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

write an equation in point-slope from for the line that has a slope of 6and contains the point (-8, -7)
How to make a mixed fraction
por que os vulcões e os terremotos são mais freqüentes em certas regiões do planeta
all answers to how to be a smart risk taker
What is x^2+8x-5 in vertex form? Please explain.
Which fraction is equivalent to 2/7
A grain storage bin has the following dimensions, 11 feet high, 28 feet long and 12 feet wide. The volume of 1 bushel is 2200 cubic inches or 1.273 cubic fee
Which expressions, when evaluated with x = –9, are negative in value? Choose all answers that are correct. A. –2x – 8 B. –26 – 2x C. 35 + 3x D. –3x
prove that x^n-Y^n divisible by x-y for all natural numbers x,y (x!=y),and n.
which channel is the most popular one for the evening news A. WANR B. WWCN C. WCLM D. WKOD