So, in this example I understand how does it work:
# Create a list of numbers
user_entries = ["10", "19.1", "20"]
# Create an empty list to store the float numbers
float_numbers = []
# Iterate over the elements in the list
for number in user_entries:
# Convert the element to float type and append it to the float_numbers list
float_numbers.append(float(number))
# Calculate the sum of the numbers in the float_numbers list
print(sum(float_numbers))
But next code works same way, but I don't really understand how does it rewrite "behind scenes". In debugging I cannot see the movement of the second code.
user_entries = ['10', '19.1', '20']
user_entries = [float(item) for item in user_entries]
print(sum(user_entries))