Ich bin sehr neu in Python und will wissen, wie ein Programm mit einer if-Anweisung zu beenden, die eine Meldung ausgibt, da dies nicht mit meinem ‚stehen‘ Variable des Fall zu sein scheint, wenn es unter < 5000. Die if-Anweisung fett ** ** ist der Code, mit dem ich Probleme habe, und es druckt immer noch die Nachricht, die ich will, aber das Programm nicht mit dieser Nachricht zu stoppen, sondern mit dem nächsten Code (Countdown-Variable)). Ignoriere 'Countdown'.beenden Skript mit if-Anweisung
Hier ist ein Teil meines Codes.
while stand <= 0 or mission > 10000:
try:
stand = int(input("Enter a VALID distance in metres: "))
except ValueError:
print("Please enter a valid distance E.g 6000: ")
**if stand > 0 or stand < 5000:
print("ERROR, ERROR")
print("Launch cannot begin, the Mission Control and spectator stands are dangerously close at a distance of {}m.".format(mission))
print("This launch site sucks! It must be demolished and rebuilt!")
print("Launch delayed.")**
if stand >= 5000:
print("Fortunately the mission control and viewing stands are situated far enough.")
while countdown == 0 or countdown == "":
print("We need a person to countdown.")
try:
countdown = int(input("How many seconds would you like the countdown to be?: "))
except ValueError: