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
•
Computers
•
12th Grade
•
Hard
Quizizz Content
FREE Resource
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)
Create a free account and access millions of resources
Similar Resources on Quizizz
15 questions
Python if statement

Flashcard
•
University
15 questions
Python if statement

Flashcard
•
University
20 questions
python flashcard

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

Flashcard
•
11th - 12th Grade
14 questions
Halloween Java

Flashcard
•
12th Grade
15 questions
Arduino Lesson 6: Potentiometers

Flashcard
•
11th Grade
17 questions
Tracing Loops in Java

Flashcard
•
12th Grade
15 questions
PCEP Section 1A: Understand fundamental terms and definitions

Flashcard
•
12th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University