I am learning python and I have discovered the concept of "list comprehensions" (I do not know if it has a Spanish translation).
I was doing tests to understand it and I did not finish clarifying myself.
For example, if I want to show the even values between a range of values (0 to 25 for example), I would know how to do it in the "normal" way, but with this method I would not: (
pares =[]
for i in range (0,26):
if i%2 ==0:
pares.append(i)
print(pares)
But with "list comprehensions" I do not get it, this is my last test,
pares = [x for x range(0,26) if x%2 ==0]
print (pares)
Health and thanks!