Question
Hello. This is a python programming problem I am stuck on. Imagine you are part of the testing team at company XYZ. Your company is
Hello. This is a python programming problem I am stuck on. Imagine you are part of the testing team at company XYZ. Your company is developing a new piece of software that will determine whether or not a string is a palindrome. The development team provides you the following code for testing.
#Function takes a string as a parameter and returns True if the string is a palindrome, False otherwise
def isPalindrome(text):
#Reversing text
rev = text[: : -1]
# Checking if both strings are equal or not
if (text == rev):
return True
return False
Your job as part of the testing team is to determine whether or not this piece of code meets the product requirements in order to be deployed. Use the unittest module to perform unit testing for the function isPalindrome and prove that the function works properly. If the code does not meet the requirements modify the function isPalindrome to work according to the requirements.
# Here are some test cases
>>> isPalindrome("alula")
True
>>> isPalindrome("love")
False
>>> isPalindrome("Madam")
True
>>> isPalindrome(12)
False
>>> isPalindrome(12.21)
False
>>> isPalindrome("Mr. Owl ate my metal worm")
True
# Function takes a string as a parameter and returns True if the string is a palindrome, False otherwise def isPalindrome (text) # Reversing text rev-textl::-1] # Checking if both strings are equal or not if (textrev) return True return False product requirements in order to be deployed. that the function works properly according to the requirements Your job as part of the testing team is to determine whether or not this piece of code meets the .Use the unittest module to perform unit testing for the function isPalindrome and prove If the code does not meet the requirements modify the function isPalindrome to workStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started