Try:
dice = [1, 3, 4, 1]
newval=""
for i in range(len(dice)):
if dice[i] == 1:
newval = dice[1:i]
print(newval)
1
solved convert javascript to python : looping for in python [closed]
Try:
dice = [1, 3, 4, 1]
newval=""
for i in range(len(dice)):
if dice[i] == 1:
newval = dice[1:i]
print(newval)
1
solved convert javascript to python : looping for in python [closed]