Skip to content

Instantly share code, notes, and snippets.

@coderberry
Created September 18, 2012 22:26
Show Gist options
  • Save coderberry/3746360 to your computer and use it in GitHub Desktop.
Save coderberry/3746360 to your computer and use it in GitHub Desktop.
for_loop_2.rb
# Nested loops
for x in (1..10) do
for y in (1..10) do
puts x * y
end
end
# Nested loops with mixed data
for x in (1..10) do
for letter in "A".."Z" do
puts "#{x}-#{letter}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment