So I resumed my python courses because I got stuck on functions and lists the last time.
Repeating chapter 4 at the moment and I can't seem to figure out what I am doing wrong. The code is giving me a return outside of function error.
I know I can just do
if s=="yes": return "Shutting down" elif s=="no": return "Shutdown aborted" else: return "Sorry"
But what if I want to do it like below?
def shut_down(s): return s if shut_down(yes): return "Shutting Down" elif shut_down(no): return "Shutdown Aborted" else: return "Sorry"
Why is the above code returning a return outside of function error?