+ 1
Calling function with input
Hi all, Can someone please help me out why the following code doesn't work? I expected to be able to enter Yes or No and having the proper reaction as a result... Thanks in advance. def shut_down(s): if s.lower() == "yes": print ("Shutting down...") elif s.lower() == "no": print ("Shutdown aborted!") else: print ("Sorry, I didn't understand you.") s=input("Shutdown? Yes or No") shut_down
2 Respostas
+ 1
Thanks Adriano for your quick reply!. That is it! Thanks for helping out.
0
The last line ought to be shut_down(s) in order to work. You forgot to present the paremeter to the function. I guess that is all.