diff --git a/prometheus.py b/prometheus.py new file mode 100644 index 0000000000..96feffd99c --- /dev/null +++ b/prometheus.py @@ -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