The block of statements below the line of stars is where I need help correcting. The true line that needs to be corrected is p = add((getX(k),getY(r))), it needs to give points of the path using the block of information. I have somthing which I know is correct below.
if can please help correcting that line ( p = add((getX(k),getY(r))));
def maxParagraphLength (paragraphs):
return max ([len (paragraph) for paragraph in paragraphs])
def countParagraphsWithCommonWords (paragraphs, commons, length):
return len ([l for l in [len ([word for word in paragraph if word in commons]) for paragraph in paragraphs] if l >= length])
def getX(x):
return 10.0 + 0.8*x
def getY(y):
return 410.0 - 0.08*y
window = Canvas()
window.setTitle ('Assignment 2 [Gonzo]')
window.setWidth (421)
window.setHeight (421)
window.setBackgroundColor('yellow')
***********************************************************************************
p = Path
for k in range(maxParagraphLength (paragraphs)+1):
r = countParagraphsWithCommonWords (paragraphs, commons, k)
p = add((getX(k),getY(r)))
#add.setFillColor('red')
#p.setBorderWidth(0)
window.add()