Python Functions Quiz

Python Functions Quiz

University

20 Qs

quiz-placeholder

Similar activities

Python Programming Quiz

Python Programming Quiz

9th Grade - University

20 Qs

PythonProgramming

PythonProgramming

University

15 Qs

1TEC_AVALIAÇÃO_INTRODUÇÃO À PROGRAMAÇÃO_ 3º TRI_AV5

1TEC_AVALIAÇÃO_INTRODUÇÃO À PROGRAMAÇÃO_ 3º TRI_AV5

12th Grade - University

16 Qs

BS TEST2

BS TEST2

University

20 Qs

CSC305: TOPIC 7

CSC305: TOPIC 7

University

15 Qs

Ex - Python Control Statements

Ex - Python Control Statements

University

20 Qs

Python-Grundlagen (IF Kl. 10)

Python-Grundlagen (IF Kl. 10)

10th Grade - University

15 Qs

File Handling in Python, Serialization in Python

File Handling in Python, Serialization in Python

University

15 Qs

Python Functions Quiz

Python Functions Quiz

Assessment

Quiz

Computers

University

Hard

Created by

Aswini G

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?