if str.startswith("Atwood_1_F", beg=0,end=len(string)-1);
elif str.startswith("Atwood_1_B", beg=0,end=len(string)-1); //the -1 in both statments only serve to denote the F from F2 as len(string)-1 on F will be "_" but the same from F2 will be "F"
Pair1.append(str)
所以如果我理解正确的话,你需要两个列表?或者你需要两个包含文件的变量?在这两种情况下,startswith()方法都应该启动。只需在列表中调用它(或以其他方式),然后设置字符串的开头。除非我误解了你的问题,否则你应该能够使用如下方法:
你只需要再加上Pair2,如果我能理解的话,这应该能回答你的问题。如果我帮了忙就告诉我。你知道吗
相关问题 更多 >
编程相关推荐