Write a Python function that multiplies a matrix by a scalar and returns the result.
matrix = [[1, 2], [3, 4]], scalar = 2
[[2, 4], [6, 8]]
def scalar_multiply(matrix: list[list[int|float]], scalar: int|float) -> list[list[int|float]]: return result