Two sum question from leet code

class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
l1 = []
di = {}
for idx,number in enumerate(nums):
if target - number in di.keys():
l1.apppend(di[target-number])
l1.append(idx)
di[number] = idx
return l1

how to resolve the error

Hello, your soln is alright just correct the spelling of append in this l1.apppend(di[target-number])
and if you get the answer then just return l1 thereafter,

def twoSum(self, nums: List[int], target: int) -> List[int]:
    l1 = []
    di = {}
    for idx,number in enumerate(nums):
        if target - number in di.keys():
            l1.append(di[target-number])
            l1.append(idx)
            return l1
        di[number] = idx
    return l1        

This is working fine, now. I hope you understand this in case it is clear to you pls mark it as resolve and provide the ratings and feedback so that we can improve our services.
In case you want to ask something you can surely ask I will help you out.
Thanks :slight_smile:
Happy Coding !!