MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/PythonLearning/comments/1m1cnbe/simple_game_using_python/n3g6tyg/?context=9999
r/PythonLearning • u/Inevitable-Math14 • Jul 16 '25
37 comments sorted by
View all comments
14
Good practice!
Just a quick note: all caps is conventionally used to denote constants. It won't change the functionality, but your IDE may complain.
You should switch around ai and GUESS, to: AIand guess
ai
GUESS
AI
guess
That way you are signaling that AI is a constant number, and guess is a variable number.
5 u/AbyssBite Jul 16 '25 Almost correct, except that ai isn't actually a const here. 0 u/WhiteHeadbanger Jul 16 '25 ai is a constant, as you are assigning the value just once. It doesn't matter how you acquired the value, or if it's hardcoded. 4 u/AbyssBite Jul 16 '25 Assigning a value once doesn't make it a constant. You can assign a variable once too. Constant means the value doesn't change during execution.You can check this out 1 u/WhiteHeadbanger Jul 16 '25 Assigning a value just once means that the value doesn't change during execution, is just worded differently.
5
Almost correct, except that ai isn't actually a const here.
0 u/WhiteHeadbanger Jul 16 '25 ai is a constant, as you are assigning the value just once. It doesn't matter how you acquired the value, or if it's hardcoded. 4 u/AbyssBite Jul 16 '25 Assigning a value once doesn't make it a constant. You can assign a variable once too. Constant means the value doesn't change during execution.You can check this out 1 u/WhiteHeadbanger Jul 16 '25 Assigning a value just once means that the value doesn't change during execution, is just worded differently.
0
ai is a constant, as you are assigning the value just once. It doesn't matter how you acquired the value, or if it's hardcoded.
4 u/AbyssBite Jul 16 '25 Assigning a value once doesn't make it a constant. You can assign a variable once too. Constant means the value doesn't change during execution.You can check this out 1 u/WhiteHeadbanger Jul 16 '25 Assigning a value just once means that the value doesn't change during execution, is just worded differently.
4
Assigning a value once doesn't make it a constant. You can assign a variable once too. Constant means the value doesn't change during execution.
You can check this out
1 u/WhiteHeadbanger Jul 16 '25 Assigning a value just once means that the value doesn't change during execution, is just worded differently.
1
Assigning a value just once means that the value doesn't change during execution, is just worded differently.
14
u/WhiteHeadbanger Jul 16 '25
Good practice!
Just a quick note: all caps is conventionally used to denote constants. It won't change the functionality, but your IDE may complain.
You should switch around
aiandGUESS, to:AIandguessThat way you are signaling that
AIis a constant number, andguessis a variable number.