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

A process by which the human brain retains an image for a fraction of a second longer than the eye records it is called the
what will happen if lymph is not returned to blood?
Please help me I stink at math need all
All about birds why are birds able to leave virtually everywhere on earth biology junction
Three cars are driven simultaneously. Draw a tree diagram to represent the outcomes
What is that capital of Alaska
simplify sin theta/sqrt 1-sin^2 theta
Which climate conditions most likely produce a landscape with rounded hills larger river valleys with many tributaries and tropical vegetation?
which gas law would you use to calculate the new pressure for a gas when the volume of the trapped gas changes while the temperature remains constant
What type of character has very few or no unique traits? flat ,round ,static,dynamic,major