I am unable to implement using random integer

https://ide.codingblocks.com/s/68081

Use jupyter notebook to write python codes not ide.

I am sorry but this does not answer my question. I wanted to know how I can implement using random integer.

What I meant to say was coding blocks ide for python is not so good it is prone to errors so rewrite your code in jupyter notebook and resend me the code

I honestly don’t understand how that would make any difference. Nevertheless, I did write this code in jupyter and pasted it here as I have to submit this assignment and ide is the only way to do so.
When I submit it shows wrong-answer for all test cases which might be because I am using middle element as pivot and it says I need to use random element but randint() doesn’t seem to work so, I was looking for an alternate approach but nevermind, I’ll just look something up on stackoverflow.

no the error is you are not taking the input in correct format ,you are only taking in the terms but you also need to take the number of terms as first input.that is the error in your code.
so first take in number of terms and then input the terms.