
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
30 sec • 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
30 sec • 1 pt
Which function is used to open a file for reading in Python?
open_file()
read()
write()
open()
3.
MULTIPLE CHOICE QUESTION
30 sec • 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
30 sec • 1 pt
Which keyword is used to catch exceptions in Python?
try
except
finally
raise
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword is used to define a function in Python?
def
func
define
function
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which function is used to convert a string to an integer in Python?
int()
str()
float()
eval()
7.
MULTIPLE CHOICE QUESTION
30 sec • 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
10 questions
VR and Trello QUIZ

Quiz
•
University
12 questions
Excel Essentials Training

Quiz
•
University
20 questions
MT Assessment

Quiz
•
University
20 questions
Quiz for E415 batch

Quiz
•
University
20 questions
Tech quiz-july

Quiz
•
University
10 questions
Module 6: Defensive Security

Quiz
•
University
20 questions
Python Quiz_Module2

Quiz
•
University
10 questions
🧠 Quizizz: Microsoft Teams Interface & Features Recap

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Other
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University