Город МОСКОВСКИЙ
00:06:06

Write a Python Program to Compute the Distance Between the Points (x1, y1) and (x2, y2)

Аватар
Питоновый Тренер
Просмотры:
22
Дата загрузки:
02.12.2023 11:19
Длительность:
00:06:06
Категория:
Лайфстайл

Описание

Hi, in this video I tried to explain how to Write a Python Program to Compute the Distance Between the Points (x1, y1) and (x2, y2)

Code
===============
import math

x1 = float(input("Enter x1 value : "))
y1 = float(input("Enter y1 value : "))

x2 = float(input("Enter x2 value : "))
y2 = float(input("Enter y2 value : "))

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

print("Distance between two co-ordinates is %.2f" % distance)


Keywords
==================
#python #python3 #python_assignment #pythonprogramming #pythontutorial #pythonprojects #pythoncourse #pythonbaba #pythonforbeginners #pythonautomation #pythonbasic #pythonbeginners

Рекомендуемые видео