How to arrange something in alphabetical order | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to arrange something in alphabetical order

For e.g names such as abhi, sneha, rishi, etc how to arrange them in alphabetical order in python

27th Apr 2021, 2:22 PM
Harshita Sharma
Harshita Sharma - avatar
5 Answers
+ 3
Just sort them, easy! ;)
27th Apr 2021, 2:24 PM
Rohit Kh
Rohit Kh - avatar
27th Apr 2021, 2:25 PM
Slick
Slick - avatar
+ 2
Hi You use use sorted function. s = "acxd" print (sorted(s)) #output = ['a','c','d','x'] but it's better to use loops
27th Apr 2021, 2:28 PM
Mani_K_A
0
Thanks😊
27th Apr 2021, 2:28 PM
Harshita Sharma
Harshita Sharma - avatar
0
Thanks😊😊
27th Apr 2021, 2:50 PM
Harshita Sharma
Harshita Sharma - avatar