-
Notifications
You must be signed in to change notification settings - Fork 0
/
BVV_ISaP_13_PW39.py
60 lines (43 loc) · 1.14 KB
/
BVV_ISaP_13_PW39.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
#PW 39
#Problem 1
def input_array(input_text):
numbers = []
try:
numbers = input(input_text).split()
except:
print("Uncorrect input!")
numbers = []
return numbers;
input_list = []
duplicates = []
while len(input_list) < 1:
input_list = input_array("Enter array: ")
for el in input_list:
if input_list.count(el) > 1 and el not in duplicates:
duplicates.append(el)
if len(duplicates) > 0:
print(f"Dublicates: {duplicates}")
else:
print("List don't have dublicates")
input("\nContinue ->")
#PW 39
#Problem 2
def input_int_array(input_text):
numbers = []
try:
numbers = input(input_text).split()
for i in range(0, len(numbers), 1):
numbers[i] = int(numbers[i])
except:
print("Uncorrect input!")
numbers = []
return numbers;
input_list = []
exit_list = []
while len(input_list) < 1:
input_list = input_int_array("Enter int list: ")
for i in input_list:
if i % 2 == 0:
exit_list.append(i)
exit_list.reverse()
print(f"Exit list: {exit_list}")