Skip to content

Commit b062731

Browse files
authored
Fix 22 (#61) also provide ways to generate letters
1. Fix #61 原始通过不了 (2) 2. 一些其他的生成 字母 `range` 的方法.
1 parent 18eaa7a commit b062731

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,11 +649,19 @@ print(a)
649649
```python
650650
def get_missing_letter(a):
651651
s1 = set("abcdefghijklmnopqrstuvwxyz")
652-
s2 = set(a)
652+
s2 = set(a.lower())
653653
ret = "".join(sorted(s1-s2))
654654
return ret
655655

656656
print(get_missing_letter("python"))
657+
658+
# other ways to generate letters
659+
# range("a", "z")
660+
# 方法一:
661+
import string
662+
letters = string.ascii_lowercase
663+
# 方法二:
664+
letters = "".join(map(chr, range(ord('a'), ord('z') + 1)))
657665
```
658666

659667
### 23.可变类型和不可变类型

0 commit comments

Comments
 (0)