Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Ask the user the required info
- nr_people = raw_input("How many people are coming to your party?") # people
- pizza = raw_input("What's the price of pizza?") # pizza price
- juice = raw_input("What's the price of juice?") # juice price
- # Now you have to convert to int or float
- # people to int
- # and prices to float, because they can be 10.5 or 2.43
- nr_people = int(nr_people)
- pizza = float(pizza)
- juice = float(juice)
- # store the result
- result = nr_people * pizza + nr_people * juice * 2
- # convert the result to str
- result = str(result)
- # print everything
- print "You have to pay " + result + " dollars."
Advertisement
Add Comment
Please, Sign In to add comment