çift indisli elamanlarından yeni bir listeyi içlem yoluyla elde etmek

This commit is contained in:
Mert Gör 🇹🇷 2023-06-11 16:00:27 +03:00
parent 54d9b5cfe7
commit afdf73b772
No known key found for this signature in database
GPG key ID: 2100A876D55B39B9
2 changed files with 7 additions and 0 deletions

View file

@ -0,0 +1,4 @@
l = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
result = [l[i] for i in range(0, len(l), 2)]
print(result)

View file

@ -0,0 +1,3 @@
l = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
result = [l[i] for i in range(0, len(l), 2)]
print(result)