Hi all, can you explain me why this simple function works well (i.e. I
can call the print function using txt) in py

>>> def test(value):
...     if value%5: txt = "hello"
...     else: txt = "test"
...     print(txt)

while in other languages like C the txt identifier would be undefined?
Is there a way to force the scoping?


Thanks,

Mattia
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to