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

Which is NOT a characteristic of minerals? A.) Are solids with a fixed shape and volume B.) Are organic in nature C.) Are naturally occurring D.) have a definit
Is the Declaration of Independence a persuasive argument? Explain your reasoning. -Please help
Help please!!!!!!!!!!!
What would happen if the secondary consumer would increase rapidly
An entry in a printed thesaurus contains
Middle-of-the-road manager b. task manager c. impoverished manager (x) d. country club manager
This layer of Earth is thought to be a solid, iron-rich zone. A) mantle B) outer core C) inner core D) lithosphere
If the conflict involves escaping a war-torn country, which character most likely connects with this conflict?
All of the following structures are built in South and Southeast Asia, except __________. A. living bridges B. homes on stilts C. floating buildings D. undergro
How is net pay calculated? A;gross pay minus deductions B;income plus benefits C;gross pay plus benefits D;income minus gross pay