python add clear terminal code example Example: how to clear console python import os os.system('cls' if os.name == 'nt' else 'clear')