Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
error with variables 3.8
#4
on line 62 you assign to err. Thus err in the body of get_time() is different variable (i.e. with local scope) than the err in the global scope. obviously it's not the else part that is executed and on line 69 err is not defined.
to resolve it you can add global err statement at the top of get_time() function.
However note that using global variables is bad practice. So the best would be to refactor your code.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
error with variables 3.8 - by jusrosetyler1123 - Dec-18-2019, 05:52 AM
RE: error with variables 3.8 - by buran - Dec-18-2019, 07:23 AM
RE: error with variables 3.8 - by jusrosetyler1123 - Dec-18-2019, 01:38 PM
RE: error with variables 3.8 - by buran - Dec-18-2019, 03:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  I want to multiply two variables, but I get an error LeqendFire 3 2,150 Aug-09-2020, 03:52 PM
Last Post: LeqendFire

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020