-1
first_len = [15,20,25,30,35]
meas_len = []
meas_len_ipt = input("type 5 values separated by comma:")
meas_len.append(meas_len_ipt)


for fl, ml in list(zip(first_len,meas_len)):
    print(fl,ml)


input('Press ENTER to exit')

I've intended

15 1
20 2
25 3
30 4
35 5

to appear, but the result is

15 1,2,3,4,5
Mureinik
  • 297,002
  • 52
  • 306
  • 350
jhj
  • 13
  • 1
  • You take a single string as input and append that to your list. You need to split that string into a list of 5 values for the code to work correctly. – Aran-Fey Jun 03 '18 at 06:26

1 Answers1

1

meas_len_ipt is just a single string when you input it. You need to split it to individual elements:

meas_len_ipt = input("type 5 values separated by comma:")
meas_len = meas_len_ipt.split(",")
Mureinik
  • 297,002
  • 52
  • 306
  • 350