Variable Scope Quiz


What is a variable's scope?

Show Answer

What is a local variable?

Show Answer

What will be the value of test_variable printed on the last line of the code below?

test_variable = 0

def test_method(test_variable)
    test_variable = 15
    test_variable
end

test_variable = test_variable + 6
test_method(test_variable)
puts(test_variable)

Show Answer