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
In Microsoft Word, when you highlight existing text you want to replace, you are in
Andreyy89
<span>In Microsoft Word, when you highlight existing text you want to replace, you are in insert mode. You know if you are in insert mode if</span><span> you see the word "Insert" in the Status bar and any text you paste in will push aside text on either side of the cursor.</span>
6 0
3 years ago
____ data refers to signals representing sound, temperature and car speed. These signals
taurus [48]

Answer:

digital

Explanation:

dspDigital signal processing (DSP) is the use of digital processing, such as by computers

8 0
3 years ago
The ____ cell on the worksheet is the one into which you can enter data.â
Illusion [34]

I guess the best answer is Active.

The Active cell on the worksheet is the one into which you can enter data.

3 0
3 years ago
Read 2 more answers
You have one address, 196.172.128.0 and you want to subnet that address. You want 10 subnets. 1. What class is this address
Korvikt [17]

Answer:

This address is by default a class c network

Explanation:

This IP address in this question is a class c network because it has 196 as its first octet. A class c network is one which has its first octet to be between 192 and 223. the class c network begins with a 110 binary.  If ip is between 192 to 223 it belongs to this class. These first 3 octets are the representation of the network number in the address. Class c's were made to support small networks initially.

8 0
3 years ago
Inputs to a system that can enhance performance is called
disa [49]
Inputs to a system that can enhance performance is called Resources
6 0
3 years ago
Read 2 more answers
Other questions:
  • Society that lives a nomadic life and relies on domesticated animals.
    6·1 answer
  • Which term is used to describe bitmap images
    8·2 answers
  • Which group and tab do you need to be in to separate text into two columns? Paragraph group and Insert tab Page Layout group and
    8·1 answer
  • What are the text or graphics that are lighter than the main text located in a document's background called?
    10·1 answer
  • A 'array palindrome' is an array which, when its elements are reversed, remains the same (i.e., the elements of the array are sa
    13·1 answer
  • Write a function checkPalindrome that accepts a single argument, a string. The function should return true (Boolean) if the stri
    15·1 answer
  • What is the name of the process that weighs the alternatives, gathers all necessary information, and can ultimately lead you to
    9·2 answers
  • It is an island country; it fought against us in World War II; it is known for sushi.
    14·2 answers
  • I have a .NET 6 basic website that I built using Entity Framework as the database for updating pages. I am ready to deploy the s
    10·1 answer
  • What can you achieve if you divide your search engine marketing account into relevant campaigns and ad groups?.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!