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
A bag of cookies holds 40 cookies. The calorie information on the bag claims that there are 10 servings in the bag and that a se
laila [671]

Answer:

import java.util.Scanner;

public class ANot {

   public static void main(String[] args) {

   Scanner in = new Scanner (System.in);

       System.out.println("How many cookies did you eat today");

       int numOfCookies = in.nextInt();

       double numCalories = (numOfCookies*300)/4;

       System.out.println("The total number of calories you consumed in "+numOfCookies+" cookies is " +

               " "+numCalories);

   }

}

Explanation:

This code is implemented in Java.

  1. We know from the question that 4 cookies contain 300 calories
  2. Therefore number of calories consumed = (number of cookies eaten*300)/4
  3. To implement this in java we used the scanner class to prompt user for the input
  4. save the input to a variable and write mathematical expression for the number of calories consumed
  5. Then output the result

4 0
3 years ago
Computer software licensed under exclusive legal right of the copyright holder with the intent that the licensee is given the ri
Shkiper50 [21]

Answer:

The following statement is 'True'.

Explanation:

There is a software named 'Proprietary software' and also called 'closed-source software', it's non-free software and used to describe the software that is not freely licensed such as operating system, file formats, and system programs. this software is licensed for studying, sharing, modification, redistribution and reverse engineering and has the copyright to use the software under only certain conditions and we can also say that it bears limit against these types of uses.

6 0
3 years ago
What are some of the challenges that could arise from setting up a file management system on a computer?
son4ous [18]
It could glitch out or be hacked or deleted.
8 0
3 years ago
Polymorphism means (Points : 2) many forms
Pavel [41]

Answer:

many forms

Explanation:

Polymorphism is a construct in object oriented programming which means multiple forms.For example: Suppose I have a function which performs the add operation on two integers and another function with the same name which concatenates 2 given strings:

  • int add ( int a, int b);
  • string add ( string a , string b)

The two functions represent polymorphic forms of the add function. The function to be invoked at runtime is determined by the runtime argument type.

For example , add (2,3) will invoke int add ( int a, int b);

Similarly, add("hello","world") will invoke string add ( string a , string b);

6 0
3 years ago
2.Consider the following algorithm and A is a 2-D array of size ???? × ????: int any_equal(int n, int A[][]) { int i, j, k, m; f
Elis [28]

Answer:

(a) What is the best case time complexity of the algorithm (assuming n > 1)?

Answer: O(1)

(b) What is the worst case time complexity of the algorithm?

Answer: O(n^4)

Explanation:

(a) In the best case, the if condition will be true, the program will only run once and return so complexity of the algorithm is O(1) .

(b) In the worst case, the program will run n^4 times so complexity of the algorithm is O(n^4).

5 0
3 years ago
Other questions:
  • Write a method called swapPairs that switches the order of values in an ArrayList of strings in a pairwise fashion. Your method
    9·1 answer
  • A thin red border indicates the active cell. (True or False)
    12·1 answer
  • HELP ASAP!!!
    7·1 answer
  • I WILL GIVE BRAINLIEST TO WHO ANSWERS FIRST AND CORRECTLY.
    8·1 answer
  • Tradegy deals with _____
    14·1 answer
  • What framework provides a simple API for performing web tasks?
    13·1 answer
  • What does the "zoom tool" do in Photoshop?
    15·2 answers
  • Indicate if the statement is true or false False 1. A spreadsheet cannot recalculate after you have changed data in your workshe
    15·1 answer
  • A local pizza shop is selling a large pizza for $9.99. Given the number of pizzas to order as input, output the subtotal for the
    12·1 answer
  • Differentiate between patent and copyright.
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!