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

Who were the Nazis ?
The neolithic revolution is most closely associated with....
The circumference of a circle is 6.28.What is the area of the circle?
Find an equivalent ratio for 22/55 then write the proportion ?
Horace read 160 pages in 4 hours. How many pages can he read in 6 hours??
The neolithic revolution is most closely associated with....
The diameter of your bicycle wheel is 25 inches. How far will you move in one turn of your wheel?
What is the change in number of individuals in a population over time? A. population decrease B. population stability C. population growth D. population resista
The plans for a shed call for a rectangular floor with a perimeter of 204 ft. The length is two times the width. Find the length and width.
The neolithic revolution is most closely associated with....