Skip to content

Instantly share code, notes, and snippets.

@oschannel
Created July 22, 2021 09:34
Show Gist options
  • Save oschannel/97cb5f52a4dd1a077dbba797f9ffe152 to your computer and use it in GitHub Desktop.
Save oschannel/97cb5f52a4dd1a077dbba797f9ffe152 to your computer and use it in GitHub Desktop.
Python Palindrome Program for Beginners.
#!/usr/bin/env python3
"""This code is from Youtube Video:
Python Palindrome Program for Beginners | By OsChannel
Watch on Youtube: https://youtu.be/jUFnTxXITDw
"""
def is_palindrome(text):
text = str(text)
if text == text[::-1]:
print("{} is a Palindrome".format(text))
return True
else:
print("{} is not a Palindrome".format(text))
return False
x = 'madam'
y = 'oschannel.com'
z = 12121
is_palindrome(x)
is_palindrome(y)
is_palindrome(z)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment