Deep-ML is a free, open-source machine learning challenge platform. Practice ML coding problems, work with real datasets in labs, and learn through interactive articles.
Please enable JavaScript to use the full platform.
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]]
Each element of the matrix is multiplied by the scalar.
Moe Chabot