tests/globals_vs_locals_condition.py | raw changeset files shortlog |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tests/globals_vs_locals_condition.py Fri Aug 20 01:43:51 2010 +0200 1.3 @@ -0,0 +1,16 @@ 1.4 +#!/usr/bin/env python 1.5 + 1.6 +b = 2 1.7 + 1.8 +def f(x): 1.9 + if x: 1.10 + b = x 1.11 + return b 1.12 + else: 1.13 + return 1 1.14 + 1.15 +result_1 = f(0) 1.16 +result_4 = f(4) 1.17 +result_2 = b 1.18 + 1.19 +# vim: tabstop=4 expandtab shiftwidth=4