Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question: This def function should search and return the integer that represents

ID: 3550046 • Letter: Q

Question

Question:

This def function should search and return the integer that represents this largest length itself. When the passing of (paragraphs) as the argument to this function, it should tell us how many words the longest paragraph contains.

If can, please correct the function to better understand, thanks.


from pg1260 import paragraphs, commons
from math import sqrt


def maxParagraphLength(paragraphs):
      largLength = int(commons)
      for int in paragraphs:
           if len(entry) > len(largLength):
              largLength = int
      return largLength

Explanation / Answer

from pg1260 import paragraphs, commons
from math import sqrt


def maxParagraphLength(paragraphs):

..........Largest_Length = int(commons)

..........for int in paragraphs:

..................if len(current_entry) > len(Largest_Length)

...........................Largest_Length = int

...........................return Largest_Length


In the above code, len refers to length of paragraph. Each time we are looking at a paragraph's length. If it is more than the current known largest length , we update it.


I have put dots in order to indent it.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote