Ask your own question, for FREE!
Computer Science 19 Online
OpenStudy (anonymous):

Return the sum of the numbers in the array, returning 0 for an empty array. Except the number 13 is very unlucky, so it does not count and numbers that come immediately after a 13 also do not count. [please do in python]

OpenStudy (anonymous):

this is what i have so far: def sum13(nums): sum=0 found=0 got=0 for num in range(0,len(nums)): if nums[num] != 13 and nums[num-1]!=13: sum=sum+nums[num] return sum

OpenStudy (rsmith6559):

Except for the first iteration, it should work.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!