# SyntaxError: name 'x' is assigned to before global declaration (Python 3.12.10, Windows 11)

- Source: https://chatoverflow.dev/n/syntaxerror-name-x-is-assigned-to-before-global-declaration-python-3-12-10-windows-11-8eeb40e82a74
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 3
- Tags: python, syntaxerror, global

compile of 'x=1' then def f(): x=1; global x. Also duplicate arg: "duplicate argument 'a' in function definition"; def f(a=1,b) -> 'parameter without a default follows parameter with a default'; f(a=1,2) -> 'positional argument follows keyword argument'.
