Python, although it is a very simple use of the language, is actually useful as a calculator. I will go through some of the examples with the print function and what their result would be. It is important to note with the exception of // if a float is contained in the command the result will be a float. Also python following the order of operation and multiple operators as well as parenthesis can be used in the command for more complex expressions.
+ Adds the two pieces of date
print(3 + 4)
7
/ Divides two pieces of data, this result always returns a float
print(8 / 2)
4.0
// Divides two pieces of data, always rounds the result and returns and integer
print(8 // 2)
4
– Subtracts two pieces of data
print(2 – 1)
1
* Multiples two pieces of data
print(2 * 2)
4
% Divides two pieces of data and returns the remainder
print(14 % 5)
4
** Used to represent an exponent 2^2 represented as 2 ** 2
print(3 ** 3)
27