NameError: global name 'object' is not defined Python -


i have been doing python couple months now, , having trouble defining functions. creating small cyoa maze there multiple rooms , player have go , forth. works of function getting nameerror: global name 'object' not defined error.

#main room def big_room():     print """you arrive inside huge square room. presented  3 giant wooden doors. door choose?or can leave."""       room = raw_input(">")      if room == "door one":         print"you open door 1 , walk in."         room_one()     elif room == "door two":         room_two()     elif room == "door three":         print """you go toward door 3 , attempt pull it. door opens loudly , walk in."""         room_three()     elif room == "leave":         dead("you decide walk away , eaten jaguar")     else:         print "what saying?."   def room_one():     print """the room has 1 torch lighting room faint glow. presented 3 doors. way go? or go back"""       room1 == raw_input(">")      if room1 == "door one":         print "test"     elif room1 == "door two":         print"test"     elif room1 == "door c":         hole()     elif room1 == "go back":         big_room()     else:         print "test me"  def hole():     print "you take step forward , floor below caves in; fall in , die."     dead()   def dead(why):     print why,"game over!"     exit(0)   raw_input("press enter continue")  def start():     print """after long time of walking through thick jungle, arrive @ temple covered in foliage , narrow entrance. go inside. or leave"""      while true:         temple = raw_input(">")          if temple =="go inside":             big_room()         elif temple == "leave":             dead("you decide walk away , eaten jaguar")         else:             print "what saying?"  start() 

when run it, can big_room , type door 1 door_one(). assume it's supposed def room_one() , run there. expcept get

the room has 1 torch lighting room faint glow. presented 3 doors. way go? or go traceback (most recent call last):   file "flee.py", line 78, in <module>     start()   file "flee.py", line 72, in start     big_room()   file "flee.py", line 21, in big_room     room_one()   file "flee.py", line 38, in room_one     room1 == raw_input(">") nameerror: global name 'room1' not defined 

i sure define when put in input did in big_room(). appreciated. thank you

there's line in code:

room1 == raw_input(">") 

did mean this?

room1 = raw_input(">") 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -