Assignment Module 4
Assignment Module 4
1. Take a variable ‘age’ which is of positive value and check the following:
a. If age is less than 10, print “Children”.
b. If age is more than 60 , print ‘senior citizens’
c. If it is in between 10 and 60, print ‘normal citizen’
2. Find the final train ticket price with the following conditions.
a. If male and sr.citizen, 70% of fare is applicable
b. If female and sr.citizen, 50% of fare is applicable.
c. If female and normal citizen, 70% of fare is applicable
d. If male and normal citizen, 100% of fare is applicable
[Hint: First check for the gender, then calculate the fare based on age factor.. For both
Male and Female ,consider them as sr.citizens if their age >=60]
# Take a variable ‘age’ which is of positive value and check the following:
age = 28
if age <=10:
print("children")
print('senior citizens')
else:
print('normal citizen')
print('normal citizen')
# Find the final train ticket price with the following conditions.
Ticket_price = 200
passanger = 'male'
age = 56
else:
print('100% of fare is applicable: ',100/100*Ticket_price)
if n%5==0:
else: