
Python Programming Quiz

Quiz
•
Other
•
University
•
Medium
Standards-aligned
Vasavi Doddamani
Used 19+ times
FREE Resource
40 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is an immutable data type in Python?
List
Dictionary
Set
Tuple
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
In Python, which operator is used for floor division?
/
//
%
**
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the purpose of the __init__ method in a Python class?
To initialize class variables
To destroy class instances
To import required modules
To define class methods
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is a correct way to define a class method in Python?
def method(self, args):
def method(cls, args):
@classmethod
def method(self, args):
@classmethod
def method(cls, args):
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
In the context of object-oriented programming, what does "inheritance" mean?
Creating multiple instances of the same class
A class acquiring the properties of another class
Defining private methods in a class
Creating a class without any attributes
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is encapsulation in object-oriented programming?
Binding code and data together
Creating multiple instances of a class
Converting one data type to another
Running multiple processes simultaneously
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is used to create a private attribute in a Python class?
Using the private keyword before the attribute name
Prefixing the attribute name with two underscores (__)
Enclosing the attribute in parentheses
Using the @private decorator
Create a free account and access millions of resources
Similar Resources on Wayground
38 questions
Unit 1 Review Quiz

Quiz
•
University
40 questions
DSA Quiz 4th Semster CE

Quiz
•
University
35 questions
IT ERA MODULE 2 - 3 (PASIMULA NG MODULE 3)

Quiz
•
University
40 questions
Fundamentals of Modern Data (Mid-term Exam)

Quiz
•
University
35 questions
AP Macro Final Review

Quiz
•
KG - University
40 questions
Practice python Questions!

Quiz
•
University
40 questions
q1 Fusion 360 animation

Quiz
•
12th Grade - University
40 questions
Geology Review

Quiz
•
KG - University
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade