I\'m new to programming and I\'m trying to do the codingbat.com problems to start. I came across this problem:
Given an array calculate the sum except when there is
You can use while loop to treat multiple 13.
while
13
def sum13(lis): while pos(lis): if pos(lis) == len(lis) - 1: lis = lis[:pos(lis)] else: lis = lis[:pos(lis)]+lis[pos(lis)+1:] return sum(lis)