How to add 'Properties > Camera > Focal Length' to 3D View Panel?
I would recommend starting with the templates available. You need to import the blender python module &amp; register your panel.

import bpy
from bpy.types import Panel


class MyPanel(Panel):
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'  # properties section 'n'
#    bl_region_type = 'TOOLS'  # tool bar section 't'
#    bl_category = "My Tab"  # add to specific tab
    bl_label = "My Panel"

    def draw(self, context):
        TheLayout = self.layout
        col = TheLayout.column(align=True)
        col.label(text="viewport lens")
        col.prop(context.space_data, "lens")
        col.separator()
        col.prop(context.scene, "camera")
        col.separator()
        col.prop(context.scene.camera.data, "lens")


def register():
    bpy.utils.register_class(MyPanel)


def unregister():
    bpy.utils.unregister_class(MyPanel)


if __name__ == "__main__":
    register()


Edited


Removed Loop of all objects to find multiple cameras.
Added scene camera prop for local selection in the event of multiple
cameras


.