我是 python 的绝对初学者,我需要编写一个可以区分两个列表的代码。总体代码仍然有效,始终不考虑列表的最后一个元素,并且诸如“AT,AC”之类的列表被认为是相同的。我希望得到一些帮助。谢谢 !
Seq1 = input( " Enter first sequence ")
Seq2 = input(" Enter second sequence ")
seq1 = list(Seq1)
seq2 = list(Seq2)
def compare_seq(seq1,seq2):
if len(seq1) != len(seq2):
print(" The sequences differ by their length ")
exit()
else:
for i in range(len(seq1)) :
if seq1[i] == seq2[i]:
print(" The sequences are the same ")
exit()
else :
print(" Sequences differ by a/mulitple nucleotide ")
exit()
compare_seq(seq1,seq2)
白衣非少年
潇湘沐
慕运维8079593
MM们
相关分类