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, 2020 in Python by anonymous
• 120 points
123 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,090 points
7,211 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, 2020 in Python by rahul
• 360 points
31,362 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
3,559 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
3,378 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
8,463 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, 2020 in Python by Niroj
• 82,560 points
7,047 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, 2020 in Python by Niroj
• 82,560 points
1,886 views
0 votes
0 answers

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

tree = [[[5, 1, 2], [8, -8, ...READ MORE

Sep 5, 2020 in Python by MUHAMMAD
• 160 points

retagged Sep 7, 2020 by Gitika 160 views
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, 2020 in Python by MD
• 95,060 points
459 views
0 votes
1 answer

Error: Name is not defined, It’s not returning a value

Remove main & try or  Use __name__ instead ...READ MORE

answered Oct 12, 2020 in Python by Gitika
• 65,870 points
52 views