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
A type of touch screen that can be up to four feet by six feet is a(n) _____.
Llana [10]
Hi,

A type of touch screen that can be up to four feet by six feet is a(n) <span>multitouch interface.
</span>.
7 0
2 years ago
Read 2 more answers
In the scenario below, select the evaluation factor that is most important.
jasenka [17]

Answer:

A. Connectivity

Explanation:

I just answered this question.

4 0
2 years ago
1:A presentation program which is developed by Microsoft
LekaFEV [45]
Option 3: PowerPoint.
4 0
2 years ago
Read 2 more answers
Jasmine is writing a shopping app. She has created a variable to keep track of the number of items in the shopping cart. Everyti
Gemiola [76]

Answer:

b. cart total + 1

Explanation:

A. cart total=1 do increment the total with every 1 click here, it only 're-assigns cart total with value 1 for every click, hence it's always 1.

B. In every click, 1 is always added to the previous value of cart total, like addItemButton(cart total+1) or so.

C. This would have worked too if "cart total" and "cartTotal" where of same type.

D. cart total is just being initially defined here.

E. Likewise here, var shows that cart total has just only been declared.

6 0
2 years ago
Create a class called Circle, which has (i) an attribute radius, (ii) a method that returns the current radius of a circle objec
nadya68 [22]

Answer:

Explanation:

The following class is written in Java. I created the entire Circle class with each of the methods and constructor as requested. I also created a tester class to create a circle object and call some of the methods. The output can be seen in the attached picture below for the tester class.

class Circle {

   double radius;

   public Circle(double radius) {

       this.radius = radius;

   }

   public double getRadius() {

       return radius;

   }

   public void resetRadius() {

       radius = 0;

   }

   public double calculateArea() {

       double square = Math.pow((Math.PI * radius), 2);

       return square;

   }

}

8 0
2 years ago
Other questions:
  • You can use Facebook's live feed tool to broadcast content as you post it
    8·2 answers
  • The part of the poppet valve that contacts the valve seat is called the A. face. B. margin. C. head. D. stem.
    6·2 answers
  • How to see the range of values of vty lines?
    15·1 answer
  • Please answer this a due tomorrow!!!
    5·1 answer
  • Write a function safeOpen() that takes one parameter, filename — a string giving the pathname of the file to be opened for readi
    15·1 answer
  • why is the disk method a special case of the general slicing​ method? choose the correct answer below. a. the cross sections of
    7·1 answer
  • A motorist is using the AHP to choose a new car from three possible models Arrow, a Bestmobile and a Commuter. The choice will a
    15·2 answers
  • Write a program that: Takes the list lotsOfNumbers and uses a loop to find the sum of all of the odd numbers in the list (hint:
    5·1 answer
  • Which is an example of a demand account
    10·1 answer
  • Write a boolean expression that is true if s references the string end.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!