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
vodomira [7]
3 years ago
9

Write a script that will read the file, (strip the carriage returns), create a dictionary of names and favorite radishes and cre

ate a dictionary of each radish type and the number of people who chose that as their favorite.

Computers and Technology
1 answer:
amm18123 years ago
8 0

Answer:

python code below:

names={}#first dictionary for names and favorite

favor={}#radish type and how many are favorite

f=open("raddish.txt")#opening file

for i in f:#for each line

j=i.strip().split("-")#splitting base on -

names[j[0].strip()]=j[1].strip()#getting first dictionary

if j[1].lower().strip() in favor:#counting the favorite elements

favor[j[1].lower().strip()]+=1

else:

favor[j[1].lower().strip()]=1

print ("First Dictionary",names)#printing the names

print("second dictionary:",favor)#printing the favorite numbers

f.close()#closing file

Explanation:

The program was implemented using python programming language.

Its operation is to read the file, (strip the carriage returns), create a dictionary of names and favorite radishes and create a dictionary of each radish type and the number of people who chose that as their favorite.

It returns as output the names of people entered for the Radishes.

See attachment for screenshot.

You might be interested in
C++ please
Nat2105 [25]

Answer:

#include <iostream>

#include <cstdlib>

#include <ctime>

using namespace std;

int main(){

   int n;

   cout<< "Enter the row and column length: ";

   cin>> n;

   int array_one[n][n];

   int array_transpose[n][n];

   for (int i = 0; i < n; i++){

      for (int j= 0; j < n; j++){

           srand((unsigned) time(0));

           array_one[i][j] = (rand() % 4000)

           array_transpose[j][i] = array_one[i][j];

       }

   }

}

Explanation:

The C source code has three variables, 'array_one', array_transpose' (both of which are square 2-dimensional arrays), and 'n' which is the row and column length.

The program loops n time for each nth number of the n size to assign value to the two-dimensional array_one. the assign values to the array_transpose, reverse the 'i' and 'j' values to the two for statements for array_one to 'j' and 'i'.

7 0
3 years ago
Network firewall entry and exit points are called
LuckyWell [14K]
___the answer is ports
6 0
4 years ago
An administrative assistant types a document, saves, and prints. The assistant is using _____.
9966 [12]
The answer to your question is software. 
3 0
3 years ago
In the context of this passage, which of the following is a synonym for alleged? A intended B claimed C denied D revealed
Zinaida [17]
B. Claimed

Alleged means somebody CLAIMED that you did something. So, you're being accused of doing something that you may have not done. I hope this helps! :)
7 0
3 years ago
Which of the following is a benefit of using a parallel circuit system?
Ad libitum [116K]

The answer is stability. In a parallel circuit the potential source or voltage remains constant even as you add additional load to the circuit. Next would be simplicity and security, do note that the normal and typical circuitry found on household uses parallel circuit model.

7 0
3 years ago
Other questions:
  • Jim has entered the age of each of his classmates in cells A1 through A65 of a spreadsheet. Which function should Jim use to fin
    11·2 answers
  • Define scanning and why it’s considered one of the most important phases of intelligence gathering for an attacker. Also discuss
    10·1 answer
  • Finally, Lee wants to modify the table he linked to his presentation. How should he begin?
    8·1 answer
  • Which track-type can be used to control the master output levels of output and bus paths? Hint: When assigned to an active outpu
    10·1 answer
  • DNA structure can be described as a twisted ladder. Imagine you are climbing a model of DNA, just as if you were climbing a ladd
    10·2 answers
  • Time
    6·1 answer
  • 1. What was the very first “photo-realistic CGI character” to appear on-screen in a movie (released in 1985)?
    8·2 answers
  • HELP TIMED!!!!!!!!!!!!!!!!!!!!
    5·2 answers
  • Which of the following uses the proper syntax for creating an HTML comment?
    8·1 answer
  • Explain the role and importance of ict in daily life ?​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!