Lightbringer
Loves Me Some Souls
<Sigh> I'm afraid it's gonna be a long wait. I always get the same random numbers when I run the code.
Then you suck because that shouldn't happen.
<Sigh> I'm afraid it's gonna be a long wait. I always get the same random numbers when I run the code.
PLst = [[2, 0, 4, 5, 7, 0, 3, 2],
[0, 4, 1, 6, 0, 1, 9, 0],
[4, 0, 0, 1, 0, 8, 2, 4],
[1, 5, 0, 0, 5, 0, 0, 2],
[0, 6, 4, 3, 0, 4, 2, 6],
[7, 3, 4, 0, 2, 5, 1, 0],
[0, 1, 6, 7, 1, 0, 0, 2],
[1, 0, 2, 0, 3, 2, 5, 0]]
I contacted my son and he said this.
The variable I is the value inside the array, not its index
Yep. Hence why the 5th element is modified before it's evaluated.
I have no clue why it shows the error like 80% of the time.
I contacted my son and he said this.
.
PLst = [2, 0, 4, 5, 7, 0, 3, 2]
for I in PLst:
print(I)
how are you guys that slow.. wow.
Slow how?
The variable I is the value inside the array, not its index
Hence it is wrong to write Plst
Instead it should be just I in the if statement
you only now understand why OPs original code fails like 80% of the time
PLst = [2, 0, 4, 5, 7, 0, 3, 2]
print(sum(PLst))
Sub = 30 - sum(PLst)
print(Sub)
#Clue here
for i in range(1,Sub):
print(i,Sub - i)
Maybe I am a Drunken Computer Programmer. Like that Drunken Kung Fu Master Jackie Chan? Once he's drunk, all of sudden he's an expert at it.
Are you an alcoholic?
Remember I was drunk and already explained and just now explained again to Havana Moon? Heh.
Now what do you think of my core dump? Seems like Python doesn't like matrices. I am new to Python.