Return Value Quiz

All methods have a return value.

True False
  def say_hello(name)
    puts "hello, " + name
  end

  x = say_hello("Avi")

What is the value of x at the end of this script?

"Avi" "hello, Avi" nil
  def do_math
    a = 4
    b = 10
    c = b - a
    return c
    "Math complete!"
  end

What is the return value of #do_math?

6 "Math complete!" nil

results matching ""

    No results matching ""