jeudi 28 janvier 2016

I need help making my raffle game

Hi I have a code which basically generates raffle numbers such as blue 3433 9421 but do you know a code which stores raffle entries and selects random winner.

import random 
word = random.choice(['blue', 'aqua', 'jade','plum', 'gold', 'navy', 'pink', 'grey', 'ruby', 'rose', 'teal',"lime",]) 
number = random.sample(range(10000000,99999999), 1)[0] 
print("{} {} {}".format(word.title(), int(number/10000), int(number%10000)))

Sometimes when I generate raffles it comes out like Aqua 4552 65 And not like Aqua 4552 6532 Could you fix this please.




Aucun commentaire:

Enregistrer un commentaire