Program 101: Ascending and Descending String using Python This program sort and display the input string into ascending and descending orders. Note: A string consists of characters like letters, numbers and and special characters Running Program: https://onlinegdb.com/7aGNa21oZ Code: # Ascending and Descending String using Python chk = input ("Enter a string/word only: ") asc = sorted(chk) asc = ''.join(asc) desc = sorted(chk, reverse=True) desc = ''.join(desc) print("\n----- Result -----") print("String Ascending Order:", asc) print("String Descending Order:", desc)
4 comments
Hello python programmer. Are you just learning or you are an expert already
Im not expert ahaha Just Learning and also a hobby :)
Oh that’s cool. It’s a fun language to learn
You're a very good programmer. Keep it up