Question: Mod 1 Homework: Anagrams Write a function word _ compare that takes two arguments. There are three possible return cases: Return the string Anagram if
Mod Homework: Anagrams
Write a function wordcompare that takes two arguments. There are three possible return cases:
Return the string Anagram if the two inputs are anagrams
Return a twotuple a tuple with two items if the two inputs are words but not anagrams
Return the string Those aren't strings! if either input is not a string.
wordcomparerat "tar"
'Anagram'
wordcomparehello "goodbye"
hello 'goodbye'
wordcompare "hello"
"Those aren't strings!"
We'll work through this problem in three parts:
Write a function in a python file
Modify that funtion to use default parameters
Import that function in a different python file
After getting this code to work, you will add a custom test case.
Part
WordCompare.py
Write a function called wordcompare inside a file
WordCompare.py that behaves as above.
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
