Quiz: Methods

Test the concepts you've learned in this section with this short quiz.

1

What is the output of the following code?

def display
  print "1"
end

print "2"
2.times do
  display
end
print "3"
A)

2113

B)

12113

C)

21113

D)

121113

Question 1 of 30 attempted

Get hands-on with 1400+ tech skills courses.