Vector Python 3 Fill

0
entrada1 = input()
entrada1 = entrada1.split(" ")
entrada1 = [float(numero) for numero in entrada1]

Can anyone explain what's happening on line 3?

    
asked by anonymous 17.04.2016 / 00:19

1 answer

1

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
    
17.04.2016 / 01:03