Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored 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