import random loop=1 HP=100 def shot(z): if z<50: return 50 print ("Direct Hit") elif z >= 50: print ("Missed") while loop==1: h=random.random()*100 n=shot(h) choice=raw_input("Pick a shot type(shot, headshot)")