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
WordArt ____ in the interior of a letter can consist of a solid color, texture, picture, or gradient.
Svetach [21]
WordArt fill in the interior of a letter can consist of a solid color, texture, picture, or gradient. 
3 0
3 years ago
Question 1
PolarNik [594]

Answer:

she is running a maintenance to make sure everything works

6 0
3 years ago
How can you prevent online shopping risks
steposvetlana [31]
<span> Use a secure browse, this will help you monitor the invents happeninig</span>
3 0
3 years ago
Read 2 more answers
The decimal equivalent of the product of 1011 and 1100 is
faltersainse [42]

Answer:

132

Explanation:

We convert each number to base 10 (decimal) and multiply.

So 1011₂ = 1 × 2³ + 0 × 2² + 1 × 2¹ + 1 × 2⁰

= 1 × 8 + 0 × 4 + 1 × 2 + 1 × 1

= 8 + 0 + 2 + 1

= 11₁₀

1100₂ = 1 × 2³ + 1 × 2² + 0 × 2¹ + 0 × 2⁰

= 1 × 8 + 1 × 4 + 0 × 2 + 0 × 1

= 8 + 4 + 0 + 0

= 12₁₀

So, 1011₂ × 1100₂ = 11₁₀ × 12₁₀ = 132₁₀

So, the decimal equivalent of the product of 1011 and 1100 is 132

3 0
3 years ago
What is the one common feature that ties together different social media technologies
Mazyrski [523]
They have the key feature of communication.
All social media encourage us to interact with others, be it with family, friends, known or unknown people.
3 0
3 years ago
Other questions:
  • "giga" can mean both 109 and 230. explain to what each refers. can this cause confusion when reading a computer advertisement?
    15·1 answer
  • What is a series of instructions or commands that a computer follows used to create software
    9·1 answer
  • Que funcion tiene la sombrilla forrada de aluminio​
    6·1 answer
  • Assuming that the actual process ids of the parent and child process are 2600 and 2650 respectively, what will be printed out at
    10·1 answer
  • The ______ is the information center that drivers need to refer to when they're NOT scanning the road.
    14·1 answer
  • A regular polygon is an n-sided polygon in which all sides are of the same length and all angles have the same degree (i.e.,the
    15·1 answer
  • A tracking signal A. is computed as the mean absolute deviation​ (MAD) divided by the running sum of the forecast errors​ (RSFE)
    10·1 answer
  • Two of the major sources used today for obtaining information to create computer maps are satellites and _____________.
    11·2 answers
  • Create a program in c/c++ which accepts user input of a decimal number in the range of 1 -100. Each binary bit of this number wi
    9·1 answer
  • Homework 8 Matlab Write a function called fibonacciMatrix. It should have three inputs, col1, col2, and n. col1 and col2 are ver
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!