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

Are you supposed to put a period at the end of a verbal expression in algebra?
which are synonyms? a. farm/corn b. river/stream c. walk/talk d. house/garden
describes the practice of products and services traded among countries around the world.
which experiences higher average tempertures than the other biome a) taiga b) alpine tundra c) tropical seasonal forest d) temperate decidiuous forest
the axiom that allows b(7) to be written 7b.
the color that is bent the least by a prism is _____. violet blue yellow red
what part of the presidential election process are established by the constitution
in triangle nlm, if the measure of angle m=(4x-4)°, m <L=(3x+12), m <n=(6x+3), what is x? A. 9 B.12 C.13 D. 14
Which of the following is the last step in creating a budget?
what is 150 mm expressed in diameters