0% found this document useful (3 votes)
13K views2 pages

Digital Python Intermediate iON LX Async SP As

This document contains two questions from a Python assessment. Question 4 asks which methods can be used to invoke the __init__ method from a subclass. The answers are super().__init__() and X.__init__(self). Question 5 provides a code snippet and asks what will be printed. The output is "STRALIA".

Uploaded by

mahesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (3 votes)
13K views2 pages

Digital Python Intermediate iON LX Async SP As

This document contains two questions from a Python assessment. Question 4 asks which methods can be used to invoke the __init__ method from a subclass. The answers are super().__init__() and X.__init__(self). Question 5 provides a code snippet and asks what will be printed. The output is "STRALIA".

Uploaded by

mahesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Digital : Python_Intermediate_iON LX_Async_&_SP_Assessment - Course ID: 54196

CLP - Python - Generic - SelfPaced - Assessment Only - E2 Batch 1

Question 4

Which of the following can be used to invoke the __init__ method in X from Y, where Y is a subclass of X
in (in Python 3.x)?(Chosse two)

1. super().__init__()
2. super().__init__(self)
3. X.__init_(self)
4. X.__init__()

Answer:

1. super().__init__()

3.X.__init_(self)

Question 5

What will be the output of the following program?

def country (*abc):

if len(abc) ==1:

item= abc[0]

def f(obj):

rerun obj[item]

else:

def f(obj):

return tuple(obj[item] for item in abc)

return f

selection = []

selection = country(slice(2, None))(‘AUSTRALIA’)

print(selection)

1. USTRALIA

This study source was downloaded by 100000813364844 from CourseHero.com on 01-23-2023 07:34:48 GMT -06:00

https://www.coursehero.com/file/104858911/Digital-Python-Intermediate-iON-LX-Async-SP-Assessment-4-5docx/
2. ALIA
3. STRALIA
4. AU

Answer: STRALIA

This study source was downloaded by 100000813364844 from CourseHero.com on 01-23-2023 07:34:48 GMT -06:00

https://www.coursehero.com/file/104858911/Digital-Python-Intermediate-iON-LX-Async-SP-Assessment-4-5docx/
Powered by TCPDF (www.tcpdf.org)

You might also like