Last active
October 8, 2021 21:15
-
-
Save Aadrian0/502184ebbe01749607c0d1c2d84fe125 to your computer and use it in GitHub Desktop.
Tabuada de qualquer número até 10 com While.
This file contains 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
from time import sleep | |
while True: | |
lol = input('Digite o número que deseja ver a tabuada: ') | |
if lol.isalpha(): | |
continue | |
tabu = int(lol) | |
v1t = tabu * 1 | |
v2t = tabu * 2 | |
v3t = tabu * 3 | |
v4t = tabu * 4 | |
v5t = tabu * 5 | |
v6t = tabu * 6 | |
v7t = tabu * 7 | |
v8t = tabu * 8 | |
v9t = tabu * 9 | |
v0t = tabu * 10 | |
print(f'{tabu} x 1 = {v1t}') | |
print(f'{tabu} x 2 = {v2t}') | |
print(f'{tabu} x 3 = {v3t}') | |
print(f'{tabu} x 4 = {v4t}') | |
print(f'{tabu} x 5 = {v5t}') | |
print(f'{tabu} x 6 = {v6t}') | |
print(f'{tabu} x 7 = {v7t}') | |
print(f'{tabu} x 8 = {v8t}') | |
print(f'{tabu} x 9 = {v9t}') | |
print(f'{tabu} x 10 = {v0t}') | |
print() | |
resp = input('Deseja continuar (s) (n): ') | |
print() | |
if resp.lower() == 's': | |
continue | |
elif resp.lower() == 'n': | |
print('Fechando...') | |
sleep(3) | |
break | |
else: | |
print('Sem gracinha.') | |
sleep(3) | |
break | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment