You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`#!/usr/bin/env python
#encoding=utf-8
import re
import string
print 'kill game by input end'
f=open("python_string_test.txt"); #count file
result=0;
identify=string.maketrans('','')
delEstr = string.punctuation + string.digits; #remove pounction and digit
for line in f.readlines(): #count each line
cleanline=line.translate(identify,delEstr);
lineArr = re.split(' ',cleanline);
index=0;
temp=[];
#remove '\n',''
while index<len(lineArr):
if lineArr[index]=='\n':
temp.append(str(index))
if lineArr[index]=='':
temp.append(str(index))
index=index+1;
index=0;
while index<len(temp):
lineArr.pop(len(temp)-index-1);
index=index+1;
result=result+len(lineArr);
print str(result); #result
`
The text was updated successfully, but these errors were encountered:
`#!/usr/bin/env python
#encoding=utf-8
import re
import string
print 'kill game by input end'
f=open("python_string_test.txt"); #count file
result=0;
identify=string.maketrans('','')
delEstr = string.punctuation + string.digits; #remove pounction and digit
for line in f.readlines(): #count each line
cleanline=line.translate(identify,delEstr);
lineArr = re.split(' ',cleanline);
index=0;
temp=[];
#remove '\n',''
while index<len(lineArr):
if lineArr[index]=='\n':
temp.append(str(index))
if lineArr[index]=='':
temp.append(str(index))
index=index+1;
index=0;
while index<len(temp):
lineArr.pop(len(temp)-index-1);
index=index+1;
result=result+len(lineArr);
print str(result); #result
`
The text was updated successfully, but these errors were encountered: