class Solution():
def twoSum(self,nums,target):
s=[]
for i in nums:
a=target-i
if a in nums:
s.append(i)
s.append(a)
for n,m in enumerate(nums):
if m==a or m==i:
s.append(n)
return s
if __name__ == '__main__':
a=Solution()
print(a.twoSum([1,2,3,4,6],7))