Periksa apakah semua elemen dalam daftar sama
# check if all elements in list are equal
my_list = [1, 1, 1, 1, ]
def check_if_equal(list):
if len(set(list)) == 1:
print('True') # output True
else:
print('False')
check_if_equal(my_list)
Impossible Impala