MCQs > IT & Programming > Python > Output of the below code snippet? x = 10 def foo(): print(x) x = x - 1 foo() print(x)

Python MCQs

Which of the following will be the output of the below code snippet? x = 10 def foo(): print(x) x = x - 1 foo() print(x)

Answer

Correct Answer: UnboundLocalError: local variable 'x' referenced before assignment

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it