Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- first_name = input("Please enter your first name: ").capitalize()
- first_answer = input("Hi {}, do you want to go to the beach? (y/n): ".format(first_name)).capitalize()
- if first_answer == "Y":
- current_temp = int(input("Please tell me the current temperature: "))
- min_temp = int(input("What is the minimum temperature for going to the beach? "))
- if current_temp >= min_temp:
- print ("You can go to the beach because it is {} degrees.".format(current_temp))
- second_answer = input("Do you want to buy an ice cream? (y/n): ")
- if second_answer == "y":
- current_cash = input("How much cash do you have? ")
- if current_cash > "0":
- ice_cream = input("How much is an ice cream? ")
- if current_cash >= ice_cream:
- ice_cream = float(ice_cream)
- current_cash = float(current_cash)
- left_over = current_cash - ice_cream
- print ("You can buy an ice cream and you will have ${:.2f} left.".format(left_over))
- print ("Enjoy your time at the beach.")
- else:
- print ("Sorry, no ice cream today.")
- print ("Enjoy your time at the beach.")
- else:
- print ("Please remember to bring cash next time.")
- print ("Enjoy your time at the beach.")
- else:
- print ("Enjoy your time at the beach.")
- else:
- print ("It's not warm enough, stay at home.")
- else:
- print("Ok, enjoy your time at home.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement