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 sentence does NOT contain an​ adjective? A. Rita likes to order​ sweet-and-sour pork at a Chinese restaurant. B. Katerina prefers noodles instead of ric
Many hispanics were ineligible to vote under the u.s. constitution because ________.
New York was originally part of which colony? A) Massachusetts B) Pennsylvania C) New Netherland D) Canada
x^2 + x - 20 Please help me, for some reason I got stuck
Which reforms were included in the New Deal of the 1930s? Choose all answers that are correct. A. a prohibition on the sale of alcohol B. an end to most child l
Designating a species a k-selected species means that the species likely exhibits which set of characteristics?
if angle EGD equals 38 what is angle IGJ
Complete each sentence below by selecting the type of muscle cell that performs the function described. "________" are used to help the heart beat and pump blo
What was a negative consequence of the industrial revolution apewx?
Multiple questions PLS HELP 1) Find all real zeros of the function y = -5x - 7 a. -5 b. -5, -7 c. 7/5 d. - 7/5 2) Find all real zeros of the fun