itertools
# Sequence comparisonsimport itertools# define some listsseq_1 = [1, 2, 3, 6, 10, 15, 34, 56]seq_2 = [1, 2, 5, 7, 9, 18, 22, 38, 91]# define a tupleseq_3 = (1, 2, 3, 6, 10, 15, 34, 56)# compare the sequences# seq_1 vs seq_2print(f"Is seq_1 is equal to seq_2: {seq_1 == seq_2}") # two sequences are obviously different.print(f"Is seq_1 is greater than seq_2: {seq_1 > seq_2}") # third valus of seq_1..
Python
2025. 4. 26. 18:32