We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0043b02 commit 4d5fc2bCopy full SHA for 4d5fc2b
1 file changed
Drake-Z/0007/0007.py
@@ -16,7 +16,7 @@ def count_num(a, b):
16
if re.match(r'^#', i) == None:
17
pass
18
else:
19
- shuzi[1] += 1 #获得注释行数
+ shuzi[1] += 1 #获得注释行数,只匹配单行注释
20
if f[-1][-1:]=='\n': #最后一行为空行时
21
shuzi[2] = f.count('\n')+1 #获得空行行数
22
shuzi[0] = len(f)+1 - shuzi[2] - shuzi[1] #获得代码行数
0 commit comments