Python Programming Quiz

Python Programming Quiz

University

133 Qs

quiz-placeholder

Similar activities

FAE PREPARATION TEST

FAE PREPARATION TEST

University

130 Qs

T1-2

T1-2

University

136 Qs

DEPTALS REVIEWER 2ND YEAR COURSES

DEPTALS REVIEWER 2ND YEAR COURSES

University

129 Qs

prepositions

prepositions

University

135 Qs

ICT is fun

ICT is fun

1st Grade - University

129 Qs

TEST SERIES - 14 - THE PRELUDE, ODE TO DEJECTION & KUBLAKHAN

TEST SERIES - 14 - THE PRELUDE, ODE TO DEJECTION & KUBLAKHAN

University

129 Qs

English Grammar Quiz

English Grammar Quiz

University

133 Qs

Curso de Inglés Posgrado

Curso de Inglés Posgrado

University - Professional Development

138 Qs

Python Programming Quiz

Python Programming Quiz

Assessment

Quiz

English

University

Practice Problem

Easy

Created by

Tâm Dương

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

133 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In which of the following does the Cricket Fan class correctly inherit from the Party Animal class?

from party import Party Animal

class CricketFan(PartyAnimal)

An= PartyAnimal()

CricketFan = PartyAnimal()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In Python, a class is... for a concrete object.

nuisance

instance

blueprint

distraction

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to define an initializer method?

def init(title, author):

def init(self, title, author):

def init():

init(self, title, author):

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What keyword is used to indicate the start of a method in a Python class?

def

break

function

continue

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements is not true about object-oriented programming?

One of the benefits of object-oriented programming is that it can hide complexity.

A class contains functions as well as the data that is used by those functions.

Constructor methods are required to initialize an object and destructor methods are required to destroy the object when no longer required.

A powerful feature of object-oriented programming is the ability to create a new class by extending an existing class.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? python class Person: def_init__(self, id): self.id =id sam Person(100) sam_dict_['age'] $I=49$ print(sam.age len(sam._dict))

49

50

51

48

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which came first, the instance or the class?

Class

Function

Instance

Method

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?