Module5_Classes

Module5_Classes

Professional Development

13 Qs

quiz-placeholder

Similar activities

Bringing Language to Life through Technology

Bringing Language to Life through Technology

Professional Development

10 Qs

17 Days of SDGs Quiz - Day 16 (English)

17 Days of SDGs Quiz - Day 16 (English)

3rd Grade - Professional Development

15 Qs

CodeMonkey Platform Management & Resources

CodeMonkey Platform Management & Resources

Professional Development

10 Qs

COUNTERS IN PLC

COUNTERS IN PLC

Professional Development

10 Qs

Guess the Country! :)

Guess the Country! :)

8th Grade - Professional Development

14 Qs

Education Framework Q1

Education Framework Q1

Professional Development

10 Qs

Action Research

Action Research

University - Professional Development

10 Qs

Introduction to Management

Introduction to Management

University - Professional Development

10 Qs

Module5_Classes

Module5_Classes

Assessment

Quiz

Education

Professional Development

Medium

Created by

Sumathi K

Used 1+ times

FREE Resource

AI

Enhance your content

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

13 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the correct syntax to define a class in Python?

def Student:

class Student():

class Student[]:

create class Student:

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the purpose of the __init__ method in a class?

It deletes the object

It is used to print data

It is the constructor method to initialize object state

It is called when the object is deleted

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What will be the output of the following code?

class Test:

def init(self):

self.val = 10

t = Test()

print(t.val)

0

10

None

Error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a pure function in Python?

A function that modifies the global state

A function that has no return value

A function that does not modify any object or global variable and always returns the same output for same input

A function that takes no parameters

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

def add(x, y):

return x + y

What Kind of Function is this?

Pure Function

Modifiers

Both

None

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

def append_item(lst, item):

lst.append(item)

What Kind of function is this?

Class Method

Modifier

Function Definition to append element to a list

Both B and C

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

In the Object Diagram shown, Which of the following is true?

Class : time

Object : Time

Class : Time

Object : time

Class : Time

Object : time

Attributes: hour min sec

Both B and C

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?