Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions strings/is_palindrome.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
def is_palindrome(txt):
"""
Checks if a given text is a palindrome.

A palindrome is a word or phrase that reads the same forwards and backwards.

Parameters:
txt (str): The text to check.

Returns:
bool: True if the text is a palindrome, False otherwise.
"""
return txt == txt[::-1]


print(is_palindrome("radar"))