initial creation

This commit is contained in:
2025-05-20 11:57:43 -04:00
commit c98b612926
8447 changed files with 1862526 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env python
"""Sort titles, ignoring leading articles"""
books = [
"A Study in Scarlet",
"The Sign of the Four",
"The Hound of the Baskervilles",
"The Valley of Fear",
"The Adventures of Sherlock Holmes",
"The Memoirs of Sherlock Holmes",
"The Return of Sherlock Holmes",
"His Last Bow",
"The Case-Book of Sherlock Holmes",
]
def strip_articles(title): # <.>
title = title.lower()
for article in 'a ', 'an ', 'the ':
if title.startswith(article):
title = title[len(article):] # <.>
break
return title
for book in sorted(books, key=strip_articles): # <.>
print(book)