Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main():
- s = input("Input a string: ")
- i = 0
- j = len(s) - 1
- ok = True
- while i < j:
- if s[i] != s[j]:
- ok = False
- break
- i += 1
- j -= 1
- if ok:
- print("PALINDROME")
- else:
- print("NOT A PALINDROME")
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement