class Solution:
def search(self, nums: List[int], target: int) -> int:
return nums.index(target) if target in nums else -1
猜你喜欢:👇🏻
⭐【Python】find()函数居然还能指定搜索的起点和终点?
⭐【Python】一种超简单的二维列表降维方法
⭐【Python】list转str
class Solution:
def search(self, nums: List[int], target: int) -> int:
return nums.index(target) if target in nums else -1
猜你喜欢:👇🏻
⭐【Python】find()函数居然还能指定搜索的起点和终点?
⭐【Python】一种超简单的二维列表降维方法
⭐【Python】list转str