06 Aug Wednesday Friday 15:00 Python Practice 20.08.05.
Question 1:
A soccer team is looking for girls from ages 10 to 12 to play on their team. Write a program to ask the user’s age and if male or female (using “m” or “f”). Display a message indicating whether the person is eligible to play on the team.
Sample Input 1: Age: 10 Gender: f Sample Output 1: Welcome to the team!
Sample Input 2: Age: 10 Gender: m Sample Output 2: You are not allowed to play!
Question 2:
Continue coding the program we did in the class, so the program will tell you whether you can pay in the zone:
height |
color |
zone |
if<90 |
green |
1 |
elif<105 |
yellow |
1, 2 |
elif <115 |
red |
2,3,4 |
elif <130 |
pink |
3,4 |
elif <150 |
blue |
4 |
else |
white |
4,5 |
Please continue coding the following program:
h = int(input('Height:')) if h < 90: c = 'green' elif h < 105: c = 'yellow' elif h < 115: c = 'red' elif h < 130: c = 'pink' elif h < 150: c = 'blue' else: c = 'white' print('your color is', c) z = int(input('Zone to play: ')) if z == 1 and (c == 'green' or c == 'yellow'): print('You can play in zone 1')
No Comments