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.
Answer:
The cost to make one tie is approximately £4.79
Explanation:
The details of the dimensions of the fabric needed to make the school tie are;
The length of the required fabric = 135 cm
The width of the fabric for the tie = 9 cm
The width of a roll of fabric when sold = 90 mm = 9 cm
The cost of the fabric per meter = £3.55
The width of the roll of fabric = The width of the fabric material required to make a tie
1 meter = 100 cm
The cost of 1 m (100 cm) of fabric = £3.55
Therefore;
The cost of the 135 cm of the fabric required for the tie, <em>c</em>, is found as follows;
c = £3.55 × 135/100 = £4.7925
The cost of the fabric required to make one tie giving the answer to two decimal place, c ≈ £4.79
Answer:
c im trying my best sorry if you get it wrong
Explanation:
It’s a piece of hardware (you can touch it) that changes something on the screen. Examples are a keyboard putting letters on the screen or a mouse moving the cursor
Answer:
B. (n2) * n.
Explanation:
The highest complexity is (n2)*n because on solving it will come out to be n³.So the growth rate is of cubical order which is the highest among the options.
(n) * 2n is of the order of square.On solving it will be 2n².
n² is also of the order of square.
nlogn complexity is less than n² but greater than n.
3n is of linear complexity.It has the lowest complexity among the options.