Ex2.3

De TravauxIndse
Révision datée du 23 mai 2011 à 10:34 par Kevinde (discussion | contributions) (Nouvelle page : ==Solutions de cet exercices :== * Solution de Kévin Detaille : import random random.random() t1=[] for i in range(1000): t1.append(random.randint(100,999)) t2=[] for...)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)

Solutions de cet exercices :

  • Solution de Kévin Detaille :
import random
random.random() 
t1=[]
for i in range(1000):
       t1.append(random.randint(100,999))
t2=[]
for i in range(1000):
       t2.append(random.randint(100,999))
a,b,i,identique=0,0,0,(len(t1)==len(t2))
if(identique):
       print(identique)
else:
       while i<len(t1) and i<len(t2) and a==0:
               b=(t1[i]==t2[i])
               if(b)and(c):
                       identique=True
                       print(identique)
                       print(b)
               else:
                       identique=False
                       a=1
                       print(b)