can someone please tell me why this won't work, I'm just starting with Ruby:
puts 'tell me a number first:'
number = gets.chomp
puts 'awesome'
puts 'now tell me a word to repeat ' + number + ' times'
word = gets
puts number.to_i * word
Thanks for helping me with that, it makes perfect sense now. I'm just starting with programming so keep a look out for other easy questions in the near future.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.