We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 919b803 + 65e2522 commit 06b7c5eCopy full SHA for 06b7c5e
CountMillionCharacter.py
@@ -292,11 +292,9 @@
292
293
wordlist = wordstring.split()
294
295
-wordfreq = []
296
-for w in wordlist:
297
- wordfreq.append(wordlist.count(w))
+wordfreq = [wordlist.count(w) for w in wordlist]
298
299
-print("String\n" + wordstring +"\n")
300
-print("List\n" + str(wordlist) + "\n")
301
-print("Frequencies\n" + str(wordfreq) + "\n")
302
-print("Pairs\n" + str(list(zip(wordlist, wordfreq))))
+print("String\n {} \n".format(wordstring))
+print("List\n {} \n".format(str(wordlist)))
+print("Frequencies\n {} \n".format(str(wordfreq)))
+print("Pairs\n {}".format(str(list(zip(wordlist, wordfreq)))))
0 commit comments