input: Write a function to calculate the standard deviation of a given dataset.
  assert std_dev([20, 25, 30, 35, 40]) == 7.0710678118654755
  assert std_dev([10, 12, 23, 23, 16, 23, 21, 16]) == 4.898979485566356
  assert std_dev([2, 4, 4, 4, 5, 5, 7, 9]) == 2.0
output: def std_dev(data):
      import math
      n = len(data)
      mean = sum(data) / n
      variance = sum((x - mean) ** 2 for x in data) / n
      return math.sqrt(variance)