[Python] python判断元素在列表中的索引位置 →→→→→进入此内容的聊天室

来自 , 2021-04-08, 写在 Python, 查看 152 次.
URL http://www.code666.cn/view/d728587f
  1. list = ["red","green","blue"]
  2.  
  3. assert list.index("red") == 0
  4. assert list.index("blue") == 2

回复 "python判断元素在列表中的索引位置"

这儿你可以回复上面这条便签

captcha