your robot gives you the lottery number (python language)

Description

Here is a python script, which will give you the lottery numbers to play.

Related Hardware
EZ-B v4
(python language)

The program is planned for a draw of 5 numbers and a lucky number. (French lottery). You will need to change the lottery program in your country.

here is the python code:

import random


def loto():
     table1  = [(random.randint(1,49)), (random.randint(1,49)), (random.randint(1,49)), (random.randint(1,49)),(random.randint(1,49))]
     tablefin = []  
     doublon = []

     for i in table1:  
         if i not in tablefin:
             tablefin.append(i) #supprime les doublons
         else:
             doublon.append(i) #extraire les doublons
     d = len(doublon)
     while d > 0:
     #nouveau tirage
         doublon = []
         table1  = [(random.randint(1,49)), (random.randint(1,49)), (random.randint(1,49)), (random.randint(1,49)),(random.randint(1,49))]
         # recherche doublon
         for i in table1:
             if i not in tablefin:
                  tablefin.append(i) #supprime les doublons
             else:
                 doublon.append(i) #extraire les doublons
             # si il existe doublon d+1 et vide la table
             if (len(doublon)==1)or(len(doublon)==2)or(len(doublon)==3)or(len(doublon)==4)or(len(doublon)==5):       
                 talkBlocking("j ai trouver un doublon , je refais un tirage")
                 d = d+1
                 doublon =[]
             else:
                 d = 0
             break   
     # tri la table avant de la dire        
     table1.sort() 
     Audio.Say("Voci les numéros a jouer au loto .")
     Audio.Say("le "+str(table1[0]))
     Audio.Say("le "+str(table1[1]))
     Audio.Say("le "+str(table1[2]))
     Audio.Say("le "+str(table1[3]))
     Audio.Say("le "+str(table1[4]))
     Audio.Say("Et le numéro chance le, "+str(random.randint(1,9)))
     Audio.Say("Je vous souhaite bonne chance, ")
     
loto()

you will need to translate the sentences into the language of your country:

example: Audio.Say ("Here are the numbers to play the lotto.")

if you won, think of me, thank you ...

note : To make the EZROBOT micro-controller speak, replace Audio.Say by Audio.SayEZB . If you are interested in pthon programs, I can give you more here.


ARC Pro

Upgrade to ARC Pro

Experience early access to the latest features and updates. You'll have everything that is needed to unleash your robot's potential.

PRO
Portugal
#1  

Nice. You have a inmoov?

PRO
Synthiam
#3  

Wow how big is the big one? Or how small is the small one lol. Can’t tell by the photos but that’s real great!

#4   — Edited

hello, the small 1m13 and the big 1m80 .

My new project to replace the arduino with EZ-BV4, to make the little inmoov more autonomous.

PRO
USA
#5  

can you translate that code into English?

#6  

What scale did you print the small guy at?

#8  

Hello EzAng

i don't speak english, i use google translate. To translate the sentences into English, just translate the sentences between quotes as well as the comments.

example :

recherche doublon. ==>

duplicate search

Audio.Say("Voci les numéros a jouer au loto .")==> Audio.Say ("Here are the numbers to play the lotto.")