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

7/8 times c for c =8
How does the economy influence energy source choices?
how to do this problem What is –7=e3+14?
What is John Steinbeck's book The Grapes of Wrath about? A. The devastation of men working on Wall Street B. The cause of drought in middle America C. The solut
What words in the second paragraph convey allens feelings toward the flag
A car traveled 281 miles in 4 hours 41 minutes. What was the average speed of the car in miles per hour?
Words that end in -ous are _____. A. nouns B. adverbs C. adjectives D. verbs
what were the political contributions of Thomas Jefferson and Richard Henry Lee
Which verbal is an infinitive? traveled traveling to travel travel
Why was the Battle of Saratoga a turning point in the American Revolution? a. It convinced the Americans that they had won the war. b. It was the last major ba