How To Change Camera Field Of View From Python Script
bpy.data.cameras gives access to the camera data. And camera data is not renamed (stays 'camera.xxx') when you set the object name.
So, access the camera via objects and use its data:
import bpy
import math

a = 'hello'
bpy.ops.object.camera_add(enter_editmode=False, align='VIEW', location=(50,0,0), rotation=(1.57057,0.00174533,1.57057))
bpy.data.objects[&quot;Camera&quot;].name = a
bpy.data.objects[a].data.lens_unit = 'FOV' #Access it by its object name
bpy.data.objects[a].data.angle= math.radians(10)

Additionally, you should not rely on the fact the created object is named &quot;Camera&quot; (because it won't if such a camera already exists).
You can:
import bpy
import math
from mathutils import Euler

a = 'hello'
camera_data = bpy.data.cameras.new(a)
camera = bpy.data.objects.new(a, camera_data)
bpy.context.collection.objects.link(camera)
camera.location = (50,0,0)
camera.rotation_euler = Euler((1.57057,0.00174533,1.57057))
camera.data.lens_unit = 'FOV'
camera.data.angle = math.radians(10)