620 B
620 B
Challenge: Functions
Difficulty: Easy Language: Python Subject: Modular Programming (Functions)
Description
Write a function named add_numbers that takes two parameters, a and b, and returns their sum.
Requirements
- Define the function
add_numbers(a, b). - Use the
returnkeyword. - Call the function and print the result of adding 5 and 10.
Hints
def add_numbers(a, b):is the standard way to define a function.- Use
print(add_numbers(5, 10))to see the result.
Validation
- Check:
python3 -c "import main; print(main.add_numbers(5, 10))" - Expected Output: 15