Listing item in input when slash comes in python ?
- Yogesh Kumar
split() method is useful in cases like this. You can split first on
/, and then split the resulting elements on
line = '1,2,3/4,5,6/7,8,9,10/11'
[x.split(',') for x in line.split('/')]
57 0 7
* Be the first to Make Comment