In Python there are the usual arithmetic operators, as in most other programming languages, namely addition, subtraction, multiplication, division and the remainder operator (modulo). In addition, there are the one-digit operators for positive and negative sign as well as operators for exponential (power) calculation and floor division. The arithmetic operators expect numeric operands and return a numeric return value.
Addition / sign
Subtraction / sign
Initializes the variables a with value 6, b with value 4, c with value 8 and z with value 0
3 – 4
Output starting values
7 – 8
Outputs the division of the variables a and b
10 – 11
Outputs the division (floor) of the variables a and b
13 – 14
Outputs the power of the variables a and b.
16 – 17
Multiplication of the variables a and b followed by subtraction of the variable z
a, b, c, z = 6, 4, 8, 0
print("a = " + str(a) + "\nb = " + str(b) + "\nc = " + str(c) + "\nz = " + str(z))
z = a / b
print("z = " + str(a) + " / " + str(b) + " = " + str(z))
z = a // b
print("z = " + str(a) + " // " + str(b) + " = " + str(z))
z = a ** b
print("z = " + str(a) + " ** " + str(b) + " = " + str(z))
a = z - a * b
print("a = " + str(a))
a = 6
b = 4
c = 8
z = 0
z = 6 / 4 = 1.5
z = 6 // 4 = 1
z = 6 ** 4 = 1296
a = 1272
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
The _ga cookie, installed by Google Analytics, calculates visitor, session and campaign data and also keeps track of site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognize unique visitors.
Installed by Google Analytics, _gid cookie stores information on how visitors use a website, while also creating an analytics report of the website's performance. Some of the data that are collected include the number of visitors, their source, and the pages they visit anonymously.
The tk_lr is a referral cookie set by the JetPack plugin on sites using WooCommerce, which analyzes referrer behaviour for Jetpack.
The tk_or is a referral cookie set by the JetPack plugin on sites using WooCommerce, which analyzes referrer behaviour for Jetpack.
JetPack installs this cookie to collect internal metrics for user activity and in turn improve user experience.
JetPack sets this cookie to record details on how user's use the website.