
Module5_Classes
Authored by Sumathi K
Education
Professional Development
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
14 questions
Study Abroad
Quiz
•
9th Grade - Professio...
12 questions
ARRHYTHMIA - SRC 2
Quiz
•
Professional Development
10 questions
Scan To Win
Quiz
•
Professional Development
10 questions
Teacher Roles
Quiz
•
University - Professi...
15 questions
Singapore
Quiz
•
12th Grade - Professi...
10 questions
4th Industrial Revolution
Quiz
•
Professional Development
15 questions
Hazardous Materials
Quiz
•
Professional Development
10 questions
What is water
Quiz
•
KG - Professional Dev...
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Education
10 questions
How to Email your Teacher
Quiz
•
Professional Development
6 questions
3RD GRADE DECLARATION OF INDEPENDENCE EXIT TICKET
Quiz
•
Professional Development
19 questions
Black History Month Trivia
Quiz
•
6th Grade - Professio...
22 questions
Multiplying Exponents with the Same Base
Quiz
•
9th Grade - Professio...
40 questions
Flags of the World
Quiz
•
KG - Professional Dev...