-
Notifications
You must be signed in to change notification settings - Fork 0
/
Worksheet_Python.txt
62 lines (36 loc) · 997 Bytes
/
Worksheet_Python.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Let's go for a dip with Python
# this is a string
# this is a string
_this is a string_
print ("this is a string")
print ("\"this is a string\"")
# Ready to splash a little with Python
list(range(1,20))
a = list(range(1,20))
x = sum(a)
print(x)
# Paddling with Python
arr = ["Jack", "Queen", "King"]
print(arr[0])
print(arr[1])
print(arr[2])
d = {'employee': 'Juanita Lopez','salary':81000, 'startdate': '2010-11-1'}
e = {'employee': 'Peter Gynn','salary':83400, 'startdate': '2008-3-25'}
f = {'employee': 'Jolie Talofa','salary':96800, 'startdate': '2007-3-14'}
print (d)
print (e)
print (f)
d.keys()
d.values()
d.items()
for k,v in d.items():
print(k, v)
for k,v in e.items():
print(k, v)
# Swimming with Python
# -*- coding: iso-8859-1 -*-
en_de = {"red" : "rot", "blue" : "blau", "yellow" : "gelb"}
print (en_de)
print (en_de["red"])
de_fr = {"rot" : "rouge", "blau" : "bleu", "gelb" : "jaune"}
print ("The French word for red is: " + de_fr[en_de["red"]])