forked from fenyx-it-academy/Class5-Python-Module-Week2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLes_2.py
More file actions
98 lines (70 loc) · 1.15 KB
/
Les_2.py
File metadata and controls
98 lines (70 loc) · 1.15 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#LISTS
'''
a='ab cd' #string
b=('a','b','c','d') #tuple
c={'a','b','c','d'} #set
d={'a':1, 'b':2,'c':3,'d':4} #dictionary
print(list(a))
print(list(b))
print(list(c))
print(list(d))
'''
'''
x=[1,2]
print(3*x)
print(x+x+x)
'''
'''
my_list=[0,3,12,8,2]
print(5 in my_list)
print(5 not in my_list)
'''
'''
n_list=["Hello",[1,2,3]]
print(n_list[0][2])
'''
'''
lst=["D","F","1","c",",",""," "]
lst.sort()
print(lst)
print(sorted(lst))
'''
'''
nums=[1,2,3]
vals=nums
del vals[1:2]
print(vals)
print(nums)
'''
'''
p_letters=[]
for letter in 'pycoders':
p_letters.append(letter)
print(p_letters)
s=[[i for i in range(3)] for j in range(5)]
print(s)
'''
'''
number_list=[]
for x in range(20):
if x%2==0:
number_list.append(x)
print(number_list)
'''
'''
number_list=[x for x in range(29) if x%2==0]
print(number_list)
'''
#TUPLES
#SETS
#DICTIONARY
Dictionary={
"cat" : "kat",
"dog" : "hond",
"horse": "paard"
}
for key in Dictionary.keys():
print(key, "->", Dictionary[key])
Dictionary['lion']='leeuw'
Dictionary.update('liom' 'leeuw')
print(Dictionary)