Rocket Launch Sequence
Charlie406 (1)

I am making a launch sequence and am trying to specify that if launch (domain) doesn't equal 1 or 2 then ask it to re enter 1 or 2 but I can't figure out how to get the while loop to identify 1 and 2 are both valid I would appreciate some help or just feel free to test it out, Thank you :).

You are viewing a single comment. View All
[deleted]
if (input) == 1:
   (code here)
elif (input) ==2:
    (code here)
else:
(input statement)
Charlie406 (1)

@poetaetoes yes I tried that but if you do it that way won't the program shut off when you don't input 1 or 2?, I want it to let them enter the number again until they enter a 1 or 2 hence the while loop maybe I'm wrong though idk

[deleted]

@Charlie406
oh so put a function.

def(loop):
   if (input) == 1:
      (code here)
   elif (input) ==2:
     (code here)
   else:
    loop()
loop()
[deleted]

@Charlie406 hope this helps!

[deleted]

@Charlie406 also, i can help you shorten the code.

[deleted]

@Charlie406

print("---------------------------------------------------------\n Com1: 
Com2 this is Com1, Button has been pressed, Over...")
  
[deleted]

@poetaetoes do that for all the ------ and the text

Charlie406 (1)

@poetaetoes I would but I'm planning on changing the text colour and having them separate is easier for me to handle being as I'm beginner and I'm not on def functions and stuff just yet sorry