1. What will the following code display? numbers = [1, 2, 3, 4, 5]
for num in numbers:
if num == 3:
print(num)
|
2. What will the following code display? numbers = [5, 10, 15, 20]
for num in numbers:
print(num)
|
3. How does a replay stop while? |
4. What will the following code display? people = {'Alice': 20, 'Bob': 17, 'Charlie': 19}
for name, age in people.items():
if age >= 18:
print(num)
|
5. What will the following code display? numbers = [1, 2, 3, 4]
for num in numbers:
print(num)
|
6. Which one of the following is a correct repeat statement while? |
7. What will the following code display? numbers = [1, 2, 3, 4]
for num in numbers:
if num < 3:
print(num)
|
8. What will the following code display? fruits = ['apple', 'banana', 'cherry']
print(fruits[1])
|
9. How do we add a lead to a list? |
10. How do we remove a clue on a list? |