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
57 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,060 points
4,493 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
• 320 points
19,143 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,028 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
1,918 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
4,532 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
• 23,950 points
416 views
0 votes
1 answer
0 votes
1 answer

Raw_Input() Is Not Defined

For Python 3.x, use input(). For Python 2.x, ...READ MORE

answered Sep 3, 2018 in Python by Priyaj
• 57,530 points
10,553 views
0 votes
1 answer

Raw_Input() Is Not Defined

For Python 3.x, use input(). For Python 2.x, ...READ MORE

answered Sep 17, 2018 in Python by Priyaj
• 57,530 points
189 views
0 votes
1 answer

How to print a message or the error if a file is not found?

To print the message that file is not ...READ MORE

answered Jan 2, 2019 in Python by Omkar
• 69,060 points
94 views