Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Python - How To Check if a String Is a Palindrome

word = input() if str(word) == str(word)[::-1] :     print("Palindrome") else:     print("Not Palindrome")
Comment

check if a string is palindrome or not using two pointer function in python

l = "I am AkiraChix"
left = 0 
right = len(l) - 1
while left < right:
    if l[left] != l[right]:
        print("False")
    else:
        left += 1        
        right -= 1
print("True")
Comment

PREVIOUS NEXT
Code Example
Python :: save standard output in variable python 
Python :: 151 - Power Crisis solution in python 
Python :: django admin text box 
Python :: get python ssl certificate location 
Python :: algebraic pyramid python 
Python :: create instances of a class in a for loop 
Python :: Python NumPy transpose Function Syntax 
Python :: unpacking tuples in python 
Python :: horizontal barplot 
Python :: how to set class attributes with kwargs python 
Python :: how to find the no of user for a wifi using python for ubuntu 
Python :: How to convert datetime in python 
Python :: pyton count senteses in a text file 
Python :: Python - Comment lire une ligne de fichier par ligne 
Python :: update dataframe based on value from another dataframe 
Python :: python get website chrome network tab 
Python :: store command in discord.py 
Python :: check whether number is even or odd 
Python :: create folders in python overwright existing 
Python :: read csv in spark 
Python :: with function python 
Python :: Query a PSQL Database From Python 
Python :: functools python install 
Python :: flask get with parameters 
Python :: importing python modules from a folder 
Python :: how to move the element of an array in python by one step 
Python :: # check if the file is not empty and get size 
Python :: sqlite database python 
Python :: generative art python 
Python :: how to insert values to database with using dictionary in python 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =