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

Please help it's due at 10 and its 9:24 I've been working on some other papers for hours
0.3 is 10 times as great as what decimal? 0.003 is 1 half of what decimal?​
5 A scientific method is a way to investigate a scientific problem. Although the order of steps can vary, the tasks performed during each step often stay the sa
Complete the following phrases with the appropriate Spanish words. Be sure to accent and spell correctly. (á, é, í, ó, ú, ñ) --¿Qué ______ es mañana? --Mañana
Please help. 15 POINTS.
What are the areas of all these triangles? I need help please? and if you could do explanations that would be great!!!
Why did explores begin to venture out to new places?
Knowing vital signs of your patient is important why
solve this problem ​
Marsha has 32 bottle caps. She wants to turn them into her school to rise money for the fundraiser that goes on year round. How much would she earn for the scho