Created
          April 18, 2020 22:01 
        
      - 
      
 - 
        
Save jatinsharrma/4667fbfad1b7c163620a143814cccfe1 to your computer and use it in GitHub Desktop.  
    Palindrome Check
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #------------------------------------------- | |
| #------------Palindrome--------------------- | |
| #------------------------------------------- | |
| # this function check whether given string is palindrome or not | |
| def palindrome(string): | |
| length = len(string) | |
| mid = length//2 | |
| for i in range(mid): | |
| if string[i] != string[length -1 -i]: | |
| return False | |
| return True | |
| # testing | |
| print(palindrome("naman")) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment