Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unknown output
#1
So I recently acquired this book "Adventures in Python" by Craig Richardson and I instantly dived into the book as an introduction in the python coding language. It all was a walk in the park until I reached this part. I type all the code down but I keep being stuck in here.

choice = ""
while choice != "/exit":
print "What would you like to do, " + captain + "?"
print ""
print "a. Explore another planet?"
print "b. Fire your Cannons?"
print "c. Open the airlock?"
print "d. Self destruct (ANY RISK IS NOT THE RESPONSIBILITY OF AIRSPACE INDUSTRIES!"
print ""
choice = raw_input ("Enter your choice: ")
The elif's are there thus the program has to obey but yet it doesn't, the output doesn't work. Here is an example of the elif outputs.

if choice == "a":
destination = raw_input("Where would you like to go? ")
print "leaving " + location
print "Travelling to " + destination
time.sleep(5)
print "Arrived at " + destination
location = destination

I will always be stuck on the letter option part even if I type a letter. Hopefully I can have this fixed as quick as possible.
Reply


Messages In This Thread
Unknown output - by brzo - Jun-22-2017, 09:11 PM
RE: Unknown output - by ichabod801 - Jun-22-2017, 09:41 PM
RE: Unknown output - by brzo - Jun-24-2017, 03:13 PM
RE: Unknown output - by Larz60+ - Jun-24-2017, 04:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unknown characters in output using to_html Kishore01 2 1,949 Mar-20-2020, 10:20 AM
Last Post: scidam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020