#Looping Quiz
Use the loop keyword
loop
Use the break keyword
break
Use the times keyword
times
Look at a loop and figure out what it will do
???
?: Here is a repeated list of puts statements.
puts
puts "hi" puts "hi" puts "hi" puts "hi" puts "hi"
How would you repeat this with loop/break 100 times?
(X)
( )
?: What will this loop do?
( )puts "so many loops" one time ( )puts "so many loops" 10 times (X)puts "so many loops" infinitely
?: True or False: puts "Hi" will never run.
puts "Hi"
(X)true ( )false
View Looping Quizarrow-up-right on Learn.co and start learning to code for free.
Last updated 6 years ago
counter = 0 loop do puts "hi" counter+=1 break if counter==100 end
loop do puts "hi" break if counter==100 end
x=0 while x < 10 do puts "so many loops" end
10.times do break puts "Hi" end