1 つの列のすべての値が同じ場合に true を返すメソッドを作成するにはどうすればよいですか。
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.