Intro to CS Semester 1 Unit 2 flashcard

Intro to CS Semester 1 Unit 2 flashcard

Assessment

Flashcard

Created by

Quizizz Content

Computers

12th Grade

Hard

Student preview

quiz-placeholder

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)

Explore all questions with a free account

or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?