0 out of 464 challenges solved
You are given a list of tuples, where each tuple contains two elements: a string and a number. Write a function `index_minimum` that returns the first element (string) of the tuple with the smallest second element (number).
#### Example Usage
```python [main.nopy]
print(index_minimum([('Rash', 143), ('Manjeet', 200), ('Varsha', 100)])) # Output: 'Varsha'
print(index_minimum([('Yash', 185), ('Dawood', 125), ('Sanya', 175)])) # Output: 'Dawood'
print(index_minimum([('Sai', 345), ('Salman', 145), ('Ayesha', 96)])) # Output: 'Ayesha'
```
#### Constraints
- The input list will contain at least one tuple.
- Each tuple will have exactly two elements: a string and a number.
- The numbers in the tuples are unique.from typing import List, Tuple
def index_minimum(tuples_list: List[Tuple[str, int]]) -> str:
"""
Given a list of tuples, return the first value of the tuple with the smallest second value.
Args:
tuples_list (List[Tuple[str, int]]): A list of tuples where each tuple contains a string and an integer.
Returns:
str: The first element of the tuple with the smallest second value.
"""
# Your code here
pass