Reputation: 29
i have been having this error and cannot find a way to fix it here is my code (i am using python 3.7)
qustion = pyperclip.paste()
qustion = qustion.replace("×", "*")
qustion = qustion.replace("÷", "/")
list_qustion = qustion.split
op_func = ops[str(list_qustion[1])] # the line where the error occurs
answer = op_func(list_qustion[0], list_qustion[2])
print(answer)
Upvotes: 0
Views: 104
Reputation: 6181
qustion.split
is a function not a list of values. What I guess you meant is -
list_qustion = qustion.split()
or possibly with the delimiter -
list_qustion = qustion.split('.')
Upvotes: 2