Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 21st, 2013, 12:52 AM
vmt.eiz vmt.eiz is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 2 vmt.eiz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 9 sec
Reputation Power: 0
What is the error?

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



What is the syntax error in the highlighted line???

Reply With Quote
  #2  
Old February 21st, 2013, 02:16 AM
dariyoosh's Avatar
dariyoosh dariyoosh is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Location: Iran / France
Posts: 138 dariyoosh User rank is First Lieutenant (10000 - 20000 Reputation Level)dariyoosh User rank is First Lieutenant (10000 - 20000 Reputation Level)dariyoosh User rank is First Lieutenant (10000 - 20000 Reputation Level)dariyoosh User rank is First Lieutenant (10000 - 20000 Reputation Level)dariyoosh User rank is First Lieutenant (10000 - 20000 Reputation Level)dariyoosh User rank is First Lieutenant (10000 - 20000 Reputation Level)dariyoosh User rank is First Lieutenant (10000 - 20000 Reputation Level)dariyoosh User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 9 h 8 m 33 sec
Reputation Power: 133
In the precedent line you forgot to close parenthesis

Code:
elif next == "taunt bear" and bear_moved:
    dead("The bear chews your leg off."

should be

Code:
elif next == "taunt bear" and bear_moved:
    dead("The bear chews your leg off.")

Reply With Quote
  #3  
Old February 21st, 2013, 02:24 AM
vmt.eiz vmt.eiz is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 2 vmt.eiz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 9 sec
Reputation Power: 0
Thanks

This is an embarrassing mistake. Thanks man.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > What is the error?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap