import time
z = input("Do you want a countdown timer or a countup timer? cd/cu : ")
if z == "cu" :
y = int(input("To what number would you like it to count up to ? "))
for x in range (0,y) :
print (1+x)
time.sleep (1) ;
# Clear screen for Unix/Linux/MacOS
print("\033c", end="")
# Clear screen for Windows
print("\033[H\033[J", end="")
print("Ended")
if z == "cd" :
y = int(input("To what number would you like it to count down from ? "))
for x in range (0,y) :
print (y-x)
time.sleep (1) ;
print("\033c", end="")
print("\033[H\033[J",end="")
print("Ended")