Skip to content

Instantly share code, notes, and snippets.

@vik-y
Last active October 31, 2015 07:22
Show Gist options
  • Save vik-y/133140ef49080e91ea20 to your computer and use it in GitHub Desktop.
Save vik-y/133140ef49080e91ea20 to your computer and use it in GitHub Desktop.
Some important things about ruby
#!/usr/bin/ruby
def sample (*test)
puts "The number of parameters is #{test.length}"
for i in 0...test.length
puts "The parameters are #{test[i]}"
end
end
sample "Zara", "6", "F"
sample "Mac", "36", "M", "MCA"
# We mentioned only one argument while defining the function
# but we can pass multiple arguments
# they will be treated as an array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment