Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

alphabeticallly

a=[2,2,4,1]
b=a
a.sort()
// a now points to object [1,2,2,4]
c=sorted(b)
//c and b also points to [1,2,2,4] 
// sort works on array only but sorted also on strings but return array of char
s="sjndk"
print(sorted(s))
// prints ['d', 'j', 'k', 'n', 's']
// sorted also works on list of strings(sorts alphabetically)
Comment

PREVIOUS NEXT
Code Example
Python :: HOW TO CREATE A DATETIME LIST QUICK 
Python :: __add__ 
Python :: iterate rows and columns dataframe 
Python :: python list insert 
Python :: python list to set 
Python :: run django server on any network address of the system 
Python :: how to use mtproto proxy for telethon 
Python :: python get focused window 
Python :: python all option 
Python :: instance variable python 
Python :: python zip file 
Python :: how to decode recv data in python 
Python :: argparse for Command-Line Interface (CLI) 
Python :: are there learning activities for django-debug-toolbar 
Python :: print 
Python :: calculate the R^2 for X and Y python 
Python :: add a row at a specific index pandas 
Python :: random number list 
Python :: string to list 
Python :: how to adda vaslues to data frame 
Python :: what is an object in python 
Python :: python take input without displaying it 
Python :: python bot ban script 
Python :: length of dictionary python 
Python :: if a specific column name is present drop tyhe column 
Python :: what is in the python built in namespace 
Python :: keras backend matrix multiplication 
Python :: minio python create bucket 
Python :: speech to text 
Python :: how to get all 5 letter words in python 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =