Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Python Program to Sort Words in Alphabetic Order.py #2050

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AndrewB50
Copy link
Contributor

The .sort() function sorts strings by ASCII Code. The original code did not return all words alphabetically. I added a .lower() function to make sure all words were the same case that way they would return alphabetically.

The .sort() function sorts strings by ASCII Code. The original code did not return all words alphabetically. I added a .lower() function to make sure all words were the same case that way they would return alphabetically.
Copy link
Contributor

@NitkarshChourasia NitkarshChourasia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is good.
But can be made much better.
By making sure the cases of the letters stays consistent, and not every letter become lowercase (or uppercase if you try to do that in next commit. Please refrain from that).

Best regards,
@NitkarshChourasia

my_str = "Hello this Is an Example With cased letters"
word_Dict = {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this dictionary is used for no reason at all?

my_str = "Hello this Is an Example With cased letters"
word_Dict = {}
count = 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this variable count is used for no reason of it being anywhere in the program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants