Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Challenge: Rename for Clarity | Refactoring Techniques
Code Quality and Refactoring in Python

bookChallenge: Rename for Clarity

In this challenge, you will focus on improving code readability by renaming variables and functions that currently have unclear or misleading names. Clear and descriptive naming is a key aspect of code quality, making your code easier to understand and maintain. Your task is to identify poorly named elements in the provided code and rename them to better reflect their purpose and behavior.

Taak

Swipe to start coding

Refactor the given code by renaming all variables and functions to clearly describe their purpose.

  • Change the function name so it reflects what the function actually does.
  • Rename all variables so that their names indicate what they represent.
  • Update all references in the code to use the new names.
  • Do not change the logic or structure of the code.
  • Call the refactored function using the new function and variable names.
  • Print the result of the function call using the following format:
print(sum_positive_numbers(numbers_list))

Oplossing

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 2. Hoofdstuk 5
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

Suggested prompts:

Can you provide the code that needs to be improved?

What are some examples of poor variable or function names to look out for?

Do you have any specific naming conventions you want me to follow?

close

Awesome!

Completion rate improved to 5.26

bookChallenge: Rename for Clarity

Veeg om het menu te tonen

In this challenge, you will focus on improving code readability by renaming variables and functions that currently have unclear or misleading names. Clear and descriptive naming is a key aspect of code quality, making your code easier to understand and maintain. Your task is to identify poorly named elements in the provided code and rename them to better reflect their purpose and behavior.

Taak

Swipe to start coding

Refactor the given code by renaming all variables and functions to clearly describe their purpose.

  • Change the function name so it reflects what the function actually does.
  • Rename all variables so that their names indicate what they represent.
  • Update all references in the code to use the new names.
  • Do not change the logic or structure of the code.
  • Call the refactored function using the new function and variable names.
  • Print the result of the function call using the following format:
print(sum_positive_numbers(numbers_list))

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 2. Hoofdstuk 5
single

single

some-alt