Nov-30-2017, 01:08 PM
can i use a if statement and in operator to trigger the code
corb = random.randrange(3) print('talks about it with ' + talks[corb] + ' about his battle' + '.')full code is
import random fight =("man fights" , "man kills" , "man wounds" , "man cuts off head of" , "man slices off arm of") killed =("mortally wounds it" , "stabs it in the eye" , "gets his arm cut off with it's sharp spikes" , "survives" , "gets his head cut of by it's sharp claws") feelin = 'mortally wounds it' bleeding = 'sharp spikes' talks =("wife,children and friends over a few drinks at the local pub" , "his girlfriend and friends over a few drinks" , " other warriors over a few drinks at the local pub at the local pub") fighting = random.randrange(4) print (fight[fighting] + ' monster and ' + killed[fighting] + '.') x =(fight[fighting] + ' monster and ' + killed[fighting] + '.') if feelin in x: print("man goes home triumphant.Tells his friends about his great battle.") corb = random.randrange(3) print('talks about it with ' + talks[corb] + ' about his battle' + '.') if bleeding in x: print("man almost bleeds to death but two other warriors come to help him out.one fights the monster.While the other one carries him away to safety.then puts him on his horse.then makes horse go fastly back to town") print("man is hurt bad")