An anagram of a string is another string with the same characters in the same frequency, in any order. For example 'ab', 'bca, acb), 'bac', 'cba, 'cab' are all anagrams of the string 'abc'. Given two arrays of strings, for every string in one list, determine how many anagrams of it are in the other list. Write a function that receives dictionary and query, two string arrays. It should return an array of integers where each element i contains the number of anagrams of queryll that exist in dictionary.

Answers

Answer 1

Answer:

from collections import Counter

def anagram(dictionary, query):

   newList =[]

   for element in dictionary:          

       for item in query:

           word = 0

           count = 0

           for i in [x for x in item]:

               if i in element:

                   count += 1

                   if count == len(item):

                       newList.append(item)

   ans = list()

   for point in Counter(newList).items():

       ans.append(point)

   print(ans)        

mylist = ['jack', 'run', 'contain', 'reserve','hack','mack', 'cantoneese', 'nurse']

setter = ['ack', 'nur', 'can', 'con', 'reeve', 'serve']

anagram(mylist, setter)

Explanation:

The Counter class is used to create a dictionary that counts the number of anagrams in the created list 'newList' and then the counter is looped through to append the items (tuple of key and value pairs) to the 'ans' list which is printed as output.


Related Questions

descriptive paragraph about a forest beside a lake

Answers

Luscious green leaves of the forest blew in the lukewarm winds of the day. The crystal waters of the lake just beside me reflected the forest in all its glory. The lake feel frigid, but the forest made me feel warm again. A sight to see, and a wonderful place to be was that gorgeous forest by the lake.

/*this function represents
*what karel has to do
*/
function start() {
turnLeft();
buildTower();
turnRight();
if(frontIsClear()){
toMove();
}
while(noBallsPresent();
turnLeft();
buildTower();
}
if(frontIsBlocked()){
goBack();
}
}

/*This represents karel is
*putting down the balls for making the tower
*/
function buildTower(){
putBall();
move();
putBall();
move();
putBall();
}

function
move();
turnRight();
move();
move();
turnLeft();
move();
}

i need help finding the issues

Answers

anything

Explanation:

I know what to say this time

Answer:

turn right

Explanation:

i think sorry if it is wrong

Please help. Will give brainliest

Answers

