This commit is contained in:
parent
4fb81b2c78
commit
00d34e7e2f
11 changed files with 23 additions and 13 deletions
5
blastoff/README.md
Normal file
5
blastoff/README.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Blastoff
|
||||
|
||||
## 4/29/2024
|
||||
|
||||
wip
|
1
blastoff/__init__.py
Normal file
1
blastoff/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
# don't modify this file
|
27
blastoff/main.py
Normal file
27
blastoff/main.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
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))
|
Loading…
Add table
Add a link
Reference in a new issue