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
Complete the statement by entering the appropriate term in the space below.
Vera_Pavlovna [14]

Answer:

Probably "compress", but these days the common answer is "upload to cloud".

Explanation:

Compressing the files is an easy way to reduce their size, unless most of the size is in already compressed, high-entropy formats (like mp3, jpeg or mp4).

The common compression format is .ZIP - you've probably seen it countless times, but other ways like RAR, 7Z are also popular, while Linux users mostly deal with tar.gz, tar.bz2 or tar.xz

On the other hand, the standard practice these days is to upload the presentation to a cloud service, like GSheets or Office PowerPoint 365, which gets rid of the limits of email filesize, while providing a convenient web-app way to view the presentation without downloading (and it doesn't clutter their inbox space or hard drives)! Alternatively, one other way to email any large file (not just a presentation) includes uploading it to some service like DropBox, GDrive or anything similar.

7 0
3 years ago
Read 2 more answers
Which wireless technology connects with most mobile devices?
LenaWriter [7]

Answer:

¡) Internet

¡¡) Alexa

¡¡¡) Electronic Devices

8 0
2 years ago
Which of the following tasks would least help an individual achieve a goal to safely lose weight?
ozzi
To continue to look at motivational or inspirational quotes to remind them or to remember how far you have come and it is not time to give up!
7 0
3 years ago
Read 2 more answers
You are building a computer from spare parts in the office. You build the computer and realize you have several different types
san4es73 [151]

Answer:

The pin count is the same

Explanation:

5 0
3 years ago
Employees are one of the main contributors to cybersecurity breaches because of _____? Select 3 options.
Tema [17]

Answer: inattention, lack of knowledge, and negligence.

Explanation: employees are often the cause of workplace incidents because they may be unknowledgeable about security protocols, negligent, or simply make a mistake.

5 0
3 years ago
Other questions:
  • Spreadshet formula to add totals​
    12·1 answer
  • What are examples of some Exotic currencies?
    14·1 answer
  • Internally, computers are constructed from circuitry that consists of small on/off switches. What is the most basic circuitry-le
    12·1 answer
  • What are informational sessions?
    15·1 answer
  • What the meaning of ethics
    14·1 answer
  • mr. Jones put the same amount of soil around each of the five plants he has six bags of soil how many bags of potting soil did m
    14·1 answer
  • jakie krasnale mieszkaja we wroclawiu i opisz kto napisal kronike, prosze nie kopiowac dlugich tekstow najlepiej by bylo opisac
    6·1 answer
  • An administrator has created a new custom object in a sandbox environment and now is ready to deploy in production. How can the
    11·1 answer
  • Suppose a host has a 1-MB file that is to be sent to another host. The file takes 1 second of CPU time to compress 50%, or 2 sec
    12·1 answer
  • fill in the balenkes ) 1)there are ................................... function keys on the keybord 2)pressing the end key moves
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!