Challenge: Indentation Rescue
In Python, indentation is not just a matter of style—it defines the structure of your code and determines how statements are grouped together. Misplaced or inconsistent indentation, especially in code with multiple nested if-else statements and loops, can lead to unexpected behavior or errors that are sometimes hard to spot. To build your confidence in handling real-world code, you will now tackle a hands-on challenge where you must rescue a function suffering from mixed-up indentation.
Swipe to start coding
Your goal is to correct the indentation in the process_numbers function so that it executes as intended.
- Ensure that all nested blocks for
if,elif,else, andforstatements are properly indented. - Make sure that print statements are executed in the correct logical branches.
- Do not change the logic or add/remove any statements—only fix the indentation.
Solución
¡Gracias por tus comentarios!
single
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla
Awesome!
Completion rate improved to 5.26
Challenge: Indentation Rescue
Desliza para mostrar el menú
In Python, indentation is not just a matter of style—it defines the structure of your code and determines how statements are grouped together. Misplaced or inconsistent indentation, especially in code with multiple nested if-else statements and loops, can lead to unexpected behavior or errors that are sometimes hard to spot. To build your confidence in handling real-world code, you will now tackle a hands-on challenge where you must rescue a function suffering from mixed-up indentation.
Swipe to start coding
Your goal is to correct the indentation in the process_numbers function so that it executes as intended.
- Ensure that all nested blocks for
if,elif,else, andforstatements are properly indented. - Make sure that print statements are executed in the correct logical branches.
- Do not change the logic or add/remove any statements—only fix the indentation.
Solución
¡Gracias por tus comentarios!
single