Advertisement
Guest User

4/7 Taking a Vacation Odd errors...

a guest
Dec 3rd, 2015
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.09 KB | None | 0 0
  1. city = raw_input("Type the city you're visiting."
  2. )
  3. nights = raw_input("How many nights will you be staying for?")
  4. def hotel_cost(nights):
  5.     if nights:
  6.         print
  7.         return 140 * nights
  8. def plane_ride_cost(city):
  9.     if city == "Charlotte":
  10.         print
  11.         return 183
  12.     elif city == "Tampa":
  13.         print
  14.         return 220
  15.     elif city == "Pittsburgh":
  16.         return 222
  17.         print
  18.     elif city == "Los Angeles":
  19.         return 475
  20.         print
  21.     else:
  22.         return "Please enter a valid location/amount of nights"
  23.  
  24. print plane_ride_cost
  25. print hotel_cost
  26.  
  27. days == raw_input("Enter number")
  28. def rental_car_cost(days):
  29.     rent = 40 * days
  30.     if days >= 7:
  31.         return rent - 50
  32.     elif days >= 3:
  33.         return rent - 20
  34.     else:
  35.         "please enter a number"
  36.     return
  37. print rental_car_cost
  38.  
  39. MEssages shown in console:
  40. Type the city you're visiting. Tampaa
  41. How many nights will you be staying for? 3
  42. <function plane_ride_cost at 0x1857f50>
  43. <function hotel_cost at 0x1857c08>
  44. Enter number 3
  45. <function rental_car_cost at 0x184f050>
  46. None
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement