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
AlexFokin [52]
3 years ago
8

In the following cell, we've loaded the text of Pride and Prejudice by Jane Austen, split it into individual words, and stored t

hese words in an array p_and_p_words. Using a for loop, assign longer_than_five to the number of words in the novel that are more than 5 letters long. Hint: You can find the number of letters in a word with the len function.
Computers and Technology
1 answer:
Sever21 [200]3 years ago
7 0

Answer:

Explanation:

Since the array is not provided, I created a Python function that takes in the array and loops through it counting all of the words that are longer than 5. Then it returns the variable longer_than_five. To test this function I created an array of words based on the synapse of Pride and Prejudice. The output can be seen in the attached picture below.

def countWords(p_and_p_words):

   longer_than_five = 0

   for word in p_and_p_words:

       if len(word) > 5:

           longer_than_five += 1

   return longer_than_five

You might be interested in
Compare GBN, SR, and TCP (no delayed ACK). Assume that the timeout values for all three protocols are sufficiently long such tha
kvv77 [185]

Answer and Explanation:

a)

For Go-Back-N:

  Host A sent total number of segments is 9.The initial segment numbers are 1,2,3,4,5 and re-sent the segemnts 2,3,4 and 5 because 2nd segment was lost.

Host B sent the number of ACKs are 8.Host B sent ACKs 1 by four times because 2nd segment was lost and sent 4ACKs with sequence numbers 2,3,4 and 5

selective repeat:

 Host A sent total number of segments is 6.The initial segment numbers are 1,2,3,4,5 and re-sent the segemnts 2 because 2nd segment was lost.

Host B sent the number of ACKs are 5.Host B sent four ACKs with sequence numbers 1,3,4,5 and re-sent ACK2 with sequence number 2 because 2nd segment was lost.

TCP :

Host A sent total number of segments is 6.The initial segment numbers are 1,2,3,4,5 and re-sent the segemnts 2 because 2nd segment was lost.

Host B sent the number of ACKs are 5.Host B sent four ACKs with sequence number 2 and There is one ACK with sequence number 6.TCP always send an ACK with expected sequence number

b) If the timeout values for all three protocol are much longer than 5*RTT,then TCP protocol successfully delivers all five data segments in shortest time interval.

 

4 0
3 years ago
Writing in Java, write a program that prompts the user to input an integer and then outputs both the individual digits of the nu
larisa [96]

Answer:

//Here is code in java.

import java.util.*;

class Main

{

public static void main (String[] args) throws java.lang.Exception

{

   try{

       int in;

     //scanner class object to read the input

    Scanner scr=new Scanner(System.in);

     // variable to keep running total

    int total=0;

    System.out.println("please enter an Integer:");

     // read the input first time

    in=scr.nextInt();

    System.out.print("individual digits of "+in+" is ");

    if(in<0)

    {

        in=-(in);

    }

   

 

     //call the function to print the digits of number

   print_dig(in);

   System.out.println();

    //calculate the sum of all digits

   do{

       int r=in%10;

       total=total+r;

       in=in/10;

   }while(in>0);

    //print the sum

   System.out.println("total of digits is: "+total);

     

   }catch(Exception ex){

       return;}

}

 //recursive function to print the digits of number

public static void print_dig(int num)

{  

    if(num==0)

    return;

    else

    {

    print_dig(num/10);

    System.out.print(num%10+" ");

    }

}

}

Explanation:

Read a number with the help of object of scanner class.if the input is negative

then make it positive number before calling the function print_dig().call

the recursive method print_dig() with parameter "num".It will extract the digits

of the number and print then in the order. Then in the main method, calculate

sum of all the digits of number.

Output:

please enter an Integer:                                                                                                  

3456                                                                                                                      

individual digits of 3456 is 3 4 5 6                                                                                      

total of digits is: 18

please enter an Integer:                                                                                                  

-2345                                                                                                                      

individual digits of -2345 is 2 3 4 5                                                                                      

total of digits is: 14

6 0
3 years ago
If you were going to construct a table that only included shape names with number prefixes, which shape would you include
NikAS [45]
The answer would be A. square
3 0
3 years ago
most dialog boxes in windows programs requiring navigation follow a similar procedure. true or false.
vfiekz [6]
I believe that is true

Hope this helps!! :)

8 0
3 years ago
Write a recursive Scheme function merge(firstNameList, lastNamelist) that receives a simple list of first names and a simple lis
miv72 [106K]

Answer:

Write a recursive Scheme function power(A, B) that takes two integer parameters, A and B, and returns A raised to the B power. A must be a positive value, but B maybe a negative value.

Explanation:

7 0
3 years ago
Other questions:
  • What is the definition of framerate?
    7·1 answer
  • Use the Internet and other sources to research the two disadvantages of standard biometrics: cost and error rates. Select one st
    10·1 answer
  • Wide area networks are defined by their ability to
    14·2 answers
  • 13.
    8·1 answer
  • What are 2 plants that grow best in our soil type ​
    9·1 answer
  • Two technicians are discussing shielded cable. Technician A says that shielded wires are generally twisted in pairs to cancel th
    14·1 answer
  • Which database item would show details such as a customer’s name, their last purchase, and other details about a customer?
    11·2 answers
  • Two technicians are discussing a parasitic load test. Technician A says that the parasitic load is measured with an ammeter Tech
    13·1 answer
  • Explain the difference between social engineering and reverse social engineering.
    6·1 answer
  • Write a program using for loop to find the cube of numbers from 50-100 <br> FASTT
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!