Sum of Two Numbers
Advanced
Sum of Two Numbers
Hey there, future coder! Today, we have a simple yet exciting challenge for you. Your mission, should you choose to accept it, is to write a function that adds together two numbers and returns their sum.
This is going to be fun and will help you understand how functions and arithmetic work in Python!
Your Task
You will write a function called sum_of_two_numbers which takes two numbers as arguments and returns their sum. Easy as pie! 🍰
Here's what your function needs to look like:
sum_of_two_numbers(3, 4) ➞ 7 sum_of_two_numbers(10, 5) ➞ 15 sum_of_two_numbers(-2, 8) ➞ 6
Examples
- If you give your function the numbers 3 and 5, it should return 8:
sum_of_two_numbers(3, 5) ➞ 8 - What if one of your numbers is zero? Keep cool and remember, adding zero to a number doesn't change it:
sum_of_two_numbers(0, 7) ➞ 7
Now it's your turn to write the function that makes all this happen! Are you ready? Go for it! 🎉
Inputs
Arg 1:
3Arg 2:
4Expected Output
7Actual Output