Skip to content

Instantly share code, notes, and snippets.

@twr14152
Last active November 5, 2020 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twr14152/be10a0d327867e64b9b4825f811dd576 to your computer and use it in GitHub Desktop.
Save twr14152/be10a0d327867e64b9b4825f811dd576 to your computer and use it in GitHub Desktop.
Python Keyword count
import keyword
def kw_count():
a = 0
for kw in keyword.kwlist:
a+=1
print(f"{a} ", kw)
kw_count()
'''
1 False
2 None
3 True
4 and
5 as
6 assert
7 async
8 await
9 break
10 class
11 continue
12 def
13 del
14 elif
15 else
16 except
17 finally
18 for
19 from
20 global
21 if
22 import
23 in
24 is
25 lambda
26 nonlocal
27 not
28 or
29 pass
30 raise
31 return
32 try
33 while
34 with
35 yield
'''
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment