# That can be useful if you need to re-run a particular loop iteration. 1.upto(10) do |number| puts "1/" + number.to_s + " = " + (1 / Float(number)).to_s print "Enter r to retry: " gets chomp retry if $_ == "r" end