
Python Basics Quiz

Quiz
•
Business
•
12th Grade
•
Hard
Standards-aligned
William Cain
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct syntax to output "Hello, World!" in Python?
`echo "Hello, World!"`
`print("Hello, World!")`
`printf("Hello, World!")`
`cout << "Hello, World!"`
Answer explanation
The correct syntax to output 'Hello, World!' in Python is `print("Hello, World!")`. This statement will display the text within the parentheses on the screen.
Tags
DOK Level 1: Recall
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a valid variable name in Python?
`1variable`
`variable_1`
`variable-1`
`variable 1`
Answer explanation
In Python, variable names can contain letters, numbers, and underscores, but cannot start with a number or contain special characters like hyphens or spaces. Therefore, `variable_1` is a valid variable name.
Tags
DOK Level 1: Recall
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? ```python x = 5 y = 10 print(x + y) ```
`5`
`10`
`15`
`50`
Answer explanation
The output of the code is `15` because it adds the values of `x` (5) and `y` (10) together.
Tags
DOK Level 1: Recall
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following data types is immutable in Python?
`list`
`set`
`dictionary`
`tuple`
Answer explanation
In Python, the data type 'tuple' is immutable, meaning its values cannot be changed after creation. Lists, sets, and dictionaries are mutable data types.
Tags
DOK Level 1: Recall
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
`14`
`11`
`10`
`7`
Answer explanation
The correct order of operations is to first multiply 4 by 2, then add 3. Therefore, 3 + 4 * 2 = 3 + 8 = 11.
Tags
DOK Level 1: Recall
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to create a function in Python?
`function myFunction():`
`def myFunction():`
`create myFunction():`
`function: myFunction()`
Answer explanation
The correct way to create a function in Python is by using the 'def' keyword followed by the function name, like 'def myFunction()'.
Tags
DOK Level 1: Recall
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? ```python def add(a, b): return a + b print(add(2, 3)) ```
`2`
`3`
`5`
`23`
Answer explanation
The output of the code will be `5` because the `add` function returns the sum of the two input parameters, which are 2 and 3 in this case.
Tags
DOK Level 2: Skill/Concept
Create a free account and access millions of resources
Similar Resources on Quizizz
20 questions
Lesson 1- 2 PowerPoint (MOAC 2016)

Quiz
•
9th - 12th Grade
15 questions
PowerPoint Vocab 2

Quiz
•
11th Grade - University
20 questions
Printing and Navigating Files

Quiz
•
9th - 12th Grade
11 questions
Learn to speak Spanish

Quiz
•
1st Grade - Professio...
20 questions
Getting a Job

Quiz
•
9th - 12th Grade
20 questions
MKT 4-2 Tools, Methods, and Metrics Used for Promotion, part 1

Quiz
•
9th - 12th Grade
12 questions
Print Advertisements Marketing Quiz

Quiz
•
9th - 12th Grade
15 questions
marketing applications unit 5 review part 1

Quiz
•
12th Grade
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade