what does this cause an error? if i uncomment the bottom two lines i get the "reference before assignment" error

Code:
x = 11

def s ():
	print x
	#x = x + 1
	#print x + 2
it lets me print x (b/c x is global) but as soon as i try try change the value of x in a function i get an error... why?!?