Last active
May 12, 2018 12:54
-
-
Save jumasheff/9db93e9da2741b26b04cd19a901178bc 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
| def second_word(text): | |
| """ | |
| returns the last word in a given text. | |
| """ | |
| some_result = "" | |
| return some_result | |
| if __name__ == '__main__': | |
| print("Example:") | |
| print(second_word("Hello world")) | |
| assert second_word("Hello world") == "world" | |
| assert second_word(" a word ") == "word" | |
| assert second_word("don't touch it") == "it" | |
| assert second_word("greetings, friends") == "friends" | |
| assert second_word("... and so on ...") == "on" | |
| assert second_word("hi") == "hi" | |
| assert second_word("Hello.World") == "World" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment