Find the error
def minus (total, decrement)
output = total – decrement
return output
Answers
Answered by
8
Answer:
Explanation:
1. It will throw invalid syntax error since the function definition does not include ":" symbol in the first line. Every function signature should end with ":" symbol.
2. The second and third line of the program is not indented for the compiler to understand that those two belongs to the minus(). Every line should get indented appropriately in python
The below is the rectified program
def minus (total, decrement):
output = total - decrement
return output
Answered by
5
The error in the given code is that the colon is missing.
- The function’s header has colon missing at the end.
- There is a need to add colon (:) at end of the header line.
- In a program, a colon is followed by a sentence or enumeration
- Thus, the correct code is
- def minus (total, decrement):
- output = total - decrement
- return output
Similar questions