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
Which DHCPv4 message will a client send to accept an IPv4 address that is offered by a DHCP server? (Points : 5) Unicast DHCPACK
gogolik [260]

Answer: Broadcast DHCPREQUEST

Explanation:

The DHCPv4 broadcast the DHCP REQUEST message by the client for accepting an IPv4 address which is basically offer by the server.

The DHCP REQUEST indicate that type of server that are basically chosen by the client for further interaction.

The DHCPREQUEST message basically used to notify that the client decline or accept the offer of server. In the DHCP protocol, it basically allow for broadcasting the individual destination in the network. The server basically sent the DHCP OFFER for receiving the DHCP REQUEST.

 

4 0
3 years ago
Diligent people are as concerned with the ____ as the ___ of their work
Ksivusya [100]

Answer:

Duration; quality/correctness.

Explanation:

Diligence is a way of life. It adds value to a piece of work. When a work is diligently done, it is said to be good or almost perfect. A diligent work evaluates all errors and corrects them from start to finish.

A diligent person takes time to analyse and complete a task to perfection. But diligence also comes with speed. A diligent work as to meet up with deadlines. Diligent people are also as concerned with the speed or duration of their work as to the correctness and quality.

5 0
2 years ago
What is malware? What are some signs that malware may be impacting the performance of your computer? How can you avoid malware?
Anni [7]

Answer:

Malware is a type of software that is specifically designed to disrupt, damage, or gain unauthorized access to a computer system. Malware can be spread through email attachments, online advertisements, websites, and other methods.

Some signs that malware may be impacting the performance of your computer include:

  • Your computer is running more slowly than usual
  • Your computer crashes frequently
  • Your computer has pop-up ads or other unwanted behavior
  • Your default homepage or search engine has changed without your permission
  • You see new icons or programs on your desktop that you didn't install

To avoid malware, you should be cautious when browsing the internet and avoid visiting suspicious websites. You should also avoid opening email attachments from unknown senders, and be wary of online advertisements. You can also protect your computer by using antivirus software and keeping it up to date.

3 0
1 year ago
Where are my files shortcut in documents folder.
faust18 [17]

Answer: Search File Explorer: Open File Explorer from the taskbar or right-click on the Start menu, and choose File Explorer, then select a location from the left pane to search or browse. For example, select This PC to look in all devices and drives on your computer, or select Documents to look only for files stored there.

Explanation: hope this helps :)

4 0
2 years ago
Write IF() function for student 3, If total mark is greater than 10 then print
Debora [2.8K]

Answer:

Explanation:

The following code is written in Java. The if() function is actually called an if statement. The following code can be copied and pasted where you need as long as it is within the scope of the mark variable in order to call it and compare it to 10

if (mark > 10){

           System.out.println("you have scored good");  

       } else {

           System.out.println("you need to improve ");

       }

3 0
3 years ago
Other questions:
  • which of the following is involved in ordering an outline. A.grouping B.merging C.organizing D.arranging
    10·1 answer
  • What three steps Name a group??
    14·1 answer
  • What is an optical storage device?
    7·2 answers
  • A number of related records that are treated as a unit is called
    6·1 answer
  • Which is considered to be the oldest form of social media? A. media-sharing sites B. location-based services C. social networkin
    5·1 answer
  • Which command displays the contents of the NVRAM?
    13·1 answer
  • Fill up the blank:- The picture that graphically represents the items you use in Windows is called a/an .......
    5·1 answer
  • The welcome screen of the program 123D consists of ___
    15·1 answer
  • Data is?
    15·1 answer
  • In needs analysis: Group of answer choices the costs of different physical network design alternatives are assessed the rate of
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!