

    # ３、请编写函数fun，其功能是计算下列多项式的和
    # sn = 1 + 1/1! + 1/2! + 1/3! + ... + 1/n!
    # 计算n为100时的值
    # 看一下求出来的和是什么？建议用math.factorial

from math import factorial as fac

# def fun(n):
#     s = 1
#     for i in range(1,n+1):
#         s += 1/(fac(i))

#     return s
def fun(n):
    return sum(
        map(
            (lambda x: 1/(fac(x))),
                range(101)
                ))

n = int(input("请输入求多项式的整数："))
print("多项式的和为：", fun(n))
9eddb6db8ebf0e4bd95d62dd5c01473eff61995d
<mask token>


def fun(n):
    return sum(map(lambda x: 1 / fac(x), range(101)))


<mask token>

<mask token>


def fun(n):
    return sum(map(lambda x: 1 / fac(x), range(101)))


<mask token>
print('多项式的和为：', fun(n))

<mask token>


def fun(n):
    return sum(map(lambda x: 1 / fac(x), range(101)))


n = int(input('请输入求多项式的整数：'))
print('多项式的和为：', fun(n))

from math import factorial as fac


def fun(n):
    return sum(map(lambda x: 1 / fac(x), range(101)))


n = int(input('请输入求多项式的整数：'))
print('多项式的和为：', fun(n))



    # ３、请编写函数fun，其功能是计算下列多项式的和
    # sn = 1 + 1/1! + 1/2! + 1/3! + ... + 1/n!
    # 计算n为100时的值
    # 看一下求出来的和是什么？建议用math.factorial

from math import factorial as fac

# def fun(n):
#     s = 1
#     for i in range(1,n+1):
#         s += 1/(fac(i))

#     return s
def fun(n):
    return sum(
        map(
            (lambda x: 1/(fac(x))),
                range(101)
                ))

n = int(input("请输入求多项式的整数："))
print("多项式的和为：", fun(n))