Variables
Hello..I have a first variable ("give"). And I have a second variable that is the response to text input ("my_response_var"). I want to create a third variable that will be likewise: 50- [give]+ [my_response_var"] and then show the third variable at a sketchpad. How can I do that?
Thanks for your help
Comments
Hi,
You can use Python in text strings with the
[= ... ]syntax, as shown here:In your case, it seems like the following text would do the job: "[=50-var.give+var.my_response_var]"
Does that help at all?
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi, thanks for your answer, but it's not working..
this is the error:
Details
item-stack: experiment[run].new_loop_3[run].men_1[prepare].new_sketchpad_9[prepare]
exception message: unsupported operand type(s) for -: 'int' and 'unicode'
time: Tue Jun 14 11:05:35 2016
exception type: TypeError
What can I do?
Thanks again
Hi,
It seems that the second variable of that equation is a string type rather than a number type. You have to specify that the value of that second variable should count as a number. You can do that by means of using "int(my_response_var)".
Cheers,
Josh