Question: Hello, I need help updating my current Python program to reflect these requirements using Python: 1 . Using either the assertTrue or assertEqual how fix

Hello, I need help updating my current Python program to reflect these requirements using Python: 1. Using either the assertTrue or assertEqual how fix the error I am receiving after running the following code for zigzag function? Write a function zigzag that takes two parameters, a string, and an integer k. It should return a string that has the parameter string spanning k lines in a zig-zag pattern. You may assume the string is all on one line and has letters, digits, punctuation, and spaces only. So tabs, newlines, and other control characters are excluded. Note this should be one long string, so use where needed. For example, with the input "ZigZagString" and k =3 should return the string: Z a r i Z g t i g g S n 2. Code that provides an error and I need help fixing: # Uses the import function to import unittest module import unittest # Creates a class called TestFunctions from unittest module # Utilizes the unittest framework class TestFunctions(unittest.TestCase): # Creates a function called test_is_prime, pass one parameter called self # Tests for prime numbers def test_is_prime(self): # Utilizes the assertTrue or assertFalse to test the boolen logic of a given integer # Tests whether the integer is prime or composite number self.assertTrue(is_prime(2)) self.assertTrue(is_prime(3)) self.assertTrue(is_prime(5)) self.assertTrue(is_prime(7)) self.assertTrue(is_prime(11)) self.assertFalse(is_prime(-1)) self.assertFalse(is_prime(4)) self.assertFalse(is_prime(6.0)) self.assertFalse(is_prime(9)) self.a
ssertFalse(is_prime(7500)) # Creates a function called test_is_anagram, pass one parameter called self # Tests two strings to determine if they are anagrams def test_is_anagram(self): # Utilizes the assertTrue or assertFalse to test the boolen logic for the given strings # Tests whether the strings are anagrams self.assertTrue(is_anagram("listen", "silent")) self.assertTrue(is_anagram("triangle", "integral")) self.assertFalse(is_anagram("apple", "pale")) self.assertFalse(is_anagram("hello", "bello")) self.assertTrue(is_anagram("Clint Eastwood", "Old West Action")) # Creates a function called test_is_anagram_set, pass one parameter called self # Tests a list of strings to determine if they are anagrams def test_is_anagram_set(self): # Utilizes the assertTrue or assertFalse to test the boolen logic for a given list of strings # Tests whether the strings are anagrams self.assertTrue(is_anagram_set(["listen", "silent", "enlist"])) self.assertTrue(is_anagram_set(["triangle", "integral"])) self.assertFalse(is_anagram_set(["apple", "pale"])) self.assertTrue(is_anagram_set(["Clint Eastwood", "Old West Action"])) self.assertFalse(is_anagram_set(["hello", "bello", "mellow"])) # Creates a function called test_is_palindrome, pass one parameter called self # Tests a word or phrase to determine if the string(s) are palindrome def test_is_palindrome(self): # Utilizes the assertTrue or assertFalse to test the boolen logic for a given string(s) # Tests whether the strings are palindromes self.assertFalse(is_palindrome("A man, a plan, a canal, Panama")) self.assertTrue(is_palindrome("racecar")) self.assertFalse(is_palindrome("hello")) self.assertTrue(is_pa

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!