Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Hands-On Database

Authors: Steve Conger

2nd Edition

0133024415, 978-0133024418

More Books

Students also viewed these Databases questions

Question

Discuss the steps in the development planning process. page 399

Answered: 1 week ago

Question

Identify the cause of a performance problem. page 380

Answered: 1 week ago