mardi 25 avril 2017

Python array calculation

I have two array a=[0.2,0.3,0.5,0.8] b=[10,4,5] I need to: 1- create random number and choose the number which bigger than the random number created and repeat this operation 10 times as from array b[0]. for example: if I got random number = 0.1 then the result number from array a is o.2 and when done 10 times we found that 0.2 repeated 3 times.

2- Then calculate and print how much the repetitive of the chosen number in step one when repeated it 10 times

3- Repeat the operation 4 time as from array b[1] and so on for b[2] 5 times




Aucun commentaire:

Enregistrer un commentaire