Reputation: 31
I'm trying to test out all the methods for a string in order to understand and learn them, and I tried doing the following removeprefix()
method, but it was not allowing me to do so. Is there some library problem I am having?
begone = 'begone'
newbegone = begone.removeprefix('be')
print(newbegone)
#print("Removing Prefix 'be':", begone.removeprefix('be'), ', new word')
#print("Removing Prefix 'gone':", begone.removeprefix('gone'), ', original word')
Upvotes: 3
Views: 5021