Bring Your Logic using Python
341 subscribers
109 photos
1 video
4 files
544 links
Logic building using Python : Materials, links, e-books and Code snippets
Download Telegram
How to check whether two strings are...

a) anagrams
>>> sorted(s1) == sorted(s2)

b) consist of the same characters
>>> set(s1) == set(s2)

c) the first of them is a palindrome
>>> s1[::-1] == s1

#Tips #Python