From ead490d726a2efddc379f0a370f2d54f5fa78c65 Mon Sep 17 00:00:00 2001
From: AndrewB50 <97339555+AndrewB50@users.noreply.github.com>
Date: Sat, 9 Dec 2023 02:20:36 -0600
Subject: [PATCH] Update Python Program to Sort Words in Alphabetic Order.py

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.
---
 ... Program to Sort Words in Alphabetic Order.py | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/Python Program to Sort Words in Alphabetic Order.py b/Python Program to Sort Words in Alphabetic Order.py
index f4ebe04a29c..63e0fc36248 100644
--- a/Python Program to Sort Words in Alphabetic Order.py	
+++ b/Python Program to Sort Words in Alphabetic Order.py	
@@ -1,18 +1,18 @@
-# Program to sort alphabetically the words form a string provided by the user
+# Program to sort words alphabetically and print them out in a list
 
+#declaring variables
 my_str = "Hello this Is an Example With cased letters"
+word_Dict = {}
+count = 0
+
+#Need to make all words the same case, otherwise, the .sort() function sorts them by ASCII code and they will not appear alphabetically. 
+my_str = my_str.lower()
 
 # To take input from the user
 #my_str = input("Enter a string: ")
 
 # breakdown the string into a list of words
 words = my_str.split()
-
-# sort the list
 words.sort()
 
-# display the sorted words
-
-print("The sorted words are:")
-for word in words:
-   print(word)
+print(words)