I'm writing a program that returns the train prices. When I run the function nothing is returning.
def transit(zone, ticket):
fareLst = ['23', '11.5', '34.5']
if zone < 2 and ticket == 'adult':
return fareLst[0]
elif zone < 2 and ticket == 'child':
return fareLst[1]
elif zone > 4 and ticket == 'adult':
return -1
def main():
transit(1, 'adult') # the function is not returning the fareLst = 23
main()
fareLstvalues stored as strings? Shouldn't they be eitherfloatorDecimal?