Home / Expert Answers / Computer Science / in-python-nbsp-write-a-function-called-has-zeroes-that-takes-a-list-of-ints-as-a-parameter-and-r-pa164

(Solved): IN PYTHON  Write a function called has_zeroes that takes a list of ints as a parameter and r ...



Write a function called has_zeroes that takes a list of ints as a parameter and returns True if the list contains a 0, and re

IN PYTHON 

Write a function called has_zeroes that takes a list of ints as a parameter and returns True if the list contains a 0, and returns False otherwise. Run this test program to determine if your code is correct: assert has_zeroes \( ([0,1,2])== \) True, "Error: the list \( [0,1,2] \) does have a 0 " assert has_zeroes \( ([1,2,3])== \) False, "Error: the list \( [1,2,3] \) does not have a 0 " assert has_zeroes \( ([2,1,0])== \) True, "Error: the list \( [2,1,0] \) does have a 0 " assert has_zeroes \( ([0])== \) True, "Error: the list [0] does have a \( 0^{\prime \prime} \) assert has_zeroes \( ([])== \) False, "Error: the list [] does not have a \( 0^{\prime \prime} \) print("All tests passed!") When your program outputs "All tests passed!", paste your code in the essay box.


We have an Answer from Expert

View Expert Answer

Expert Answer


Assert is keyword that is used to test the test cases at the debugging time ->It is used as a debugging tool. syntax: ->assert expr, msg ->if expr is
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe