题库首页 › 青少年软件编程(Python) › 题目 18925

下面为银行存款计算程序,假设存款利率每年都是0.03,小明有1000元,求存满5年后的总金额,下面Python代码空白处应该填入哪个选项?( ) def interest(total, years, rate=0.03): for i in range(years): total *= ( ) return total print(interest(1000, 5))

A:total+rate
B:rate
C:1+rate
D:years+ rate

正确答案:C

试卷来源:202603 青少年软件编程等级考试Python四级真题

本卷相关题目

在线做题 同科目题库