题目
FIT1008-FIT1054-FIT2085_S2_2025 Week 9 Workshop Quiz
多项选择题
For a function to be recursive (and practical in Python), what should it have?
选项
A.a. Must return a value
B.b. 1 or more base cases
C.c. 1 or more recursive calls
D.d. No loops
查看解析
标准答案
Please login to view
思路分析
Let’s break down the question carefully: What features make a function recursive and practical in Python?
Option a: 'Must return a value' — While many recursive functions do return a value, it is not a strict requirement for recursion to be possible. A function could be recursive and perform actions without returning a me......Login to view full explanation登录即可查看完整答案
我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。
类似问题
Which of the following code snippets returns the factorial of a given number? (Hint: Factorial of 5 = 5! = 1 * 2 * 3 * 4 * 5 = 120)
Which of the following code snippets returns the factorial of a given number? (Hint: Factorial of 5 = 5! = 1 * 2 * 3 * 4 * 5 = 120)
What is a base case in recursion?
What will this recursive function print when called with countdown(3)?
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!