0

I have this code and VScode is underlining most of it in blue. What is the reason and how do we solve it?

# Python code to count minimum deletions required # so that there are no consecutive characters left\ def countDeletions(string): ans = 0 for i in range(len(string) - 1): # If two consecutive characters are # the same, delete one of them. if (string[i] == string[i + 1]): ans += 1 return ans # Driver code string = "AAABBB" # Function call to print answer print(countDeletions(string)) 

enter image description here

8
  • 3
    What happens if you hover over the lines? Does it tell you? Blue squigglies in VSCode usually means your code has correct syntax but can't be run for some reason. Commented Jul 26, 2022 at 22:50
  • 4
    I suggest you delete the backslash at the end of the comment in line 2. That MAY be confusing VSCode's parser into thinking that the next line is part of the comment. Commented Jul 26, 2022 at 22:52
  • stackoverflow.com/a/69535248/2823755 ?? Commented Jul 26, 2022 at 23:14
  • Does VS Code Pylint highlighting the whole function with blue underline on missing function/class docstring answer your question? Commented Jul 26, 2022 at 23:16
  • blue is the range of a problem matcher item Commented Jul 26, 2022 at 23:43

1 Answer 1

0

Thanks to the commenters I learned How to read what's wrong which is by hovering over the underlined stuff.

It turns out they were all linting problems or warnings from the linter

I did see here how to disable this but this wasn't explaining what was the source or the reason for that.

Finally I know it and can trace and fix linting issues

Errors were due to snake_case function naming. classes and naming having no docstrings. and, operations without white spaces around it ex "==" instead of " == ".

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.