Hi, everyone.(I'm working my way through 'Make Games With Python'. This is from Chapter 6, a solar system simulator. I only want to calculate for each pair of 'bodies' once.)
Code:
# Is there a simpler way of writing the next 4 lines?:for px in range(len(bodies)): for opx in range(px+1, len(bodies)): p=bodies[px] op=bodies[opx]Statistics: Posted by BMardle — Sun Feb 15, 2026 9:56 am