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
Alik [6]
3 years ago
6

Write a program that asks the user for a word. Next, open up the movie reviews.txt file and examine every review one at a time.

If a review contains the desired word you should make a note of the review score in an accumulator variable. Finally, produce some output that tells your user how that word was used across all reviews as well as the classification for this word (any score of 2.0 or higher can be considered
Computers and Technology
1 answer:
Hatshy [7]3 years ago
5 0

Answer:

import numpy as np

word = input("Enter a word: ")

acc = []

with open("Downloads/record-collection.txt", "r") as file:

   lines = file.readlines()

   for line in lines:

       if word in line:

           line = line.strip()

           acc.append(int(line[0]))

   if np.mean(acc) >= 2:

       print(f"The word {word} is a positive word")

       print(f"{word} appeared {len(acc)} times")

       print(f"the review of the word {word} is {round(np.mean(acc), 2)}")

   else:

       print(f"the word {word} is a negative word with review\

{round(np.mean(acc), 2)}")

Explanation:

The python program gets the text from the review file, using the user input word to get the definition of reviews based on the word, whether positive or negative.

The program uses the 'with' keyword to open the file and created the acc variable to hold the reviews gotten. The mean of the acc is calculated with the numpy mean method and if the mean is equal to or greater than 2 it is a positive word, else negative.

You might be interested in
Audio tools support reading fluency by
Artist 52 [7]

Answer:

The answer is "demonstrating how a text is read".

Explanation:

Audio tools like Text to Speech are commonplace in programs like Duolingo. They offer you a somewhat accurate example of how to properly pronounce a word or phrase.

4 0
4 years ago
Read 2 more answers
What is the output of the code corresponding to the following pseudocode? (In the answer options, new lines are separated by com
Viefleur [7K]

Answer:

Following are the output of the given question

3 4 6 8

Explanation:

In the following code, firstly, we have declare two integer data type "X" and "Y".

  • Then, set two for loop in which first one is outer loop and the second one is the inner loop, inner loop starts from 1 and end at 2 and outer loop starts from 3 and end at 4.
  • Then, when the variable X=1 then the condition of the outer loop become true and the check the condition of the inner loop, when Y=3, than the multiplication of X and Y occur and output should be 1*3=3.
  • Then, the value of the X will remain same at time when the value of Y become false. Thrn, second time X=1 and Y=4 and output should be 4.
  • Then, X=2 because Y turns 5 so the inner loop will terminate and than outer loop will execute. Then again Y=3 but X=2 and output should be 6.
  • Then, the value of the X will remain same at time when the value of Y become false. Thrn, second time X=2 and Y=4 and output should be 8.

Finally, all the conditions of the loop become false and the program will terminate.

3 0
4 years ago
Ms. Osteen gives her class an assignment to insert background color that gradually changes from blue to green. To accomplish thi
irina1246 [14]

Answer:

C

Explanation:

7 0
3 years ago
In this problem, we want to compare the computational performance of symmetric and asymmetric algorithms. Assume a fast public-k
MariettaO [177]

Answer:

The AES decryption time is 8 minutes

Explanation:

GIVEN THAT:

The 1 GByte is equal to 230 bytes and equal to 233 bits

The RSA decryption time is calculated as = 233 / (100*230 )

= 83886. 06 seconds

= 23 hours

The RSA decryption time is 23 hours

The AES decryption time is calculated as = 233 / (17 * 230 )

= 481.81 seconds

= 8 minutes .

The AES decryption time is 8 minutes

4 0
4 years ago
In cyberspace, bret attempts to steal consumers' credit card numbers stored in the networked computers of cinco corporation, a f
Mandarinka [93]

The quantity of data that can be stolen is limited by the same physical limits that exist in the real world.

Quantitative data is defined as data that can be measured in numerical values. The two main kinds of quantitative data are discrete data and continuous data. Height in feet, age in years, and weight in pounds are examples of quantitative data. Qualitative data can be described as descriptive data that is not expressed numerically. Data quality means a measure of the condition of data based on factors such as accuracy, completeness, consistency, reliability and whether it's up to date.

You can learn more about the quantitative data at brainly.com/question/96076

#SPJ4

5 0
2 years ago
Other questions:
  • Using a Mouse
    8·2 answers
  • Help verify each identity<br><img src="https://tex.z-dn.net/?f=%20%5Cfrac%7Bcsc%7D%7Bcot%20%5C%3A%20x%20%20%5C%3A%20%2B%20%20%5C
    9·1 answer
  • What is institutional advertising focused on promoting?
    8·1 answer
  • Based upon the contents of the BOOKS table, which line of the following SQL statement contains an error?
    13·1 answer
  • If the ____________ is broken on a laptop, chances are other parts are also broken.
    5·1 answer
  • Match the command to the use. Test connectivity to a remote computer Test DNS lookup View packets in a transmission Display the
    14·1 answer
  • As a general rule, what is the size of a brochure?
    11·1 answer
  • Blender is used by which video game team member?
    15·1 answer
  • IF ANSWER I WILL BE REALLY HAPPY
    13·2 answers
  • You can create an arraylist using _________. a. new arraylist[] b. new arraylist[100] c. new arraylist&lt;&gt;() d. arraylist()
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!