If you want the position of the bones as they appear in pose mode, here is the loop for your print.
for bone in bpy.data.objects['metarig'].pose.bones:
print(f'{bone.name}.location = {bone.location}')
If you want the position of the bones as they appear in edit mode, you don't want to use the object, but rather the armature, and you need to print locations for both head and tail:
for bone in bpy.data.armatures['metarig'].bones:
print(f'{bone.name}')
print(f'\t head = ({bone.head[0]:5.2f}, {bone.head[1]:5.2f}, {bone.head[2]:5.2f})')
print(f'\t tail = ({bone.rail[0]:5.2f}, {bone.tail[1]:5.2f}, {bone.tail[2]:5.2f})')
Although you might want to make the print of the positions prettier.