146k views
3 votes
(Python)Write an expression using Boolean operators that prints "Eligible" if user_age is greater than 17 and not equal to 25.

Sample output with input: 17

Ineligible

User Jungwon
by
6.5k points

1 Answer

3 votes

Answer:

user_age = int(input())

if (user_age > 17) and (user_age != 25):

print('Eligible')

else:

print('Ineligible')

Step-by-step explanation:

the code is very easy to do because it asks for it in Boolean operators. So user_age = int(input()) ## asks for user input

then it checks the status by seeing if the number is greater than 17 and not equal to 25. we know that > is greater and we know that != means not equal. Therefore, this will rule out both and then give the eligible or ineligible statement.

User Erick Castrillo
by
7.6k points