Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 matrixl

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions