Lab 3.1 – Print "Python is awesome!" 10 Times
Score: 1.0
Task: Write a program that prints "Python is
awesome!" 10 times.
📌 Algorithm
- Use
range(10)to generate numbers 0 through 9. - The loop runs 10 times.
- Each iteration prints
"Python is awesome!". - Use
_as the loop variable because we don't need its value.
💻 Solution Code
for _ in range(10):
print("Python is awesome!")
📤 Expected Output
Python is awesome! Python is awesome! Python is awesome! Python is awesome! Python is awesome! Python is awesome! Python is awesome! Python is awesome! Python is awesome! Python is awesome!
📖 Step‑by‑Step Explanation
range(10)generates numbers 0 through 9.- The loop runs 10 times, once for each number.
- Each iteration prints
"Python is awesome!". - We use
_because we don't need the loop variable.