I am trying to make a program which calculates entrance costs.. I have managed to do it except from one part which requires if two adults and three childeren then the cost is $15. Should this be done using an if statement and how would I do it?
import math
loop = 1
choice = 0
while loop == 1:
print "Welcome"
print "What would you like to do?:"
print " "
print "1) Calculate entrance cost"
print "2) Leave swimming centre"
print " "
choice = int(raw_input("Choose your option: ").strip())
if choice == 1:
add1 = input("Adults: ")
add2 = input("Concessions: ")
add3 = input("Children: ")
print add1, "+", add2, "+", add3, "answer=", add1 *5 + add2 *3 + add3 *2
elif choice == 2:
loop = 0
Thank you for any help in advance, it will be much appreciated!!
while True:thenbreakwhen you want the loop to end.if add1 == 2 and add3 == 3: print '$15'. Then put the print statement in theelse:after that.