Question: 11. Implement the following function in the PyDev module functions.py and test it from a PyDev module named 11.py def slope(x1 yiy x2, y2): Calculates
11. Implement the following function in the PyDev module functions.py and test it from a PyDev module named 11.py def slope(x1 yiy x2, y2): Calculates the slope of a line. Slope is calculated as rise 7 run where rise is distance between y coordinates, and run is distance between x coordinates. Use: slp slope(xi, yi, x2, y2) Parameters: x1 x coordinate of first point on a graph (float) y y coordinate of first point on a graph (float) X2 H x coordinate of second point on a graph (float) y y coordinate of second point on a graph (float) X2 X Returns SLP slope of the line through (x1,71) and (x2,2) HR Sample testing Enter first X 1 Enten first y 2 Enter second X3 Enter second y 4 The slope is 1.0 Test functions.py Choose File No file chosen Submit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
