subject

1. Please fix below function to working order, run a number of tests on it so that you know it works.
The language is python 3:
An anagram is a pair of words which are the same up to a rearrangement of letters. For instance the anagrams of
"auctioned" are:
cautioned
education
Now, we're going to consider two words anagrams regardless of whether they're English words.
so happy has anagrams:
Yppah
Yahpp
Pahyp
// Funtion //
We're going to implement a function called:
def anagram_buggy(first_word, second_word):
This function should take two strings, convert them to the same case (to ignore case), and then check if they are anagrams.
Here is the code:
def anagram_buggy(first_word, second_word):
first_word = first_word. lower()
second_word = second_word. upper()
first_word_dict = {}
second_word_dict = {}
for letter in first_word:
if letter in first_word_dict:
first_word_dict[letter] += 1
for letter in second_word_dict:
if letter in second_word_dict:
second_word_dict[letter] += 1

for letter in first_word_dict:
if first_word_dict[letter] != second_word_dict[letter]:
return False

return True

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:30
4.11 painting a wall (1) prompt the user to input integers for a wall's height and width. calculate and output the wall's area (integer). note that in this case there is a new line after each prompt. (submit for 1 point). enter wall height (feet): 11 enter wall width (feet): 15 wall area: 165 square feet (2) extend to also calculate and output the amount of paint in gallons needed to paint the wall (floating point). assume a gallon of paint covers 350 square feet. store this value in a variable. output the amount of paint needed using the %f conversion specifier. (submit for 2 points, so 3 points total). enter wall height (feet): 11 enter wall width (feet): 15 wall area: 165 square feet paint needed: 0.471429 gallons (3) extend to also calculate and output the number of 1 gallon cans needed to paint the wall. hint: use a math function to round up to the nearest gallon. (submit for 2 points, so 5 points total). enter wall height (feet): 11 enter wall width (feet): 15 wall area: 165 square feet paint needed: 0.471429 gallons
Answers: 3
question
Computers and Technology, 22.06.2019 04:00
Chloe is building a kiosk-based excel application. she wants to make some modifications to the screen elements in order to keep users from being distracted by parts of the application that are irrelevant to her application. she turns to henry for guidance as she knows he built a similar solution earlier this year.chloe has decided to hide the worksheet gridlines and the vertical scroll bar. what does henry tell her to use to do this? a) screen elements dialog boxb) display options dialog boxc) customization dialog boxd) excel options dialog box
Answers: 2
question
Computers and Technology, 22.06.2019 17:00
Annie is creating a corporate report for a company’s annual meeting. in the report, she wants to add the signature of various department heads. which device can annie use to capture signatures to include in the report? a. printer b. monitor c. e-reader d. digitizing tablet
Answers: 1
question
Computers and Technology, 23.06.2019 01:00
Let r be a robotic arm with a fixed base and seven links. the last joint of r is a prismatic joint, the other ones are revolute joints. give a set of parameters that determines a placement of r. what is the dimension of the configuration space resulting from your choice of parameters?
Answers: 3
You know the right answer?
1. Please fix below function to working order, run a number of tests on it so that you know it works...
Questions
question
Mathematics, 04.03.2021 20:00
question
Mathematics, 04.03.2021 20:00
question
Mathematics, 04.03.2021 20:00
question
Biology, 04.03.2021 20:00