Strings & Methods
Lists
Loops
range() & Counters
f-Strings & Mixed Concepts
100

What method converts all letters in a string to uppercase?

upper()

100

What symbol is used to create a list?

Square brackets [ ]

100

Which loop is used when the number of repetitions is known?

for loop

100

What does range(5) start with?

0

100

What symbol is used inside an f-string to insert variables?

{ }

200

What is the output of:

print("Python"[0])

P

200

Which method adds an item at the end of a list?

append()

200

Which loop runs while a condition is true?

while loop

200

What numbers does range(1, 4) produce?

1, 2, 3

200

Which statement correctly uses an f-string?
A. print("Age: {age}")
B. print(f"Age: {age}")

B

300

What does len("computer") return?

8

300

What is the output of:

nums = [1, 2, 3]
print(nums[-1])

3

300

What keyword stops a loop immediately?

break

300

What is the output of:

for x in range(2, 8, 2):
    print(x)

2
4
6

300

What is the output of:

name = "Sam"
score = 90
print(f"{name} scored {score}")

Sam scored 90

400

What is the output of:

print("Hi" * 2)

HiHi

400

Which method inserts an item at a specific position?

insert()

400

What is the output of:

for i in range(3):
    print(i)

0
1
2

400

What is a loop counter?

A variable that controls or counts loop repetitions

400

What is the length of this list?

items = ["a", "b", "c", "d"]

4

500

What is the output of:

word = "banana"
print(word.replace("a", "o"))

bonono

500

What happens if you use remove() on a value not inside the list?

An error occurs

500

What is the output of:

count = 2
while count >= 0:
    print(count)
    count -= 1

2
1
0

500

How many times will this loop run?

for i in range(1, 10, 3):
    print(i)

3 times (1, 4, 7)

500

What is the output of:

text = "HELLO"
print(text.lower())

hello