Skip to content

Instantly share code, notes, and snippets.

@rodrigo-x
Created May 5, 2021 21:51
Show Gist options
  • Save rodrigo-x/d657f9b25a2973a6027eb823525d5838 to your computer and use it in GitHub Desktop.
Save rodrigo-x/d657f9b25a2973a6027eb823525d5838 to your computer and use it in GitHub Desktop.
Usando try
#!/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