I have an issue appending or in fact printing anything after this block of code:
reversedPriv = [52,27,13,6,3,2]
array= [9]
var = 0
numA = []
for i in array:
Instead of j
it should be var != i
:
reversedPriv = [52,27,13,6,3,2]
array= [9]
var = 0
numA = []
for i in array:
for j in reversedPriv:
while var!= i:
if j < i:
var = var + j
numA.append(j)
numA.sort()
break
break
print(numA)
Or without the while,
reversedPriv = [52,27,13,6,3,2]
array= [9]
var = 0
numA = []
for i in array:
for j in reversedPriv:
if (var != i) and j < i:
var = var + j
numA.append(j)
numA.sort()
print(numA)
Or,
reversedPriv = [52,27,13,6,3,2]
array= [9]
var = 0
numA = []
numA = [sorted([x,y]) for x,y in zip(reversedPriv[:-1],reversedPriv[1:]) if x+y == array[0]][0]
print(numA)
Output:
[3, 6]