Created
April 9, 2020 16:50
-
-
Save roman-on/51e820c736381dc5a367a228f8072fd5 to your computer and use it in GitHub Desktop.
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
""" | |
Write a function called last_early | |
The function accepts as a string parameter. The function returns True if the last character that appears in the string also appears earlier. Otherwise the function returns False. | |
Instructions | |
No big or small letters are important. | |
# >>> last_early("happy birthday") | |
# True | |
# >>> last_early("best of luck") | |
# False | |
# >>> last_early("Wow") | |
# True | |
# >>> last_early("X") | |
# False | |
""" | |
def last_early(my_str): | |
if my_str[-1:].lower() in my_str[:-1].lower(): | |
print("True") | |
else: | |
print("False") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment