How should I check the value of s?


#1

Question

How should I check the value of s?

Answer

s is the argument provided to the function when it is called elsewhere in the program, so it’s just a value that we’re comparing against the strings ”yes” and ”no”.
Be sure you’re not using the function, shut_down(s), in your if or elif conditions being checked, as that’s invalid and will cause it to infinitely call itself. We’re only comparing s, the value passed to the function.


FAQ: Learn Python: Functions - Review: Functions