Hey, trying to create a radial pattern with a sphere in Python, but somehow I am missing the last sphere.

As you can see by the image and code below, I am trying to distribute 7 spheres in 180 degrees. If I set it to 360 degrees works fine as it already has the last point, the first sphere. But if I set it to 90 or 180 for example, it misses the last sphere. I need to somehow add this last sphere, but not sure how.
Increasing the number of spheres (max_iterations) won't do the trick as it will distribute one more object within a similar radius.
btw, this can easily be done with MASH and duplicate special, but I need this in python.
Thank you.
import maya.cmds as cmds
degrees = 180
max_iterations = 7
for i in range(max_iterations):
#print (i)
rotation = (degrees/max_iterations) * i
#print(rotation)
my_sphere = cmds.polySphere(r=0.15)
cmds.move(2,my_sphere, x=1 , absolute=1)
cmds.move( 0,0,0, [ my_sphere[0]+'.scalePivot', my_sphere[0]+'.rotatePivot' ], xyz=1, absolute=1 )
cmds.rotate(rotation, my_sphere, y=1)