Created
August 25, 2017 21:01
-
-
Save Titowisk/81d576d474b77b5ddeabe0f5239017be to your computer and use it in GitHub Desktop.
Programa anterior(mega_sena.py) otimizado em menos linhas de código.
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
# coding: utf-8 | |
# Aplicativo de na mega sena. | |
import random | |
sorteio = [] | |
def gerar_mega2(): | |
while len(sorteio) <= 5: | |
d = random.randint(1, 60) | |
if d in sorteio: | |
continue | |
else: | |
sorteio.append(d) | |
sorteio.sort() | |
print(sorteio) | |
gerar_mega2() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment