Untitled
unknown
python
2 years ago
483 B
11
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...