mcarville0802 mcarville0802
  • 23-11-2020
  • Computers and Technology
contestada

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.

Respuesta :

Cytokine
Cytokine Cytokine
  • 23-11-2020

In python 3.8:

if user_tickets < 5:

   num_tickets = 1

else:

   num_tickets = user_tickets

For this code to work properly, you'll have to first declare user_tickets before the if-else statements.

Answer Link

Otras preguntas

What is the mean of 84 92 92 96
Describe the importance of tourism sector for the country. write in 6 points ​
Hiiiii, could one of you lovely's help me with my English?
Make a sentence with botany without using the meaning ​
A restaurant has 2 flavors of ice cream, 4 types of sauce and 7 toppings. A student chooses one topping and one type of sauce. How many different desserts could
“And what O’Priest, is the noble truth of the path leading to the cessation of misery? It is … right belief, right resolve, right speech, right behavior, right
A clock gains 0.020 seconds per minute. How many seconds will the clock gain in exactly 6 months, assuming exactly 30 days per month? (Chemistry)
Two angles are supplementary. They are represented by (3x)° and (12x+1)°. Find both angles.
Write a program that contains the following two methods: /** Convert from feet to meters */ public static double footToMeter (double foot) /** Convert from mete
Statistics indicate that over half of the world output now comes from emerging markets. This is leading to a(n) ___________ of living standards across the globe