It is important to understand that in Blender bones have two conditions: Their Edit Mode and their Pose Mode. So the solution to the question, as long as you don't specify it better, varies by the intent. It matters because accessing those bones, and retrieving their coordinates, works quite differently, as the Pose is stored on the Object, but the Edit Bone on the Object Data of the Armature.
The proposed solution here is based on the assumption that your screenshot shows what you're trying to do. That screenshot was taken in Pose Mode, so here we go:
import bpy
import math # we need this to get the anglein degrees
import numpy # we need this for the Vector Math
cob = bpy.data.objects.get('Armature')
# remember, we are working on the Pose Bones in this example!
bones = cob.pose.bones
# get the bones
bone1 = bones['FirstBone']
bone2 = bones['LastBone']
# get the bone locations as Vectors in World Space
pointA = bone1.head
pointB = bone1.tail
pointC = bone2.tail
# find the two Vectors
# you retrieve the Vector by subtracting the intended Vector Root coordinate from the Tip coordinate
vecA = pointA - pointB
vecB = pointC - pointB
print(vecA, vecB)
# calculate the angle, formula taken from https://stackoverflow.com/questions/39497496/angle-between-two-vectors-3d-python
angle=numpy.arccos(numpy.dot(vecA,vecB)/(numpy.linalg.norm(vecA)*numpy.linalg.norm(vecB)))
# remember the angle is in RADIANS!
print(math.degrees(angle))
Important bits for you are: You need Vectors to be able to calculate the angle inbetween. Those Vectors can be derived by a subtraction of head and tail of the bone you're looking for. A screenshot of the file I was testing this in:

The formula to calculate the angle between two Vectors was taken - as stated in the comment - from a StackOverflow question. It involves using numpy, which offers the needed Vector math classes for this.
I have created a .blend file to test this quickly here:

Open the file, press run script
in the Text Editor, and the angle should be assigned to the Text field. Repose the bones to test again.