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]
4 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]4 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
Mariel types a sentence. She then decides to include that sentence four more times. She then decides she only wants the sentence
Minchanka [31]
CTRL Z and CTRL Y
(undo)_____(redo)
8 0
3 years ago
Read 2 more answers
Which of the following code segments does not contain any errors?
Readme [11.4K]

Answer:

c. double triple(float n) { return (3 * n); }

Explanation:

In option a print is used to print integer.While printf is used in C to print something.

In option b there is no * operator between s s s it should be s*s*s.So it will give error.

In option d there is also no multiply operator * in between 3.14 2 r it should be 3.14*2*r.

So we can say that option c is error free.

8 0
3 years ago
Pls help me awnser this I will give points
joja [24]

Answer:

first one is "int" second one is "string" and third one should be "float"

Explanation:

not sure if the first one is right but try this.

6 0
3 years ago
An example of an "external brain" is:
mojhsa [17]

<u>Answer:</u>

<em>Organize things </em>

<u>Explanation</u>:

It is the <em>duty and power of external brain to Organize ideas</em>. Per day we may have plenty of works to be done. So we start thinking about <em>one by one and finally we try to sort out and organize how to perform, when to do and what is the first and last task etc. </em>

It is the external brain which is helping us to figure it out. But there are certain times where we <em>dump things together</em>, especially when there is an very important like marriage of our family member, where they <em>give lots of responsibilities. </em>

<em>At that time, we have very limited time to work out things and we dump our external brain. </em>

7 0
3 years ago
Read 2 more answers
Jim has listed stages of the product life cycle in his presentation. Which slide element can Jim use to make the items in the li
Sergeeva-Olga [200]
I believe the correct answer is C.
7 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following is an appropriale way to declinc an offer in a<br>professional environment?​
    13·2 answers
  • Exercise 3: Function Write a function named word_count that accepts a string as its parameter and returns the number of words in
    10·1 answer
  • What is the point of having bullets points in a text box
    11·1 answer
  • What is the role of the ieee in computer networking and wireless communications?
    14·1 answer
  • 1. Create an array of ints with 20 elements. With a random number generator, seeded with time, assign a random number between 1
    8·1 answer
  • The _______ is a small program run by a computer when first powered on. its primary function is to stabilize the machine and dev
    11·1 answer
  • What are the Java counterpart to UML attributes.
    6·1 answer
  • All of the following are examples of roadblocks to achieving a goal except
    12·2 answers
  • Builder Software is used to create _____? answers: 3d digital art design for cameras audio special effects
    5·2 answers
  • What is the deck of a suspension bridge called​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!