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 some ways to insert a row or column? Check all that apply.
kondaur [170]

Answer:

There are two ways to insert the new column or row in the table.

Explanation:

<u>Method I</u>

i. Select the cell where you want to add a new row or column,

ii. Click on Home Tab

iii. Find insert button in Cells Group.

iv. Click on Insert Row or Insert Column button.

By following above mentioned steps we can add a row or column in Excel sheet.

<u>Method II</u>

i. Select the cell where you want to add a new row or column,

ii. Right Click on the selected Cell.

iii. Find Insert Button in drop down menu and Click on Insert.

iv. There are four options in POP menu, choose Entire Row or Entire Column to insert row or column.

4 0
3 years ago
Read 2 more answers
How many binary digits does a single hexadecimal digit represent?
Anna35 [415]
Four binary digits.  So letter D.


8 0
3 years ago
n what sense is it now possible for a country to be ""occupied"" by an invisible invader that arrives through airwaves and wirel
Mademuasel [1]

Answer:

Option A. is correct

Explanation:

It now not possible for a country to be "occupied" by an invisible invader that arrives through airwaves and wireless networks. It is almost impossible to block foreign countries’ satellite broadcasts and Internet transmissions inspite of Spy satellites and other communications technology and Global positioning systems.

Option A. is correct

5 0
2 years ago
Match the job roles with their appropriate qualifications
UNO [17]
Knowledge...- software QA engineer
Master’s...- business analyst
course...- network and computer admin
training...- multimedia artist
3 0
3 years ago
Simple geometry can compute the height of an object from the the object's shadow length and shadow angle using the formula: tan(
agasfer [191]

Answer:

The program to this question can be given as:

Program:

#include <stdio.h>  //include header files

#include<math.h>

int main()    //main method  

{        

   double treeHeight = 0.0;         //declare variables

and assign value

   double shadowLength = 0.0;  

   double angleElevation =  0.11693706;

   // (0.11693706 radians = 6.7 degrees) convert number into angle.      

   shadowLength = 17.5;  

treeHeight = shadowLength * tan(angleElevation);   //convert number into angle

   printf("Tree height: %lf\n", treeHeight);   //print value.

   return 0;  

}

Output:

Tree height: 2.055778

Explanation:

In the above C language program firstly we include the headers. In this header file, we include a (math.h) header file this file helps to use the math function. Then we declare the main method in the main method we declare the variable that is given in the question that are treeHeight, shadowLength , angleElevation. All the variable datatype is double because it stores the floating-point value. Then we apply the formula that is  treeHeight = shadowLength * tan(angleElevation). In this formula, the treeHeight variable holds the value. Then we print the variable value for print the double value we use the lf(that is long float).

7 0
3 years ago
Other questions:
  • Examples of apps include pop-up windows, validation of webform inpts and images that change when a cursor passes over them
    12·1 answer
  • X = 0
    15·1 answer
  • Help!!!! ASAP TIMED TEST 50 points!!!!
    7·1 answer
  • Which of the following examines the organizational resource of information and regulates its definitions, uses, value, and distr
    9·1 answer
  • A collection of computers, printers, routers, switches, and other devices
    15·1 answer
  • when two people are in a race, what do you need to know to determine who is the fastest 1 units of speed that are identical 2 th
    10·1 answer
  • Ema Company for business .
    14·1 answer
  • What is wrong with each of the following code segments? int[] values; for (int i = 0; i &lt; values.length; i++) { values[i] = i
    7·1 answer
  • A router is connected to a network 192.169.1.0/24 and network 192.168.2.0/24. The router is configured to use RIP and has learne
    8·1 answer
  • To create a datetime object for the current date and time, you can use theGroup of answer choicestoday() method of the date clas
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!