Skip to content

Commit

Permalink
Arrange in Alphabetical Order
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartikeya006 committed Oct 20, 2020
1 parent 303be3e commit c11eecd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Python-programming-1/alpha_rearrange.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Program to Rearrange the Entered Lower Case Alphabets in their Correct Arrangement
a = int(input("Enter Number of Alphabets:-"))
b = []
for i in range(a):
b.append(input(f"Enter {i}th Lower Case Alphabet:-"))
for i in range(a):
b[i] = ord(b[i])
b.sort()
for i in range(a):
b[i] = chr(b[i])
print("Alphabets in Correct Arrangement:-")
print(b)

0 comments on commit c11eecd

Please sign in to comment.