В Python, когда вы хотите включить более одной переменной или текста в свой вывод, вы добавляете его в свой выходной оператор с запятой (,).Это похоже на то, как вы добавили бы + в Java в своем операторе вывода.
print ("total cost" (cost))
должно быть print ("total cost", cost)
, а print ("your total price is" int(ar))
должно быть print ("your total price is", int(ar))
Внедрение массива в ваш код будет выглядеть примерно так, если два значения в массиве равны 25 и35.
yourUserInput = input("will you use route 1 or 2 ")
cost = 1
finance = 1
price = 1
list_values = [25,35]
if yourUserInput == "1":
finance = list_values[0]
elif yourUserInput == "2":
finance = list_values[1]
else:
print("you did not enter a valid route")
print ("total cost = ", cost)
# ticket type
tickettype = input("what type of ticket would you like (single or return) ")
if tickettype == "single" or tickettype == "Single":
price = list_values[0]
elif tickettype == "return" or tickettype == "Return":
price = list_values[1]
else:
print("you did not enter a valid ticket type")
cost = finance * price
ar = (finance + price)
#print "the total is therefore",
print ("your total price is", ar)
input("press enter to exit the program")
Я советую вам прочитать https://docs.python.org/3/whatsnew/3.0.html, чтобы лучше понять основы Python.