Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def super_sum(list):
- total = 0
- '''Iterating over each value in the list,
- and adding the indexes of the first
- occurrence of the letter "s", we have:'''
- for values in list:
- total += values.index("s")
- # total = total + values.index("s")
- return total
- print(super_sum(["mustache", "greatest"]))
- print(super_sum(["mustache", "greatest", "almost"]))
Add Comment
Please, Sign In to add comment