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

What is the answer? Simplify (v + 6) 3
At the movies, a couple bought 2 medium drinks and a large popcorn for $8.50. At the same theater, a family bought 3 medium drinks and 2 large popcorns for a to
Add 0.74 and 0.19. How many tenths are in the sum?
me pueden ayudar con este ejercicio 3+(-2)x8
5.What is Xian China famous for?
The clincher sentence: A. introduces the main idea. B. turns the main idea upside down. C. restates the main idea. D. explains the topic sentence of a paragraph
Josh's team scored 40 points at the game. Josh scored 15% of the team points. How many points did Josh score. P.S, How do you give the brainliest
4x +1 = -47 I’ve been trying to find this out for a while now and I simply just can’t
Why did Andew Jackson remove many government workers from office after becoming president?
Is the word geometry is derived from a Greek word, and literally means 'measurement of land'.