r/shittyprogramming • • Mar 10 '23

Javascript is hard sometimes

Post image
504 Upvotes

64 comments sorted by

View all comments

Show parent comment

3

u/great_site_not Mar 10 '23

That's not very Pythonic. Fixed it for you:

sum(eval("[" + "dot for dot in" + "[" + ",".join(re.sub(r".", "1", "hello world")) + "]" * 2))