-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuestion5.py
More file actions
38 lines (29 loc) · 720 Bytes
/
Question5.py
File metadata and controls
38 lines (29 loc) · 720 Bytes
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
# List one
# creating an empty list_one
X = []
# number of elements as input
n = int(input("Enter number of elements for the first list : "))
# iterating till the range
for i in range(0, n):
ele = int(input())
X.append(ele) # adding the element
print(X)
# creating an empty list_two
Y = []
# number of elements as input
n = int(input("Enter number of elements for the second list: "))
# iterating till the range
for i in range(0, n):
ele = int(input())
Y.append(ele) # adding the element
print(Y)
# Checking whether ∀x ∈ X, ∃y ∈ Y such that y | x
count = 0
for i in X:
for j in Y:
if j%i == 0:
count +=1
if count > 1:
print("True")
else:
print("false")