Create an algorithm that can sort an array of numbers into ascending order.

[5, 2, 8, 1, 4]
user
"""
Algorithm to sort an array of numbers into ascending order
"""

def sort_ascending(nums):
    sorted_list = []
    while nums:
        lowest = nums[0]
        for num in nums:
            if num < lowest:
                lowest = num
        sorted_list.append(lowest)
        nums.remove(lowest)

    return sorted_list

if __name__ == '__main__':
    unsorted = [5, 2, 8, 1, 4]
    print(sort_ascending(unsorted)) #[1, 2, 4, 5, 8]
assistant