WelcomeUser Guide
ToSPrivacyCanary
DonateBugsLicense

©2026 Poal.co

387

options = "zero -1 two three four -55555 six -7777777 eight nine ten -11 twelve thirteen fourteen -123454321 -15 sixteen -17" hyphenIndex, spaceIndex, tokenTuple = (), (), () pos = 0 print(options) while pos < len(options): if options[pos] == "-": hyphenIndex = hyphenIndex + (pos,) print("HYPH: \'-\'", pos) tmpPos = options.find(" ", pos) if tmpPos != -1: pos = tmpPos spaceIndex = spaceIndex + (pos,) print("ZERO: \' \'", pos) if len(hyphenIndex) > len(spaceIndex): spaceIndex = spaceIndex + (len(options),) pos += 1 flagSlices = tuple(zip(hyphenIndex, spaceIndex)) print(flagSlices) for start, end in flagSlices: print(start, end) print(options[start:end])

I don't know, it works, fuck you. It's really annoying ho there's no required semi-colon to end statements and how loops / conditions / whatever else ends in colon. The tab thing is kind of cool, the "immutable" lie is stupid AF and I spent more time working through that than anything else. That I can't change the step rate of my iterator in a for loop is just bad. Oh, range(5) = [0, 4], but it's actually [0, 5), it's dumb, I hate it, it doesn't mimic C as is often claimed and ... what ever. Oh, "HUMAN READABLE" kill yourself.

options = "zero -1 two three four -55555 six -7777777 eight nine ten -11 twelve thirteen fourteen -123454321 -15 sixteen -17" hyphenIndex, spaceIndex, tokenTuple = (), (), () pos = 0 print(options) while pos < len(options): if options[pos] == "-": hyphenIndex = hyphenIndex + (pos,) print("HYPH: \'-\'", pos) tmpPos = options.find(" ", pos) if tmpPos != -1: pos = tmpPos spaceIndex = spaceIndex + (pos,) print("ZERO: \' \'", pos) if len(hyphenIndex) > len(spaceIndex): spaceIndex = spaceIndex + (len(options),) pos += 1 flagSlices = tuple(zip(hyphenIndex, spaceIndex)) print(flagSlices) for start, end in flagSlices: print(start, end) print(options[start:end]) I don't know, it works, fuck you. It's really annoying ho there's no required semi-colon to end statements and how loops / conditions / whatever else ends in colon. The tab thing is kind of cool, the "immutable" lie is stupid AF and I spent more time working through that than anything else. That I can't change the step rate of my iterator in a for loop is just bad. Oh, range(5) = [0, 4], but it's actually [0, 5), it's dumb, I hate it, it doesn't mimic C as is often claimed and ... what ever. Oh, "HUMAN READABLE" kill yourself.

(post is archived)

[–] 1 pt

options = "zero -1 two three four -55555 six -7777777 eight nine ten -11 twelve thirteen fourteen -123454321 -15 sixteen -17" tokens = options.split() negative_tokens = [token for token in tokens if token.startswith('-')] print("Extracted negatives:") for i, token in enumerate(negative_tokens): print(f"{i+1}: {token}")

[–] 0 pt

Yeah, it's day 3 of Python for me, so I didn't use split because I wanted to do the thinking, the scripting. Python is fucking retarded because they're no type conversion.

I also don't know what half of your shit does.

[–] 0 pt (edited )

The bracket notation is a list comprehension. It's there in place of the plain old for loop. It iterates how you specify and applies a function. If you want to do type conversion, you can do like strings = ['1', '2', 'abc', '4'] integers = [int(s) for s in strings if s.isdigit()] print(integers)