- 博客(3)
- 收藏
- 关注
翻译 #while小结
#三酷猫的钓鱼核算收入。fish_record='鲫鱼5条、鲤鱼8条、鲢鱼7条、草鱼2条、黑鱼6条、乌龟1只'price='8,5,3,2,9,8'num1=0sum1=0Amount=0i=0while i<6: num1=int(fish_record[2+i*5]) sum1=sum1+num1 Amount=Amount+int(price[i*...
2019-06-10 19:26:39 320
原创 线性查找
fish=‘鲫鱼5条、鲤鱼9条、鲢鱼8条、草鱼7条、黑鱼6条、乌龟2只’print(len(fish))record_len=len(fish)i=0while i<record_len: #与字符串进行比较,查找乌龟的记录if fish[i:i+2]‘乌龟’:if int(fish[i+2])/20:print(“找到乌龟了,是%d只偶数个。”%(int...
2019-06-09 15:14:09 377
翻译 #input函数
need=input(‘您好,欢迎来到西安银行,请问您需要帮助吗?需要or不需要?’)if need==‘需要’:number=int(input(‘请问您需要什么帮助呢?1:存取款;2:货币兑换;3:咨询’))if number1:print(‘请您去存取款窗口。’)elif number2:print(‘金甲龙和人民币的兑换率为1:51.3,即1金甲龙=51.3人民币’)mone...
2019-06-09 11:08:12 894
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人