Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Python 3.6.0
- def calc7(numbers):
- if not numbers:
- return -1
- rate = 1
- total = 0
- for n in numbers:
- total = total + (n * rate)
- if n == 7:
- rate = 2
- else:
- rate = 1
- return total
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement