Shut down experiments


#1



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


I was experimenting a bit with my code. What could this be useful for? This is Exercise 17 Functions Review btw


def surprise():
    s = "probably"
    return s

def shut_down(s):
    if s == 'yes':
        return "Shutting down"
    elif s == "no":
        return "Shutdown aborted"
    elif surprise() == "probably":
        return "Shutting down in..."
    else:
        return "Sorry"


s = surprise()
print shut_down(s)


And a slight variation 

def surprise():
    s = "probably"
    return s

def shut_down(s):
    if s == 'yes':
        return "Shutting down"
    elif s == "no":
        return "Shutdown aborted"
    elif s == "probably":
        return "Shutting down in..."
    else:
        return "Sorry"


s = surprise()
print shut_down(s)


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.