I\'m coding a small program to time and show, in a ordered fashion, my Rubik\'s cube solvings. But Python (3) keeps bothering me about times being used prior to global decla
The global declaration is when you declare that times
is global
def timeit():
global times # <- global declaration
# ...
If a variable is declared global
, it can't be used before the declaration.
In this case, I don't think you need the declaration at all, because you're not assigning to times
, just modifying it.