Python Functions and File Handling Quiz

Python Functions and File Handling Quiz

University

15 Qs

quiz-placeholder

Similar activities

QUIZ 1 : ADOBE ILLUSTRATOR BASIC TOOLS

QUIZ 1 : ADOBE ILLUSTRATOR BASIC TOOLS

University

20 Qs

Medicare Overpayments

Medicare Overpayments

12th Grade - Professional Development

10 Qs

Google Classroom

Google Classroom

KG - University

10 Qs

C++  quiz

C++ quiz

University

15 Qs

Kuiz Microsoft Power Point

Kuiz Microsoft Power Point

KG - University

15 Qs

Season 1 #Spaic ML Azure Weekly Quiz

Season 1 #Spaic ML Azure Weekly Quiz

KG - Professional Development

20 Qs

SKEE1103 CT#10: Functions and Scope

SKEE1103 CT#10: Functions and Scope

University

14 Qs

[CSC301] Quick Exercise 4-1

[CSC301] Quick Exercise 4-1

University

15 Qs

Python Functions and File Handling Quiz

Python Functions and File Handling Quiz

Assessment

Quiz

Other

University

Medium

Created by

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?