How to put While into IF-Else (text base game in Python)
Hello! I'm rookie in Python, and starting to learn by this fun example. Can't understand how to make 2 decisions: 1- you start shooting, and While is operating, 2- just print the letter On PC i can make it with wait input(), but after chose of 2, 1-st message is printing anyway. I think i need some function.. Thx for help! print ("While walking on your yard, you saw some strange moves in the grass\nIt was alien, ugly and horrible.\nNext moment you already took the lazer gun\nand you started to think:\n 1) Of course I can kill him with my lovely gun \n 2) Hmm, maybe I should wait, he is just ugly :) ") print ("*******") a = int(input()) if a == 1: print ("You chose to start shooting.\nBattle has begun") print ("*******") else: print ("It was clever idea, monster has teleported to his ship \nand flew away in deep space") alien = 5 lazer = 1 action = True while action: alien = alien - 1 print ("You hit alien! HP left:") print (alien) if alien == 1: print ("I got him hard") continue if alien <= 0: print ("Last critical hit moved out alien's brain and his soft body laid down on the ground") break