MJ49
MJ49

Reputation: 123

pycharm variable and comment color

For some reason when I declare a variable within a function using PyCharm, the font color is the same as if it were a comment (See picture). Anyone else having this problem? I didn't change any setting it just started happening, very frustrating!

enter image description here

Upvotes: 3

Views: 7721

Answers (3)

You can go to settings > editor > color scheme > custom and change the color for Line Comment

Same way settings > editor > color scheme > Python and change the color for variable

Upvotes: 3

Jason
Jason

Reputation: 3535

This is due to x is not used by any other function or code. If you hover your cursor over it for few second, the warning would tell you what's the reason.

Upvotes: 1

Adam
Adam

Reputation: 56

That usually happens when you have not interacted with the variable anywhere else in the function.

For example, if you added a line after such as:

print x

the color would change back.

Upvotes: 2

Related Questions