Question:

What Will Be The Output Of The Following Code Snippet?

class A:
    def __init__(self):
        self.x = 1
 
    def func(self):
        self.x = 10
 
class B(A):
    def func(self):
        self.x += 1
        return self.x
 
def main():
    b = B()
    print(b.func())
 
main()

 

Answers:


Keywords:

© 2017 QuizBucket.org