Dec-20-2017, 10:08 PM
arr=[1,2,3,9] ip=arr[0] im=arr[3] srcfor=ip+im i=8 while srcfor>=0: if srcfor<8: ip+=1 srcfor=ip+im if srcfor==i: break else: if srcfor<8: im-=1 srcfor=ip+im if srcfor==i: break print (srcfor)
Hi, I'm new of the Forum. The code that you can see at the top of the thread is a my experiment. I was searching to create a code that into an array search a couple of numbers that if sum, the result would be 8. So I tried with some while loops and if statements, but it don't give me any output, Please Help Me.