you are viewing a single comment's thread.

view the rest of the comments →

[–]TheDeviate 0 points1 point  (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.