0
def type_of_equality(list1, list2):
new_string = ""
if list1 == list2:
new_string += "value"
return new_string
elif list1 != list2:
new_string += "not equal"
return new_string
elif list1 is list2:
new_string += "reference"
return new_string
동등한 가치의 측면 여부에 참조 측면에서 동일한 동일한 경우, 나는이나는 두 개의 목록이
x = [1,2,3]
y = x
print(type_of_equality(x, y))
출력이되어야한다 참조를 시도 대신 출력 인 경우 알아낼 필요 같은. 어떻게 수정해야합니까?
'x == y'. 'x는 y'도 그렇지만 결코 일어나지 않습니다. – user2357112
참조보다 빨리 값을 확인하고 있습니다! – Kasramvd
오, 이해합니다. 내 잘못. –