Answers for "clear last two lines python"

2

python delete the last line of console

print("This message will remain")
print("This message will be deleted", end="\r")
#NOTE: If you run it in IDLE by pressing F5, the shell will still display#
#both messages, however, if you run the program by double clicking#
#then the ouput console will delete it!#
Posted by: Guest on August-09-2020
4

python remove last part of string

#Removing last three characters
foo = foo[:-3]
Posted by: Guest on August-04-2020

Python Answers by Framework

Browse Popular Code Answers by Language