ch05
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
# dictionary.comprehensions.positions.py
|
||||
word = 'Hello'
|
||||
|
||||
positions = {c: k for k, c in enumerate(word)}
|
||||
|
||||
print(positions) # prints: {'H': 0, 'e': 1, 'l': 3, 'o': 4}
|
||||
Reference in New Issue
Block a user