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
charle [14.2K]
3 years ago
7

Write a program that first reads in the name of an input file and then reads the input file using the file.readlines() method. T

he input file contains an unsorted list of number of seasons followed by the corresponding TV show. Your program should put the contents of the input file into a dictionary where the number of seasons are the keys, and a list of TV shows are the values (since multiple shows could have the same number of seasons). Sort the dictionary by key (least to greatest) and output the results to a file named output_keys.txt, separating multiple TV shows associated with the same key with a semicolon (;). Next, sort the dictionary by values (alphabetical order), and output the results to a file named output_titles.txt. Ex: If the input is:
Computers and Technology
1 answer:
Kazeer [188]3 years ago
3 0

Answer:

9.2. Métodos del Objeto File (Python para principiantes)

You might be interested in
Under which reflection(s) is the image of line m also a line?
lubasha [3.4K]

Answer:

c

Explanation:

5 0
3 years ago
Read 2 more answers
Write a program that include a method that returns the sum of all the elements of a Linked List of Integers. Allow the user to e
Illusion [34]

Answer:

static void Main(string[] args)

       {

           //declare a blank linked list

           LinkedList<int> numList = new LinkedList<int>();

           Console.WriteLine("Enter the Numbers");

           //check if the size of the linkedlist is 10

           while(numList.Count < 10)

           {

               //read the input supplied by the user

               string val = Console.ReadLine();

               //check if the input is integer

               if(int.TryParse(val, out _) == false)

               {

                   //if not integer, display error message and prompt for new number

                   Console.WriteLine("Invalid number");

                   continue;

               }

               //add the inputted number to the linkedlist

               numList.AddLast(int.Parse(val));

               

           }

           //call the method for linkedlist sum and display it

           Console.WriteLine(SumLinkedList(numList));

           Console.Read();

       }

       //method for linkedlist summation

       private static int SumLinkedList(LinkedList<int> val)

       {

           //declare sum as zero

           int sum = 0;

           //loop through the linkedlist to display the num and sum all numbers

           foreach(int item in val)

           {

               Console.Write(item + " ");

               sum += item;

           }

           return sum;

       }

   }

Explanation:

program written with c#

8 0
2 years ago
Design a 128KB direct-mapped data cache that uses a 32-bit address and 16 bytes per block. The design consists of two components
Kitty [74]

Answer:

See the attached pictures for detailed answer.

Explanation:

The cache contain 8K number of blocks.each block has 16 Byte worth of data. Each of these bytes are addressable by block offset. Now, each of these blocks are addressable and their address is provided by line offset or set offset. If block number is given in Decimal format then the block to which that block will be mapped is given by expression

mappedToBlock = (bNumber)mod2​​​13

TAG and valid but consititues something called cache controller. TAG holds the physical address information because the TAG in physical address get divided into TAG and line offset in cache address. Valid bit tells status of blocks. If it is 1 then data blocks are referred by CPI else not.

7 0
3 years ago
What is one key difference between the radiation and convection zones?
Anuta_ua [19.1K]
 convection requires a medium is not the main difference, it is simply the most obvious aspect of what is a fundamentally different mechanism for transfering energy. Convection is the transfer of energy by movement of a medium, whereas radiation is the transfer of energy by, well, thermal radiation. Conduction also requires a medium, but, again, it is a fundamentally different mechanism than either convection or radiation; in this case it is the transfer of energy through a medium.

Unfortunately, analogies are hard but if you can visualize the particles involved, it would help. Picture the red hot iron you mentioned. On a molecular level, the material is emitting lots and lots of photons (hence why it is glowing red). The creation of these photons takes energy; energy from the heat of the iron. These photons leave the iron, pass through the environment, and eventually collide with some other object where they are absorbed and deposit their energy. This is radiative heat transfer. If that energy is deposited on your retina or a CCD (like in a digital camera), an image forms over time. This is how infrared goggles work and they would work equally well in high vacuum as here on earth.

In conduction, the next simplest example, there is no generation of photons (physics nerds forgive me for the sake of simplicity). The individual atoms in the object are vibrating with heat energy. As each atom gains energy from it's more energetic neighbors, so it gives up energy to its less energetic ones. Over time, the heat "travels" through the object.

In convection, the molecules of gas near the object gain energy, like in the conduction case, but those same molecules that gained energy then travel through the environment to some other location where they then give off their heat energy.

In summary:

radiation = generated and absorbed photonsconduction = molecules exciting their neighbors succesivelyconvection = molecules heated like in conduction, but then move to another location
7 0
2 years ago
Directions
Aneli [31]
Would you like me to answer with a paragraph or essay,
3 0
2 years ago
Other questions:
  • ___________is a security strategy that applies multiple layers of defense because there is an assumption that any single protect
    12·1 answer
  • How to check what level you are in runescape?
    9·2 answers
  • Define a method pyramidVolume with double parameters baseLength, baseWidth, and pyramidHeight, that returns as a double the volu
    11·2 answers
  • Your co-worker is at a conference in another state. She requests that you
    9·1 answer
  • Use the drop-down menus to complete each sentence about the layers of the atmosphere.
    14·2 answers
  • Lori Redford, who has been a member of the Project Management group, was recently promoted to manager of the team. She has been
    12·1 answer
  • When you sign in to your Microsoft account with another Windows device, your settings will appear very differently than they do
    7·1 answer
  • What is the purpose of application software policies? Check all that apply.
    9·1 answer
  • Do software engineers save millions of dollars in usa
    6·1 answer
  • You need to install a 32-bit application on a 32-bit version of windows 10. In which default directory will the application be i
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!