Generation

generate functionSun, 23 Apr 2023

construya un programa con los códigos básicos que solicite al usuario dos puntos (x, y) en un plano y determine la distancia

import math print("Enter the x and y value of the first point") x1 = float(input("Enter the x value of point 1: ")) y1 = float(input("Enter the y value of point 1: ")) print("Enter the x and y value of the second point") x2 = float(input("Enter the x value of point 2: ")) y2 = float(input("Enter the y value of point 2: ")) d = math.sqrt((x1-x2)**2 + (y1-y2)**2) print("Distance between", (x1,y1), "and", (x2,y2), "is", d)

Questions about programming?Chat with your personal AI assistant