summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArjun Satarkar <me@arjunsatarkar.net>2023-05-24 16:40:41 +0000
committerArjun Satarkar <me@arjunsatarkar.net>2023-05-24 16:40:41 +0000
commit504cbcec63407d8b54ba14079a74fa48513e921f (patch)
treed04c22d4ee0f9d57492c200362d2c82e5e26ee2b
parent6f695756666712219b1597aaba59823a7b5a1ac8 (diff)
downloadDnDnDnD-504cbcec63407d8b54ba14079a74fa48513e921f.tar
DnDnDnD-504cbcec63407d8b54ba14079a74fa48513e921f.tar.gz
DnDnDnD-504cbcec63407d8b54ba14079a74fa48513e921f.zip
Reformat
-rwxr-xr-xmain.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/main.py b/main.py
index 997b1e5..c9bfc7b 100755
--- a/main.py
+++ b/main.py
@@ -2,20 +2,26 @@
import sys
try:
- word_num = int(sys.argv[1])
+ word_num = int(sys.argv[1])
except IndexError:
- word_num = None
+ word_num = None
WORDLIST_FILE_PATH = "corncob_lowercase.txt"
with open(WORDLIST_FILE_PATH, "r") as wordlist_file:
- valid_words = set([word[0].upper() + word.rstrip()[1:] for word in wordlist_file.readlines() if word.startswith("d")])
+ valid_words = set(
+ [
+ word[0].upper() + word.rstrip()[1:]
+ for word in wordlist_file.readlines()
+ if word.startswith("d")
+ ]
+ )
sys.stdout.write("Dungeons & Dragons")
for word in valid_words:
- if word_num is not None:
- if word_num <= 0:
- break
- word_num -= 1
- sys.stdout.write(" & " + word)
+ if word_num is not None:
+ if word_num <= 0:
+ break
+ word_num -= 1
+ sys.stdout.write(" & " + word)
print()