Question: Hello, I need help writing a program in Python: Instructions: Write a series of functions and testing functions. Your program when executed, with all of

Hello, I need help writing a program in Python:
Instructions:
Write a series of functions and testing functions. Your program when executed, with all of the tests should run and no output generated.
Your tests will cover all of the functionality of the function and a range of the types. For instance, if you have a conditional statement, you should have a test that takes the true branch and another that takes the false branch. You should have at least different 5tests per function.
Primality Testing:
Write a function is_prime that takes in an int parameter and returns a bool if the number is prime. The function should use nave trial division with the acceleration that prime numbers other than 2or 3are not multiples of 2or 3.Similar to the characterization of the primes modulo 6(ie 2*3).This means your primary divisor loop should skip in multiples of 6,known as optimization. It is ok to research this optimization, make sure to cite any references you use. You need to exhaustively test your function for every number below 7500. You should have five tests in total.
Anagrams Testing:
An anagram is a set of two or more words or phrases that use the same letters. Write two complementary functions, is_anagram which takes in two strings, and is_anagram_set which takes in a set of strings. Both functions should return True only if all of the strings are mutually anagrams. They should return False otherwise. Your is_anagram_set should use is_anagram in its implementation. Only letters are considered for anagrams. Spaces and punctuation are ignored. You should have five tests for is_anagram and five tests for is_anagram_set.
Palindromes Testing:
A palindrome is a word or phrase that uses the same letters forward and backward. Write a function is_palindrome that returns True or False as appropriate. Again, only letters are considered for anagrams. Spaces and punctuation are ignored. You should have five tests in total.
ZigZag
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 =3should return the string:
Z a r
i Z g t i g
g S n

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!