Hi
I'm new in python and i'm do not understand why my code is not working. I want to generated random figures with this code:
import random
import division
a1 = ''
a2 = ''
def zufallsZahl(a1,a2):
a1 = random.randint(1,10)
a2 = random.randint(1,10)
print a1, a2
s1 = [a1, a2]
while a1 % a2 == 0:
print 'Wert von a1 und a2: ', a1,a2
s1 = [a1, a2]
print 'Wert von s1: ', s1
return s1
else:
print 'Ich bin im else'
zufallsZahl(0,0)
and now i am want request it with the following code:
import zufallsZahl
import rechnenCore
s1 = zufallsZahl.zufallsZahl()
#b = zufallsZahl.zufallsZahl()
#rechnenCore.rechnen(a,b)
print s1
My problem is that sometimes the retur value is None and sometimes the correct figures.
Can anybody help? Thanks
Roel