Computer Science, asked by varshi1708, 10 months ago

computer science program using python language
In the town of line segments, Iwo line segments can
only become friends I their slopes are equal Line
segments are not smart enough to calculate their own
or some other line segment's slope so they use a
machine called the slopeFinder to check their
compatibility. Recently someone stole the slopeFinder
and now the line segments are upsel because they
cannot make new friends. The Mayor of the town has
hled you to wille a code to lix the crisis that thell town
is lacing
Input Format
Input Contains two line segments each on a line of its
own Cach line segment is denoted by lour Integers Xa,
Ya, Xb and Yb where (X, Ya) and (Xb, Yb) denole the
two and points of the line segment
Constraints
0 < Xal|XB|YO||YD| < 100
Output Format
Output yes it both the line segments have the same
slope and "no" otherwise (without the quotes)
Samplo Input o
0011
1021

Answers

Answered by raniadra1980
4

Answer:

first complete java is then start pythone

Answered by poojan
17

The slopes of line segments program:

Program:

slopes=[]

#taking the attributes of 2 line segments and calculating their slopes

for i in range(2):

   xa,ya,xb,yb=map(int,input().split())

   slope=(yb-ya)/(xb-xa)

   slopes.append(slope)

#Checking if the slopes are equal or not

if slopes[0]==slopes[1]:

   print("yes")

else:

   print("no")

Input:

0 0 1 1

1 0 2 1

Output:

Yes

Learn more:

1) Write a Python function sumsquare(l) that takes a nonempty list of integers and returns a list [odd,even], where odd is the sum of squares all the odd numbers in l and even is the sum of squares of all the even numbers in l.

brainly.in/question/15473120

2) Python program to find absolute difference between the odd and even numbers in the inputted number.

brainly.in/question/11611140

Attachments:
Similar questions