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

how did African Americans challenge segregation after World War 2
How long was the French Revolution being planned? Were there leaders who did the organizing?
what number can you use to divide 47.5 over 190 when reducing and what number can you use  to divide 100 over 400 whe dividing
how do you work out and solve 12 = 4/5k
8x-2(x+1)=2(3x-1) A.0 B.2 C.no solution <-- that's what I think it is. D.identity. Can someone check my answer
Factor using the gcf : 6x^3-9x^2+12x
Can you help me with this problem?
Maya works 16 hours per month at her part-time job earning $6.75 per hour. She earns some additional money house sitting for neighbors and friends. Maya charges
If a hot dog cost $2.99 and 7% tax how much is one hot dog
Find two supplementary angels such that the measure of the first angle is 38° less than three times the measure of the second