Lecture 2 Flashcard

Lecture 2 Flashcard

Assessment

Flashcard

Computers

12th Grade

Hard

Created by

Quizizz Content

FREE Resource

Student preview

quiz-placeholder

13 questions

Show all answers

1.

FLASHCARD QUESTION

Front

Which of the following is not a data type from Python? Bool, NoneType, Tuple, Array

Back

Array

2.

FLASHCARD QUESTION

Front

Which built-in function determines the data type of a value? Options: varType(), type(), data(), dataType()

Back

type()

3.

FLASHCARD QUESTION

Front

What does type(None) return?

Back

NoneType

4.

FLASHCARD QUESTION

Front

T or F: Tuples can contain elements of different data types.
Ex: (4, 3.2, "6", "a")

Back

True

5.

FLASHCARD QUESTION

Front

Which of the following is the correct way to initialize a variable of type string then cast it to a float? Options: var = "8.0" var = float(var), str var = "8.0" var = float(var), var = "8.0" var = (float) var, str var = "8.0" var = (float) var

Back

var = "8.0" var = float(var)

6.

FLASHCARD QUESTION

Front

Which of the following accurately uses a for loop to print "hello world" some N times?
Options:
for (int j = 0; j<N; j+=1) {
print("hello world") }
,
for (int j = 0; j < N; j++):
print("hello world")
,
for j in range(N):
print("hello world")
,
for j in range(len(N)) {
print("hello world") }

Back

for j in range(N):
print("hello world")

7.

FLASHCARD QUESTION

Front

Which of the following accurately uses a while loop to count the number of even numbers from 0 to N (including N)?
Options:
count = 0
j = 0
while j<N+1:
if j%2 == 0:
count += 1
j += 1
,
count = 0
j = 0
while j<N:
if j%2 == 0:
count++
j++
,
count = 0
while j in range(N):
if j%2 == 0:
count += 1
,
count = 0
while j in range(N+1):
if j%2 == 0:
count += 1

Back

count = 0
j = 0
while j<N+1:
if j%2 == 0:
count += 1
j += 1

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?