-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon value.py
More file actions
33 lines (24 loc) · 962 Bytes
/
common value.py
File metadata and controls
33 lines (24 loc) · 962 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
def main():
list_a = []
list_b = []
list_a_digits = int(input("There are two lists you must fill out. For the first list, enter how many numbers you are adding to the list: "))
list_a_digits += 1
w = 1
y = 1
#While loop keeps adding user input to a list
while w < list_a_digits:
add_number_a = int(input("Add number to the list: "))
list_a.append(add_number_a)
w+=1
list_b_digits = int(input("This is now the second list. How many digits you are adding to this second list: "))
while y < list_b_digits:
add_number_b = int(input("Add number to the list: "))
list_b.append(add_number_b)
y+=1
for i in list_a:
for x in list_b:
if i == x:
print(x)
#For every number in list a, compare with number in list b. check if it matches with a number in list_b.
while True:
main()