
Module5_Classes
Quiz
•
Education
•
Professional Development
•
Medium
Sumathi K
Used 1+ times
FREE Resource
Enhance your content
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
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

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
10 questions
Introduction to Management
Quiz
•
University - Professi...
15 questions
UN Headquarters NYC
Quiz
•
10th Grade - Professi...
10 questions
CodeMonkey Platform Management & Resources
Quiz
•
Professional Development
12 questions
Language Functions in the Classroom
Quiz
•
Professional Development
14 questions
POB 1-Information Used in the Workplace
Quiz
•
Professional Development
16 questions
COVID-19
Quiz
•
Professional Development
10 questions
COUNTERS IN PLC
Quiz
•
Professional Development
15 questions
Digital Maketing Workshop
Quiz
•
Professional Development
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
20 questions
ELA Advisory Review
Quiz
•
7th Grade
15 questions
Subtracting Integers
Quiz
•
7th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
