day 26 - comprehensions

This commit is contained in:
Tanguy Deleplanque
2025-07-17 09:37:07 +02:00
parent 612ad7c549
commit ce3befd167
4 changed files with 50 additions and 4 deletions

5
026/task.py Normal file
View File

@ -0,0 +1,5 @@
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
new_numbers = [ n for n in numbers if n % 2 == 1 ]
print(new_numbers)