Program to determine focal length of a spherical mirror | Determines focal length of a spherical concave mirror ; Determines focal length of a spherical convex mirror ; Driver function
def focal_length_concave ( R ) : NEW_LINE INDENT return R / 2 NEW_LINE DEDENT def focal_length_convex ( R ) : NEW_LINE INDENT return - ( R / 2 ) NEW_LINE DEDENT R = 30 ; NEW_LINE print ( " Focal ▁ length ▁ of ▁ spherical ▁ concave ▁ mirror ▁ is ▁ : " , focal_length_concave ( R ) , " ▁ units " ) NEW_LINE print ( " Focal ▁ length ▁ of ▁ spherical ▁ convex ▁ mirror ▁ is ▁ : ▁ " , focal_length_convex ( R ) , " ▁ units " ) NEW_LINE