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 value of xquestion 2 and 4
four different between corrasion and attrition
What is 138 divided by 12
what is the answer to 3 = x/12 + 3?
how did a communist government in China affect us relations with Japan
who led the colony of jamestown, and what three things did he do to help the colonists surrvie
Read the summary of “The Beginnings of the Maasai.” In “The Beginnings of the Maasai,” the daughter of the Maasai explains the relationship between the Maasai a
What are some ideas of a history fair project
What is the greatest possible decimal that is greater than 3, but less than 9
Which of these is most important to success in your job? A. Showing up and being on time B. Spending quality time with your supervisor C. Keepin