Python Functions Quiz

Quiz
•
Computers
•
8th Grade
•
Medium
Dean Groom
Used 19+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the input() function in Python?
Display a message
Take input from the user
Perform a mathematical operation
End the program
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the print() function do in Python?
Take input from the user
Print a file
Display text or variables on the screen
Run a Python script
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What type of value does the input() function always return?
Integer
String
Boolean
List
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a correct way to use the if statement in Python?
if x == 5:
if (x = 5):
if x => 5:
if x equals 5:
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the else statement in Python?
To define a loop
To check multiple conditions
To execute a block of code if the condition is false
To end a program
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword is used to create a function in Python?
func
function
def
create
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following libraries can be imported to generate random numbers?
math
random
time
input
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Hangman Game - Programming Questions

Quiz
•
7th - 11th Grade
20 questions
Topic 2 - Computing Hardware

Quiz
•
1st - 9th Grade
20 questions
Year 7 Microbit

Quiz
•
7th - 8th Grade
17 questions
Python

Quiz
•
6th - 10th Grade
20 questions
Python First Steps Homework Quiz

Quiz
•
7th - 9th Grade
20 questions
Python turtle year 8 assessment

Quiz
•
7th - 9th Grade
20 questions
ASK T2 - Kod Arahan (Python)

Quiz
•
7th Grade - University
18 questions
Python ծրագրավորման լեզու

Quiz
•
8th 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