Answer:
Follows are the code to this question:
def FindPair(Values,SUM):#defining a method FindPair
found=False;#defining a boolean variable found
for i in Values:#defining loop for check Value
for j in Values:#defining loop for check Value
if (i+j ==SUM):#defining if block that check i+j=sum
found=True;#assign value True in boolean variable
x=i;#defining a variable x that holds i value
y=j;#defining a variable x that holds j value
break;#use break keyword
if(found==True):#defining if block that checks found equal to True
print("(",x,",",y,")");#print value
else:#defining else block
print("Sorry there is no such pair of values.");#print message
Values=[3,8,13,2,17,18,10];#defining a list and assign Values
SUM=20;#defining SUM variable
FindPair(Values,SUM);#calling a method FindPair
Output:
please find the attachment:
Explanation:
In the above python code a method, "FindPair" is defined, which accepts a "list and SUM" variable in its parameter, inside the method "found" a boolean variable is defined, that holds a value "false".