Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function add_two_numbers(number_one, number_two) -- Function means the following is a function definition.
- -- add_two_numbers is the function name.
- -- number_one and number_two are arguments.
- local number_three = number_one + number_two -- Sets number_three variable to the value of number_one plus number_two
- return number_three -- Returns the value behind the return to the calling code.
- end -- You need to close the function with end keyword.
- print(add_two_numbers(5, 2)) -- Prints 7.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement