In my application user inputs data which is then used in calculating.
For example, the inputted data is:
[[74, 74], [65, 73], [91, 69]]
And of course, when trying to print(type(data)) I get string type.
I iterate through these arrays so I need it to be list type.
I tried using split/eval, yet no success
#Enter text_to_decipher
print("Enter your text to decipher or keep the default: ")
print(text_to_decipher)
print('\n')
#start collecting input
temp_text = ""
while True:
temp=input()
if temp == "":
break
else:
temp_text = temp_text + temp
if temp_text != "":
text_to_decipher = temp_text
print (text_to_decipher)
print (type(text_to_decipher))
text_to_decipher = input()
print (type(text_to_decipher))
Error that happens when my code tries to iterate through the string and not the list:
Traceback (most recent call last): File "main.py", line 1091, i <module ats1=iter(pair,k[2],iter_function) file "main.py", line 1022, in iter r=M[1] IndexError: string index out of range
Any ideas?