How to Print Bus Fares
#BUS TICKET FARE
print('TICKET FARE GENERATOR')
print(' Ticket Code - Cost(in Rs.)')
print(' t = 4')
print(' r = 5')
print(' w = 10')
print(' c = 12')
z= input('Enter Ticket Code: ')
n=int(input('Enter Number of Tickets: '))
d=4
r=5
w=10
c=12
if(z=='d'):
t=n*d
elif (z=='r'):
t=n*r
elif (z=='w'):
t= n*w
elif (z=='c'):
t=n*c
else:
print ( 'Bus Code Error \n Please Try Again !! ')
if(n>10):
t=t-(t*10)/100.0
print('Your Ticket Fare = ',t,'With 10 percent discount')
else:
print('Your Ticket Fare=',t)
#The Bus Codes and fares can be set as per need.
Made By:-
Nilay Saraf
Comments
Post a Comment