Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #sum_of_values_and_indices
- lists = [1, 2, 3]
- def sum_of_values_and_indices(lists):
- total = 0
- for list in lists:
- total += list
- total += lists.index(list)
- return(total)
- sum_of_values_and_indices(lists)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement