Python code that needs some overview
- by fabio
Hi guys, im currently learning python (in the very begining), so I still have some doubts about good code manners and how should I proceed with it.
Today I created this code that should random trought 01 to 60 (but is running from 01 to 69)
import random
dez = ['0', '1', '2', '3', '4', '5', '6']
uni = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
sort = []
while len(sort) <= 5:
random.shuffle(dez)
random.shuffle(uni)
w = random.choice(dez)
z = random.choice(uni)
chosen = str(w) + str(z)
if chosen != "00" and chosen not in sort:
sort.append(chosen)
print chosen
I'm also in doubt how to make the code stop at "60".