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
IRISSAK [1]
3 years ago
8

April 107 90 29 31 66 0.344

Computers and Technology
1 answer:
Misha Larkins [42]3 years ago
3 0

Answer:

Check the explanation

Explanation:

with open('stats. txt', 'r') as   # open the file in read mode

   list1 = []   # initialize an empty list

   for i in  . readlines ():  # read every line of file

       for j in i. split ():  # split each line by a space and append it to the list1

           list1. append (j)

   months = [] # initialize required lists to empty list

plate_apperence = []

at_bats = []

runs = []

hits = []

total_bats = []

for i in range(0, len(list1)-1, 7): # use a for loop and give parameters as start,stop and step count

months. append(list1[i]) # append list1 elements to required lists

plate_apperence. append(int(list1[i+1]))

at_bats. append(int(list1[i+2]))

runs. append(int(list1[i+3]))

hits. append(int(list1[i+4]))

total_bats. append(int(list1[i+5]))

for i in range(len(months)): # for each element in months

print("Player's Average Batting and slugging percent for the month ", months[i], " is as shown below")

print("{:.2f}".format(hits[i]/at_bats[i])) # calculate Average batting and slugging percent and print them

print("{:.2f}". format(total_bats[i]/at_bats[i]))

print("\n")

Kindly check the attached images below to get the Code Screenshot and Code Output.

You might be interested in
Which headphone is better for music
Advocard [28]
Personally vmoda crossfadr wireless
4 0
3 years ago
1. What conversion factor should be used to convert from Gigaliters to liters?
Ilia_Sergeevich [38]
The conversion factor is 10 to the 9th power
5 0
3 years ago
The constructor signature is defined as the constructor __________ followed by the __________.
d1i1m1o1n [39]

Answer:

The constructor signature is defined as the constructor name followed by the parameter list.

Explanation:

In object oriented programming, a class constructor is a special method that will run automatically whenever a new object is created from the class. The constructor name is same with the class name. Besides, the class constructor is often used to initialize the attributes with initial values. Those initial values are held by the parameter list of the constructor.

One example of the constructor defined in a Java class is as follows:

// class name

public class BankAccount {

    // attribute names

      private String holder;

      private double amount;

      // constructor name

      public BankAccount(String holder, double amount) // parameter list

     {

               this.holder = holder;

               this.amount = amount

      }

}    

7 0
4 years ago
What is the impact of Customer Centricity?
skad [1K]
Customer-centric businesses generate greater profits, increased employee engagement, and more satisfied customers. Customer-centric governments and nonprofits create the resiliency, sustainability, and alignment needed to fulfill their mission.
5 0
2 years ago
Rewrite the MERGE procedure so that it does not use sentinels, instead stopping once either array L or R has had all its element
Strike441 [17]

Answer:

Merge sort is a sorting technique based on divide and conquer technique.

Explanation:

MERGE(A, p, q, r)

   n1 = q - p + 1

   n2 = r - q

    L[1..n1] and R[1..n2]   this creates the new array

   for i = 1 to n1

       L[i] = A[p + i - 1]

   for j = 1 to n2

       R[j] = A[q + j]

   i = 1

   j = 1

   for k = p to r

       if i > n1

           A[k] = R[j]

           j = j + 1

       else if j > n2

           A[k] = L[i]

           i = i + 1

       else if L[i] ≤ R[j]

           A[k] = L[i]

           i = i + 1

       else

           A[k] = R[j]

           j = j + 1

4 0
3 years ago
Other questions:
  • Hen pointing to a tool on the ribbon, a ______ appears, displaying information about the tool.
    7·1 answer
  • The inflexible, circular platters on ____ disks use magnetic particles to store data, instructions, and information.
    5·1 answer
  • Create a query that will list all technician names, employee numbers, and year hired in order by year hired (Newest to Oldest).
    5·1 answer
  • Write a program that asks the user for the name of a text file. the program should display the last 10 lines of the file on the
    13·1 answer
  • What analogy could you use to explain the hardware parts of a computer?
    11·1 answer
  • Technical colleges offer certification in audio engineering through programs that are normally from 2 to 6 months long. False Tr
    14·1 answer
  • Which words in the sentence make up the adjective phrase? Which word does the adjective phrase modify? The farmer delivers five
    15·1 answer
  • $
    15·2 answers
  • 8. When “arc rated” clothing is worn it must allow for what
    9·1 answer
  • In cell N2, enter a formula using the IF function and structured references as follows to determine which work tier Kay Colbert
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!