0
Looking for a Function
Hello everyone who is reading ✋🏼. I am looking for a function that would be able to store each one by one. I explain myself. I’ve got « O * 2 * 3 * 4 », I need my iterator as soon as he meets ‘*’ he stores the item before as an argument. So 0 , 2 , 3 , 4 are different item
2 Réponses
+ 3
The method 'split' that type str comes with, splits a string by space by default, but you can define another split sign.
inp = input()
list_ = inp.split('*')
+ 1
wow, thank you very much @HonFu