Computer Science I Rallapalli Study Guide

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/29

flashcard set

Earn XP

Description and Tags

God bless yall; I pray you pass

30 Terms

1
New cards

A for loop can visit each character in a string.

True

2
New cards

A loop's else block runs when a break statement ends that loop.

False

3
New cards

A counter can keep track of how many times a loop has run.

True

4
New cards

Writing a function definition automatically runs that function's body.

False

5
New cards

A function must accept at least one argument.

False

6
New cards

A function can return several results together in a tuple.

True

7
New cards

The join() string method can combine several strings into one string.

True

8
New cards

A list can contain another list as one of its items.

True

9
New cards

Dictionary keys must all be numbers.

False

10
New cards

Sorting a list of numbers changes how many items the list contains.

False

11
New cards

Which loop is usually best for asking for a password until it is correct?

A while loop

12
New cards

What is an infinite loop?

A loop that keeps repeating without ending

13
New cards

A loop visits rows, and a loop inside it visits each item in a row. What is this called?

A nested loop

14
New cards

Which statement about the stop value in range() is correct?

The stop value is excluded from the sequence

15
New cards

A search loop should stop as soon as a matching name is found. Which statement helps?

break

16
New cards

What is a function stub?

A placeholder function whose full logic will be added later

17
New cards

What is a parameter in a function definition?

A name that receives an input when the function is called

18
New cards

How does a keyword argument identify where its value should go?

By using the parameter name

19
New cards

What does dynamic typing allow in Python?

A variable name can refer to values of different types over time

20
New cards

What does it mean that functions are objects in Python?

They can be stored in variables or passed to other functions

21
New cards

What does a variable's scope describe?

Where in a program its name can be used

22
New cards

Which operation can select just the first few characters of a string?

Slicing

23
New cards

What does the string method lower() return?

A lowercase version of the string

24
New cards

A price should display two digits after the decimal point. Which feature helps?

String formatting

25
New cards

What does iterating over a list mean?

Visiting the items one at a time

26
New cards

What does a list slice let you select?

A portion of the list

27
New cards

Which dictionary method provides key-value pairs for a loop?

items()

28
New cards

Why can removing items from a list while looping over it cause problems?

Item positions change, so some items may be skipped

29
New cards

What is a nested dictionary?

A dictionary containing another dictionary as a value

30
New cards

Which Python feature provides access to command-line arguments?

sys.argv