Lab #2 +, -, *, /,

if we type in decimal integer then it will run to an error

but if it change to a “float” then it can run

 

inputfirstint = raw_input (“please enter the first integer : “)
inputsecondint = raw_input (“please enter the second integer : “)
inputfirstnum = float (inputfirstint)
inputsecondnum = float (inputsecondint)
print “the sum of ” ,inputfirstnum, ” and ” ,inputsecondnum, ” is : ” ,inputfirstnum + inputsecondnum,
print
if inputfirstnum < inputsecondnum :
print “the difference of ” ,inputfirstnum, ” and ” ,inputsecondnum, ” is : ” ,inputsecondnum – inputfirstnum,
else :
print”the difference of ” ,inputfirstnum, ” and ” ,inputsecondnum, ” is : ” ,inputfirstnum – inputsecondnum,
print
print “the product of ” ,inputfirstnum, ” and ” ,inputsecondnum, ” is : ” ,inputfirstnum * inputsecondnum,
print
print “the quotient of ” ,inputfirstnum, ” and ” ,inputsecondnum, ” is : ” ,inputfirstnum / inputsecondnum,
print “with the remainder ” ,inputfirstnum % inputsecondnum,