Mein Programm sieht wie folgt aus:
while True:
output = print ("Tippe drei Zahlen zwischen 1 und 6")
output1 = input ("Zahl 1:")
if (int (output1) <= 6):
if (int (output1) >= 1):
zahl1 = output1
elif (int (output1) >6):
print ("Die Zahl ist zu hoch! Sie muss zwischen 1 und 6 liegen!")
elif (int (output1) <1):
print ("Die Zahl ist zu niedrig! Sie muss zwischen 1 und 6 liegen!")
output2 = input ("Zahl 2:")
if (int (output2) <= 6):
if (int (output2) >= 1):
zahl2 = output2
elif (int (output2) >6):
print ("Die Zahl ist zu hoch! Sie muss zwischen 1 und 6 liegen!")
elif (int (output2) <1):
print ("Die Zahl ist zu niedrig! Sie muss zwischen 1 und 6 liegen!")
output3 = input ("Zahl 3:")
if (int (output3) <= 6):
if (int (output3) >= 1):
zahl3 = output3
elif (int (output3) >6):
print ("Die Zahl ist zu hoch! Sie muss zwischen 1 und 6 liegen!")
elif (int (output3) <1):
print ("Die Zahl ist zu niedrig! Sie muss zwischen 1 und 6 liegen!")
Jetzt möchte ich irgendwie schaffen, dass wenn man eine zu hohe oder zu niedrige Zahl angegegben hat, man nochmal nach dieser Zahl gefragt wird. Also, wenn ich bei z.B. Zahl2 eine 7 angebe, nochmal nach Zahl2 gefragt werde und nicht nach Zahl3. Wie kann ich dies erreichen?