so i was trying to make a very simple counter (although not sure if that's what you call it)
import time
a = 0
def main():
time.sleep(5)
b = a + 1
print (b)
del(a)
a = b
del(b)
main()
main()
i know this is very unefficient and there is probably some command to count, but why doesn't this work?
i thought for sure it would give me the next number every 5 seconds: 1, 2, 3, 4, 5, etc.
but apparently "a is referenced before assignment" which i don't see why it's a problem, because after the first reference a = 0, shouldn't it just loop...?