How can I make this model? I added a torus and I was trying to extrude the faces but I couldn't get the exact shape!
Should I continue with torus or circle will be much better?
How can I make the part (circled in red) shown in the image? 

P.S.  I have to use python scripting to make this model
Add a Torus go to edit mode. Select a loop and confirm that you're in face selection as shown in the GIF.



import bpy
bpy.ops.mesh.select_nth(nth=3, offset=0)
bpy.ops.transform.translate(value=(0, 0, 0.5), constraint_axis=(False, False, True), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, release_confirm=True)