Ich möchte ein Programm schreiben was mir dafür die 6 Gleichungen mit Lösung ausgibt.
Das Problem ist, dass das Programm startet aber kein Ergebniss ausgibt.
Code: Alles auswählen
from random import randint
#Random Zahlen werden generiert und Variablen werden festgeleget
a = randint(0, 9)
b = randint(0, 9)
c = randint(0, 9)
d = randint(0, 9)
e = randint(0, 9)
f = randint(0, 9)
g = randint(0, 9)
h = randint(0, 9)
i = randint(0, 9)
j = randint(0, 9)
#While Schleife mit den 6 Gleichungen die gelöst werden sollen
while((a*1000+b*100+c*10+d)/(g*10+i) !=(g*100+h*10+d) and
(f*1000+e*100+j*10+g)-(f*1000+e*100+b*10+h) !=(i*10+g) and
(j*1000+e*100+d*10+b)-(f*1000+e*100+d*10+i) !=(e*1000+h*100+h*10+c)and
(a*1000+b*100+c*10+d)-(f*1000+e*100+j*10+g) !=(j*1000+e*100+d*10+g)and
(g*10+i)+(f*1000+e*100+b*10+h) !=(f*1000+e*100+d*10+i)and
(g*100+h*10+d)*(i*100+g*10) !=(c*1000+h*100+h*10+c)):
#while schleife in der Gleiche Zahlen ausgeschlossen werden, sodass jede variable nur eine Zahl erhält
#solange dies nicht wahr ist werden weiterhin Zahlen generiert
while(a == b or a == c or a == d or a == e or a == f or a == g or a == h or a == i or a == j or
b == a or b == c or b == d or b == e or b == f or b == g or b == h or b == i or b == j or
c == b or c == a or c == d or c == e or c == f or c == g or c == h or c == i or c == j or
d == b or d == c or d == a or d == e or d == f or d == g or d == h or d == i or d == j or
e == b or e == c or e == d or e == a or e == f or e == g or e == h or e == i or e == j or
f == b or f == c or f == d or f == e or f == a or f == g or f == h or f == i or f == j or
g == b or g == c or g == d or g == e or g == f or g == a or g == h or g == i or g == j or
h == b or h == c or h == d or h == e or h == f or h == g or h == a or h == i or h == j or
i == b or i == c or i == d or i == e or i == f or i == g or i == h or i == a or i == j or
j == b or j == c or j == d or j == e or j == f or j == g or j == h or j == i or j == a):
a = randint(0, 9)
b = randint(0, 9)
c = randint(0, 9)
d = randint(0, 9)
e = randint(0, 9)
f = randint(0, 9)
g = randint(0, 9)
h = randint(0, 9)
i = randint(0, 9)
j = randint(0, 9)
print("a= ",a)
print("b= ",b)
print("c= ",c)
print("d= ",d)
print("e= ",e)
print("f= ",f)
print("g= ",g)
print("h= ",h)
print("i= ",i)
print("j= ",j)