
Fundamentals of Python Programming
Quiz
•
Others
•
University
•
Practice Problem
•
Easy
Dharshini J
Used 1+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are the basic data types in Python?
int, float, str, bool, list, tuple, dict
int, float, str, array
bool, dict, string, number
char, float, set, list
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you declare a variable in Python?
let variable_name = value
var variable_name = value
variable_name : value
You declare a variable in Python by using the syntax: variable_name = value.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of an if statement in Python?
To repeat code multiple times.
To define a function in Python.
To create a loop for iteration.
To execute code conditionally based on a boolean expression.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Explain the use of for loops in Python.
For loops can only iterate over numbers in Python.
For loops in Python are used to create classes.
For loops in Python are used to define functions.
For loops in Python allow iteration over sequences and execute a block of code for each item.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you read a file in Python?
Use 'readfile("filename.txt")' to read a file in Python.
Read a file by calling 'file.read()' directly without opening it.
Use 'open(file.txt)' to read a file in Python.
Use 'with open("filename.txt", "r") as file: content = file.read()' to read a file in Python.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the difference between 'read' and 'readlines' methods?
The 'read' method reads a file line by line; 'readlines' reads the entire file at once.
The 'read' method can only be used on text files; 'readlines' can be used on binary files.
Both 'read' and 'readlines' return the same type of data.
The 'read' method returns a single string; 'readlines' returns a list of strings.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is exception handling in Python?
Exception handling is done using 'if' statements in Python.
Exception handling in Python is a way to manage errors using 'try' and 'except' blocks.
Exception handling in Python is only for syntax errors.
Python does not support exception handling.
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
Already have an account?
Similar Resources on Wayground
10 questions
Thì Quá Khứ Đơn và Thì Hiện Tại Hoàn Thành (Mai)
Quiz
•
University
10 questions
vocabulary
Quiz
•
University
15 questions
Kuis PTI Pertemuan 12 (Kelompok 11)
Quiz
•
University
10 questions
Budget 2025 Quiz
Quiz
•
University
10 questions
Understanding the part of speech about clauses and phrases
Quiz
•
University
5 questions
LATIHAN PENGUKUHAN
Quiz
•
University
15 questions
Java Serialization and File Handling
Quiz
•
University
10 questions
FLN Quiz (Foundation Literacy and Numeracy)
Quiz
•
University
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
15 questions
4:3 Model Multiplication of Decimals by Whole Numbers
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
The Best Christmas Pageant Ever Chapters 1 & 2
Quiz
•
4th Grade
12 questions
Unit 4 Review Day
Quiz
•
3rd Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
Discover more resources for Others
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
7 questions
Different Types of Energy
Interactive video
•
4th Grade - University
20 questions
Slopes and Slope-Intercept Form
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
7 questions
Biomolecules (Updated)
Interactive video
•
11th Grade - University
20 questions
Winter/Holiday Trivia
Quiz
•
KG - University
10 questions
WINTER WIN Time - ELA - 12/9/2025
Quiz
•
KG - University
7 questions
Human Impact on Resources
Interactive video
•
4th Grade - University
