bewellplus.gsu.edu
Anonymous Anonymous
  • 02-01-2016
  • Computers and Technology
Answered

Python Elif Function

Verified Answer :

Neuron
Neuron Neuron
  • 03-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

Related Questions

Turn 12 and 25 into a fraction
What is the cube root for 326
When adding like fractions why is the numerator the only part of the fraction that changes
Residential energy use can be reduced by using Energy Star appliances true or false
increase 240 by 30
11 Which slogan contains alliteration One Dollar Snacks Million Bucks Taste The Snack You Can Sneak Distinct Taste Simply the Best Snacks
Which term describes the right of a lender to sell collateral to get back the principal if the borrower cannot repay the loanSelect one of the options below as
Explain why 1 hundred 4 tens and 14 tens name the same amount
Weightlifters are often concerned with the amount of protein in their diets because growing muscles require protein Just as muscles need the basic building bloc
Identify the enclosed portion of the following sentence Jacob had to buy a new cell phone after dropping his old one in the pool1 point adverb clause adjective