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
483 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,210 points
12,911 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
41,253 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
6,693 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
6,333 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

edited Oct 7, 2021 by Sarfaraz 15,497 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,880 points
22,042 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 Jul 1, 2020 in Python by Niroj
• 82,880 points
8,560 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 6, 2020 in Python by MUHAMMAD
• 160 points

retagged Sep 7, 2020 by Gitika 986 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,440 points
2,435 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,910 points
1,010 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP