Skip to content

Commit aed817c

Browse files
committed
Codes 4 Week01
1 parent 0073bc2 commit aed817c

File tree

5 files changed

+52
-0
lines changed

5 files changed

+52
-0
lines changed

Week01/first.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print("Python is the best!")

Week01/literals.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
print("7")
2+
print(7)
3+
print(7.0)
4+
print(7j)
5+
print(True)
6+
print(0b10)
7+
print(0o10)
8+
print(0x10)
9+
print(7.4e3)

Week01/memory.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
a = 5
2+
print(hex(id(a)))
3+
b = 4
4+
print(hex(id(b)))
5+
c = 3
6+
print(hex(id(c)))
7+
d = 3
8+
print(hex(id(d)))
9+
print(hex(id(2)))

Week01/operations.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
print(2**3)
2+
print(2**3.0)
3+
print(2.0**3)
4+
print(2.0**3.0)
5+
6+
print(2 * 3)
7+
print(2 * 3.0)
8+
print(2.0 * 3)
9+
print(2.0 * 3.0)
10+
11+
print(6 / 3)
12+
print(6 / 3.0)
13+
print(6.0 / 3)
14+
print(6.0 / 3.0)
15+
16+
print(6 // 3)
17+
print(6 // 3.0)
18+
print(6.0 // 3)
19+
print(6.0 // 3.0)
20+
21+
print(6 % 3)
22+
print(6 % 3.0)
23+
print(6.0 % 3)
24+
print(6.0 % 3.0)
25+
26+
print(-8 + 4)
27+
print(-4.0 + 8)

Week01/priorities.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
print(9 % 6 % 2)
2+
print(2**2**3)
3+
print(2 * 3 % 5)
4+
print(-3 * 2)
5+
print(-2 * 3)
6+
print(-(2 * 3))

0 commit comments

Comments
 (0)