Please sort out this error

2 Likes

Yes name ‘num’ is not defined here because you are using try and except block outside the class and declared variable num inside the class. So you are getting this error.
Correct this

2 Likes

@kinnukeshiya

Your num variable is not defined under try block…it is defined outside try block .

2 Likes