+ 1

Why it doesn't run on phyton?

x = float(input("Inserire numero di partenza: ")) y = float(input("Inserire numero di arrivo: ")) y += 1 z = float(input("Inserire distanza tra i numeri: ")) number = list(range(x, y, z)) print(number)

8th Feb 2018, 4:39 PM
Edoardo Di Franco
Edoardo Di Franco - avatar
5 Answers
+ 1
ok thanks, how Can I make It run with floats?
8th Feb 2018, 5:22 PM
Edoardo Di Franco
Edoardo Di Franco - avatar
+ 1
Your floats are not lined up correctly.
8th Feb 2018, 5:22 PM
Anthony Perez
+ 1
ok thank you, I'm trying it
8th Feb 2018, 6:07 PM
Edoardo Di Franco
Edoardo Di Franco - avatar
0
You use floats. I think "range" expects integers.
8th Feb 2018, 5:20 PM
Paul
Paul - avatar
0
This works at Sololearn: import numpy as np x = float(input("Inserire numero di partenza: ")) y = float(input("Inserire numero di arrivo: ")) y += 1 z = float(input("Inserire distanza tra i numeri: ")) number = list(np.arange(x, y, z)) print(number) I am not sure it is what you want. And it needs numpy. It is not in the standard python installation.
8th Feb 2018, 5:59 PM
Paul
Paul - avatar