题库 Python题库 题目列表 以下能正确计算出“1!+3!+5!”值(n!=1x2x3…xn)的自...
单选题

以下能正确计算出“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
题目信息
2021年 6月 选择题
0%
正确率
0
评论
29
点击