1
votes
print(array[i])

OutPut:

<rect(338, 100, 24, 200)>

I am expecting to print only the value '338' in the variable array[i]

Expected Output:

338
assuming <rect(338, 100, 24, 200)> is an instance of the pygame Rect class, you can access the individual values with .x .y .w .h Example: print(array[i].x). If that's not the case, it would be helpful if you added more information about the class. - Nik