3 ms·
Thanks for this suggestion - it works great. import sys # run: python3 countdown.py 10 def main(n:int): print(n) or n-1 and main(n-1) main(int(sys.
by jftuga 2y ago
Thanks for this suggestion - it works great.
import sys # run: python3 countdown.py 10
def main(n:int): print(n) or n-1 and main(n-1)
main(int(sys.argv[1]))
This also works and is definitely more Pythonic:
_ = [print(n) for n in range(10,0,-1)]