Complete the function diff do not modify the rest

0 votes
def diff(a,b):
    
# end function

print(" *** Find difference between A(x1,y1) and B(x2,y2) ***")
ins = input("Enter x1 y1 x2 y2 : ").split()
pointA= (int(ins[0]),int(ins[1]))
pointB= (int(ins[2]),int(ins[3]))
print("A B ==>",pointA,pointB)
print("Differnce from", pointA,"to", pointB,"==>",diff(pointA,pointB))
print("Differnce from", pointB,"to", pointA,"==>",diff(pointB,pointA))
output
 *** Find difference between A(x1,y1) and B(x2,y2) ***
Enter x1 y1 x2 y2 : 1 2 3 4
A B ==> (1, 2) (3, 4)
Differnce from (1, 2) to (3, 4) ==> (2, 2)
Differnce from (3, 4) to (1, 2) ==> (-2, -2)
Nov 22, 2021 in Python by anonymous
• 120 points
410 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Python

0 votes
1 answer

What does the random.triangular(low, high, mode) function do in python?

It returns a random floating point number ...READ MORE

answered May 27, 2019 in Python by Vinod
1,099 views
0 votes
1 answer

What to do when len() does not return the number of integers in range(1,100)?

You can use the following code block: x=range(1,100) len(x) Output: ...READ MORE

answered May 28, 2019 in Python by Fata
• 1,050 points
859 views
0 votes
1 answer

What does the dir() function do in python?

The dir() function returns all properties and methods of ...READ MORE

answered Aug 6, 2019 in Python by Mohammad
• 3,230 points
949 views
0 votes
1 answer

How do I use Django templates without the rest of Django?

Hello @kartik, Let's say you have this important ...READ MORE

answered Jun 23, 2020 in Python by Niroj
• 82,840 points
1,586 views
0 votes
1 answer

Why do we not follow the "off by one" rule in python

It's because of the way in which ...READ MORE

answered Nov 15, 2020 in Python by Gitika
• 65,770 points
689 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,467 views
0 votes
1 answer
+5 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,790 points
4,127 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP