Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions prometheus.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
def calculate_sum(my_list: list[int]) -> int:
"""
Calculates the sum of a list of integers, where each number is multiplied by its index.

Args:
my_list (list[int]): The input list of integers.

Returns:
int: The sum of the integers in the list, where each number is multiplied by its index.

Raises:
TypeError: If the input is not a list.

Examples:
>>> calculate_sum([1, 2, 3, 4])
30