2021年6月电子学会青少年软件编程(Python四级)等级考试试卷
操作/编程
四级
2021
2022-10-30 11:27:49
94次
2021年6月电子学会青少年软件编程(Python四级)等级考试试卷
操作/编程
四级
2021
2022-10-30 11:27:49
94次
一、单选题
11.
以下能正确计算出“1!+3!+5!”值(n!=1x2x3…xn)的自定义函数是?( )
A.def f(): s=0 t=1 for i in range(1,6,2): t=t*i s=s+t return s |
B.def f(): s=0 t=0 for i in range(1,6,2): t=t*i s=s+t return s |
C.def f(): s=0 t=1 for i in range(1,6,2): t=t*i if i%2==1: s=s+t return s |
D.def f(): s=0 t=1 for i in range(1,6): t=t*i if i%2==1: s=s+t return s |
【知识点】 电子学会Python四级
