Answered step by step
Verified Expert Solution
Question
1 Approved Answer
# Tests for hasMultiplesOf def test_hasMultiplesOf_1 (): assert hasMultiplesOf(3, [ - 3, 0, 3, 6]) == True def test_hasMultiplesOf_2 (): assert hasMultiplesOf(3, [ - 3,
# Tests for hasMultiplesOf def test_hasMultiplesOf_1(): assert hasMultiplesOf(3, [-3, 0, 3, 6]) == True def test_hasMultiplesOf_2(): assert hasMultiplesOf("3", [-3, 0, 3, 6]) == False def test_hasMultiplesOf_3(): assert hasMultiplesOf(3, (-3, 0, 3, 6)) == False def test_hasMultiplesOf_4(): assert hasMultiplesOf(1.1, [1.1, 2.2, 4.4]) == True def test_hasMultiplesOf_5(): assert hasMultiplesOf(5, []) == False
def hasMultiplesOf(x, listOfNums): ''' - Returns True if ALL items in listOfNums are multiples of x. - theList can have elements of any type. - If listOfNums is not a list type, return False. - If listOfNums is empty, return False since no items are a multiple of x - If listOfNums contains an element that is not a number (int or float), return False. ''' return "stub"
Step 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