check if a string is lapindrome or not in python

Solutions on MaxInterview for check if a string is lapindrome or not in python by the best coders in the world

showing results for - "check if a string is lapindrome or not in python"
Daniela
19 May 2019
1s=input()
2s1,s2='',''
3if(len(s)%2==0):
4 s1=s[:len(s)//2] 
5 s2=s[len(s)//2:]
6else: 
7 s1=s[:len(s)//2]
8 s2=s[len(s)//2+1:]
9l1=list(s1)
10l2=list(s2)
11l1.sort()
12l2.sort()
13s1=str(l1)
14s2=str(l2)
15if(s1==s2):
16 print('YES')
17else: 
18 print('NO')