+ 1
Sololearn question
Hi guys there is one of the sololearn Practice can you help me. If input is like (I want 1 apple) The out put has to be like (I want one apple) I know how to make 1 to one but how to undrestand it is first of the sentence or end of that or in the middle of that i mean how can i undrestand the place of number?
3 Answers
+ 2
You could use the find method.
user_input = input()
index = user_input.find("1")
For more complex cases you could use RegEx (regular expression) like here.
https://www.w3schools.com/JUMP_LINK__&&__python__&&__JUMP_LINK/python_regex.asp
https://www.sololearn.com/learn/o-Python/2475/?ref=app
+ 4
Fateme Biglari
Can you share your code attempt here so we can see your concept.
We can then help you build your understanding on code you already understand
+ 3
Can use loops and membership operators