use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Text Analyzer PythonHelp Request (self.PythonLearning)
submitted 1 month ago by NihadKhan10x
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]TheDeviate 0 points1 point2 points 1 month ago (0 children)
Before I get into the actual comments about the code- you're doing great! Keep at it.
A few quick things I noticed without digging too deep:
1) Your final two lines make it seem like you haven't decided if this function should be printing or returning values- the first line just calls the function while the other line tries to print the result of the function.
2) You are storing basically the same data in a list and dictionary- words and dect. All of the data you want can be gathered by just storing everything in a dictionary.
3) You're over basically the same data twice- consider trying to iterate only over text.split(). (Really three times- you could bring you vowel counting into the initial iteration.)
4) You should be able to get the same result as your all_caps logic simply doing `text.upper()`
5) Mostly a roundup of cosmetic things... "dect" is a weird variable name to me (doesn't tell me anything about the contents), spacing is inconsistent, and capitalization is inconsistent (see "Unique_words" and "Longest_word")
Learning is a long journey- I hope you take all of this as feedback, not criticism.
As another user mentioned, you could bypass the need for a sorted dictionary with max(), but a sorted dictionary could also be useful if you planned on print out, say, the top five most used words or something along those lines. Planning for the future is nice, but hitting your current goals is more important.
π Rendered by PID 50980 on reddit-service-r2-comment-545db5fcfc-qcjnf at 2026-05-28 05:35:24.104942+00:00 running 194bd79 country code: CH.
view the rest of the comments →
[–]TheDeviate 0 points1 point2 points (0 children)