0
How would I remove everything before a certain word once the word is found?(Python)
For example: x=input() #users types ‘jsnhandkqkv’ Now I want to cut off everything before the word hand but I need it to work no matter where hand is typed, how would I do this?
5 Respostas
+ 1
If you would like to remove something before you can use eomething like for example
user_input.lstrip('keyword', 'start word' 'endword')
+ 1
x = 'footballer'
x=x[x.find('ball'):]
print(x)
Hope this helps
0
del x[index:index:index]
0
Thank you