CBSE Class 12 Computer Science
Question 84 of 103
Working with Functions — Question 17
Back to all questionsThe errors in the code are:
define check() #Error 1
N = input ('Enter N: ') #Error 2
i = 3
answer = 1 + i ** 4 / N
Return answer #Error 3- The function definition lacks a colon at the end.
- The 'input' function returns a string. To perform arithmetic operations with
N, it needs to be converted to a numeric type, such as an integer or a float. - The return statement should be in lowercase.
The corrected code is given below:
def check():
N = int(input('Enter N:'))
i = 3
answer = 1 + i ** 4 / N
return answer