Question: What would be the result of running the code below? class Parent: An arbitrary class num 1 : int

What would be the result of running the code below?
class Parent:
"""An arbitrary class
"""
num1: int
def __init__(self, num1: int)-> None:
self.num1= num1
class Child(Parent):
"""A subclass.
"""
num2: int
def __init__(self, num1: int, num2: int)-> None:
self.num2= num2
if __name__=='__main__':
c = Child(1,2)
print(c.num2)
print(c.num1)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!