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 in Python by anonymous
• 120 points
7 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
635 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
148 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
170 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,880 points
461 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,970 points
129 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 2,482 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,810 points
1,860 views