r/shittyprogramming • • Apr 10 '19

One Line of Code™

https://gist.github.com/WorryingWonton/ce8a3a74b0298f0b734fe4dd0a883a63
101 Upvotes

22 comments sorted by

View all comments

Show parent comment

1

u/ArrowThunder Apr 11 '19 edited Apr 11 '19
# other other plebeian multiline trash
sum = 0
unlucky = False
for i in nums:
  wasUnlucky = unlucky
  unlucky = i == 13
  if not (wasUnlucky or unlucky):
    sum += i
return sum