def searchInsert(self, nums, target):
    '\n        :type nums: List[int]\n        :type target: int\n        :rtype: int\n        '
    if ((nums is None) or (len(nums) == 0)):
        return 0
    for i in range(0, len(nums)):
        if (nums[i] == target):
            return i
        elif (nums[i] < target):
            if ((((i + 1) < len(nums)) and (nums[(i + 1)] > target)) or ((i + 1) == len(nums))):
                return (i + 1)
    return 0
:type nums: List[int]
:type target: int
:rtype: int
def searchInsert(self, nums, target):
    '\n        :type nums: List[int]\n        :type target: int\n        :rtype: int\n        '
    if ((nums is None) or (len(nums) == 0)):
        return 0
    for i in range(0, len(nums)):
        if (nums[i] == target):
            return i
        elif (nums[i] < target):
            if ((((i + 1) < len(nums)) and (nums[(i + 1)] > target)) or ((i + 1) == len(nums))):
                return (i + 1)
    return 0