I don’t understand it sorry :(.

Write the function appendEvens() which, given two arrays, adds all of the even elements from the first to the second. You may assume the second has enough space.

Answers

Answer:

function appendEvens( arr1, arr2) {

   for (let i in arr1){

       if (i%2 == 0){

           arr2.push(i);

       }

   }

}

Explanation:

The defined javascript function "appendEvens" is a function that returns undefined. It accepts two arrays and pushes the even numbers from the first array to the second.

Assume a large shared LLC that is tiled and distributed on the chip. Assume that the OS page size is 16KB. The entire LLC has a size of 32 MB, uses 64-byte blocks, and is 32-way set-associative. What is the maximum number of tiles such that the OS has full flexibility in placing a page in a tile of its choosing?

Answers

Answer:

19 - 22 bits ( maximum number of tiles )

Explanation:

from the given data :

There is 60 k sets ( 6 blocks offset bits , 16 index bits and 18 tag bits )Address has 13-bit page offset and 27 page number bits14-22 bits are used for page number and index bits

therefore any tour of these bits can be used to designate/assign tile number

so the maximum number of tiles such that the OS has full flexibility in placing a page in a tile of its choosing can be between 19 -22 bits

Write a program that lets the user play the game Rock, Paper, Scissors against the computer. The program should:

Answers

Answer:

import random

def simulateRound(choice, options):

   compChoice = random.choice(options)

   if choice == compChoice:

       return ["Tie", compChoice]

   elif choice == "rock" and compChoice == "paper":

       return ["Loser", compChoice]

   elif choice == "rock" and compChoice == "scissors":

       return ["Winner", compChoice]

   elif choice == "paper" and compChoice == "rock":

       return ["Winner", compChoice]

   elif choice == "paper" and compChoice == "scissors":

       return ["Loser", compChoice]

   elif choice == "scissors" and compChoice == "rock":

       return ["Loser", compChoice]

   elif choice == "scissors" and compChoice == "paper":

       return ["Winner", compChoice]

   else:

       return ["ERROR", "ERROR"]

def main():

   

   options = ["rock", "paper", "scissors"]

   choice = input("Rock, Paper, or Scissors: ")

   choice = choice.lower()

   if choice not in options:

       print("Invalid Option.")

       exit(1)

   result = simulateRound(choice, options)

   print("AI Choice:", result[1])

   print("Round Results:", result[0])

if __name__ == "__main__":

   main()

Explanation:

Program written in python.

Ask user to choose either rock, paper, or scissors.

Then user choice is simulated against computer choice.

Result is returned with computer choice.

Result is either "Winner", "Loser", or "Tie"

Cheers.

what's a website layout

Answers

Answer:

Explanation:

A website layout is a pattern (or framework) that defines a website's structure. It has the role of structuring the information present on a site both for the website's owner and for users. It provides clear paths for navigation within webpages and puts the most important elements of a website front and center.

Effective home page layout is all about making your website easy to use and navigate. It allows you to steer your visitors' focus to things you want them to pay extra attention to. Let's get started on what to include in an effective home page, and we'll dive into some specific examples and layouts!

the term technology is derived from the Chinese word. it is true or false​

Answers

Answer:

True

Explanation:

it's your perfect answers

Yes it is true
Its true

Memory compression is a useful alternative to paging:_______.
a. when the compression algorithm is can achieve the best possible compression ratio.
b. when the system has slow magnetic disks but not faster SSDs.
c. when the speed of the compression algorithm fastest.
d. even when the system has faster SSDs.

Answers

Answer:

d. even when the system has faster SSDs.

Explanation:

Given that Memory compression and Paging are both means of performing memory management in different ways.

However, Memory compression is a useful alternative to paging "even when the system has faster SSDs."

This is because Memory compression enhances the productivity of Radom Access Memory, RAM, which in turn increases the performance level of a computer.

Also, paging requires consistent writing on Disks, which has been found to degrade disks most especially solid-state drives, SSDs.

Emma was typing two pages in her document. When she was typing, she wanted to undo an error. A few lines later, she wanted to repeat the
action that she had last performed
After her typing was done, Emma wanted to improve the formatting of the document. Therefore, she cut the subheading on the first page
and pasted it on the second page. She also copied a paragraph from the first page and pasted on to the second page. Arrange the tiles
according to the keyboard shortcuts Emma used when she was typing.

Answers

Answer:

I don't know what the options are, but here is my answer:

Ctrl + Z (Undo - "When she was typing, she wanted to undo an error.")

Ctrl + Y (Redo or repeat - "A few lines later, she wanted to repeat the

action that she had last performed")

Ctrl + X (Cut - "Therefore, she cut the subheading on the first page")

Ctrl + V (Paste - "and pasted it on the second page.")

Ctrl + C (Copy - "She also copied a paragraph from the first page")

Ctrl + V (Paste - "and pasted on to the second page.")

Hope this helped! (Please mark Brainliest)

Iman manages a database for a website that reviews movies. If a new movie is going to be added to the database what else will need to be added.

Answers

Answer:

The answer would be a record.

Explanation: Took the test

How do I fix my mistake in the code, do not give me a bs answer like “I don’t know sorry” if you do not know just move on because I will report it like I have before.

Answers

The problem lies within your if statement. You're using a single equals sign when you should be using two.

if (operation == 1)

Two equal signs is a comparison operator. It checks to see if one value equals another value. In your case, its checking if operation equals 1. But, this only solves half the problem. Operation is a string and you need to compare it to a string.

if (operation == "1")

I hope this helps!

What is the function of the operating system of a computer?

It allows the CPU to communicate with input and output devices.
It executes commands from other computer hardware.
It lets the user communicate with the mouse.
It processes information from the hard drive to allow programs to run.

Answers

Answer:

It allows the CPU to communicate with input and output devices.

Explanation:

Plzzzzzzzzzzzzz give me brainiest

Display all the lines in unixPasswd that contain at least 10 consecutive lowercase letters. How many names are there in total that meets this criteria?

Answers

Answer and Explanation:

To display 10 consecutive lower case letters in Unix, we make use of the commands below. The first command finds the letters in the file and the second command counts them line by line.

$ grep '[a-z]\{10,\}' /unixPasswd/passwd

# this command displays lines with at least 10 consecutive lowercase letters or more than 10 consecutive lowercase letters

$ grep '[a-z]\{10,\}' /unixPasswd/passwd | wc -l

# this command counts the number of lines that has at least 10 consecutive lower case letters or more than 10 consecutive lowercase letters

Note: the unixPasswd is a file in passwd file. The # is used when we want to add comments, is optional here. The $ is a prompt on the terminal that begins a new command.

Varied amount of input data Statistics are often calculated with varying amounts of input data. Write a program that takes any number of integers as input, and outputs the average and max. Ex: When the input is 15 20 0 5, the output is:

Answers

In Python 3.8:

nums = list(map(int, input("Enter your numbers space separated: ").split()))

print(f"The largest number is {max(nums)} and the average of all the numbers entered is {sum(nums)/len(nums)}")

Using a third-party package of your choice, write a program that reads the contents of a csv file and saves it to an Excel file. The program should take two arguments. The name of the input file and the name of the output file.

Answers

Answer:

import pandas as pd

df = pd.read_csv("file_csv")

df.to_excel("file.xlsx", sheet_name = "name_of_sheet")

# or use: with df.ExcelWriter("file.xlsx", mode='a') as file,

#df.to_excel(file, sheet_name= "sheet name")

Explanation:

This python source code uses the pandas package to read csv (comma separated values) file and converts it to an excel file (xlsx) using the read_csv and ExcelWriter methods respectively.

The sensitivity range for an objective function coefficient is the range of values over which the current __________________ remains the same.

Answers

Answer:

Optimal solution point

Explanation:

The sensitivity range for an objective function coefficient is the range of values over which the current optimal solution point remains the same.

Additionally, the range of optimality can be defined as the optimality range with respect to an objective coefficient that comprises of the range of values over which a current optimal solution point will always remain optimal.

Hence, the managers supervising various production lines are saddled with the responsibility of focusing on the objective function coefficient for optimal level of output or productivity.

Write code that creates a text area displaying 10 rows and 15 columns. The text area should be capable of displaying scroll bars, when necessary. It should also perform word style line wrapping.

Answers

Answer:

<textarea wrap="hard" cols="30" rows="5"></textarea>

Explanation:

A textarea element or tag is a form tag element of a HTML file. It is used to ask for input value from a user in a webpage. The textarea tag has an opening and a closing tag.

The 'cols' attribute is used to set the column length while the 'rows' attribute sets the row length of the textarea element. The 'wrap' attribute has three options namely; soft, hard, and off. 'soft' adds the textarea wrapping, 'hard' sets off the box wrapping but only wraps each line, while the 'off' option removes all wrapping in the tag.

An inkjet printer’s output appears to have missing elements. What is the first thing a technician should try if the ink cartridge appears to be full?

Answers

Answer:

Check the printing properties or print test page.

Explanation:

In a situation whereby an inkjet printer’s output appears to have missing elements. The first thing a technician should try if the ink cartridge appears to be full to "Check the printing properties."

This helps to serve as a maintenance technique or solve the ink cartridge problems.

Depending on the windows or PC's Operating System. To check the printer's properties on Windows 7, a user will have to click on the “Start” button > Control panel > Devices and Printers. Followed by right-clicking the printer icon and open up “Printer Properties” and click “Print Test Page”

Ms office suite comes with its own set of pictures in the​

Answers

Answer:

clipart ...........................

Explanation:

clipart is the correct answer for the above question.

When we code an algorithm, we need to provide the commands in the order we want the
computer to carry them out.

Answers

Answer:

true                                                  q     it says it needs 20 characters so here you go

Which of the following is a real job title on The interactive media career pathway?

Answers

Answer:

The right answer is A

Explanation:

Plzzzzzzzzzzzzz give me brainiest

The answer to your question is B

PLS HELP I WILL MARK BRAINLIEST

Answers

Answer:

C

Explanation:

Animal cells each have a centrosome and lysosomes, whereas plant cells do not. Plant cells have a cell wall, chloroplasts and other specialized plastids, and a large central vacuole, and animal cells do not.

100 points and brainlist....................................................................................................................................................................................................................... It Takes a Village! In every business, it takes more than one person to create success - whether you are talking about a berry farm, a historic theater, a popular amusement park, or an expanding coffee chain. While you watch the videos, notice how many different people work together to support and sustain these operations. Cogdell Berry Farm Fox Theatre Six Flags Jittery Joes Now, let's put it all together by creating a presentation entitled "It Takes a Village." Your presentation could either be a word document, a digital mind map, or a slideshow, but it must include a chart and research paragraph for each company. In your presentation, you should create a visual chart or slideshow featuring each company and highlighting at least two different jobs that are needed to keep each company running. Make it clear that each company is comprised of many different positions and discuss how people with different skills and interests work together to contribute to a successful enterprise. Finally, pick out one career from each video and do some additional research on it. Let's consult our handy reference, the Bureau of Labor Statistics' Occupational Outlook Handbook once again to find more information. This time check out the headings 'How to Become One,' 'Pay,' and 'Job Outlook' for each career you choose. Your presentation should include the following content: A chart/slideshow that describes each of the four companies with at least two jobs discussed in each company. In depth research on one job per company, including: How to Become One Pay Job Outlook However you choose to arrange your presentation, make sure to show clearly that the companies you learned about rely on more than one position to keep things running smoothly.

Answers

Answer:  what do i need to do Im confused I will edit my answer to answer correctly to help you Have a Nice day and that was a very nice trick

Explanation:

Answer:

give them brainliest :)

Explanation:

hai ima guurl andd here r the lyricss to mah favorite song
All I need is a little love in my life
All I need is a little love in the dark
A little but I'm hoping it might kick start
Me and my broken heart
I need a little loving tonight
Hold me so I'm not falling apart
A little but I'm hoping it might kick start
Me and my broken heart
Yeah
Shotgun, aimed at my heart, you got one
Tear me apart in this song
How do we call this love
I tried, to run away but your eyes
Tell me to stay oh why
Why do we call this love
It seems like we've been losing control
So bad it don't mean I'm not alone
When I say
All I need is a little love in my life
All I need is a little love in the dark
A little but I'm hoping it might kick start
Me and my broken heart
I need a little loving tonight
Hold me so I'm not falling apart
A little but I'm hoping it might kick start
Me and my broken heart
Maybe some part of you just hates me
You pick me up and play me
How do we call this love
One time tell me you need me tonight
To make it easy, you lie
And say it's all for love
It seems like we've been losing control
So bad it don't mean I'm not alone
When I say
All I need is a little love in my life
All I need is a little love in the dark
A little but I'm hoping it might kick start
Me and my broken heart
I need a little loving tonight
Hold me so I'm not falling apart
A little but I'm hoping it might kick start
Me and my broken heart
Me and my broken heart
Me and my broken
Yeah, yeah, yeah
It's just me
It's just me
It's just me
Me and my broken heart
All I need is a little love in my life
All I need is a little love in the dark
A little but I'm hoping it might kick start
Me and my broken heart
I need a little loving tonight
Hold me so I'm not falling apart
A little but I'm hoping it might kick start
Me and my broken heart

Answers

Answer:wow that’s a lot of lyrics but intersting

Explanation:

Answer:

that's a cool song

Explanation:

have a great day:)

