Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Challenge: Improve Readability | Foundations of Code Quality
Code Quality and Refactoring in Python

bookChallenge: Improve Readability

In this challenge, you will practice improving code readability by refactoring a poorly written Python function. Apply the clean code principles you have learned, such as using meaningful names, organizing code logically, and making your code easy to follow. Focus on making the function clear and maintainable for anyone who might read or modify it in the future.

Aufgabe

Swipe to start coding

Refactor the provided function to improve readability and maintainability.

  • Rename the function and all variables to clearly describe their purpose.
  • Organize the code into logical, well-structured steps.
  • Add comments where the logic might not be immediately clear.
  • Use consistent code formatting and spacing throughout.
  • Ensure the function returns the result as an integer value.

Lösung

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 4
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

close

Awesome!

Completion rate improved to 5.26

bookChallenge: Improve Readability

Swipe um das Menü anzuzeigen

In this challenge, you will practice improving code readability by refactoring a poorly written Python function. Apply the clean code principles you have learned, such as using meaningful names, organizing code logically, and making your code easy to follow. Focus on making the function clear and maintainable for anyone who might read or modify it in the future.

Aufgabe

Swipe to start coding

Refactor the provided function to improve readability and maintainability.

  • Rename the function and all variables to clearly describe their purpose.
  • Organize the code into logical, well-structured steps.
  • Add comments where the logic might not be immediately clear.
  • Use consistent code formatting and spacing throughout.
  • Ensure the function returns the result as an integer value.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 4
single

single

some-alt