The error in the program is that the sum function can only take two arguments. The function sum(num1, num2)
is defined to take only two parameters, but the print(sum(4, 5.5, 6))
statement is providing three arguments: 4, 5.5, and 6. This will result in a TypeError
.
To fix the issue, you need to adjust the call to the sum
function so that it only passes two arguments. For example:
print(sum(4, 5.5))
This will work correctly.