我的问题是,如果我的列表是...,我如何在列表中找到具有相同字符数的字符串?
myList = ["Hello", "How","are", "you"]
我希望它返回值为 3 的字符串
上面列表中的示例...
["How","are","you"]
这是我试过的...
def listNum(myList, x):
for i in range(len(myList)):
if i == x:
return(i)
myList = ["Hello", "How","are", "you"]
x = 3
listNum(myList, x)
qq_花开花谢_0
慕的地6264312
三国纷争
相关分类