when assign x = x + 1 python thinks x is declared as a local var , as a result it trys to to find the value of x inside the function , if cant found , we'll receive an error which says "UnboundLocalError: local variable 'x' referenced before assignment"
when assign x = x + 1
python thinks x is declared as a local var , as a result it trys to to find the value of x inside the function , if cant found , we'll receive an error which says "UnboundLocalError: local variable 'x' referenced before assignment"
u need to declare global before the variable but never used it in my life bcs there's no reason
Could be useful for debugging if u dont have access to debugging libraries which could be the case in your professional work
Worked with it a lot back in the days when I was designing a GPS signal generator @@youssefbenhachem993
Part 2?
The second part will be uploaded today. Once it's uploaded, I'll share the link.