Skip to content

Instantly share code, notes, and snippets.

@sumn2u
Created May 12, 2021 17:12
Show Gist options
  • Save sumn2u/9677f7615357b3e7db234c6277118180 to your computer and use it in GitHub Desktop.
Save sumn2u/9677f7615357b3e7db234c6277118180 to your computer and use it in GitHub Desktop.
testing script
leeted = """L0r3m ip5um d010r 5i7 4m37, c0n53c737ur 4dipi5cing 31i7. A3n34n id c0nv411i5 31i7. Pr0in c0mm0d0 u7 7311u5 n0n viv3rr4. V357i8u1um gr4vid4 nunc 53d ni5i u17rici35 d4pi8u5. In 4uc70r 70r70r u7 dui f4uci8u5, vi743 p0r74 m4554 7incidun7. M0r8i id 4rcu ni8h. L0r3m ip5um d010r 5i7 4m37, c0n53c737ur 4dipi5cing 31i7. P3113n735qu3 73mpu5, ip5um vi743 in73rdum 814ndi7, 4n73 0rci 4uc70r 4ugu3, id 5c313ri5qu3 53m ni51 14cini4 0rci. Ph45311u5 c0ngu3 ju570 id in73rdum 0rn4r3. Ph45311u5 ru7rum 3r47 5i7 4m37 ip5um 53mp3r p14c3r47. V357i8u1um 54gi77i5 13c7u5 47 ip5um v3n3n47i5 p3113n735qu3. Nu114m in 7incidun7 70r70r, id h3ndr3ri7 qu4m. M0r8i 37 c0n53qu47 m37u5. M0r8i v3n3n47i5 13c7u5 n0n n3qu3 u17ric35, n3c 0rn4r3 nu114 ru7rum. M43c3n45 cur5u5 dui 5i7 4m37 54pi3n in73rdum, 3g37 dic7um ju570 1080r7i5. S3d 37 dui c0ndim3n7um, c0ngu3 ip5um u7, 313if3nd ni8h. Fu5c3 47 53m 3u 54pi3n dic7um 5c313ri5qu3."""
item_raw = leeted.split(" ")
print(item_raw)
items_clean = leeted.replace(",","").split(" ")
print(items_clean)
even = []
odd = []
for index, value in enumerate(items_clean):
if (index % 2) == 0:
even.append(value)
else:
odd.append(value)
print(even)
print(odd)
# in list items_clean find all words with an even index, collect in new list even
# even =
diggi_items = []
# # in list items_clean find all words having an odd index, collect in new list odd
# odd =
for index, value in enumerate(items_clean):
if(value[0].isnumeric()):
diggi_items.append(value)
print(diggi_items)
# # in list items_clean find all words starting with a number, collect into a new list diggi_items
# diggi_items =
# # produce a new(!) sorted list of diggi_items, sorting in ascending order, diggi_items remains unaltered
diggi_items_asc = sorted(diggi_items)
print(diggi_items_asc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment