I\'m trying to remove the last 3 characters from a string in python, I don\'t know what these characters are so I can\'t use rstrip, I also need to remove any white
rstrip
Removing any and all whitespace:
foo = ''.join(foo.split())
Removing last three characters:
foo = foo[:-3]
Converting to capital letters:
foo = foo.upper()
All of that code in one line:
foo = ''.join(foo.split())[:-3].upper()