Seudónimo Seudónimo
  • 02-01-2016
  • Computers and Technology
contestada

Python Elif Function

Respuesta :

Neuron
Neuron Neuron
  • 04-01-2016
The python elif function is a part of the if loop and can be used when we have more than two conditions. Usually, you would want to do something like this:

def random_function(variable):
   if variable equals 10:
      return y
  elif variable equals 11:
      return x
  else:
     return z.

As you can see, with this you can control for the different things that variable can stand for. 

I wrote this in pseudocode so it's easier to understand :)

Answer Link

Otras preguntas

Are 3/9 3/10 3/11 3/12 in least to greatest form
how to draw a drawing graph?
explain the significance of the carp in Wang's "The Carp."
Explain whether you think nature or nurture is responsible for the personalities of the characters in the novel. use evidence from the first four chapters of fr
Which expression is a QUOTIENT? A) 8(4 + 5) B) 5 - (2 x 3) C) 8 + (6 ÷ 3) D) (5 + 2) ÷ (2 + 3)
Why did early humans leave Asia and migrate to the Americas
Jenna constructs the model to represent 3x2 11x – 4. what factors does jenna need to model for the sides?
The following question refers to “letter to john allan” and “alone.” compared to poe’s letter to john allan, poe’s poem “alone” is less repetitious. is more dem
Cindy has 30 meter of fencing. She plans to fence in a rectangular dog run that is 4 meters wide. [Remember, the formula for the perimeter of a rectangle( the d
what is 2/3 rounded to the nearest tenth?