Commit fbf3b14c by Đường Sỹ Hoàng

Functions&Variables

parent 7871e566
Pipeline #114 canceled with stages
in 0 seconds
def cheese_and_crackers(cheese_count,boxes_of_crackers)
puts "You have #{cheese_count} cheeses!"
puts "You have #{boxes_of_crackers} boxes of crackers!"
puts "Man that's enough for a party!"
puts "Get a blanket.\n"
end
puts "We can just give the function numbers directly:"
cheese_and_crackers(20,30)
puts "Or, we can use variables from our script:"
amount_of_cheese=10
amount_of_cracker = 50
cheese_and_crackers(amount_of_cheese,amount_of_cracker)
puts "We can even do math inside too:"
cheese_and_crackers(10+20,5+6)
puts "And we can combine the two, variables and math:"
cheese_and_crackers(amount_of_cheese +100, amount_of_cracker +1000)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment