Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

beginner question 1

Status
Not open for further replies.

brent3721

Programmer
Apr 7, 2006
2
US
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

 
Feherke,

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.

b r e n t
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top