P Series

    0

    1

    HARIGOVIND VALSAKUMAR

    PythonPSeries
    HGV Public Cookbook

    Function to return P series.

    def p_series(nth_term power):
        if nth_term == "":
            return nth_term
        nth_term = int(nth_term)
        power = int(power)
        series = []
        for temp in range(int(nth_term)):
            series.append(f"1/{pow(temp + 1, int(power))}" if series else 1)
        return series
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.