Untitled
Anonymous
python
09/05/2023 10:25 PM
644 B
18
Indexable
from typing import Dict, List
def f1(lista: List[str]) -> Dict[str, List[int]]:
dic = dict()
for item in lista:
dic[item] = [n for n in range(len(item))]
return dic
def f2(dicionario: Dict[str, List[int]], letra: str) -> Dict[str, List[int]]:
for key, value in dicionario.items():
if letra not in key:
continue
for index, c in enumerate(key):
if letra == c:
value.remove(index)
return dicionario
Editor is loading...