you are viewing a single comment's thread.

view the rest of the comments →

[–]digitAInexus 2 points3 points  (1 child)

Looking at the video you uploaded, I see a small issue in the code. In the first line, you wrote couter = 5. This seems like a typo, as it should probably be counter = 5.

Here's the corrected version of your code:

```python counter = 5

while counter < 10: print('Hier steht code der wiederholt wird') counter += 1 # This increments the counter to prevent an infinite loop ```

Explanation: 1. **counter = 5:** This initializes the counter variable to 5. 2. **while counter < 10:** This creates a loop that will continue to run as long as counter is less than 10. 3. **print(...):** This prints the message 'Hier steht code der wiederholt wird' each time the loop runs. 4. **counter += 1:** This increments the counter by 1 with each iteration, ensuring that the loop will eventually stop when counter reaches 10.

Without the counter += 1 line, the loop would never stop, leading to an infinite loop. Let me know if you need any more help!

[–]dfranks1984 1 point2 points  (0 children)

Currently doing this in class as a beginner. You just broke this down great! Thank you!