Defining/adding new variable

I’m looking for a way to add data which refers to a value, and I can’t remember how to define variables. Specifically, how do I tell psychopy to do the following:
thisTrial.addData('value_x', x_rounded)
where “x_rounded” is not a printed string but a value which I calculated previously. How do I refer to this value? I think I need to define it somehow but I can’t find a way to do it.
Thank you

@agata, this link has a nice tutorial that explains how to define variables in Python.