0
How should I debug this code?
Using PsychoPy (a software under Python) I randomize (shuffle) the positions of three text. Now, I want to make an associatin between text position and key press (named Chouce.keys). I wrote this line: if textA.pos== [0,0] and Choice.keys [0]== 'right': chosenText= A but I faced this error: value Error: the truth value of an array with more than one element is ambiguous. Use a.any() ora.all(). What does this error want? What should I do? I appreciate any advice.
3 Antworten
+ 4
Use parenthesis maybe to specify explicitly which are the boolean conditions you want to check.
+ 2
Please post your code here in the Code Playground, maybe I'm not seeing it right.
0
Thank you for your answer. Is that what you mean?
if (textA.pos==[0,0]) and (Choice.keys [0]=='right'): chosenText= A
The same error appears