乐之之

知而行乐,乐而行之,天道酬勤,学无止境。

2022年10月21日

7、使用递归函数写20的阶乘

摘要: 题目: 使用递归函数写20的阶乘:1x2x3...19x20 解题思路: 1、自定义number递归函数。 2、每阶乘一次参数减1 答案: result = 0 def number(num): if num ==1: return 1 result = num * number(num-1) re 阅读全文

posted @ 2022-10-21 17:12 乐之之 阅读(258) 评论(0) 推荐(0) 编辑