what is the solution of this by python 3 ?
Given an array of integers, return indices of the two numbers such that they add up to a spe
For each entry in the list, check whether there's any other numbers in the list after that number that add up to the target. Since a+b = target is equivalent to b = target - a, you can just take each element, look at all the numbers after that element, and check whether they are target - element. If so, return the indices.
for index,num in enumerate(nums):
if target-num in nums[index+1:]:
return(index, nums.index(target-num))