Answered step by step
Verified Expert Solution
Link Copied!

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

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions

Question

8. explain when to use imagery.

Answered: 1 week ago