27 января 2023
id 1353347414#write a program to insert a string at the begining of every elements in a list.
a = [100,123,345,567,789,890,98,876,543,678]
#enter customer before each element
print(['rio{0}'.format(i) for i in a])
Seem like a good solution to me, plus you're using list comprehension which is a bit faster than normal for loops