Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #53746

Re: Newbie question related to Boolean in Python

Newsgroups comp.lang.python
Date 2013-09-05 16:36 -0700
References <f2259124-4af1-4608-9969-8e42a140633e@googlegroups.com> <b8s8e6F1ll0U1@mid.individual.net>
Message-ID <dd0aa339-d713-4368-996f-77cc0b6e3929@googlegroups.com> (permalink)
Subject Re: Newbie question related to Boolean in Python
From Thomas Yang <skwyang93@gmail.com>

Show all headers | View raw


 bear_moved = False

    while True:
        next = raw_input("> ")
    
        if next == "take honey":
            dead("The bear looks at you then slaps your face off.")
        elif next == "taunt bear" and not bear_moved:
            print "The bear has moved from the door. You can go through."
	    bear_moved = True
	elif next == "taunt bear" and bear_moved:
	    dead("The bear gets pissed off and chews your leg off.")
	elif next == "open door" and bear_moved:
	    gold_room()
	else:
	     print "I got no idea what that means."

# sorry if it looks confusing, this is the real code

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Newbie question related to Boolean in Python skwyang93@gmail.com - 2013-09-05 13:08 -0700
  Re: Newbie question related to Boolean in Python Neil Cerutti <neilc@norwich.edu> - 2013-09-05 20:38 +0000
    Re: Newbie question related to Boolean in Python Thomas Yang <skwyang93@gmail.com> - 2013-09-05 16:36 -0700
      Re: Newbie question related to Boolean in Python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-06 02:28 +0000
  Re: Newbie question related to Boolean in Python Dave Angel <davea@davea.name> - 2013-09-05 20:47 +0000
  Re: Newbie question related to Boolean in Python Tim Roberts <timr@probo.com> - 2013-09-05 21:02 -0700

csiph-web