Computers and Technology, 24.04.2020 22:21 kevo2024
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
Answers: 1
Computers and Technology, 22.06.2019 01:40
When the pc version of the spreadsheet program became available, the ibm pc quickly became the top-selling personal computer?
Answers: 3
Computers and Technology, 22.06.2019 08:30
Linda subscribes to a cloud service. the service provider hosts the cloud infrastructure and delivers computing resources over the internet.what cloud model is linda using
Answers: 1
Computers and Technology, 24.06.2019 21:30
Aobject is used for displaying the results of a question based on stored data. a. query b. report c. table d. form
Answers: 2
Computers and Technology, 24.06.2019 23:00
Why is it preferable to code web pages in html format? a. to create more lines code b. to apply general formatting rules c. to display properly as search results in all browsers d. to add meaning to the document
Answers: 1
1. Please fix below function to working order, run a number of tests on it so that you know it works...
Chemistry, 22.04.2021 01:00
Chemistry, 22.04.2021 01:00
Mathematics, 22.04.2021 01:00
Health, 22.04.2021 01:00
Mathematics, 22.04.2021 01:00
Health, 22.04.2021 01:00
World Languages, 22.04.2021 01:00
Spanish, 22.04.2021 01:00
Mathematics, 22.04.2021 01:00
Mathematics, 22.04.2021 01:00
Arts, 22.04.2021 01:00
Mathematics, 22.04.2021 01:00