Home > database >  'input' is not defined Pylance(reportUndefinedVariable)
'input' is not defined Pylance(reportUndefinedVariable)

Time:12-08

Here input gets underline but code runs properly

it just started happening, now all "input()" gets yellow underline But code works properly

CodePudding user response:

a=int(input()) 

if u r keeping any integer values.

CodePudding user response:

This problem does not occur in my pylance. It seems that there are some errors in your vscode's pylance. It doesn't recognize the input() method.

You can try to update the pylance in the extension store or add the following code in settings.json:

  "python.analysis.diagnosticSeverityOverrides": {
    "reportUndefinedVariable": "none"
  }

CodePudding user response:

That happens because you are using input. Use raw_input instead. raw_input is what you have to use with python 2.

CodePudding user response:

Just Uninstall Pylance extension.

  • Related