why is monitor called softcopy output device?​

Answers

Answer:

A display device is the most common form of output device it presents output visually on a computer screen.the output appears temporarily on the screen and can easily altered or erased,it is sometimes referred to as softcopy

Please solve the ones you can. Solving Both will be appreciated. thank you

Answers

Answer:a=b+c=2ca

Im not sure about this answer

Explanation:

A boundary marks the inside and outside of a system and sets the system apart from its environment.

A. True

B. False

Answers

Answer:

True

Explanation:

The system boundary can be regarded as a conceptual line that demacate

the system that is under study from 'everything else'. which is the environment. The environment consist of things that can influence the system but not part of the system. when the system is small , its boundary will be sharper. Some Large systems usually have multiple boundaries.boundary can as well be regarded as the point of contact which gives room for meeting between a system its environment , it is also point subsystems meet each other. It should be noted that boundary marks the inside and outside of a system and sets the system apart from its environment.

Discuss ISG. Discuss how ISG moves information security beyond technical decisions and makes security a strategic decision. How and why does ISG move information security from the technical arena to the business arena. Discuss why this is necessary.

Answers

Answer:

ISG (Information Security Governance) refers to the engagement of executive management in the issues surrounding how Information Security matters, assets, and risks are directed and managed.

ISG is the high-level involvement that a business entity introduces to achieve the correct information structure, leadership, and guidance, which help it to analyze and mitigate information security risks.

