"Review: Functions"


#1


https://www.codecademy.com/courses/python-beginner-c7VZg/4/1?curriculum_id=4f89dab3d788890003000096


def shut_down(s = "yes"):
    return "shutting down"
elif shut_down(s = "no"):
    return "shutdwon aborted"
else:
    return "sorry"


#2
 My code doesn't run correctly.  Please advise.

Sincerely,

Ian Michael Jones


#3

s a variable inside the function, look:

def test_function(s):
    print s
test_function("hello world")

When i call the function, i determine what the value is that s will hold. Knowing this, we can simple do:

def shut_down(s):
   if s == "yes":
      /* do something */

remember to use two equal signs to compare, one equal sign is used for assigning a value to a variable


#4
 Thanks for all of your help! I really do appreciate it! Take care!

Sincerely,

Ian Michael Jones


#5