Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7265482

Browse files
committed
Finalize
1 parent 94f19ea commit 7265482

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

07_gashlycrumb/gashlycrumb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def main():
4343
dictionary = {}
4444

4545
for line in dictionary_source:
46-
dictionary[line[0]] = line.rstrip()
46+
dictionary[line[0].upper()] = line.rstrip()
4747

4848
for letter in letters:
4949
print(dictionary.get(letter.upper(),'I do not know \"'+letter+'\".'))

README_fleide.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,16 @@ print(f'{num_lines:8}{num_words:8}{num_bytes:8} {fh.name}')
238238

239239
```PYTHON
240240

241+
dictionary = {}
241242

243+
for line in dictionary_source:
244+
dictionary[line[0].upper()] = line.rstrip()
245+
246+
#alt
247+
lookup = { line[0].upper() : line.rstrip() for line in dictionary_source}
248+
249+
#from module import function as alias
250+
from pprint import pprint as pp
251+
pp(dictionary)
242252

243253
```

0 commit comments

Comments
 (0)