CS172 Test 1 Review

CS172 Test 1 Review

Assessment

Flashcard

Computers

University

Hard

Created by

Wayground Content

FREE Resource

Student preview

quiz-placeholder

15 questions

Show all answers

1.

FLASHCARD QUESTION

Front

What is the official name of the string type in Python?

Back

str

2.

FLASHCARD QUESTION

Front

Which operator should we use to check if one variable is equal to another? Options: =, ==, !=, <=

Back

==

3.

FLASHCARD QUESTION

Front

To execute a statement n times, which loop should we use? Options: for line in f:, for item in n:, for i in range(len(n)):, for i in range(n):

Back

for i in range(n):

4.

FLASHCARD QUESTION

Front

To handle errors converting between types, what Python feature do we need to use?

Back

try/except block

5.

FLASHCARD QUESTION

Front

In Python, this is a mutable sequence of related data, usually all of the same type

Back

list

6.

FLASHCARD QUESTION

Front

Lists support this operation, but tuples do not. Options: Taking the length, Indexing, Unpacking, Appending

Back

Appending

7.

FLASHCARD QUESTION

Front

Which indices will the following slice access: myList[1:3]

Back

1,2

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?