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 solution to the equation 8 - 2b = -2 ___ * (12b + 6) ? 3 b =
If p pencils cost d dollars, how many pencils can be bought for c cents?
Rearrange the equations and identify the equations parallel lines a) y=2x-5 b) 3y=2x+4 c) 2y=4x-5 d) 3y=x+4 e) 5-3y+x=0 f)6y-4x-5=0
Sanford's shoe store received a shipment of shoes for its newest location. The manager determined that 35% of the shoes were athletic shoes. What fraction of th
PLEASE HELP I DON'T UNDERSTAND
Find if f(x) = 3x and g(x) = x + 1.
where was nathaniel alexander the inventor born
Your company has received an invoice amounting to $1,500 and the terms are 2/10, net 30. If you decide to pay within 10 days, how much will you have to pay?
If p pencils cost d dollars, how many pencils can be bought for c cents?
Why did each Native American culture develop differently?