Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren0
Cleaner Code
TRYING TO MAKE MY CODE LOOK MORE SIMPLER IS THAT ANYWAY TO MAKE THIS CODE BECOME ONE LINE ? https://code.sololearn.com/cMe8FzYrOg81/?ref=app
2 Antworten
+ 6
You can use a simple list comprehension, that is made for tasks like this:
print([num for num in a if num <=5])
+ 3
Sometimes shorter is more confusing, making the longer version "cleaner"
https://code.sololearn.com/c3Ihd6b9h2ZU/?ref=app