for solving above problem I normally use for loop like that:
list1 = ['1', '2', 3,32423,5.76, "afef"]
list2 = []
for ele in list1:
list2.append(str(ele))
does python has some build in function for solving that problem?
You can use the built-in function map like the following:
list1 = ['1', '2', 3, 32423, 5.76, "afef"]
list2 = list(map(str, list1))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With