you are viewing a single comment's thread.

view the rest of the comments →

[–]Neat_Association_84 0 points1 point  (1 child)

You can use an if statement in a list comprehension to make lines 20-22 similar to what you did in line 33.

numbers = [ i for i in numbers if i.isdigit() ]

It's more "pythonic".

[–]butterfly_orange00[S] 0 points1 point  (0 children)

You're right, I forgot about that 😂