Description
This is a collection of the same computer science or coding exercise on the general concept of loops, but in three languages: JavaScript, Python, and Java. With this collection, you can:
- Distribute to classes or students who are focusing on different languages,
- Have students compare the same concept across different languages.
The general uses of the exercise no matter what the language is described below.
In this exercise, your students will read and debug a short piece of code. They also will communicate about testing, logic in the algorithm, and potential solutions. This debugging puzzle reinforces and integrates concepts of loops and strings.
Use this exercise to:
- Have students read and describe code.
- Have students debug or fix code that does not behave as intended.
- Have students either work independently or together in groups.
- Work either with a computer and IDE (more practical) or offline on paper (more challenging).
- Enrich understanding of foundational concepts of loops, strings, characters, arrays, and language syntax.
- Provide hands-on problem-solving work that may take 10 to 60 minutes of class time.
Target students:
- Students learning about programming fundamentals.
- Students who need more practice reading and debugging existing code.
Debugging Puzzles: Stop That Loop! - JavaScript, Python, Java
Highlights
Description
This is a collection of the same computer science or coding exercise on the general concept of loops, but in three languages: JavaScript, Python, and Java. With this collection, you can:
- Distribute to classes or students who are focusing on different languages,
- Have students compare the same concept across different languages.
The general uses of the exercise no matter what the language is described below.
In this exercise, your students will read and debug a short piece of code. They also will communicate about testing, logic in the algorithm, and potential solutions. This debugging puzzle reinforces and integrates concepts of loops and strings.
Use this exercise to:
- Have students read and describe code.
- Have students debug or fix code that does not behave as intended.
- Have students either work independently or together in groups.
- Work either with a computer and IDE (more practical) or offline on paper (more challenging).
- Enrich understanding of foundational concepts of loops, strings, characters, arrays, and language syntax.
- Provide hands-on problem-solving work that may take 10 to 60 minutes of class time.
Target students:
- Students learning about programming fundamentals.
- Students who need more practice reading and debugging existing code.




