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

They went with an employee from this agency. (ask about the object: use whom) help please ​
P÷✓2=✓t/r+qexpress t in the terms of p and q​
How does the American dream relate to the concept of meritocracy?
Decide which of the two given prices is the better deal and explain why. You can buy shampoo in a ​5-ounce bottle for ​3,89$ or in a 14​-ounce bottle for 11,99$
Expansionary fiscal policy is generally designed to ____________ aggregate demand and thus ____________ real GDP and employment in the economy.
Which answers describe the shape below? Check all that apply. A. Rectangle B. Rhombus C. Quadrilateral D. Square E. Parallelogram F. Trapezoid
What is the value of y?
people who get population education are also aware of health issue and environment degradation see​
Find all the roots of the equation [tex] {x}^{6} - 64 = 0[/tex]​
Can you please help me with this ☺️