Building finder palindrome – Python

Palindrome check:

this program check if a string is a palindrome

Used: for , if , else

palindrome.png
To copy or see all commands you can click on Details button below

 

#!/usr/bin/python

”’
author: Hopeless
task: check if a string is a palindrome
”’

string = raw_input(‘[*] enter your string: ‘)

#rev_string
rev_string = ”

for i in range(len(string)):
rev_string += string[len(string)-i-1]

if rev_string==string:
print True
else:
print False
print

print rev_string
print string

 

Untitled.png

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s