A
A
Alexander2020-05-29 18:26:55
Python
Alexander, 2020-05-29 18:26:55

Which way would be more optimal in terms of performance, to make each element of the list a string?

Good afternoon, there is a list of 100 million numbers, which method will be more productive for further operations on the list (enumeration, sorting, etc.)?

l = [i for i in range(100000000)]
l = map(lambda i: str(i), l)
# Или
l = [i for i in range(100000000)]
l = [str(i) for i in l]

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question