Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#Write a function called are_anagrams. The function should #have two parameters, a pair of strings. The function should #return True if the strings are anagrams

#Write a function called are_anagrams. The function should

#have two parameters, a pair of strings. The function should

#return True if the strings are anagrams of one another,

#False if they are not.

#

#Two strings are considered anagrams if they have only the

#same letters, as well as the same count of each letter. For

#this problem, you should ignore spaces and capitalization.

#

#So, for us: "Elvis" and "Lives" would be considered

#anagrams. So would "Eleven plus two" and "Twelve plus one".

#

#Note that if one string can be made only out of the letters

#of another, but with duplicates, we do NOT consider them

#anagrams. For example, "Elvis" and "Live Viles" would not

#be anagrams.

#Write your function here!

#Below are some lines of code that will test your function.

#You can change the value of the variable(s) to test your

#function with different inputs.

#

#If your function works correctly, this will originally

#print: True, False, True, False, each on their own line.

print(are_anagrams("Elvis", "Lives"))

print(are_anagrams("Elvis", "Live Viles"))

print(are_anagrams("Eleven plus two", "Twelve plus one"))

print(are_anagrams("Nine minus seven", "Five minus three"))

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Medical Image Databases

Authors: Stephen T.C. Wong

1st Edition

1461375398, 978-1461375395

More Books

Students also viewed these Databases questions