文字未显示在屏幕上

时间:2016-11-15 22:15:17

标签: python-3.x

我无法在屏幕上显示整个文字。

我的代码是:

akiss =("Romeo.txt")
numwords = 0
numchars = 0

with open(akiss, 'r') as file:
    for line in file:
        wordslist = line.split()
        numwords += len(wordslist)
        numchars += len(line)

print (" number of words are:")
print (numwords)
print ("number of characters are:")
print (numchars)

0 个答案:

没有答案