Practice python Questions!

Practice python Questions!

University

40 Qs

quiz-placeholder

Similar activities

Final Day Quiz for ICT Skill Share

Final Day Quiz for ICT Skill Share

4th Grade - Professional Development

41 Qs

PNUR 1157 Review

PNUR 1157 Review

University

40 Qs

research

research

University

35 Qs

Python Data Structures Quiz

Python Data Structures Quiz

University

38 Qs

Ulangan MYOB kelas XI

Ulangan MYOB kelas XI

12th Grade - University

40 Qs

Executive Functioning

Executive Functioning

University

41 Qs

Basics of Python Programming

Basics of Python Programming

University

44 Qs

Instrumentasi Kelautan 4

Instrumentasi Kelautan 4

University

40 Qs

Practice python Questions!

Practice python Questions!

Assessment

Quiz

Other

University

Hard

Created by

Ben Goldblatt

Used 23+ times

FREE Resource

40 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given a custom Python class A, how can we make class A abstract?

custom Python classes are always abstract

specify the "abstract" keyword in one of its methods

specify "raise NotImplemented()" in one of its methods

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given a custom Python class A and subclasses B, C, and D that all contain a method op() with the same code. Where would be the preferred class to specify the method op() and its implementation?

include op() only in A

include op() in B, C, and D

no preferred location

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given a custom Python class A and its subclasses B, C, and D, where all four classes contain a method op(). How can we ensure that the method op() in class A cannot be executed:

make the method op() in class A abstract

we don't need to do anything in particular

it's not possible to do this

4.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Given a custom Python class A and this code snippet: myobj1 = A() x = myobj1 + 7 y = 7 + myobj1 We can ensure that the preceding statements succeed by:

implementing the __add__() method

implementing the __radd__() method

no need for extra code

5.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Queues are useful for the following types of use cases:

scheduling tasks for execution (e.g., processes)

checking if expressions contain balanced parentheses

almost any type of use case involving trees

6.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Stacks are useful for the following types of use cases:

handling prefix and postfix expressions

checking if expressions contain balanced parentheses

almost any type of use case involving trees

7.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

A custom Python generator will:

include the yield keyword

be more efficient in terms of memory usage

does not have particular advantages

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?