From: Tom Smith Date: 2009-08-29T06:56:17+09:00 Subject: Re: Error with an array of strings Thanks all for your help. Josh, that's definitely an improved loop, thanks. In any case, here's the improved code I've ended up with (pre-changing the loop): all_inputs = Array.new until $_ == "n" puts "Enter Number:\n" response = gets response.chop! response.to_f all_inputs.push(response) print "add more numbers to average? y or n\n" continue = gets continue.chop! end averageall = all_inputs.inject(0){|sum,num| sum + num.to_f } / all_inputs.length print "Average is: ", averageall,"\n" -- Posted via http://www.ruby-forum.com/.