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
When saving a memo you created in Word, which one of the following extensions is automatically assigned to the document?
VMariaS [17]
What are the options and if it's meaning like when you save something it has .pdf .jpg or .doc after the title then it would be ".doc"
8 0
3 years ago
True/False: Each individual element of an array can be accessed by the array name and an element number, called a subscript. Tru
Dahasolnce [82]

Answer:

True

Explanation:

3 0
2 years ago
On Windows computers, applications from Microsoft will not look and act the same as windows and menus from the operating system.
Andrej [43]

True.

Windows is an operating system built by Microsoft. Chrome and Android are operating systems built by Google. MacOS (Macbook pro etc) and iOS (iPhone, iPad, Apple Watch etc) are operating systems built by Apple.

Engineers build applications or apps for all of the above operating systems (OS). For example, Microsoft Word menus will look slightly different on Windows vs on a Mac. The underlying functionality maybe the same but the way it looks may have subtle differences.

Think of the OS as the foundation of a building. Once you have the foundation, you can build a house, a skyscraper, an office building etc depending on what you want to build.

6 0
2 years ago
Read 2 more answers
What is the best response to cyberbullying?
astra-53 [7]
Answer is C





Braine list please:)
5 0
3 years ago
Read 2 more answers
What was named the worst game ever?
Schach [20]

Answer:

Fortnight

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • Write a program that prompts the user to enter the year and the first three letters of a month name (with the first letter in up
    8·1 answer
  • IT investments can lead to developing IT capabilities and dynamic IT competencies, which can lead to achieving the following six
    5·1 answer
  • If none of the contacts of a manual switch change status when the operator is activated, what is the most probable cause?
    9·1 answer
  • In the view that follows, which field can't be updated create view example_2 as select invoice_number, invoice_date, invoice_tot
    13·1 answer
  • One of the most common uses of spreadsheet are
    8·1 answer
  • Which shortcut key combination will move the cursor to the beginning of the line?
    13·1 answer
  • What methods would you add to make this class declarationvery useful?
    11·2 answers
  • After data is collected, how is it analyzed?
    10·1 answer
  • How to create create a database in mysql using clv files
    11·1 answer
  • In cell b12 create a formula using max f7nction to calculate maximum value in B4:B9
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!