Answer:
Following are the code to this question:
file= open('book.txt') #open file
li= {} #define an empty list
for lines in file: # use for loop Split file data into words
d= lines.lower().strip(' !?').split() #define variable d that Add it to map
for val in d: #define loop to store data
if val not in li: #check value is not in list
li[val] = 0 #define list and assign value in 0
li[val] = li[val] + 1 #Sort the book data and add its value
m = sorted(li.items(),key = lambda x : -x[1]) #sorted value into the m variable
print(m[:10]) #print value
Output:
please find the attachment.
Explanation:
In the given python code first, we open the file "book.txt", in next line, an empty list is defined, that uses the for loop which can be described as follows:
- In the for loop is used, that reads the file data, and defines a variable "d", that stores the values into the map.
-
In the next line another loop is used, that check file values, if values are the same type so, it adds values and writes it.
- In the last line, m variable is used, that sorts the values and use the slicing to print its value.
Answer
Dog breeds = observations, Average weight and energy level for each breed = variables. Each cluster is a category.
Explanation:
Using a method of clustering, she would be putting the dog breeds that are more similar together and in order to do this she has to look at various factors such as observation which are the dog breeds, and the average weight and energy level of the breeds, which represents variables. Every one of these clusters would be a category.
Answer: Redirection symbol
Explanation: Redirection symbol/operator is the special operator that is used in programs along with commands. The operators that are generally used are ">",">>","I" and "<". These commands are given in the section of the DOS commands and other command prompt sections. This is the process where the changes in input feed and output is analyzed and read through these commands.
Answer:
MacOS, Linux, Android, Microsoft Windows, software de ciencia computacional, motores de juegos, automatización industrial y aplicaciones de software como servicio.
:-) (-: