Assign point_dist with the distance between point (x1, y1) and point (x2, y2). the calculation is: distance = squarerootof( (x2 - x1)2 + (y2 - y1)2 ). sample output for the given program:

Respuesta :

W0lf93
import math def calculateDistance(x1,y1,x2,y2): dist = math.sqrt((x2 - x1)**2 + (y2 - y1)**2) return dist distance = calculateDistance(2,4,6,8) print distance

The program is an illustration of functions

Functions are collections of defined program statements, that are executed when evoked

The program in Python, where comments are used to explain each line is as follows:

#This imports the math module

import math

#This defines the function

def calculateDistance(x1,y1,x2,y2):

      #This calculates the distance between the points

      dist = math.sqrt((x2 - x1)**2 + (y2 - y1)**2)

      #This returns the calculated distance

      return dist distance

Read more about Python functions at:

https://brainly.com/question/14284563

ACCESS MORE
EDU ACCESS