Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def is_palindrome(w):
- """
- Gib True zurueck, wenn das Wort eine Palindrom ist,
- andernfalls gib False zurueck.
- Annahme: Strings.
- """
- if len(w) == 0 or len(w) == 1:
- return True
- if w[0] == w[-1]:
- return is_palindrome(w[1 : -1])
- else:
- return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement