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

Police use a general warrant to search a suspect's home for a stolen television set. Police go through the entire house and do not find a television set. Howeve
Solve equation by completing the square
A cube has an edge length of 2x. Write an expression for the total area of the cube.
how can you assess whether you are not looking for enough ahead when you drive​
WILL MARK BRAINLIEST!!!! Thank youuu!
Switzerland was an neutral country during the WWI. T or F
A corn muffin recipe calls for 1/4 cup of cornmeal and 5/6 cup of flour. What is the least common denominator of the fractions
Helppp Plsss ASAP!! Show your work. Thanks ​
a man can walk 5 miles in 6 hours. if his speed increased 50% how long would it take to walk 6 miles​
In which sentence do the subject and verb agree?