Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write an expression that will cause the following code to print \"18 or less\" i

ID: 3760923 • Letter: W

Question

Write an expression that will cause the following code to print "18 or less" if the value of user_age is 18 or less. Write only the expression.
----------------------------------------------------------------
user_age = 17
if '''Your solution goes here''':
print('18 or less')
else:
print('Over 18')

Also

Write an if-else statement for the following:
If user_tickets is less than 5, assign 1 to num_tickets. Else, assign user_tickets to num_tickets.
Ex: if user_tickets is 3, then num_tickets = 1.

user_tickets = 0

'''Your solution goes here'''

Explanation / Answer

user_age = 17
if user_age<=18:
print('18 or less')
else:
print('Over 18')

if user_tickets<5:

num_tickets = 1

else:

num_tickets = user_tickets

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote