2
のPythonを使用すると、これは私のコードです:フラスコ とPythonとフラスコ
word=input("Type Something: ")
listofwords=word.split()
wordfreq = []
for w in listofwords:
wordfreq.append(listofwords.count(w))
print("Word: "+str(listofwords)+ "\n")
print("Count: "+str(wordfreq) + "\n")
私のコードは正常に動作します。私の唯一の問題は、水平方向に印刷することです。 単語:['is'、 'the'、 'bus'、 'at'、 'the'、 'terminal'] Count:[1,2,1,1 、2、1]
どのように私はこのようにプリントアウト垂直私の結果を持っています: ワード カウント1 "" 2 " "で" 1 "" 2 "バス" 1 "です"端末 "1
また、私のコードのどの部分を自分のhtmlの表セクションに" tr "と" td "の下に置くべきですか。私はすでに「th」の下にWordとCountを持っており、正常に動作します。 python 3.xでは