Created
July 22, 2021 09:34
-
-
Save oschannel/97cb5f52a4dd1a077dbba797f9ffe152 to your computer and use it in GitHub Desktop.
Python Palindrome Program for Beginners.
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
#!/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