print('Please input two numbers:') num1 = float(input()) num2 = float(input()) print('the sum of the two numbers is : ', num1+num2)
输入数字可能是整数也可能是小数,此时统一转换成float来计算
print('Please input two numbers:') num1 = float(input()) num2 = float(input()) print('the sum of the two numbers is : ', num1+num2)
输入数字可能是整数也可能是小数,此时统一转换成float来计算