Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I would appreciate it if you can check whether my code is correct and write 5 pytests for different cases for it. The Pytest format
I would appreciate it if you can check whether my code is correct and write 5 pytests for different cases for it.
The Pytest format is :
def test_function name_1:
assert function name==blablabla
def multiplyScalarMatrix (matrixl, scalar): Input: matrixl is a list, scalar is an integer. If incorrect input types are given, return None. Otherwise, return the list that represents a matrix that is the product of matrixl and scalar. if type (matrixl) !=list or type (scalar) !=int: return None for i in range (len (matrixl)): for j in range (len (matrixl[i])): matrixl[i][j] *= scalar return matrixl def multiplyScalarMatrix (matrixl, scalar): Input: matrixl is a list, scalar is an integer. If incorrect input types are given, return None. Otherwise, return the list that represents a matrix that is the product of matrixl and scalar. if type (matrixl) !=list or type (scalar) !=int: return None for i in range (len (matrixl)): for j in range (len (matrixl[i])): matrixl[i][j] *= scalar return matrixlStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started