+ 1
Please help to create two diffrent functions!
in my hangman.py game I defines a cls() function inside play() function and now I am troubling to separate them without getting any problems.. please help me to separate that two functions.. My code : https://code.sololearn.com/c99iLxxZG8Ud/?ref=app
2 odpowiedzi
+ 1
The short version is that the function within the function needs to be defined outside it, but accept as parameters any situational data from the outside that it will need to run. Then, the other function can call it and pass it the necessary data.
+ 1
You may be defining functions when you don’t need to. Functions should encapsulate code that gets run in different places of the program over and over, such as getting a choice from a list of options.