Which line of code outputs the decimal portion of a float stored in the variable x?
CB30: Unit 2 TEST Review

Quiz
•
Computers
•
9th - 12th Grade
•
Hard
Used 154+ times
FREE Resource
34 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
print(x / 1000)
print(x - int(x))
print(x)
print(x % 1000)
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Three of the following values could be stored as strings. When would you NOT use a string command?
To store a list of colors
To store decimal values
To store a word
To store values NOT used for calculations
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Consider the following code:
x = int(input("Enter a number: "))
print (x)
What happens if the user types in A?
It prints 65
It prints A
This would cause an error: an integer variable cannot store a string.
This would cause an error: int and input cannot be used together in the same line
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of the following is NOT a data type in Python?
float
string
decimal
integer
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of the following numbers might this code generate: random.randint(1,9)?
10
1
11
0
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is NOT a built-in function in python?
sqrt()
string()
fabs()
print()
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
To generate numbers between and including -10 to 10 you would use:
random.random()*20 + -10
randint(-10, 10)
random.random(-10, 10)
random.randint(-10, 10)
Create a free account and access millions of resources
Similar Resources on Quizizz
30 questions
Programming Techniques

Quiz
•
8th - 10th Grade
35 questions
[AP CSP] Programming with Conditionals [If, Elif, Else]

Quiz
•
9th Grade - University
30 questions
Python Basics Quiz

Quiz
•
10th Grade
30 questions
String

Quiz
•
10th Grade - University
32 questions
Unit 1 APCSA

Quiz
•
9th Grade - University
29 questions
Computer Parts

Quiz
•
9th - 12th Grade
29 questions
Python Quiz

Quiz
•
10th Grade
30 questions
Python Introduction

Quiz
•
9th - 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
20 questions
Distance, Midpoint, and Slope

Quiz
•
10th Grade
20 questions
Figurative Language Review

Quiz
•
10th Grade
27 questions
STAAR English 1 Review

Quiz
•
9th Grade