Last active
August 16, 2021 17:23
-
-
Save artsi0m/57a5924dbb1ca43a33037a06afd5e1b6 to your computer and use it in GitHub Desktop.
My codewars snippets
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
| ################################################################ | |
| # https://docs.python.org/3/tutorial/datastructures.html | |
| # https://docs.python.org/3/howto/sorting.html | |
| # https://docs.python.org/3/library/stdtypes.html | |
| def array_diff(a, b): | |
| c = [] | |
| for el in a: | |
| if el not in b: | |
| c.append(el) | |
| return c |
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
| ################################################################ | |
| # https://pyformat.info/ | |
| # https://docs.python.org/3/library/functions.html?highlight=slice | |
| # https://docs.python.org/3/faq/design.html#why-are-python-strings-immutable | |
| # stackoverflow.com/ | |
| # questions/12169839/which-is-the-preferred-way-to-concatenate-a-string-in-python | |
| # stackoverflow.com/ | |
| # questions/60497971/how-can-i-slice-out-the-last-and-first-characters-of-a-string-in-python | |
| def to_jaden_case_word(word): | |
| capital_letter = '' | |
| capital_letter = word[:1].capitalize() | |
| str = '{}{}' | |
| return str.format(capital_letter, word[1::1] ) | |
| def to_jaden_case(string): | |
| str = '' | |
| for word in string.rsplit(' '): | |
| _word = to_jaden_case_word(word) | |
| __word = '{} ' | |
| str += __word.format(_word) | |
| return str[0:-1] |
Author
Author
You can write here if you think that it should be private gist.
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.codewars.com/kata/5390bac347d09b7da40006f6/train/python