Python Functions Quiz

Python Functions Quiz

University

20 Qs

quiz-placeholder

Similar activities

Django Viva

Django Viva

University

20 Qs

NumPy

NumPy

University

15 Qs

Python Programming

Python Programming

University

20 Qs

Functions in Python

Functions in Python

University

15 Qs

[Python For All] Quiz 5 - Numpy

[Python For All] Quiz 5 - Numpy

University

15 Qs

Python Quiz

Python Quiz

University

20 Qs

Get started with python

Get started with python

University

19 Qs

Python

Python

University

15 Qs

Python Functions Quiz

Python Functions Quiz

Assessment

Quiz

Computers

University

Hard

Created by

Jayanthi P

Used 1+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you define a function in Python?

function myFunc():

define myFunc():

def myFunc():

def: myFunc()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following correctly calls a function named greet()?

call greet()

greet[]

greet()

execute greet()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A variable defined inside a function has which type of scope?

Global

Local

Module

External

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the lifetime of a local variable in a function?

Until the program ends

Until the function terminates

Until the module terminates

As long as the function is not called again

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the return statement in a function do?

Terminates the program

Exits the function and returns a value

Restarts the function

Pauses the function execution

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if no return statement is used in a function?

The function returns None

The function returns 0

The function raises an error

The function automatically prints the result

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are required arguments in Python functions?

Arguments that must be passed in a specific order

Arguments with default values

Arguments passed using keyword names

Arguments passed as a tuple

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?