2. ISG moves information security from the technical arena or specialists to the business front burner by ensuring the involvement of those responsible for corporate governance (i.e. board-level management) in the security of an entity's information infrastructure.

3. It becomes necessary to have the board's involvement in order to create senior management awareness and secure their support in efforts to implement policies and processes for the security of information assets.

Explanation:

Generally, corporate governance consists of the set of policies and internal controls by which organizations are directed and managed. Information security governance should be a subset of an organization's overall governance program, which analyzes the risk management, reporting, and  accountability responsibilities of senior management in solving information security challenges.

(Printing Numbers in Various Field Widths) Write a program to test the results of printing the integer value 12345 and the floating-point value 1.2345 in various size fields. What happens when the values are printed in fields containing fewer digits than the values?

Answers

Answer:

sorry I didn't understand the question

Other Questions
Which of the following is an indication of a physical change?O A. The formation of a new substanceO B. Giving off a smellO C. A change in the shape of a substanceO D. The production of gas and heat A rectangular poster is 50 cm long and 25 cm wide. If 1 cm is approximately .4 inches What is the perimeter of the poster What was the role of Tammany Hall in New York City?O a settlement houseO the Democratic political machineo the home of the operaO a municipal building Select the correct answer.Read the sentence from the passage.Having undertaken, for the glory of God, and advancement of Christian faith and honor of our King and Country, a voyage to plant the first colony in the northern parts of Virginia, do by these presents solemnly and mutually in the presence of God and one of another, covenant and combine ourselves together into a civil body politic.What is the definition of covenant as it is used in this context?A. pledgeB. settleC. bargainD. engage Sun Yat-sen's Four Point Plan was based on the Three Principles of the People which were _____.Democracy, Communism, and NationalismNationalism, Socialism, and DemocracySocialism, Democracy, and CommunismCommunism, Nationalism, and Socialism A jet flies over the ocean. A sound wave travels from the jet to the surface of the ocean. Almost none of the energy from the sound passes into the water. The diagram below illustrates the path of the sound wave.Which of the following statements about this scenario is true?A.The sound wave's direction, speed, and wavelength change.B.The sound wave's direction and wavelength change, but its speed remains the same.C.The sound wave's direction changes, but its speed and wavelength remain the same.D.The sound wave's direction and speed change, but its wavelength remains the same. Let f(x)=7x+5 and g(x)=x-1. If h(x)=f(g(x)), then what is the inverse of h(x) When 0.25 moles of NH3 are produced according to the reaction below, how many moles of H2 must have reacted?N2 + 3 H2 --> 2 NH3O 1.5 moles H2O 0.38 moles H2O 0.25 moles H2O 0.17 moles H2 The following graph shows the proportional relationship between the cost and duration of a car rental.Which statements about the graph are true?Choose all answers that apply:Choose all answers that apply:(Choice A)AThe yyy-coordinate of point AAA represents the total cost of a 555-day car rental.(Choice B)BThe total cost of a 222-day car rental is \$90$90dollar sign, 90.(Choice C)CNone of the above 01:44:12Considering the temperature vs. time graph below, how does the temperature at the beginning of a change of statecompare with the temperature at the end of the change?Temperature vs. Time140410080Temperature (C)33040202020Time (min)The temperature is always lowerThe temperature is always the sameThe temperature is usually lowerThe temperature is usually higher Read the short paragraph below.Everyone knows that water is important. Who doesnt like to drink a cool glass of water after a long day? But some people dont seem to worry about polluting the local water supply. They should! I like water, and so should everyone else.What change would most improve this introductory paragraph?providing additional examples of the importance of wateremphasizing further the foolishness of not caring about waterproviding summary evidence of the bad impacts of water pollutionemphasizing that water pollution is as bad as air pollution Hemoglobin A1 is the quaternary protein structure on a red blood cell involved in oxygen transport. Hemoglobin A1 has two -chains and two -chains. A blood pH change caused several bonds to break between the amino acid chain. Which would most likely result from this change in concentration? A.The hemoglobin will no longer carry oxygen due to a change in the shape of the protein.B.The hemoglobin will continue to carry oxygen at the same level as the previous structure. C.The hemoglobin will adapt to concentration changes to maintain its original shape.D.The hemoglobin will increase its oxygen carrying capacity to restore the blood concentration levels. A) A solution of c6h2o4 in c2h5oh has a boiling point of 80.38 Celsius. what is the molality of the solution ?B) what is the approximation of concentration of dissolved solution in blood, if the osmotic pressure is 7.65 atm at 37Celsius. Can anyone please help FAST! Im looking for the correct answer and how you explain it! Ill mark brainlist please and thank you! Help: Which layer is older?A DF Which answer choice shows 87.962 written in expanded form? A. 80 + 70 + 0.9 + 0.06 + 0.002 B. 80 + 7 + 0.9 + 0.06 + 0.02 C. 80 + 7 + 0.9 + 0.06 + 0.002 D. 8 + 7 + 9 + 6 + 2 solve this please!!!!! Wickland Company installs a manufacturing machine in its production facility at the beginning of the year at a cost of $87,000. The machine's useful life is estimated to be 5 years, or 400,000 units of product, with a $7,000 salvage value. During its second year, the machine produces 84,500 units of product. Determine the machines' second year depreciation under the double-declining-balance method.A. $16,900.B. $16,000.C. $17,400.D. $18,379.E. $20,880. hich equation corresponds to the sentence, "Five times a minus two is equal to t"?A.2a + 5 = tB.5(2) + a = tC.5a 2 = tD.2 x 5(a) = t A woman standing before a cliff claps her hands, and 2.8s later she hears the echo. How far away is the cliff? The speed of sound in air a ordinary temperature is 343 m/s.