Question: 2. Enumerate Practice Problem Write a function called pos_sum that accepts an iterable of Numbers and returns a List of Numbers where each element is

2. Enumerate Practice

Problem

Write a function called pos_sum that accepts an iterable of Numbers and returns a List of Numbers where each element is the sum of the element and its position.

Requirements

  • You must use enumerate in your solution
  • You must provide appropriate type hints for each parameter and the return value.
    • Read the problem closely to figure out what the appropriate types are

Examples

pos_sum([10, 20, 30]) returns [10, 21, 31]

pos_sum((35.6, 35.9, 85.2 , 16.23)) returns [35.6, 36.9, 87.2, 19.23]\

2. Enumerate Practice Problem Write a function called pos_sum that accepts an

code.py New 1 from typing import TypeVar, List, Iterable 2 from numbers import Complex Number = TypeVar('Number', bound - Complex), Vou Aw def pos_sum(...)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!