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

Discuss the factors that could fail the process of dough rising(6marks)​
According to the “homework should be banned” example, is the evidence relevant?
Read this passage and then answer the question….. Which of these statements is true? A.) There was a casual relationship between economic chaos and increased f
Plzzzzzzz help me with this problem i have
Latoya is a software saleswoman. Let represent her total pay (in dollars). Let represent the number of copies of English is Fun she sells. Suppose that and are
A ordinary fair dice is thrown once. What is the probability the dice lands on a even number
Complete the sentence A _______ spans a geographic area like a city,is larger than a LAN and smaller than WAN
What is the equation of the line that is parallel to Y =-2/3 X +4 and that passes through (-2,-2)?
Read the excerpt from "A Quilt of a Country." Once these disparate parts were held together by a common enemy, by the fault lines of world wars and the electrif
gumawa tula tungkol sa pagmamahal sa ating bansapa help naman po PLEASE​