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: 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 zigzag 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 should return the string: Z a r i Z g t i g g S n 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 TestFunctionsunittestTestCase: # Creates a function called testisprime, pass one parameter called self # Tests for prime numbers def testisprimeself: # Utilizes the assertTrue or assertFalse to test the boolen logic of a given integer # Tests whether the integer is prime or composite number self.assertTrueisprime self.assertTrueisprime self.assertTrueisprime self.assertTrueisprime self.assertTrueisprime self.assertFalseisprime self.assertFalseisprime self.assertFalseisprime self.assertFalseisprime self.a
ssertFalseisprime # Creates a function called testisanagram, pass one parameter called self # Tests two strings to determine if they are anagrams def testisanagramself: # Utilizes the assertTrue or assertFalse to test the boolen logic for the given strings # Tests whether the strings are anagrams self.assertTrueisanagramlisten "silent" self.assertTrueisanagramtriangle "integral" self.assertFalseisanagramapple "pale" self.assertFalseisanagramhello "bello" self.assertTrueisanagramClint Eastwood", "Old West Action" # Creates a function called testisanagramset, pass one parameter called self # Tests a list of strings to determine if they are anagrams def testisanagramsetself: # Utilizes the assertTrue or assertFalse to test the boolen logic for a given list of strings # Tests whether the strings are anagrams self.assertTrueisanagramsetlisten "silent", "enlist" self.assertTrueisanagramsettriangle "integral" self.assertFalseisanagramsetapple "pale" self.assertTrueisanagramsetClint Eastwood", "Old West Action" self.assertFalseisanagramsethello "bello", "mellow" # Creates a function called testispalindrome, pass one parameter called self # Tests a word or phrase to determine if the strings are palindrome def testispalindromeself: # Utilizes the assertTrue or assertFalse to test the boolen logic for a given strings # Tests whether the strings are palindromes self.assertFalseispalindromeA man, a plan, a canal, Panama" self.assertTrueispalindromeracecar self.assertFalseispalindromehello self.assertTrueispa
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
