0
0
Pythonprogramming~10 mins

Continue statement behavior in Python - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to skip printing the number 3 in the loop.

Python
for i in range(1, 6):
    if i == [1]:
        continue
    print(i)
Drag options to blanks, or click blank then click option'
A5
B2
C1
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Using a number other than 3 in the condition.
Forgetting to use the continue statement.
2fill in blank
medium

Complete the code to skip all even numbers in the loop.

Python
for num in range(1, 7):
    if num % 2 == [1]:
        continue
    print(num)
Drag options to blanks, or click blank then click option'
A0
B1
C2
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1 instead of 0 in the condition.
Not using the modulo operator correctly.
3fill in blank
hard

Fix the error in the code to correctly skip printing the word 'skip'.

Python
words = ['go', 'skip', 'stop']
for word in words:
    if word == [1]:
        continue
    print(word)
Drag options to blanks, or click blank then click option'
Askip
B"skip"
C'skip'
D'stop'
Attempts:
3 left
💡 Hint
Common Mistakes
Not using quotes around the string.
Using the wrong string value.
4fill in blank
hard

Fill both blanks to skip numbers less than 4 and print the rest.

Python
for n in range(1, 7):
    if n [1] 4:
        continue
    print(n)
Drag options to blanks, or click blank then click option'
A>=
B>
C<
D<=
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong comparison operator.
Skipping numbers greater than 4 instead.
5fill in blank
hard

Fill all three blanks to skip words starting with 'a' and print others in uppercase.

Python
words = ['apple', 'banana', 'avocado', 'cherry']
for w in words:
    if w[1]('a'):
        continue
    print(w[2]())
Drag options to blanks, or click blank then click option'
Astartswith
Bupper
C()
Dlower
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting parentheses after method names.
Using the wrong string method.