Functions 17. Review: Functions


#1



Exercise, where I stuck:
https://www.codecademy.com/en/courses/python-beginner-c7VZg/4/1?curriculum_id=4f89dab3d788890003000096


Oops, try again. Your code looks a bit off. Feel free to peek back at earlier exercises if you need a refresher! Your code threw the following error: invalid syntax (python, line 4)


What i expect to happen:
I expect that programm will ask me "Enter Yes or No", then I print "Yes", and programm will print(or return, whatever) "shutting down"


def shut_down(s):
    rawinput("Enter Yes or No")
    s = rawinput
    if s = "Yes":
        return "Shutting down"
    elif s = "No":
        return "Shutdown aboted"
    else:
        return "Sorry"


#2

to check if a number is divisible by 3 check if the remainder equals zero. To calculate the remainder use the modulo operator (%)


#3

Thank You, my bad. Now I have another problem.


#4

if you want to prompt the user for input, do this outside the function, store the result of this prompt in a variable and pass this variable as argument when calling the function

a single equal sign means assign

If you need more help, make a new topic since this is a question for a different exercise


#5