Conditionals Quiz

def robert_likes(object)
  if object
    return "Robert likes this thing!"
  else
    return "Robert says 'ehh..'"
  end
end

Which of the following objects does Robert like?

true 1 false nil 0 "false"
def flow_control(integer)
  if integer == 5
    return "Go five go!"

  elsif integer > 5
    return "Too many to count..."

  else
    return "Not enough to be interesting"
  end

  "I love flow control!"
end

For which of the following arguments will we see the "I love flow control!" return value?

5 100 -100 0 We will never see "I love flow control!"

results matching ""

    No results matching ""