Which of the following is a string in Python?
Quiz 143 - Python Data Types and Numbers

Quiz
•
Computers
•
9th Grade
•
Medium
Jonathan Saurine
Used 3+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
True
"Hello"
3.14
123
Answer explanation
In Python, a string is defined by enclosing text in quotes. The correct choice, "Hello", is a string because it is surrounded by double quotes. The other options are a boolean (True), a float (3.14), and an integer (123).
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What data type is used to store whole numbers in Python?
Integer
Float
String
Boolean
Answer explanation
In Python, the data type used to store whole numbers is called 'Integer'. Unlike floats, which represent decimal numbers, integers are used for counting and indexing.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which function is used to convert a string to an integer?
int()
bool()
str()
float()
Answer explanation
The function int() is used to convert a string representation of a number into an integer. The other options serve different purposes: bool() converts to a boolean, str() converts to a string, and float() converts to a floating-point number.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of 17 % 5 in Python?
3
2
12
5
Answer explanation
In Python, the modulus operator % returns the remainder of the division. For 17 % 5, 17 divided by 5 is 3 with a remainder of 2. Therefore, the result is 2.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which operator is used for exponentiation in Python?
^
%
**
//
Answer explanation
In Python, the operator for exponentiation is '**'. It raises a number to the power of another, unlike '^' which is a bitwise XOR, '%' for modulus, and '//' for floor division.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of bool(0) in Python?
False
True
None
0
Answer explanation
In Python, the bool() function converts values to a boolean. The integer 0 is considered falsey, so bool(0) evaluates to False. Therefore, the correct answer is False.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a float in Python?
3.0
3
"3.14"
True
Answer explanation
In Python, a float is a number that has a decimal point. Among the options, 3.0 is a float, while 3 is an integer, "3.14" is a string, and True is a boolean. Therefore, the correct answer is 3.0.
Create a free account and access millions of resources
Similar Resources on Quizizz
14 questions
PYTHON

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

Quiz
•
9th Grade
10 questions
Pyhton

Quiz
•
9th - 10th Grade
15 questions
Understanding Data Types in Python Quiz

Quiz
•
9th Grade
15 questions
Python programming language Quiz - Week 9

Quiz
•
9th Grade
19 questions
Python Year 9 Quiz

Quiz
•
8th - 10th Grade
10 questions
Vocabulary Do Now 1

Quiz
•
9th - 12th Grade
12 questions
Python Programming Basics

Quiz
•
7th - 11th 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
Discover more resources for Computers
25 questions
Spanish preterite verbs (irregular/changed)

Quiz
•
9th - 10th Grade
10 questions
Identify Slope and y-intercept (from equation)

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

Interactive video
•
7th - 12th Grade
8 questions
"Keeping the City of Venice Afloat" - STAAR Bootcamp, Day 1

Quiz
•
9th - 12th Grade
26 questions
June 19th

Quiz
•
4th - 9th Grade
27 questions
STAAR English 1 Review

Quiz
•
9th Grade
20 questions
Understanding Linear Equations and Slopes

Quiz
•
9th - 12th Grade