-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path8.2.py
More file actions
75 lines (66 loc) · 1.21 KB
/
Copy path8.2.py
File metadata and controls
75 lines (66 loc) · 1.21 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
"""
/step/1
n = int(input())
s = 0
while n > 0:
if n % 10 % 2 == 0:
s += n % 10
n //= 10
print(s)
/step/2
n = 8 #
count = 0
maximum = -10 ** 6 - 1 #
for i in range(n):
x = int(input())
if x % 4 == 0: #
count += 1
if x > maximum:
maximum = x
if count > 0:
print(count)
print(maximum)
else:
print('NO')
/step/3
n = 4
count = 0
maximum = 0
for i in range(1, n + 1):
x = int(input())
if x % 2 != 0:
count += 1
if x > maximum:
maximum = x
if count > 0:
print(count)
print(maximum)
else:
print('NO')
/step/4
n = int(input())
for i in range(1, n+1):
if i==1 or i==n:
print('*'*19)
else:
print('*' + ' ' * 17 + '*')
/step/5
n = input()
print(n[2])
/step/6
from numpy import prod
n = input()
print(len([i for i in n if i=='3']))
lastDigit = n[-1]
print(len([i for i in n if i==lastDigit]))
print(len([i for i in n if int(i)%2==0]))
print(sum([int(i) for i in n if int(i) > 5]))
print(int(prod([int(i) for i in n if int(i) > 7])))
print(len([i for i in n if i=='0' or i=='5']))
/step/7
1 число = 1729
2 число = 4104
3 число = 13832
4 число = 20683
5 число = 32832
"""