MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/PythonLearning/comments/1m1cnbe/simple_game_using_python/n3g69i7/?context=3
r/PythonLearning • u/Inevitable-Math14 • Jul 16 '25
37 comments sorted by
View all comments
Show parent comments
5
Almost correct, except that ai isn't actually a const here.
ai
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 2 u/More_Yard1919 Jul 16 '25 This is technically correct, and I am not sure if I would use the all-caps convention here, but practically this is to signify that the value should never be reassigned after it is initialized.
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 2 u/More_Yard1919 Jul 16 '25 This is technically correct, and I am not sure if I would use the all-caps convention here, but practically this is to signify that the value should never be reassigned after it is initialized.
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
2 u/More_Yard1919 Jul 16 '25 This is technically correct, and I am not sure if I would use the all-caps convention here, but practically this is to signify that the value should never be reassigned after it is initialized.
2
This is technically correct, and I am not sure if I would use the all-caps convention here, but practically this is to signify that the value should never be reassigned after it is initialized.
5
u/AbyssBite Jul 16 '25
Almost correct, except that
aiisn't actually a const here.