2018年3月11日
摘要: There are two faulty programs. Answer the following questions about each program. 1.Identify the fault. 程序一:索引值i取不到0,数组中遗漏最后一个元素。 程序二:当搜索到第一个0时便返回其索引( 阅读全文
posted @ 2018-03-11 17:45 znnby1997 阅读(155) 评论(1) 推荐(1) 编辑
摘要: 功能:银行账户计算利率(python实现) 部分代码: def addInterest(balance, rate): newBalance = balance * (1 + rate) balance = newBalance def test(): amount = 1000 rate = 0. 阅读全文
posted @ 2018-03-11 16:46 znnby1997 阅读(1262) 评论(0) 推荐(0) 编辑