input: Write a function to find the smallest number in a given list. The function should iterate through each element in the list, compare it with the current smallest number, and update the smallest number if the current element is smaller. If the list is empty, the function should return None.
  assert smallestNumber([4, 5, 6, 7, 8])==4
  assert smallestNumber([9, 2, 1, 7, 8])==1
  assert smallestNumber([10])==10
  assert smallestNumber([])==None
output: def smallestNumber(lst):
      if not lst:
          return None
      smallest = lst[0]
      for num in lst:
          if num < smallest:
              smallest = num
      return smallest