String Coding
List Coding
For Loop Coding
While Loop Coding
Mixed Coding Challenge
100

What is the output?

text = "Code"
print(text[1])

o
100

What is the output?

nums = [5, 10, 15]
print(nums[0])

5

100

What is the output?

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

0
1
2

100

What is the output?

count = 1
while count <= 3:
    print(count)
    count += 1

1
2
3

100

What is the output?

name = "Sam"
print(f"Hello {name}")

Hello Sam

200

What is the output?

word = "apple"
print(word[-2])

1

200

What is the output?

nums = [1, 2, 3]
nums.append(4)
print(nums)

[1, 2, 3, 4]

200

What is the output?

for i in range(2, 6):
    print(i)

2
3
4
5

200

What is the output?

x = 3
while x > 0:
    print(x)
    x -= 1

3
2
1

200

What is the output?

nums = [1, 2]
for n in nums:
    print(n * 2)

2
4

300

What is the output?

msg = "Python"
print(msg[:3])

Pyt

300

What is the output?

items = ["a", "b", "c"]
items.insert(1, "x")
print(items)

['a', 'x', 'b', 'c']

300

What is the output?

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

    print(i)

1
4
7

300

How many times will this loop run?

num = 5
while num < 5:
    print(num)
    num += 1

0 times

300

What is the output?

word = "abc"
for letter in word:
    print(letter)

a
b
c

400

What is the output?

text = "banana"
print(text.count("a"))

3

400

What is the output?

letters = ["A", "B", "C"]
letters.remove("B")
print(len(letters))

2

400

How many times will this loop run?

for x in range(5):
    print("Hi")

5 times

400

What is the output?

count = 0
while count < 4:
    print("Loop")
    count += 2

Loop
Loop

400

What is the output?

nums = [1, 2, 3]
print(len(nums) * 2)

6

500

What is the output?

text = "Hello"
new = text.replace("l", "z")
print(new)

Hezzo

500

What is the output?

nums = [10, 20, 30, 40]
nums.pop()
print(nums)

[10, 20, 30]

500

What is the output?

total = 0
for i in range(1, 4):
    total += i
print(total)

6

500

What is the output?

n = 1
while n < 10:
    print(n)
    n *= 2

1
2
4
8

500

What is the output?

text = "Hi"
for i in range(3):
    text += "!"
print(text)

Hi!!!