n = int(input('Enter total number of family members '))
price = 0
for i in range(n):
j = int(input('Enter the age of each family member '))
if j < 10:
print('Not allowed to swing')
price = price + 100
elif 10 <= j < 15:
print('Allowed to swing')
price = price + 90
elif 15 <= j <= 20:
print('Allowed to swing')
price = price + 95
else:
print('Not allowed to swing')
price = price + 100
print('The total charge for your family is {} Rs.'.format(price))
Enter total number of family members 6
Enter the age of each family member 48
Not allowed to swing
Enter the age of each family member 25
Not allowed to swing
Enter the age of each family member 23
Not allowed to swing
Enter the age of each family member 21
Not allowed to swing
Enter the age of each family member 15
Allowed to swing
Enter the age of each family member 12
Allowed to swing
The total charge for your family is 585 Rs.
Comments
Leave a comment