-
Notifications
You must be signed in to change notification settings - Fork 51
/
lesson_2.py
118 lines (100 loc) · 2.09 KB
/
lesson_2.py
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# print(abs(-6))
# print(bin(4))
# print(4 << 6)
# print(bin(256))
# print(4 >> 6)
# print(type(4))
# print(type(4.1245))
# print(complex(3,5))
# s1 = 'privet'
# s2 = ' student'
# print(type(s1))
# print(s1 + s2)
# print(s1[5:1:-2])
# print(s1.upper())
# print(s1.islower())
a = [1,2,3,4,3,3,3,3,3,0.31]
# while a.count(3) > 0:
# a.remove(3)
# print(a)
# a.reverse()
# print(a)
# a.append(5)
# print(a[3:6])
# a.insert(1, 3)
# print(a)
# a.remove(1)
# print(a)
# a.remove(3)
# print(a)
# a.sort(reverse=True)
# print(a)
# kortage = (1,3,5,7)
# print(kortage)
# spisok = list((1,2,3,4,5))
# mnojestvo = set('abrakadabra')
# print(mnojestvo)
# print(mnojestvo.pop())
# print(mnojestvo)
# print(list(mnojestvo))
# capitals = {"Russia": "Moscow", "Germany": "Berlin"}
# capitals_2 = dict(key_1='val_1', key_2='val_2')
# print(capitals)
# print(capitals_2)
# print(capitals.keys())
# print(capitals.values())
# print(capitals.items())
# print(capitals.setdefault("France"))
# print(capitals)
# capitals["France"] = 'Paris'
# print(capitals)
# capitals.update(capitals_2)
# print(capitals)
# print(2 + 2 == 3)
# print(b'text'.decode('utf-8'))
# print('text'.encode('utf-8'))
# print(bytes([10, 20, 30, 40, 50]))
#
# a = bytearray(b"text text2 text3")
# spisok = [1,2,'stroka',10,100]
# print(spisok[1:4])
# try:
# print('hello')
# a = 500/0
# print('bye')
# while True:
# print('ывпывп')
# except ZeroDivisionError:
# print('Нельзя делить на ноль!')
# print('Вы что! В самом деле!')
# a = 500/1
#
# print(a)
# stroka = 'abrakadabra'
# for element in stroka:
# print(element)
# spisok = [1,2,3]
# new_spisok = []
# for element in spisok:
# new_spisok.append(element*2)
#
# print(new_spisok)
# a = 4
# b = 0
# print(a/b if b != 0 else 0)
# a = 4.0
# b = 4
# print(a is not b)
# my_list = [[10,20,30], [40,50], [60, 70]]
# print(sum(my_list, []))
# a = 2
# b = 3
#
# a,b = b,a
# print(a,b)
my_list = [1,2,3,3,1,2,3,4,5,5,5,3,6,7,4]
print(max(set(my_list), key=my_list.count))
print(my_list.count(3))
# n = 10
# for i in range(1,n,2):
# print(i)