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

How did the western Roman empire finally end?
What are 6 substances you might find in the air?
a. An aqueous solution of Mn(NO3)2 is very pale pink, but an aqueous solution of K4[Mn(CN)6] is deep blue. Explain why the two differ so much in the intensities
Can u help me solve this
How are photosynthesis and cellular respiration related? A. Cellular respiration breaks down glucose, while photosynthesis produces glucose. B. Cellular respira
What kind of isolation occurs when two populations of birds have different courtship dances?
how did the gupta empire devope
Which one of the following powers are permitted to states?A. the power to join moneyB. the power to sign treaties with foreign nationsC. the power to form their
Help me in this question pls (also these two picture are one question)
The National Rifle Association (NRA) is a ___________ interest group that protects the rights of gunowners. A. conservative B. liberal