alexa

Listing item in input when slash comes in python ?

Listing item in input when slash comes in python ?

The 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('/')]

258 0
7

Write a Comments


* Be the first to Make Comment

GoodFirms Badge
GoodFirms Badge

Fix Your Meeting With Our SEO Consultants in India To Grow Your Business Online

Facebook
Twitter
LinkedIn
Instagram
Whatsapp
Call Now
Quick Inquiry