Sergey volkovskiy 1st macs aabbcc a1b1c1 link curl -X DELETE https mar

 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
Sergey volkovskiy
#1st
macs = ['aabbcc','a1b1c1']
link = 'curl -X DELETE https://marina.ring.com/'
print([f'{link}{i}' for i in macs])
#2nd_1
my_str = 'abracadabra'
my_list = []
for i in my_str:
my_list.append(my_str.rfind(i))
result = {key:value for key,value in zip(my_str,my_list)}
print(result)
#2nd_2
my_list = [1, 2, 4, 6, 2, 7, 1, 2, 1, 2, 2]
result = {}
for i in my_list:
if i in result:
result[i] += 1
else:
result[i] = 1
for key, value in result.items():
print ("% d : % d"%(key, value))
#3rd
numbers = [1, 2, 3, 4, 5, 6, 6, 6,7, 8, 22]
counter = 0
for i in numbers:
if i%2 ==0:
counter = counter + 1
print(counter)
#4th
num = [0, 3, 3, 6, 12, 7, 4, 21]
result = []
for i in num:
if i == 0:
result.append(i)
elif i%num.index(i) == 0:
result.append(i)
else:
pass
print(result)
#5th
my_str = "quick BROWN fox JUMPS over THE lazy DOG"
result = ""
index = 0
for i in my_str:
if index % 2 == 0:
result += i.upper()
else:
result += i.lower()
index += 1
print(result)