Answer
The variables x and y are not defined outside the scope of the function hence using them outside will give NameError.
Work Step by Step
The variable x and y are defined in the scope of the function and hence they can only be used inside the function, but the program tries to print them outside of the function hence it will give an error.