Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

Students also viewed these Databases questions

Question

what is finally block in java

Answered: 1 week ago