From 2cbe9adc971fa977aaaf116e57a3a500df051ea7 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Sun, 13 Oct 2019 20:32:12 +0000 Subject: [PATCH] Travis build: 159 --- README.md | 22 ++++++++++++++++++++++ snippet_data/snippetList.json | 15 +++++++++++++++ snippet_data/snippets.json | 20 ++++++++++++++++++++ 3 files changed, 57 insertions(+) diff --git a/README.md b/README.md index e22e88462..89cf6cc0c 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,7 @@ * [`kebab`](#kebab) * [`n_times_string`](#n_times_string) * [`palindrome`](#palindrome) +* [`reverse_string`](#reverse_string) * [`snake`](#snake) * [`split_lines`](#split_lines) @@ -1929,6 +1930,27 @@ palindrome('taco cat') # True
[⬆ Back to top](#contents) +### reverse_string + +Returns the reverse of a string. + +Use string slicing to reverse the string. + +```py +def reverse_string(string): + return string[::-1] +``` + +
+Examples + +```py +reverse_string("snippet") #"teppins" +``` +
+ +
[⬆ Back to top](#contents) + ### snake Converts a string to snake case. diff --git a/snippet_data/snippetList.json b/snippet_data/snippetList.json index 1d412d9f4..43ce32d0e 100644 --- a/snippet_data/snippetList.json +++ b/snippet_data/snippetList.json @@ -928,6 +928,21 @@ "hash": "c3008a44f2eb31adaca3e4f91c29a56a955e3105f9c187aa055fc55c35874b41" } }, + { + "id": "reverse_string", + "type": "snippetListing", + "title": "reverse_string", + "attributes": { + "text": "Returns the reverse of a string.\n\nUse string slicing to reverse the string.\n\n", + "tags": [ + "string", + "beginner" + ] + }, + "meta": { + "hash": "530fb0bc1bfaf1b56910aee3137be644986727e2f15b7e7ac2010f8797d86258" + } + }, { "id": "sample", "type": "snippetListing", diff --git a/snippet_data/snippets.json b/snippet_data/snippets.json index dd46bb7d6..bde40535e 100644 --- a/snippet_data/snippets.json +++ b/snippet_data/snippets.json @@ -1228,6 +1228,26 @@ "hash": "c3008a44f2eb31adaca3e4f91c29a56a955e3105f9c187aa055fc55c35874b41" } }, + { + "id": "reverse_string", + "title": "reverse_string", + "type": "snippet", + "attributes": { + "fileName": "reverse_string.md", + "text": "Returns the reverse of a string.\n\nUse string slicing to reverse the string.\n\n", + "codeBlocks": { + "code": "def reverse_string(string):\n return string[::-1]", + "example": "reverse_string(\"snippet\") #\"teppins\"" + }, + "tags": [ + "string", + "beginner" + ] + }, + "meta": { + "hash": "530fb0bc1bfaf1b56910aee3137be644986727e2f15b7e7ac2010f8797d86258" + } + }, { "id": "sample", "title": "sample",