Why this does not work? I'm used to HDLs.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
count = 0
def increment(value):
count = count + value
count = 10
increment(20)
My expectation when running this script is count = 30
but instead, i get an error:
File "/Users/.../untitled0.py", line 7, in increment
count = count + value
UnboundLocalError: local variable 'count' referenced before assignment