[[email protected] ~]# cat 1.py #!/usr/bin/python num1 = input("Please input first number: ") num2 = input("Please input second number: ") print "%s + %s = %s" % (num1, num2, num1+num2) print "%s - %s = %s" % (num1, num2, num1-num2) print "%s * %s = %s" % (num1, num2, num1*num2) print "%s / %s = %s" % (num1, num2, num1/num2)
[[email protected] ~]# python 1.py Please input first number: 4 Please input second number: 3 4 + 3 = 7 4 - 3 = 1 4 * 3 = 12 4 / 3 = 1
时间: 2024-10-28 23:28:11