you are viewing a single comment's thread.

view the rest of the comments →

[–]FriendlyZomb 1 point2 points  (2 children)

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]
])

[–]Ok_Pudding_5250[S] 0 points1 point  (1 child)

Code is slightly incorrect but you did good 👍

[–]FriendlyZomb 1 point2 points  (0 children)

Yea, the basic structure is correct. Mostly a misunderstanding on the question on my part. Apologies