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.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.