Python Forum

Full Version: functions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I have a big problem with this task. Can someone help me? Thank you in advance! :)

Modify the program from point 1 so that the function instead of four numbers gets two lists containing the coordinates of the points. (Point 1 below). It's mainly about operations on lists and counting the length of the section with their help.

Write a program that will: contain a function called with four parameters (x1, y1, x2, y2) being
coordinates (x, y) of two points on the plane. This function is to return a number equal to
the length of the segment formed from these points.
Hi welcome to the forum.
Please read Homework and No Effort Questions
So they want you to create a function like
def dist(x1, y1, x2, y2):
And modify it to
def dist(p1, p2):
Show us your code for the first function and we can help with the second