import bpy
# need to be in object mode to do this operation, you could place a check here and
# switch, but that is extra work!
for i in bpy.context.active_object.data.vertices:
print(i.co, i.select)
With the check in place, that might look something like this:
import bpy
# places us into object mode even if we are already. I prefer this method over
# Toggle() toggle can get messy fast.
bpy.ops.object.mode_set(mode='OBJECT')
# need to be in object mode to do this operation
for i in bpy.context.active_object.data.vertices:
print(i.co, i.select)