Nov-21-2020, 03:10 PM
The list comprehension is a compact way to create a list. This
My_string = ''.join([str(num) for num in My_list])is the same as
temp = [] for num in My_list: temp.append(str(num)) My_string = ''.join(temp)With the construction of the temp list being done by the code between the [].