scope question

Fiack Vincent a at a.a
Tue Aug 7 11:37:35 EDT 2001


On Tue, 07 Aug 2001 15:59:27 +0100, Mark Robinson
<m.1.robinson at herts.ac.uk> wrote:
>count = 0
>def function():
>	print count

You aren't modifing 'count', and it seems that you can read it without
declaring it as global.

count = 0
def function():
	other = count + 1
	print other

this works.
-- 
Vincent.



More information about the Python-list mailing list