0
한 열의 모든 값이 같으면 true를 반환하는 메서드를 만드는 방법은 무엇입니까? methodhead의다차원 목록의 모든 값이 동일한 지 확인하십시오.
myListtrue = [['SomeVal', 'Val',True],
['SomeVal', 'blah', True]] #Want this list to return true
#because the third column in the list
#are the same values.
myListfalse = [['SomeVal', 'Val',False],
['SomeVal', 'blah', True]] #Want this list to return False
#because the third column in the list
#is not the same value
same_value(myListtrue) # return true
same_value(myListfalse) # return false
예 :
def same_value(Items):
#statements here
# return true if items have the same value in the third column.
초고속 응답! 대단히 감사합니다. 이것은 완벽하게 작동합니다! –