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

Look below for question:
What is decrease £20 by 15%
how does precipitation return to the water cycle
what is a transfer of food goods and disease between the old new worlds columbian
Which statement best describes the Odyssey? A. The Odyssey was the earliest submarine used by the ancient Greeks to explore the many surrounding seas. B. The Od
Complete the well-know saying: __________ blot ___________ copybook! ______________ not over till ___________ over.
Please help. Full explanation if you can. 1. The ratio of boots to sandals in a shoe store is 8:3. If there are 245 more boots than sandals in the store, how ma
what is 7.3519 to 1 decimal place?
You own a beauty salon where you not only cut hair but you also sell hair products. You buy a dozen barrettes for $18.00 and then sell them in your store for $2
find the x-intercept of the parabola with vertex (6,27) and y-intercept (0,-81)