Function that prints the location of all the vertices of an active object
Assuming your object is selected, the following code should work:
import bpy

for vert in bpy.context.active_object.data.vertices:
    print (vert.co)

I will also point out blender has an integrated terminal where you can type incomplete python statements (e.g bpy.context.active_object.data.) and press tab in order to print a display of the possible completions. This is very useful to quickly navigate over the properties of bpy objects and gain quick intuition on what you can and can't do.