VSCode is saying variables that change using += 1 in python should be constants. Is this correct?
Here is an extremely simplified version of my code below: foo = 0 bar = 0 baz = 0 while True: answer = input('Type an input here: ') print('And do something with it here.') if answer == 'okay': foo += 1 else: bar += 1 baz += 1 print(foo, bar, baz) When I save this, VSCode is giving me a warning saying: Constant name "foo" doesn't conform to UPPER_CASE naming style Constant name "bar" doesn't conform to UPPER_CASE naming style Constant name "baz" doesn't conform to UPPER_CASE naming style My question is does the "+= 1" affect whether or not the variable should be a constant? I thought the "+= 1
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.