answer.
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
Readme [11.4K]
2 years ago
6

Write a function in the cell below that iterates through the words in file_contents, removes punctuation, and counts the frequen

cy of each word. Oh, and be sure to make it ignore word case, words that do not contain all alphabets and boring words like "and" or "the". Then use it in the generate_from_frequencies function to generate your very own word cloud!

Computers and Technology
1 answer:
viktelen [127]2 years ago
4 0

Answer:

Explanation:

The diagrams attached to the questions are shown in the first and the second image below. The first image shows the code and the second image shows the error  that appears at the moment of running it.

To answer that ; We will notice that the error in the second image is what it says; what happened is that the individual subject performing this action is trying to to open the file called "h.txt", but the python interpreter is unable to find the file. The individual subject will need to have h.txt inside your current working directory for python to open it.

From the third image attached ; I have careful attached an image that illustrate how you can add the file by going to file →  open (right from your jupyter notebook). Afterwards you can either upload the file, or create a new text file and paste the contents on it as displayed in the fourth image attached in the diagram below.

You might be interested in
The Gas-N-Clean Service Station sells gasoline and has a car wash. Fees for the car wash are $1.25 with a gasoline purchase of $
beks73 [17]

Answer:

d = {"R":2.89,"P":3.09, "S":3.39, "N":0}

noofgallons = input("Enter number of Gallons:")

gastype = input("Enter Gas type/; R,P,S,N")

cwr = input("Is Car Was Requieed")

if(gastype == "R"):

   gal == nooffgallons * d['R']

   if (cwr=="y" and gal<10):

       gal+=3.00;

       elif(cwr=="y" and gal>=10):

           gal+=1.25

           elif(cwr=="n"):

               gal=gal

   elif(gastype==P):

       gal== nooffgallons * d['P']

       if(cwr="y" and gal<10):

           gal+=3.00;

           elif(cwr=="y"and gal>=10):

           gal+=1.25

           elif(cwr=="n"):

               gal=gal

       elif(gastype ==S):

           gal=noofgallons *d['S']

           if(cwr="y" and gal<10):

               gal+=3.00;

               elif(cwr=="y"and gal>=10):

                   gal+=1.25

                   elif(cwr=="n"):

                       gal=gal

                       

                       

print("tptal cost paid"+ gal)

The above program uses a dictionary for storing gasoline types and their cost, and dictionary is always constant, and hence its fulfilled the requirement of keeping it constant. And car wash is treated accordingly. And if elif else ladder has been used to calculate the total number of gallons.

Rest part is self explanatory.

Explanation:

The code is self explanatory.

7 0
2 years ago
A semaphore puts a thread to sleep:
otez555 [7]

Answer:

B. until another thread issues a notify on the semaphore.

Explanation:

A semaphore is a variable that is shared between threads and is not negative. It also acts as a calling mechanism that uses two atomic operations wait and signal for synchronization of processes.

A thread that is waiting for a process can be signaled by another thread.

A semaphore puts a thread to sleep until another thread issues a notify on the semaphore.

The wait operation will get a semaphore or otherwise wait if the busy S semaphore is available.

The signal operation will release a semaphore or wake a process if there is a thread waiting for S.

3 0
2 years ago
You have an on-premises network that contains several servers. You plan to migrate all the servers to Azure. You need to recomme
Ainat [17]

Answer:

A). Fault tolerance

Explanation:

The Microsoft Azure is described as the cloud computing service that is known for its flexibility, cost-effectiveness, and quick and easy compliance to fulfill the company's requirements.

As per the question, in order to ensure that 'some servers are available in case of a single Azure data center going offline for an increased time period', the recommendation must include the 'fault tolerance' ability of Azure services. Azure infrastructure has the ability to immediately react in case of a failure to restore the servers and its services. In case of hardware failure, crashing of hard-disks, or short-term availability problems with servers, Azure predicts and manages such failures effectively. Thus, <u>option A</u> is the correct answer.

7 0
2 years ago
Which among the following enhances WS-Security to facilitate a mechanism for issuing, renewing, and validating security tokens?
Aleksandr-060686 [28]

Answer:

a. WS-Trust

Explanation:

WS-Trust can be defined as a WS-specification as well as OASIS standard that help to provides extensions to WS-Security, in order to facilitate a mechanism for issuing, renewing, as well as validating of security tokens which is why the aim and objectives of WS-Trust is to help and enable applications to construct trusted SOAP message exchanges.

Nevertheless WS-Trust enables the issuance as well as the dissemination of credentials within several and various trust domains.

5 0
2 years ago
Given the macro definition and global declarations shown in the image below, provide answers to the following questions:
galben [10]

Answer:

A. 243

B. True

C. 0

Explanation:

Macro instruction is a line of coding used in computer programming. The line coding results in one or more coding in computer program and sets variable for using other statements. Macros allows to reuse code. Macro has two parts beginning and end. After the execution of statement of quiz4 x, 4 the macro x will contain 243. When the macro is invoked the statement will result in an error. When the macro codes are executed the edx will contain 0. Edx serve as a macro assembler.

4 0
2 years ago
Other questions:
  • The OSHA Workplace Poster 3165 is optional for workplaces.<br> A) True<br> B) False
    13·2 answers
  • Carrie works on a help desk and is assigned a ticket that was automatically generated by a server because of an error. The error
    14·2 answers
  • Type two statements that use rand() to print 2 random integers between (and including) 100 and 149. End with a newline. Ex:
    8·2 answers
  • When using the following symbol, there are two arrows coming out of it. One arrow corresponds to what happens in the program if
    7·1 answer
  • For any element in keysList with a value greater than 60, print the corresponding value in itemsList, followed by a semicolon (n
    14·2 answers
  • Consider a one-way authentication technique based on asymmetric encryption: A --&gt; B: IDA B --&gt; A: R1 A --&gt; B: E(PRa, R1
    13·1 answer
  • Write a C program that creates two threads to run the Fibonacci and the Runner processes. Threads will indicate the start and th
    14·1 answer
  • Drag each tile to the correct box.
    8·2 answers
  • A script sets up user accounts and installs software for a machine. Which stage of the hardware lifecycle does this scenario bel
    5·1 answer
  • I have a variable and set it equal to 5. 1 then send it as an argument to a function that adds 5 to the variable passed in. Outs
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!