entrada1 = input()
entrada1 = entrada1.split(" ")
entrada1 = [float(numero) for numero in entrada1]
Can anyone explain what's happening on line 3?
entrada1 = input()
entrada1 = entrada1.split(" ")
entrada1 = [float(numero) for numero in entrada1]
Can anyone explain what's happening on line 3?
I am new to Python, but I believe you are transforming numeric1 values into float and playing in an array
[float (number) for number in input1]
And assigned the array on top of input1, which were previously strings.
The most experienced people please correct me, but it should be some simpler way to implement:
entrada2 = []
for i in range(0, len(entrada1)):
entrada2.append(float(entrada1[i]));
entrada1 = entrada2