-1

コードに問題があります。これを実行すると、構文エラー「print」が表示されます

word1 = input("Words: ")
characters = len(word1)
listOfStuff = str(word1)
strip = ""
x = 1
while not characters > 140 - 11:
    word = input("Words: ")
    if characters <= 140 - 11:
        listOfStuff = listOfStuff + ' ' + str(word)
        characters = characters + len(word) - 1
    elif characters > 140 - 11:
        strip = len(word)
        break
finalLength = len(listOfStuff)
print(listOfStuff.rstrip(strip)
print(finalLength)

私はいつ間違っていますか?

4

2 に答える 2

5

閉じ括弧がありません:

print(listOfStuff.rstrip(strip)
#                      --------^
于 2013-08-29T08:54:05.690 に答える