Skip to content

Commit cea3982

Browse files
author
ashegde
committed
feat(example): numbers
1 parent 32df3e8 commit cea3982

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

codes/session_1/numbers.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Open terminal > python3
2+
# Start typing below commands and see the output
3+
4+
2 + 2
5+
45 - 5
6+
7+
# Division always returns a floating point number
8+
45 / 5
9+
10+
# To avoid floating in division
11+
45 // 5
12+
13+
17 % 2
14+
15+
5 * 2
16+
17+
5 ** 2 # 5 square, 5 to the power of 2
18+
19+
width = 45
20+
height = 45
21+
width * height
22+
23+
# List printed expression is assign to `_`
24+
a = 100
25+
b = 200
26+
c = 250
27+
28+
a + b # 300
29+
c + _ # 550 (250 + 300)
30+
31+
32+
33+
34+
35+
36+
37+
38+

0 commit comments

Comments
 (0)