Advertisement
karlakmkj

Print 30 times

Sep 1st, 2021
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.15 KB | None | 0 0
  1. # using loop method with do
  2. m = 0
  3. loop do
  4.   m +=1
  5.   print "Ruby!"
  6.   break if m == 30
  7. end
  8.  
  9. # shortcut using .times
  10. 30.times {print "Ruby!"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement