I have been learning Python, and for some reason, I have encountered a strange error where the console is not reading my print function. I set up the code so that I would receive a printed value depending on the number that was inputted into the console. However, the print value would be skipped over.
> print "The hotel costs $140 per night" > def hotel_cost(nights): > return 140 * nights > def plane_ride_cost(city): > if city == 1: > print "The cost to travel to Charlotte is 183" > return 183 > elif city == 2: > print 220 > return 220 > elif city == 3: > print 222 > return 222 > elif city == 4: > print 475 > return 475 > else: > print "Follow the directions!" > city = input("Enter 1 for 'Charlotte', 2 for 'Tampa', 3 for 'Pittsburgh', or 4 for 'Los Angeles'")
Here is a clarifying image:
The printed value should be 183, yet it never shows up. Any suggestions?
Thanks for the help.
. ````indent preformatted text by 4 spaces`