
Python Functions and File Handling Quiz

Quiz
•
Other
•
University
•
Medium
Mahipal Jadeja
Used 1+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does the return statement do in a function?
Displays output on the console.
Exits the function and returns a value to the caller.
Defines a variable within the function.
Calls another function.
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which function is used to open a file for reading in Python?
open_file()
read()
write()
open()
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does the seek() function do in file handling?
Closes the file after reading or writing.
Moves the file pointer to a specific position in the file.
Creates a new file with the specified name.
Reads the entire contents of the file.
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which keyword is used to catch exceptions in Python?
try
except
finally
raise
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which keyword is used to define a function in Python?
def
func
define
function
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which function is used to convert a string to an integer in Python?
int()
str()
float()
eval()
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does the abs() function in Python do?
Converts a value to an absolute integer.
Returns the absolute value of a number.
Calculates the average of a sequence of numbers.
Returns the absolute difference between two numbers.
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Quiz for E415 batch

Quiz
•
University
20 questions
Quanta

Quiz
•
University
12 questions
Brainy Bites: Python

Quiz
•
University
20 questions
Python Quiz_Module2

Quiz
•
University
12 questions
Aula Invertida

Quiz
•
University
20 questions
Tech quiz-july

Quiz
•
University
13 questions
Introduction to Python Programming Quiz 9E

Quiz
•
10th Grade - University
10 questions
UNIT2_PYTHON

Quiz
•
University
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade