Level 3 Python Quiz 4

Quiz
•
Computers
•
9th - 12th Grade
•
Hard

Samuel Markham
Used 1+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Function definitions in Python start with what keyword?
def
fun
function
define
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A function parameter is a kind of variable accessible...
3.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which two statements are true?
The return keyword forces a function to restart its execution
The return keyword may cause the function to return a value
The return keyword forces the function's execution to terminate
The return keyword can only appear once inside a function
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following Python code?
tup = (1, ) + (1, )
tup = tup + tup
print(len(tup))
2
4
0
the snippet causes an error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code if the user enters "kangaroo" as their first prompt and 0 as their second?
Error.Error.Error
4.0
Do not divide by Zero!
Wrong value.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the expected behaviour of the following snippet if the user enters 0?
value = input("Enter a value: ")
print(10 / value)
The program will raise a ValueError exception
The program will raise the ZeroDivisionError exception
The program will raise the TypeError exception
The program will output 0 to the console
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following Python code?
list = [1, 2, 3, 4]
print(list[4])
4
1
the snippet causes an IndexError
None
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Python Basics ;)

Quiz
•
11th Grade
20 questions
Python First Steps Homework Quiz

Quiz
•
7th - 9th Grade
18 questions
Computer Science (Python)

Quiz
•
9th Grade
25 questions
GCSE Computer Science: Programming (Python)

Quiz
•
9th - 12th Grade
16 questions
For and While Loops in Python

Quiz
•
9th - 12th Grade
20 questions
Class XI_Introduction to Python

Quiz
•
11th Grade
17 questions
GCSE Computer Science - Python Programming Concepts

Quiz
•
9th - 11th Grade
18 questions
Programming Terms & Structures

Quiz
•
11th Grade
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
Discover more resources for Computers
50 questions
Trivia 7/25

Quiz
•
12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade
6 questions
RL.10.1 Cite Evidence

Quiz
•
10th Grade
10 questions
Characteristics of Life

Quiz
•
9th - 10th Grade
14 questions
Algebra 1 SOL Review #1

Quiz
•
9th Grade