0
I am having a tricky question with me!!!!
write a program that get up to sum =8 of the given array [1,2,3,9 ].
1 Answer
+ 6
Try this:
a=[1,2,3,9,4]
for k in a:
for y in a:
if k-y==8:
print(str(k)+" - "+str(y)+" = 8")
if k+y==8:
print(str(k)+" + "+str(y)+" = 8")
if k*y==8:
print(str(k)+" * "+str(y)+" = 8")
if k/y==8:
print(str(k)+" / "+str(y)+" = 8")
Python. It is not finished , but I hope you can finish it