From 41fbc9dc11ea81cdd32b8d2b16674919085ba058 Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Tue, 23 Dec 2025 19:22:19 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Add=20docstrings=20to=20`firstta?= =?UTF-8?q?sk`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docstrings generation was requested by @pranjalkishor. * https://github.com/aravindputrevu/help-center/pull/90#issuecomment-3687710035 The following files were modified: * `python/simple_utils.py` --- python/simple_utils.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 python/simple_utils.py diff --git a/python/simple_utils.py b/python/simple_utils.py new file mode 100644 index 0000000..330794a --- /dev/null +++ b/python/simple_utils.py @@ -0,0 +1,38 @@ +# simple_utils.py - A tiny utility library +def reverse_string(text): + """ + Return the characters of the input string in reverse order. + + Parameters: + text (str): Input string to reverse. + + Returns: + str: The reversed string. + """ + return text[::-1] + +def count_words(sentence): + """ + Count the words in a sentence. + + Counts sequences of characters separated by whitespace in the given sentence and returns that count. + + Parameters: + sentence (str): Input text to count words in. + + Returns: + int: The number of words in the sentence. + """ + return len(sentence.split()) + +def celsius_to_fahrenheit(celsius): + """ + Convert a temperature from degrees Celsius to degrees Fahrenheit. + + Parameters: + celsius (float | int): Temperature in degrees Celsius. + + Returns: + float: Temperature in degrees Fahrenheit. + """ + return (celsius * 9/5) + 32 \ No newline at end of file