https en wikipedia orgwikilccircuit an lc circuit also called a resonant circuit tank circuit or tuned circuit is an electric circuit consisting of an inductor represented by the letter l and a capacitor represented by the letter c connected together the circuit can act as an electrical resonator an electrical analogue of a tuning fork storing energy oscillating at the circuit s resonant frequency source https en wikipedia orgwikilccircuit this function can calculate the resonant frequency of lc circuit for the given value of inductance and capacitnace examples are given below resonantfrequencyinductance10 capacitance5 resonant frequency 0 022507907903927652 resonantfrequencyinductance0 capacitance5 traceback most recent call last valueerror inductance cannot be 0 or negative resonantfrequencyinductance10 capacitance0 traceback most recent call last valueerror capacitance cannot be 0 or negative https en wikipedia org wiki lc_circuit an lc circuit also called a resonant circuit tank circuit or tuned circuit is an electric circuit consisting of an inductor represented by the letter l and a capacitor represented by the letter c connected together the circuit can act as an electrical resonator an electrical analogue of a tuning fork storing energy oscillating at the circuit s resonant frequency source https en wikipedia org wiki lc_circuit this function can calculate the resonant frequency of lc circuit for the given value of inductance and capacitnace examples are given below resonant_frequency inductance 10 capacitance 5 resonant frequency 0 022507907903927652 resonant_frequency inductance 0 capacitance 5 traceback most recent call last valueerror inductance cannot be 0 or negative resonant_frequency inductance 10 capacitance 0 traceback most recent call last valueerror capacitance cannot be 0 or negative
from __future__ import annotations

from math import pi, sqrt


def resonant_frequency(inductance: float, capacitance: float) -> tuple:
    

    if inductance <= 0:
        raise ValueError("Inductance cannot be 0 or negative")

    elif capacitance <= 0:
        raise ValueError("Capacitance cannot be 0 or negative")

    else:
        return (
            "Resonant frequency",
            float(1 / (2 * pi * (sqrt(inductance * capacitance)))),
        )


if __name__ == "__main__":
    import doctest

    doctest.testmod()