Module5_Classes

Module5_Classes

Professional Development

13 Qs

quiz-placeholder

Similar activities

Creating and managing learning environment

Creating and managing learning environment

Professional Development

10 Qs

Gypsum Products I

Gypsum Products I

Professional Development

15 Qs

Basic Administration

Basic Administration

Professional Development

10 Qs

Introduction to drones

Introduction to drones

Professional Development

10 Qs

Cycle 2: Session 2 Review.

Cycle 2: Session 2 Review.

University - Professional Development

10 Qs

Vocabulary Project 3

Vocabulary Project 3

Professional Development

9 Qs

Quiz 2-Functions of management

Quiz 2-Functions of management

Professional Development

10 Qs

8051 microcontroller basics

8051 microcontroller basics

University - Professional Development

10 Qs

Module5_Classes

Module5_Classes

Assessment

Quiz

Education

Professional Development

Medium

Created by

Sumathi K

Used 1+ times

FREE Resource

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
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?