Different text location on even or odd trials

I need text on the screen to show in a different location every other trial. So on odd trials the text would display at the bottom of the screen and on even number trials display at the top of the screen.
I have created variables to change the X and Y positions in the text Position component. I’m just not quite sure in my code component how to say I “on even trials x and y go here, on odd trials they go here”.
I have been trying an if statement looking at the ‘thisN’ column in the data file to determine whether the trial is even or odd. But I don’t know what I can add to my if statement to know if the trial is odd or even or not. In a different programming language I know, I am able to tell it if the trial number divided by 2 is not a decimal, display in this location, but I’m less familiar with python and am not sure if there’s something similar I can do.

Thanks so much.

Python has the modulus operator %, which when used as x % y gives you the remainder of x divided by y (e.g., 5 % 2 returns 1). You should be able to use this in an if statement (e.g., if trialN % 2 == 0…) to determine which trials are odd and which even, and set the text position accordingly.