def FunTest():
length = 0
list1 = []
values1 = input("list1= ")
list1.append(values1)
list2 =[]
values2 = input("list2= ")
list2.append(values2)
if(len(list1) > len(list2)):
length = len(list1)
elif(len(list1) < len(list2)):
length = len(list2)
elif(len(list1) == len(list2)):
length = len(list2)
for i in range(0, length):
for j in range(0, length):
if list1[i] == list2[j] :
print("True")
break;
FunTest()
또 왔다 얘더라
[1,2]
[3,2] 이런 식으로 입력받으면 True 출력하는건데 진짜 왜 나만안대냐고
for문 안에 있는 length를 각각 len(list1), len(list2)로도 해봤는데 구것도 아니구 ㅠ
입력 왜 저럼?
오빠 제발 알려저
입력이 [1,2] 이렇게 들어온다면 list1 = [] values1 = input("list1= ") list1.append(values1) 말고 list1 = [...]) 이렇게 받아보셈
물론 list2도 동일하게
eval이 뭐야?? 그 방법대로 하니까 풀리네
그건 알아서 구글에 찾아보셈
고마어~