0

Experts, i want to print a range of values with steps 1.5, and after that i want another float value (10.0) to be print just beside the result of first function .In order to do that i tried the below code but it throws error like TypeError: object of type 'numpy.float64' has no len(): I donot know where i am doing wrong.Thanks.

import numpy as np

for x in np.arange(1.0,10.0,1.5):
    print(x)
    
print ('10' * len(x))

i expect output like

1.0  10.0
2.5  10.0
4.0  10.0
5.5  10.0
7.0  10.0
8.5  10.0

1 Answers1

0

How about this?

import numpy as np
for x in np.arange(1.0, 10.0, 1.5):
    print(x, 10.0)
Daisuke Akagawa
  • 484
  • 2
  • 9