input: Write a function to rewrite the given Python code by introducing list comprehensions. The function should accept a range start, range end, and a condition to filter the numbers, and return the list of numbers that satisfy the condition. If the condition is not provided, the function should return all numbers in the range.
  assert list_comprehension(1, 21, lambda x: x % 2 == 0) == [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
  assert list_comprehension(1, 21, lambda x: x % 3 == 0) == [3, 6, 9, 12, 15, 18]
  assert list_comprehension(1, 21) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
  assert list_comprehension(10, 21, lambda x: x % 5 == 0) == [10, 15, 20]
  assert list_comprehension(20, 30) == [20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]
output: def list_comprehension(start, end, condition=None):
      if condition:
          return [x for x in range(start, end) if condition(x)]
      else:
          return [x for x in range(start, end)]