Algebra

Manipulating Varables

Algebra

🙋 Need help? Ask an expert now!

Operations in python

Just like a calculator, python works well with numbers. You can add variables together if they are the same type!

There are a multitude of other mathematical functions that you can use.

  • * = Multiplication

    • Can be used with floats and integers
  • + = Addition

    • Can be used with floats, integers and strings
  • - = Subtraction

    • Can be used with floats and integers
  • / = Division

    • Can be used with floats and integers

Other functions:

  • ** = Exponential

  • // Integer Division

    • Integer division is division in which the fractional part (remainder) is discarded is called integer division.
  • % Modulus Division

    • In computing, the modulo operation finds the remainder after division of one number by another (sometimes called modulus)

Examples in the interpreter!

                        
# Declare variables x and y x = 2 y = 3 # Add x and y and print the result print('The sum of x and y is: ',x + y) # Subtract x and y and print the result print('The difference of x and y is: ', x - y) # Multiply x and y and print the result print('x * y equals: ', x * y) # Divide x and y and print the result print('x / y = ' x / y)
Edit Me on GitHub!