I want to remove the first 3 numbers of any string that I put in the input.
response = input("Insert String: ")
If I were to put any string in the response it would print it with the first 3 characters removed.
I want to remove the first 3 numbers of any string that I put in the input.
response = input("Insert String: ")
If I were to put any string in the response it would print it with the first 3 characters removed.
You can use string slicing.
response=input("Insert string:")[3:]
For more information on how slicing works, check out Understanding slicing on Stack. Happy coding!
Try:
response = input("Insert String: ")
prefixStr = response[:2]
last_3_chars = response[-3:]
print(last_3_chars, prefixStr, sep='\t')
Maybe? I'm not sure exactly what you mean. Please clarify your request.