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 a cholangiography?
What is the role of a control group in any experiment?
Intervention in which of the following countries would best be considered a peacekeeping expedition? ChinaSouth africPanamaSomalia​
A box of books has _______inertia than a box of cotton balls.
if a measurement is said to be precise this means that it is what​
Which describes the basic structure of a fatty acid
Read the passage. "That's the worst of living so far out," bawled Mr. White, with sudden and unlooked-for violence; "of all the beastly, slushy, out-of-the-way
Identify the value of b. HELP PLEASE!
Describe the process of rewriting the expression Please Help
The art of using and understanding space involves _______________ a. varying the size of objects or subjects, so that some are smaller than others and the illus