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
why does planets orbit the sun? asap i give brainlist i know it on that subject i dont know what else goes with it
Fynjy0 [20]

Answer:

Anyway, the basic reason why the planets revolve around, or orbit, the Sun, is that the gravity of the Sun keeps them in their orbits. Just as the Moon orbits the Earth because of the pull of Earth's gravity, the Earth orbits the Sun because of the pull of the Sun's gravity.

Explanation:

7 0
2 years ago
How would you write this using Java: Use a TextField's setText method to set value 0 or 1 as a string?
katrin [286]

Answer:

Explanation:

The following Java code uses JavaFX to create a canvas in order to fit the 10x10 matrix and then automatically and randomly populates it with 0's and 1's using the setText method to set the values as a String

import javafx.application.Application;

import javafx.scene.Scene;

import javafx.scene.control.TextField;

import javafx.scene.layout.GridPane;

import javafx.stage.Stage;

public class Main extends Application {

   private static final int canvasHEIGHT = 300;

   private static final int canvasWIDTH = 300;

   public void start(Stage primaryStage) {

       GridPane pane = new GridPane();

       for (int i = 0; i < 10; i++) {

           for (int j = 0; j < 10; j++) {

               TextField text = new TextField();

               text.setText(Integer.toString((int)(Math.random() * 2)));

               text.setMinWidth(canvasWIDTH / 10.0);

               text.setMaxWidth(canvasWIDTH / 10.0);

               text.setMinHeight(canvasHEIGHT / 10.0);

               text.setMaxHeight(canvasHEIGHT / 10.0);

               pane.add(text, j, i);

           }

       }

       Scene scene = new Scene(pane, canvasWIDTH, canvasHEIGHT);

       primaryStage.setScene(scene);

       primaryStage.setMinWidth(canvasWIDTH);

       primaryStage.setMinHeight(canvasHEIGHT);

       primaryStage.setTitle("10 by 10 matrix");

       primaryStage.show();

   }

   public static void main(String[] args) {

       Application.launch(args);

   }

}

3 0
2 years ago
When data can flow across a cable in both directions, this is known as___Communicating?
Ede4ka [16]

Answer:

full duplex communication.

Explanation:

In a duplex type of topology or communication, data or information can be transferred in both directions.

There are two different types of these communications

3 0
2 years ago
Lots of Ways to Use Math.random() in JavaScript
Alja [10]

Math.random() is a built-in function in JavaScript that generates a random number between 0 and 1.

<h3>What is Math.random()?</h3>

Math.random() is a useful and versatile function that can add a element of randomness to your JavaScript programs.

This function can be used in a variety of ways in JavaScript programs, such as:

  1. Generating random numbers for games or simulations.
  2. Creating random samples for statistical analysis.
  3. Shuffling elements in an array for a random order.
  4. Selecting random items from a list for a quiz or survey.
  5. Creating unique IDs or keys for objects in a database.

To Know More About built-in function, Check Out

brainly.com/question/29796505

#SPJ4

8 0
1 year ago
The "fathers of the internet" are vinton cerf and ________.
Harrizon [31]
Robert E Kahn I hope this helps
8 0
3 years ago
Other questions:
  • Given the following code, what is output by the method call, mystery(6 * 8)?
    8·1 answer
  • Help, please!! A file named "games.txt" exists and has 80 lines of data. You open the file with the following line of code. aFil
    6·1 answer
  • Hosts A and B are communicating over a TCP connection, and Host B has already received from A all bytes up through byte 126. Sup
    10·1 answer
  • Write a paragraph on the following topic.
    14·1 answer
  • One blog may have a greater social influence than another when it has_______?
    12·2 answers
  • What is the difference between edge and core networks?
    13·1 answer
  • Kevin needs to get his data from a database into a text file to send to another group. He needs to _____.
    12·2 answers
  • Match the desired outcome to the appropriate action.
    6·1 answer
  • , how do you make this user <br> XtraCrispyIzzy<br> 12 characters or less for microsoft?
    8·1 answer
  • What was the name of the first computer, developed by charles babbage?.
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!