1、两数求和

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 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/zwb8848happy/p/8366239.html