Nuacht

# Let’s say I give you a list saved in a variable: a = [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]. Write one line of Python that takes this list a and makes a new list that has only the even elements of ...
GitHubLíon na míonna: 9

02_List Comp.py

print([i for i in range(20) if i%2==0]) # nested codition like divisible by 2 and 3 print([i for i in range(20) if i%2==0 if i%3==0]) # using AND/ OR condition print ...