Advertisement
Guest User

Untitled

a guest
Aug 4th, 2011
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. im_outside = 42
  2.  
  3. def afunction():
  4.     print "Here is an outside variable as seen from a function: %d" % im_outside
  5.     print "But now I'm going to modify it..."
  6.     im_outside = 27
  7.     print "And here it is: %d" % im_outside
  8.  
  9. print "Here is a variable I can see: %d" % im_outside
  10. afunction()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement