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

A particular type of​ wood-frame door is priced at ​$1560 with a sales tax of ​$78. Find the rate of sales tax
In water, a strong acid will In water, a weak base will break down into its component parts. break down into its component parts.
It takes half of a yard of ribbon to make a bow How many bows can be made with 5 yards of ribbon
-Solve (they are powers)300.000 =____ x 10*40 =____ x 10*1 =____ x 10*5.000 =____ x 10*20.000 =____ x 10*
How can you use the properties of operations to evaluate this expression? 18 + 4(28)
The Treaty of Versailles brought an end to
How do text features and organization support an author's ideas? Text features and organization support an author's ideas by ___________________________.
Describe the spatial (physical) features of the Amazon rainforest.
what value for h would make the statement-4h=-14
Who wrote Sweet but Psycho, and why did she write it?