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
Artist 52 [7]
3 years ago
5

If you have downloaded this book's source code from the companion Web site, you will find a file named text.txt in the Chapter 1

2 folder. (The companion Web site is at www.pearsonhighered/gaddis.) The text that is in the file is stored as on sen- tence per line. Write a program that reads the file's contents and calculates the average of words per sentence.
Computers and Technology
1 answer:
Lubov Fominskaja [6]3 years ago
6 0

Answer:

Explanation:

The following python code loops through each line within a file called text.txt and counts all the words, then it divides this count by the number of sentences in the text file. Finally, output the average number of words per sentence.

f = open("text.txt", "r")

all_words = 0

sentences = 0

for x in f:

   list = x.split(' ')

   all_words += len(list)

   sentences += 1

average = all_words / sentences

print("There are an average of " + str(average.__round__()) + " words in each sentence.")

You might be interested in
APCS A: I'm reviewing an old ap test and can't get past this problem:
yaroslaw [1]

Answer:

The answer is "Option A"

Explanation:

Following are the complete code to these question:

public class Arr//defining a class-Arr

{

public static void main(String[] args)//main method  

{

        int [][] numbers={{1, 2, 3},{4,5,6}}; //defining 2D array numbers

for(int[] row : numbers) //use for loop that holds all array value into 1D  array

{

for (int n: row)//defining n variable that holds row array values  

{

System.out.print (n); //print n variable value

}

}

}

}

The code comment explains its functioning.

7 0
3 years ago
In the system of stream orders, the smallest unit in the network comprised of both the most numerous type, and the shortest leng
alexgriva [62]
The answer is E a Variable number
3 0
3 years ago
what uses gps tracking to track vehicles? group of answer choices edge matching. cartography. automatic vehicle location. geogra
TEA [102]

Automatic vehicle location (AVL) uses GPS tracking to track vehicles.

Option C is correct.

<h3>What is GPS tracking used for?</h3>

GPS tracking is the monitoring of your location using the Global Positioning System (GPS ). Track the location of an entity or object remotely. This technology can determine a target's longitude, latitude, ground speed and heading.

<h3>Why is GPS used in vehicles?</h3>

The GPS navigation system provides information about your current location and driving directions. Used for navigation. GPS tracker systems, on the other hand, track the physical location of the vehicle and monitor its speed and direction.

<h3>Do all vehicles have GPS trackers?</h3>

NO if you purchased your vehicle new from an authorized dealer. Your vehicle probably doesn't have an aftermarket tracking device installed. However, if you buy a used/pre-owned vehicle, it is very important to inspect the vehicle inside and out for trackers.

Learn more about GPS tracking vehicles :

brainly.com/question/14614577

#SPJ4

3 0
1 year ago
You are adding new wires in your building for some new offices. The building has a false ceiling that holds the lights and provi
Katena32 [7]

Answer:

Plenum rate cable.  

Explanation:

The Plenum rated cable has an unique coating with the low fire resistance and smoke. The main reason to used the Plenum rate cable in the office because it allowing the intense cooling of the  servers also  for the safety purpose we used the Plenum rate cable.  

In the office we used Plenum rate cable wires because The house has a false ceiling housing the lights and supplying air-conditioning and ventilation routes.

8 0
3 years ago
The…..executed simple
Lina20 [59]

Answer:

ok ok

Explanation:

7 0
2 years ago
Read 2 more answers
Other questions:
  • "HotelExp” is a 3-D range name applied to the workbook shown.
    12·1 answer
  • Bob's Assembly is a hardware manufacturer. It specializes in builders' hardware for doors, cabinets, windows, and bathrooms. Bob
    10·1 answer
  • The icons to insert pictures and clip art in the PowerPoint application are located in the _____ grouping on the Insert tab.
    7·1 answer
  • Which remote assistance option requires peer name resolution protocol (pnr) and ipv6?
    5·1 answer
  • File compression is only available on hard-disk drives. <br><br><br> a. True <br><br><br> b. False
    6·1 answer
  • When a web page author includes meta keywords, like sex, that have little to do with the information on the page, the author is
    11·1 answer
  • What kind of data are spreadsheets typically used with?
    6·1 answer
  • Clunker Motors Inc. is recalling all vehicles from model years 2001-2006. A bool variable named norecall has been declared . Giv
    11·1 answer
  • What motivated Barbara MBANEFO to become an engineer?
    8·2 answers
  • Given integer variables totalTickets, vipTickets, and sessionNum, which line of code correctly calls the following function? voi
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!