May-17-2019, 09:55 PM
I think this:
for k in range (sar.index(j)+1, len(sar)): #nuo to rasto elemento ištrina visus tokius pačius #(pirmą palieka) if k >= len(sar): break if sar[k] == i: del sar[k]Could be replaced with a replace, so to speak. Something like:
start = sar.index(j) + 1 sar = sar[:start] + sar[start:].replace(i, '')Although I guess I'm assuming sar is a string. If it's a list, maybe:
start = sar.index(j) + 1 sar = sar[:start] + [x for x in sar[start:] if x != i]
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures