Learn practical skills, build real-world projects, and advance your career
liste=[]
liste=range(20)
liste1=[]
for x in liste:
    if x % 2 ==0:
        liste1.append(x)
liste1
[0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
liste2 = [x for x in liste if x % 2 == 0]
liste2
[0, 2, 4, 6, 8, 10, 12, 14, 16, 18]