Hallo, ich hatte in der Schule folgende Aufgabe in Mathe und habe interessehalber versucht diese durchs coden zu lösen. Wie ihr unten seht bin ich noch ziemlich am Anfang und hab wahrscheinlich einiges Falsch gemacht, meine Frage, ist es möglich das einfacher darzustellen und falls ja, auch so, dass man manuell alle Gleichungen per Input() neu eingeben kann?
bei der while Schleife mit x==0 ist mir nichts besseres eingefallen…
Danke schon mal!
from random import *
x = 0
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) # Pick a random number between 1 and 100.
x = a * 100 + b * 10+ d - f * 10 * d
y = e * 100 + g * 10 + d
z = a * 100 + b * 10 + b - c * 10 + d
w = e * 100 + e * 10 + d
v = c * 10 + d - e * 10 + f
q = f * 10 + h
r = f * 10 + d + e * 10 + f
s = c * 10 + e
while x == 0:
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)
if x == y and z == w and v == q and r == s:
print(a)
print(b)
print(c)
print(d)
print(e)
print(f)
print(g)
print(h)
x = 1
else:
print("false")