xxxxxxxxxx
import sys
import time
for i in range(10):
print("Loading" + "." * i)
sys.stdout.write("\033[F") # Cursor up one line
time.sleep(1)
xxxxxxxxxx
#The rstrip() method removes any trailing characters (characters at the end
#a string), space is the default trailing character to remove.
string = 'Bonjour!!!!!!!!!'
string.rstrip("!")
#Output:
'Bonjour'