Created
December 6, 2014 21:12
-
-
Save hpjaj/0d21e889d1a8a73ed604 to your computer and use it in GitHub Desktop.
week 3 - 1e - Ten for Fifty
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def method | |
a = 50 | |
puts a | |
end | |
a = 10 | |
method | |
puts a | |
=begin | |
This displays like so: | |
The 50 is displayed because line 7 calls the method "method" which puts its locally | |
scoped variable of a, which is assigned on line 2 to a value of 50 | |
50 | |
The 10 is displayed because on line 6 a top level local scope assigns a to 10 | |
and then this top level variable is called on line 8, which prints 10 | |
10 | |
=end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment