Posts

Showing posts with the label set
 Prorgram is: # #           Equality elements lists, sets, dictionaries # Elem_A = 10 Elem_B = 10 Elem_C = 15 List_A = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] List_B = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] List_C = [1,2,3,3,3,6,7,8,9,10] Set_A = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} Set_B = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} Set_C = {1, 2, 3, 3, 3, 3, 7, 8, 9, 10} Dictionary_A = {1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7, 8:8, 9:9, 10:10} Dictionary_B = {1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7, 8:8, 9:9, 10:10} Dictionary_C = {1:1, 2:2, 3:3, 4:3, 5:3, 6:3, 7:7, 8:8, 9:9, 10:10} def compare(X,Y):     if X == Y:         Alfa = True     else:         Alfa = False     return Alfa print(' Element equality') Elem_Test_AB = compare(Elem_A,Elem_B) print('Element A is equal to element B? Result is:', Elem_Test_AB) Elem_Test_AC = compare(Elem_A,Elem_C) print('Element A is equal to element C? Result is:', Elem_Test_AC) print(' Lis...