classSolution: deftwoSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ for index, num in enumerate(nums): num2 = target - num if num2 in nums: index2 = nums.index(num2) if index != index2: return [index, index2]