Python - Alternate elements Similarity
Given list of elements, check if all the alternate elements are equal to K. Input : test_list = [5, 3, 5, 2, 5, 8, 9], K = 5 Output : False Explanation : 9 != 5, hence False. Input : test_list = [4, 3, 4, 2, 4], K = 4 Output : True Explanation : All alternates equal to 4. Method #1 : Using loop This