Last active
August 12, 2020 04:16
-
-
Save Kaue-Romero/b6e52088166fa030911ec18bb37fd389 to your computer and use it in GitHub Desktop.
Um silmulador de dado cujo você escolhe quantos lados o dado possui obs:Não há tratamento de erros
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
from random import randint | |
n1 = int(input('Quantos lados o dado tem ? ')) | |
n2 = randint(1, n1) | |
while True: | |
n = str(input('Você que jogar o dado? ')).upper().strip() | |
while n not in 'SN': | |
n = str(input('Você que jogar o dado? [S/N] ')).upper().strip() | |
if n == 'S': | |
n2 = randint(1, n1) | |
print(f'Você jogou o dado e caiu em {n2}') | |
n1 = int(input('Quantos lados o dado tem ? ')) | |
else: | |
break | |
print('Obrigado por usar o código') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment