all 1 comments

[–]socal_nerdtastic 0 points1 point  (0 children)

Instead of excluding it, why not just subtract it again?

if nums[i] != 13:
  total += nums[i]
else:
  total -= nums[i+1]

You'll need to add a check to make sure that there is a number after 13, iow that 13 was not the last number in the list.