Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Python Anagram Using sorted() function

# function to check if two strings are
# anagram or not
def check(s1, s2):
     
    # the sorted strings are checked
    if(sorted(s1)== sorted(s2)):
        print("The strings are anagrams.")
    else:
        print("The strings aren't anagrams.")        
         
# driver code 
s1 ="listen"
s2 ="silent"
check(s1, s2)
Comment

PREVIOUS NEXT
Code Example
Python :: pip install time python 
Python :: modern ui python 
Python :: Examples pandas.read_hfd5() 
Python :: Code Example of Comparing None with None type 
Python :: link prettify in beautifulsoup 
Python :: Simple Example to Plot Python Treemap with lables 
Python :: Math Module asin() Function in python 
Python :: Python 2 vs Python 3 Print Statement 
Python :: for i in range(6, 11): print(i, end="") 
Python :: view(-1 1) pytorch 
Python :: meter replacement application 
Python :: boto3 get_item 
Python :: python create empty list with size 
Python :: convert float array to integer 
Python :: python ordereddict initialization 
Python :: Python NumPy squeeze function Example with axis=1 
Python :: Python NumPy copyto function example copy elements from a source array to a destination array. 
Python :: django.db.utils.operationalerror: (1051, "unknown table 
Python :: Python NumPy ascontiguousarray Function Example Tuple to an array 
Python :: how to kill python program 
Python :: get method from plot 
Python :: Python __truediv__ magic method 
Python :: python service linux 
Python :: NumPy left_shift Code When inputs and bit shift are numbers 
Python :: qt list widget let editable 
Python :: python list and numpy array 
Python :: raspberry pi set python 3 as default 
Python :: list x[:-1] 
Python :: ternary operator in list comprehension python 
Python :: python event emitter 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =