x= [10]
def add_list():
x=[30,40]
X.append(50)
print x
add_list()
print x
The above example prints
(A) [10] [30,40]
(B) [10] [30,40,50]
(C) Error in the program
(D) [30,40,50]
Answers
Answered by
1
Answer:
C error in the program..
Answered by
0
There is error in the program.
Explanation:
Reason X has been declared outside the definition of add_list(). So any variable should be declared inside the function or procedure for the function to have access on the variable. Otherwise, though it is visible to us, pro-grammatically it would not be visible to the procedure or function.
There are two ‘X’ used here, one in smaller case and another in capital. So each language consider variables in different way, some are not case-sensitive and some are case-insensitive.
Similar questions