+ 2

can we sory str line for example "mekteb" how can we sort it??

23rd Jun 2016, 7:37 AM
Meri
Meri - avatar
4 Respostas
+ 2
sorted ('mekteb') it will return a sorted list
23rd Jun 2016, 1:41 PM
Mario Juárez
Mario Juárez - avatar
+ 2
you can call the join method from an empty str to rebuild an str from the list "".join(sorted("mekteb"))
24th Jun 2016, 12:14 AM
Houcemeddine Filali
Houcemeddine Filali - avatar
+ 1
try sort as list
23rd Jun 2016, 8:46 AM
John Doe
John Doe - avatar
+ 1
thanks
23rd Jun 2016, 9:08 AM
Meri
Meri - avatar