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
Which type of chart is used to chart progress over time?
Morgarella [4.7K]

Answer: Timeline

Explanation:

6 0
3 years ago
A(n)<br> is a fast compute with lots of storage. pls help
Pachacha [2.7K]

Answer:

Surface Laptop 3 - 15", Platinum (metal), AMD Ryzen 5 3580U, 8GB, 128GB

4 0
3 years ago
Read 2 more answers
Suppose we can buy a chocolate bar from the vending machine for $1 each. Inside every chocolate bar is a coupon. We can redeem s
Tanya [424]

Answer and Explanation:

Using JavaScript:

/* program should take N input which represents the dollar amount and output how many chocolate bars and how many coupons we have*/

function chocolatebar(dollars){

var dollaramt= dollars;

var i;

for(i=0; i <= dollaramt; i++){

i=i+6

?

Alert ("you have 1 extra chocolate bar");

:

Alert ("keep buying chocolate bars to get more coupons for a bonus chocolate bar")

}

}

*

7 0
3 years ago
A taxi cab costs $1.25 for the first mile and $0.25 for each additional mile. Write an
Mumz [18]

Answer:

0.25x+1.25=8

Explanation:

Hope this helps

3 0
2 years ago
How many lines of text are in your questionnaire document
wel

Answer:

*9* lines - I think.

Explanation:

8 0
2 years ago
Other questions:
  • To extend the bottom border of a hyperlink across the complete width of a navigation list, change the ____ property of each hype
    9·1 answer
  • How do I download the Microsoft word on my Hp probook
    8·2 answers
  • Explain the steps users can take to maintain an operating system
    15·1 answer
  • Although highly accurate navigational information from the GPS constellation is exploitable by adversary forces, it is unlikely
    5·1 answer
  • Gabe wants to move text from one document to another document. He should _____.
    9·2 answers
  • Which of the following types of cloud platforms would a webmail service offered to the general public be considered?
    9·1 answer
  • Assuming that the user enters 45 and 62 as inputs for n1 and n2, respectively, what is the output of the following code snippet?
    15·1 answer
  • When doing a Risk assessment, what is one of the most important things to do?
    8·2 answers
  • Which of the following is NOT AN EXAMPLE of personal identifying
    9·2 answers
  • A timer is set after each frame is sent before waiting an ACK for that frame, how long does the timer take to be expired?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!