In: Computer Science
please give thumbs up, thanks
sample output:
code:
#required funcion
def FindPair(Values,SUM):
hasfound=False;
for i in Values:
for j in Values:
if (i+j ==SUM):
hasfound=True;
a=i;
b=j;
break;
if(hasfound==True):
break;
if(hasfound==True):
print("(",a,",",b,")");
else:
print("Sorry there is no such pair of values.");
#main to call FindPair Function
def main():
Values=[3,8,13,2,17,18,10];
SUM=20;
FindPair(Values,SUM);
#callinf main functions
main()