Am trying to use sqlite3 and python but am getting this error ..name connection not definedr | Sololearn: Learn to code for FREE!

0

Am trying to use sqlite3 and python but am getting this error ..name connection not definedr

8/9/2020 11:01:08 PM

Aliyu Hassan

3 Answers

New Answer

+3

can you show or take a pic of your code?

+3

How about showing the code that is throwing the error?

0

"NameError: name 'connection' is not defined" is the error I believe you're getting? If yes, I would check to make sure you have instantiated the variable "connection". I would also check the spelling, you could have misspelled the variable, also, check the scope of the variable and how it is being called, you may have to set "connection" as a global variable. As others have mentioned it is tough to say why this error is present without seeing the code that is producing this error. If you can, help us, help you, and post the code.