Question: #I have a *getMetricList that needs to be define for the fuction to ex
ID: 3550496 • Letter: Q
Question
Question:
#I have a *getMetricList that needs to be define for the fuction to execute properly in this program to run without errors.
#I found and place two of three functions already that are: *getMetrics and *findCentroid
#Need help finding were this function will be located at: *getMetricsList
from cs1graphics import *
window = Canvas()
window.setTitle ('Metrics Plotter [Gonzo]')
window.setWidth (421)
window.setHeight (421)
window.setBackgroundColor('lightgreen')
def getX(x):
return 10.0 + 400.0*x
def getY(y):
return 410.0 - 16.0*y
metricsList = getMetricsList (paragraphs)
def getMetrics():
for metrics in metricsList:
x = getX(metrics [0])
y = getY (metrics [0])
p = Circle (1.0, Point (x, y))
p.setFillerColor('blue')
p.setBorderWidth(0)
window.add(p)
centroid = findCentroid (metricsList)
def findCentroid():
x = getX (centroid[1])
y = getY (centroid[1])
p = Circle (2.0, Point(x,y))
p.setFillColor ('red')
p.setBorderWidth (0)
p.setDepth (40)
window.add(p)
Explanation / Answer
def getMetricsList (paragraphs):
metricsList = []
for record in paragraphs:
metricsList.append (record)
return metricsList
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.