Hello _ world

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
print('Please input two numbers:')
num1 = float(input())
num2 = float(input())
print('the sum of the two numbers is : ', num1+num2)

输入数字可能是整数也可能是小数,此时统一转换成float来计算

 

posted on 2018-01-27 15:39  Hello _ world  阅读(141)  评论(0编辑  收藏  举报