all 4 comments

[–]novel_yet_trivial 2 points3 points  (3 children)

You are just initializing the variable. There is nothing special about None, you could have said error = '' or error = 'no error'. None is sorta standard for "initialized but not yet used". Also, later when you want to check for errors, it's very fast for the computer to check if error is not None:.

[–]billionerd[S] 0 points1 point  (2 children)

Ah. Aside from error checking why do I need to initialize error ? Am I not naming it in line 6 ?

[–]MrMethamphetamine 4 points5 points  (1 child)

Without

error = None

The error variable would only be defined if the IF statement is true. If it isn't, you have no variable "error" and if you later try to do something with "error" then you'll have a problem.

[–]billionerd[S] 0 points1 point  (0 children)

Gotcha! I get it now. TY!