name error: name 'symtr' is not globally defined

0 votes
class Solution(object):
    def symtr(self,root1, root2):
        if(root1==None and root2==None):
            return True
        elif(root1==None and root2!=None or root1!=None and root2==None or root1.val != root2.val):
            return False
        return symtr(root1.right,root2.left) and symtr(root1.left,root2.right)
    
    def isSymmetric(self, root):
        if(root==None):
            return True
        else:
            x=symtr(root.left,root.right)
            return x
May 14 in Python by anonymous
• 120 points
97 views

Hey, @Bitra,

I am running your code but not getting any error, please run your code once more and see if the exact error you are getting or not. If,  the error is still there then do ping me.

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Python

0 votes
1 answer

Python argparse error "NameError: name 'file' is not defined"

The right datatype for destination in argpasrse module ...READ MORE

answered Nov 28, 2018 in Python by Omkar
• 69,030 points
5,881 views
0 votes
3 answers

Python error "NameError: name 'sr' is not defined"

NameError: name 'xx' is not defined Python knows ...READ MORE

answered Mar 19 in Python by rahul
• 360 points
26,672 views
0 votes
1 answer

Python error "Python NameError: global name 'Thread' is not defined"

There is a built-in function with the ...READ MORE

answered May 31, 2019 in Python by Riya
2,745 views
–1 vote
1 answer

Python error saying "NameError: name 'email' is not defined"

you need to define the variable email READ MORE

answered Nov 29, 2019 in Python by Casper
• 160 points
2,689 views
0 votes
1 answer

Python Error saying "NameError: global name 'true' is not defined"

It's a very small mistake. Change true ...READ MORE

answered Jun 17, 2019 in Python by Vinayak
6,498 views
0 votes
1 answer

Input() error - NameError: name '…' is not defined

Hello @kartik, You should use raw_input if you are ...READ MORE

answered May 5 in Python by Niroj
• 58,500 points
4,147 views
0 votes
1 answer

Error:Python NameError: name 'include' is not defined

Hello @kartik, On the basis of your information provided ...READ MORE

answered Jun 30 in Python by Niroj
• 58,500 points
734 views
0 votes
0 answers
0 votes
1 answer

when I run this, I get NameError: name 'state' is not defined error. How to solve this?

Hi@MUHAMMAD, I tried to run the exact code ...READ MORE

answered Sep 8 in Python by MD
• 56,480 points
83 views
0 votes
2 answers

NameError: name 'raw_input' is not defined

Hi, There may a problem with your python ...READ MORE

answered Jun 25 in Python by MD
• 56,480 points
17,926 views