from random import* def saisie(): ch= "" x=0 while x != 2: y = randint(1,26) ch= ch + chr(y+64) if chr(y+64) == 'Z': x= x+1 return ch def Verifier(ch): i = 0 b = True while i != len(ch) and b: if ch[i] in {"A","E","U","Y","I","O"}: b = False else: b = True i = i+1 if b == True : print("tout consonne ") else: print("non") return b def testrand(): i = 1 x = 1 while i != 51 and x != 50: ch = saisie() if Verifier(ch) == True: x = 50 else : i = i +1 if x == 50 : print("nombre de tours necessaires =" ,i) else: print("on n'as pas trouve") testrand()