There is no single built-in command to clear python shell. But we can achieve this through other ways. Shown below is a method that you can follow to clear your shell.
import os os.system('cls') # For Windows os.system('clear') # For Linux/OS X
When this command is executed your shell will be cleared and you can see a ‘0’ on top of the screen. To prevent ‘0’ from showing on top of the window, replace the 2nd line with:
Or you can just simply quit the python shell using quit() and then clear the screen using cls and again start the python shell