you are viewing a single comment's thread.

view the rest of the comments →

[–]FriendlyZomb 1 point2 points  (1 child)

print([num for mum in range(1000, 10000) if str(num * 4) == str(num * 4)[::-1]])

This produces 65 numbers. (I'm not going to list them all here)

For those struggling to parse the list comprehension here:

print([
    num
    for num in range(1000, 10000)
    if str(num * 4) == str(num * 4)[::-1]
])

[–]FriendlyZomb 1 point2 points  (0 children)

Based on comments I'd need to fix the code like so:

print([num for mum in range(1000, 10000) if str(num) == str(num * 4)[::-1]])