def two_sum(nums, target):
    """Returns a list of index of two numbers if the sum of them
    is equal to target number, None otherwise"""
    seen = {}
    for index, num in enumerate(nums):
        another = target - num
        if another in seen:
            return [seen[another], index]
        else:
            seen[num] = index
    return "No such pair in the list"