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

what is the value of 9 in 26.219
What does CPU stand for. And it is the _____ of the computer
how are elements and compounds alike
Is this a sentence fragment or complete sentence? I have always been interested in these special creatures.
Container a and b hold 11,875 liters of water altogether. Container b holds 2,391 liters more than container a holds. How much water does container a hold?
order from least to greatest 2.614; 2.146; 2.46; 2.164
what is 2,852.1 rounded to the nearest tenths
Please help me out, asap! :-) Thank You very much... A particle accelerates from rest with an acceleration of 3m/s^2 to a speed V. It continues at this speed fo
What might be an advantage of collecting evidence in a natural setting rather than in a lab?
what are the constants of t-shirts