Question: 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. Sample output with

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. Sample output with input: 3

Value of num_tickets: 1

user_tickets = int(input())

user_tickets = 3

if(user_tickets<5):

num_tickets = 1

else:

num_tickets = user_tickets

print('Value of num_tickets:', num_tickets)

what am i doing wrong? the first test passed, testing with input: 3 how to test with input:5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!