'pylance not accessed in python

I am having a problem with pylance .Don't know exactly what it is. attaching a picture. if I write a code to some game it gives some "not accessed pylance" error. if I copy and past the exact code from somewhere then it works. any solutions to solve this please?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source