Which line of code outputs the decimal portion of a float stored in the variable x? Options: print (x / 1000), print (x - int(x)), print (x), print (x % 1000)

Intro to CS Semester 1 Unit 2 flashcard

Flashcard
•
Quizizz Content
•
Computers
•
12th Grade
•
Hard
Student preview

20 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Back
print (x - int(x))
2.
FLASHCARD QUESTION
Front
What happens if the user types in A when executing the code: x = int(input("Enter a number: "))
print (x)?
Back
This would cause an error: an integer variable cannot store a string.
3.
FLASHCARD QUESTION
Front
Which of the following is NOT a data type in Python? float, string, decimal, integer
Back
decimal
4.
FLASHCARD QUESTION
Front
When would you NOT use a string command? Options: To store a list of colors, To store decimal values, To store a word, To store values NOT used for calculations.
Back
To store decimal values
5.
FLASHCARD QUESTION
Front
Which of the following numbers might this code generate: random.randint(1,9)? Options: 10, 1, 11, 0
Back
1
6.
FLASHCARD QUESTION
Front
What is NOT a built-in function in python? Options: sqrt(), string(), fabs(), print()
Back
string()
7.
FLASHCARD QUESTION
Front
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)
Back
random.randint(-10, 10)
Explore all questions with a free account
Similar Resources on Quizizz
18 questions
Java Basics MP1 Test 3

Flashcard
•
11th Grade
21 questions
Java Loops

Flashcard
•
KG
17 questions
Java Basics

Flashcard
•
12th Grade
18 questions
AP CSA Unit 1 Review

Flashcard
•
10th - 12th Grade
9 questions
STRING MANIPULATION (PYTHON)

Flashcard
•
11th - 12th Grade
19 questions
Intro to CS Midterm Exam

Flashcard
•
12th Grade
13 questions
Fall Semester Exam Review (Units 1, 2)

Flashcard
•
12th Grade
17 questions
AP CS A Unit 3 Review

Flashcard
•
11th - 12th Grade
Popular Resources on Quizizz
39 questions
Respect and How to Show It

Quiz
•
6th Grade
20 questions
math review

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

Quiz
•
6th Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
10 questions
Human Body Systems and Functions

Interactive video
•
6th - 8th Grade
20 questions
Multiplication Facts

Quiz
•
3rd Grade
Discover more resources for Computers
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
20 questions
Investing

Quiz
•
9th - 12th Grade
20 questions
Insurance

Quiz
•
9th - 12th Grade
20 questions
Common Grammar Mistakes

Quiz
•
7th - 12th Grade
20 questions
Paying for College

Quiz
•
9th - 12th Grade
15 questions
Central Tendency

Quiz
•
9th - 12th Grade
20 questions
Banking

Quiz
•
9th - 12th Grade