Tag Archives: #Shows

#TC1014 #WSQ03

2 min read

Here’s my code for the #WSQ03, i used these links as a reference to help me deal with this task: http://stackoverflow.com/questions/17651384/python-remove-division-decimal 

http://stackoverflow.com/questions/5584586/find-the-division-remainder-of-a-number

 I have put some comments in the code to explain what each line does.

num1 = int(input(“Give me a number: “)) #Asks the user for a number

num2 = int(input (“Give me another number: “)) #Asks the user for another number

suma = num1+num2 #this is the variable for the sum of two numbers

resta= num1-num2  #this is the variable for the difference of two numbers

multi= num1*num2  #this ios the variable for the product of two numbers

div=num1/num2 #this is the variable for the division of two numbers

rem= num1%num2 #this is the variable for the remainder of the division of two numbers

print (“The sum of your numbers is”, suma) #Shows the user the result of the sum

print (“The difference of your numbers is”, resta) #Shows the user the result of the difference

print (“The product of your numbers is”, multi) #Shows the user the result of the product

print (“The division of your numbers is”, int(div)) #Shows the user the result of the division

print(“The remainder of the division of your numbers is”, int(rem)) #Shows the user the remainder of the division

I could have printed every result in one print function but i think it looks better this way. 🙂 #TC1014 #WSQ03