Created
May 5, 2021 21:51
-
-
Save rodrigo-x/d657f9b25a2973a6027eb823525d5838 to your computer and use it in GitHub Desktop.
Usando try
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
try: | |
from time import sleep | |
except ImportError: | |
from time import sleep | |
try: | |
cont = 100 | |
while cont <= 200: | |
print(f'{cont}', end=' ', flush=True) | |
sleep(0.5) | |
cont += 1 | |
except KeyboardInterrupt as err: | |
print(err) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment