Design an algorithm in Python to search a list of numbers for a particular number and return the index at which the number is located.
def search(nums, target):
    for i, num in enumerate(nums):
        if target == num:
            return i
    return -1