1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
harkovskaia [24]
3 years ago
13

Write a function that checks whether two words are anagrams. Two words are anagrams if they contain the same letters. For exampl

e, silent and listen are anagrams. The header of the function is:
def isAnagram(s1, s2):

(Hint: Obtain two lists for the two strings. Sort the lists and check if two lists are identical.)

Write a test program that prompts the user to enter two strings and checks whether they are anagrams.

Sample Run 1

Enter a string s1: silent

Enter a string s2: listen

silent and listen are anagrams

Sample Run 2

Enter a string s1: split

Enter a string s2: lisp

split and lisp are not anagrams

Computers and Technology
1 answer:
Masteriza [31]3 years ago
4 0

Answer:

def isAnagram(s1, s2):

   list1=s1

   list2=s2

   sortedlist1 = sorted(list1)

   sortedlist2 = sorted(list2)

   if sortedlist1 == sortedlist2:

       print(list1+ " and "+list2+ " are anagram")

   else:

       print(list1+ " and "+list2+ " are not anagram")

Explanation:

Here is a call to the function isAnagram():

list1 =input("Enter String1 ")

list1 =input("Enter String2 ")

isAnagram(list1,list2)

Attached is the run and output for this program

You might be interested in
Can someone please give me two (2) thesis statement for this question?
ira [324]

Answer: On a personal note it has changed not a bit, i go to online school so nothing has changed.

Explanation:

3 0
3 years ago
How do you get to the homepage?
ratelena [41]

Answer:

Press the big clear logo that says "BRAINLY"

4 0
2 years ago
How to become a software tester?
Delicious77 [7]

Answer:

<em>Certified Software Tester (CSTE): This certification often requires a bachelor's degree and two years of relevant experience, or six years of experience with no degree, to qualify for the test</em>

6 0
2 years ago
Read 2 more answers
Subscribe to (Thicc sickqueen) and like 2 vids and the claim your prize
lara [203]

Answer:

done

Explanation:

5 0
4 years ago
Horizontal and vertical scaling usually refer to increasing the capacity of
salantis [7]

Answer:

I think servers and networks.

3 0
3 years ago
Other questions:
  • A _______ is the most commonly used input device.
    5·2 answers
  • What is a project manager?
    6·2 answers
  • What is the most significant result based on the development of windmills and water wheels?
    13·1 answer
  • Do the pros of interpersonal communication via social media outweigh the cons? Explain.
    9·2 answers
  • Comparing tools made of stone, iron, and bronze: place them in the correct order from least to most durable
    14·1 answer
  • Write an expression that evaluates to true if the value of the integer variable numberOfPrizes is divisible (with no remainder)
    13·1 answer
  • 9) If you are working on the part of 5-15 minutes, time-stamping (every 30 seconds) should start at: a) [00:05:00] b) [00:00:00]
    13·1 answer
  • Create the Following Menu in a loop so the menu will continually show until the user chooses to exit.AddMultiplyExitAdd a value
    10·1 answer
  • Master pages are used to create
    7·1 answer
  • Select the correct answer.
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!