Feb-02-2019, 08:06 AM
Hi everyone,
I am new in coding and struggling to to find a way for the following.
Can someone help me with some commands (I will study it in details then) to help me if this case.
I have have a list like this
a = [[10, 20], [30, 60], [[50, 200]]
I will create a variable (b) which will increase from ZERO until the smallest value of a[x][1].. When this variable reaches it, then I will a.append(0) or if it increase 100 times and do not reach any number, then the program stops
For example
b = 1
is b > 20 i.e a[0][1] NO
is b > 40 NO
is b > 60 NO
then
b = 2
..
b = 21
is b > 20 YES
then
a = [[10, 20, 0], [30, 40], [[50, 60]]
I am trying this:
a = [[10, 20], [30, 40], [50, 60]]
z = 0
b = 0
while z < 100:
if b > a[z][1]:
a[z].append(0)
z = 0
z += 1
b += 1
print (a)
The real case is one sample with many defects, I will test it by increasing the stress until one defect fail, at the end I will now how many defect failed by looking which one has the ZERO at the end.
Thank you!
I am new in coding and struggling to to find a way for the following.
Can someone help me with some commands (I will study it in details then) to help me if this case.
I have have a list like this
a = [[10, 20], [30, 60], [[50, 200]]
I will create a variable (b) which will increase from ZERO until the smallest value of a[x][1].. When this variable reaches it, then I will a.append(0) or if it increase 100 times and do not reach any number, then the program stops
For example
b = 1
is b > 20 i.e a[0][1] NO
is b > 40 NO
is b > 60 NO
then
b = 2
..
b = 21
is b > 20 YES
then
a = [[10, 20, 0], [30, 40], [[50, 60]]
I am trying this:
a = [[10, 20], [30, 40], [50, 60]]
z = 0
b = 0
while z < 100:
if b > a[z][1]:
a[z].append(0)
z = 0
z += 1
b += 1
print (a)
The real case is one sample with many defects, I will test it by increasing the stress until one defect fail, at the end I will now how many defect failed by looking which one has the ZERO at the end.
Thank you!