There's an error in your What are arguments? section. you have the following definition:
def sum(num1, num2):
return num1 + num2
You then try to use the sum function you defined:
val1 = 10
val2 = 20
ans = sum(val1 + val2)
However, you defined sum to be a function that takes exactly two arguments, and you called it as a function that takes exactly one argument, so that call to sum won't work:
There's an error in your What are arguments? section. you have the following definition:
You then try to use the
sumfunction you defined:However, you defined
sumto be a function that takes exactly two arguments, and you called it as a function that takes exactly one argument, so that call tosumwon't work:So, you'll need to call it as:
sum(val1, val2)Thanks for pointing out the issue! Now it is fixed.