SeaswimmerTheFsh
00d34e7e2f
Some checks failed
Actions / Lint Code (Ruff & Pylint) (push) Failing after 12s
27 lines
483 B
Python
27 lines
483 B
Python
from time import sleep
|
|
|
|
def countdown(n: int) -> None:
|
|
if n <= 0:
|
|
print('Blastoff!')
|
|
else:
|
|
print(n)
|
|
sleep(1)
|
|
countdown(n-1)
|
|
|
|
def countup(n: int) -> None:
|
|
if n >= 0:
|
|
print('Blastoff!')
|
|
else:
|
|
print(n)
|
|
sleep(1)
|
|
countup(n+1)
|
|
|
|
def count(n: int) -> None:
|
|
if int(n) >= 0:
|
|
countdown(n)
|
|
else:
|
|
countup(n)
|
|
|
|
if __name__ == "__main__":
|
|
num = input("Enter a number: ")
|
|
count(int(num))
|