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
What are the values of the following expressions? In each line assume that,
MissTica

Answer:

double x = 2.5;

double y = -1.5;

int m = 18;

int n = 4;

string s = "Storm";

string t = "Watch";

The output of the expression "x + n*y - (x+n)*y" is "6.25".

and the output of expression "m/n + m%n" is "6".

Explanation:

for the first expression,

x + n*y - (x+n)*y ,put value of every variables in it.

=2.5+4*(-1.5)-(2.5+4)*(-1.5)

=2.5-6.0-(6.5*(-1.5)

=-3.5+9.75

=6.25

for the second expression,

m/n + m%n,  put value of every variables in it.

=18/4 +18%4

=4+2      ("/ will give quotient and % will give remainder")

=6

4 0
3 years ago
How long does it take to learn python
Alla [95]

Answer:

five to 10 weeks

On average, it can take anywhere from five to 10 weeks to learn the basics of Python programming, including object-oriented programming, basic Python syntax, data types, loops, variables, and functions.

:

3 0
3 years ago
Read 2 more answers
Which view allows you to make changes to the content of your presentation?
Neporo4naja [7]

Answer:

Share your screen and edits the parts you want. What meet are you using, zoom or something else?

6 0
3 years ago
What could be one possible reason where the recipient is not guaranteed that the data being streamed will not get interrupted?
IRINA_888 [86]

One possible reason could be low network bandwidth, where the maximum data throughout allowed by the network is insufficient to accommodate the large amount of data being streamed.

Let me know if you have any questions.

3 0
3 years ago
You can access various sites on the WWW by using hyperlinks or by
Vilka [71]
<span>or by following directions on screen </span>
5 0
3 years ago
Other questions:
  • Which of the following is something that scientists often seek by using computer models and simulations?
    8·2 answers
  • Which of the following websites can help you learn about general career trends?
    13·1 answer
  • How can you add contrast between text and headlines in a document? increase the font size of the headline make the headline long
    6·1 answer
  • Directory servers from different vendors are synchronized through ________.
    9·1 answer
  • A store trying to analyze the behavior of its customers will often maintaina two-dimensional array A, where the rows correspond
    6·1 answer
  • Write a program that reads students’ names followed by their test scores. The program should output each student’s name followed
    13·1 answer
  • Based on this information, what is their gross income for six months? Roderick
    10·1 answer
  • List three different sets of keywords that could be used to search for information on how to
    15·1 answer
  • What is the different between information and data
    9·1 answer
  • ____ the most popular word processing applications software<br><br>​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!