I declare guess as a global variable so it can be used in any function. I thought it would be a shortcut so you don’t have to type the same variable for different functions.
Global variables are generally the wrong way to go about solving a given problem. They make it unclear which functions read or write that variable, thus reducing clarity of your code. It also means that the variable exists throughout the entire duration of the program, keeping it in memory even when it is no longer needed.
2 Likes
Oh okay. Thanks for the feedback! I didn’t know if it would affect the memory.

