

Intro to CS Semester 1 Unit 2 flashcard
Flashcard
•
Computers
•
12th Grade
•
Practice Problem
•
Hard
Wayground Content
FREE Resource
Student preview

20 questions
Show all answers
1.
FLASHCARD QUESTION
Front
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)
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)
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?