Skip to content

Commit cf0a939

Browse files
committed
Exam prep
1 parent d3ab679 commit cf0a939

File tree

7 files changed

+43
-0
lines changed

7 files changed

+43
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
3+
dct = {
4+
"name":"James",
5+
"James": 20
6+
}
7+
8+
if 'James' in dct:
9+
print(dct["James"])
10+
11+
else:
12+
print("The key james does not exist")
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
a = [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
3+
4+
evens = [even for even in a if even % 2 == 0]
5+
6+
print(evens)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
print("""
3+
Welcome to python
4+
Welcome to comp science
5+
""")
6+
7+
print('Welcome to python \nWelcome to comp science')
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
a = (10.5 - 5.6) / 0.5
3+
4+
print(a)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
i = 10
3+
j = 20
4+
5+
# temp = i + j
6+
# i = temp - i
7+
# j = temp - j
8+
9+
# python way
10+
i, j = j, i
11+
12+
print(f'i={i} \nj={j}')
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

kivy_app

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 4e8ce7affa7cf82ea74f6359d28c18c5009ec828

0 commit comments

Comments
 (0)