Whenever I print out anything from the lists at the top, it is always displayed as having only one decimal place, e.g. oneAdult[0] is displayed as 20.0 not 20.00 like I want it to. I want it to be the latter as it is a currency, so just one decimal place would look weird. Thanks for help!
oneAdult = [20.00, 30.00]
oneChild = [12.00, 18.00]
oneSenior = [16.00, 24.00]
familyTicket = [60.00, 90.00]
sixPeoplePlus = [15.00, 22.50]
print("this tells you information about prices of one and two day tickets")
while True:
try:
oneOrTwo = int(input("are you buying tickets for 1 or 2 days? "))
if oneOrTwo == 1:
print("day succesfully selected. the prices are,\n for one adult $", oneAdult[0], "\n for one child $", oneChild[0], "\n for one senior $", oneSenior[0], "\n for a family ticket $",familyTicket[0], "\n and for a group of six people or more(price per ticket) $",sixPeoplePlus[0])
break;
elif oneOrTwo == 2:
print("the prices are,\n for one adult $", oneAdult[1], "\n for one child $", oneChild[1], "\n for one senior $", oneSenior[1], "\n for a family ticket $",familyTicket[1], "\n for a group of six people or more(price per ticket) $",sixPeoplePlus[1])
break;
else:
print("your answer needs to be either '1' or '2'")
except ValueError:
print("provide this value in integer form")
continue
print("\n")