-
-
Notifications
You must be signed in to change notification settings - Fork 49.6k
Closed
Description
For some reason when i assign a list to x this works perfectly fine, but when i take a list input i get an error. Does anyone know why?
Thank you.
print('*** QUESTION 4 ***')
def perimeter(points):
d = 0
len_points = len(points)
if len(points) < 3:
return 0
for i in range(len_points):
d += math.sqrt((points[i-1][0] - points[i][0])**2 + ((points[i-1][1] - points[i][1])**2))
return d
x = list(input('please enter a list'))
print(type(x))
print(perimeter(x))```
Metadata
Metadata
Assignees
Labels
No labels