def solution(msg: list)-> list:
# your code here
return [f"{i}:{e}" for i, e in enumerate(msg, start=1)]
assert solution([]) == []
assert solution(["a", "b", "c"]) == ["1:a", "2:b", "3:c"]
def solution(msg: list)-> list:
new_list = []
for i, element in enumerate(msg, start=1):
obj = str(i) + ": " + element
new_list.append(obj)
return new_list
def solution(msg: list)-> list:
# your code here
return [f"{msg.index(i)+1}:{i}" for i in msg]
if __name__ == '__main__':
assert solution([]) == []
assert solution(["a", "b", "c"]) == ["1:a", "2:b", "3:c"]
def solution(lists:list):
reslut =
for i in lists:
index = lists.index(i)
key = i
value = str(index + 1)
element = (value + ‘:’ + key)
reslut.append(element)
print(reslut)
def solutions(lists:list):
reslut =
for key, value in enumerate(list, start=1):
reslut.append("{}:{}".format(key, value))
print(reslut)