\n 1 min read <\/span>\n <\/p>\n #WSQ03<\/a> #TC1014<\/a><\/span><\/p>\n this time the program has to ask the user for two integers and calculate sum, difference, product, division (no decimals) and remainder.<\/span><\/p>\n lets start with the input function so we can enter the numbers for the operations. use a variable like “x” and write this:<\/span><\/p>\n x = int(input()) \u00a0 <\/span><\/p>\n also you can add text in the input function to tell the user what you want him to input:<\/span><\/p>\n x = int(input(“enter an integer: “)<\/span><\/p>\n repeat the line with another variable like “y”\u00a0<\/span><\/p>\n y = int(input(“enter an integer: “)<\/span> now let’s start with the calculations, set a different variable for each one and the rigth operators:\u00a0<\/span><\/p>\n +, -, *, \/ and %<\/span><\/p>\n example: a = x+y<\/span><\/span><\/p>\n if you didn’t used the “int” function it won’t add them like 1+2=3 but it would go like this 1+2=12. that was my problem when writing the line.<\/span><\/p>\n finish the rest of the operations and then the print function:<\/span><\/p>\n print (a)<\/span>\u00a0 ——here goes the variable you want to print.<\/span><\/p>\n and thats it.<\/span><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":" \n 1 min read <\/span>\n <\/p>\n #WSQ03<\/a> #TC1014<\/a><\/span><\/p>\n this time the program has to ask the user for two integers and calculate sum, difference, product, division (no decimals) and remainder.<\/span><\/p>\n lets start with the input function so we can enter the numbers for the operations. use a variable like “x” and write this:<\/span><\/p>\n x = int(input()) <\/span><\/p>\n also you can add text in the input function to tell the user what you want him to input:<\/span><\/p>\n x = int(input(“enter an integer: “)<\/span><\/p>\n repeat the line with another variable like “y” <\/span><\/p>\n y = int(input(“enter an integer: “)<\/span> now let’s start with the calculations, set a different variable for each one and the rigth operators: <\/span><\/p>\n +, -, *, \/ and %<\/span><\/p>\n example: a = x+y<\/span><\/span><\/p>\n if you didn’t used the “int” function it won’t add them like 1+2=3 but it would go like this 1+2=12. that was my problem when writing the line.<\/span><\/p>\n finish the rest of the operations and then the print function:<\/span><\/p>\n print (a)<\/span> ——here goes the variable you want to print.<\/span><\/p>\n and thats it.<\/span><\/p>\n<\/div>\n
<\/span><\/p>\n
<\/span><\/p>\n