Aug 8, 2024
x = 5
x
.x
will display 5
.x + y
x
and y
, adds them, and prints the result in interactive mode.print(x + y)
to display the result.vi editor
in Linux)..py
for Python scripts.first.py
print(100)
x = 5
y = 20
print(x + y)
python3 first.py
100 25
+
, -
, *
, /
, **
).+
(Addition)-
(Subtraction)*
(Multiplication)/
(Division)**
(Exponentiation)7 / 5
results in 1
).7 / 5
results in 1.4
).20 + 32
r - 1
1 + 1
print
to display results.%
7 % 3
results in 1
.//
7 // 5
results in 1
.+
operator joins two strings.