第16819题 单选题
下列Python程序段中自定义函数do(n)的作用是什么

分析给定Python程序段中自定义函数do(n)的作用:

def do(n):   
    s=0   
    f=1   
    for i in range(1,n+1,2):   
        s=s+1/i*f   
        f=-f   
    return s
print(do(10))
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析