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
We are sending a 30 Mbit MP3 file from a source host to a destination host. All links in the path between source and destination
Daniel [21]

Answer:

Option  A is the correct answer.

Explanation:

8 0
3 years ago
What are the different between Facebook and LinkedIn
DIA [1.3K]
Face you can talk to friends post picture's and see pictures of friends i am not really sure what is linkedln
7 0
3 years ago
Read 2 more answers
Given a string variable named sentence that has been initialized , write an expression whose value is the the very last characte
Blizzard [7]
Strings can usually be dealt with as arrays of characters.

sentence[ -1 ]

sentence.substring( sentence.size() -1 );
8 0
3 years ago
In three or four sentences, describe how a person buys and sells stock.
Aleksandr-060686 [28]
In order to buy stock, you must go and find a stock broker. You do not always need a broker, but it is more convenient to have one to manage your stock. It also makes your life in the market easier. The broker will manage your shares and you tell him when you want to buy or sell your stock.
4 0
3 years ago
Read 2 more answers
Which option can be used to access more settings than are available in the Backstage view?
Bumek [7]

Answer:

orientation settings

Explanation:

so u can now more about whta u doing

6 0
3 years ago
Other questions:
  • Please I need all the help I can get Thank You So Much
    14·1 answer
  • What is another name for a central processing unit? Computer Integrated circuit Microprocessor Transistor
    9·2 answers
  • By applying styles, _______ formats are being applied each time. A. various B. different C. the same D. similar
    6·2 answers
  • An interface is a class that contains only the method headings and each method heading is terminated with a semicolon. True Fals
    7·1 answer
  • Post as a reply your example of "data, which is processed into information" case - examples should not necessarily be related to
    13·1 answer
  • 1. In your own words, describe the purpose of a for a loop.
    11·1 answer
  • Which of the following can spreadsheet programs help a person with? (choose all that apply.)
    9·1 answer
  • Which of the following is the best example of an installation issue?
    6·2 answers
  • HELP ME PLEASEEEE
    8·1 answer
  • -) An attribute is a(n)?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!