浙大版《Python 程序设计》题目集 第2章-3 阶梯电价 (15分)

elec = int(input())
if elec < 0:
    print('Invalid Value!')
elif elec <= 50:
    print('cost = %.2f' % (elec*0.53))
else:
    cost = 50*0.53+0.58*(elec-50)
    print('cost = %.2f' % cost)
发布了13 篇原创文章 · 获赞 0 · 访问量 52

猜你喜欢

转载自blog.csdn.net/weixin_42229583/article/details/104553651
今日推荐