Computing
Computer Science LearnITWithMrC ⛯ Year 7 Year 8 Year 9 GCSE
Responsive image

Lesson Video

14

Lesson Tasks

  • Watch the Lesson video
    Make notes on your notes sheet.
  • Read the lesson notes
    Make notes on your notes sheet.
  • Complete the learning activities
    Make any notes on your notes sheet.
  • Check the Learning outcomes
    Update your learning objectives

What do I need to Learn?

I am familiar with and able to use addition, subtraction, multiplication and real division in a computer program.
I am familiar with and able to use integer division, including remainders in a computer program.

Key Terms

Arithmetic operations Operand Operator Modulus Integer Division

Arithmetic operators in Python

Operator Name Meaning Example
+ Addition Add two operands or unary plus x + y
+2
- Subtraction Subtract right operand from the left or unary minus x - y
-2
* Multiplication Multiply two operands x * y
/ Division Divide left operand by the right one (always results into float) x / y
% Modulus Modulus - remainder of the division of left operand by the right x % y (remainder of x/y)
// Integer division Floor division - division that results into whole number adjusted to the left in the number line x // y
** Exponent Exponent - left operand raised to the power of right x**y (x to the power y)

Click on the button below to go to the Python Tutorial for operators

Python Tutorial

Exercise

Create a program so that a user INPUTS two numbers and the OUTPUT states the division and remainder of dividing the first number by the second number. i.e. :


        Please enter a number: 10
        Please enter a second number: 4
        The number 10 divided by 4 is 2 remainder 2
        >>>
    

Extension Exercise

Create a program so that a user INPUTS a number and the OUTPUT states if it is odd or even. i.e. :


        Please enter a number: 4
        The number 4 is even
        >>>