From e5acf8c7624e0b4bff1b4572dd19d7f99563c269 Mon Sep 17 00:00:00 2001 From: Soumya sankar <72860338+soumyasankar99@users.noreply.github.com> Date: Sat, 23 Sep 2023 20:12:49 +0530 Subject: [PATCH] Created using Colaboratory --- Function_001.ipynb | 250 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 223 insertions(+), 27 deletions(-) diff --git a/Function_001.ipynb b/Function_001.ipynb index 91d1750..08c8b4e 100644 --- a/Function_001.ipynb +++ b/Function_001.ipynb @@ -4,7 +4,7 @@ "metadata": { "colab": { "provenance": [], - "authorship_tag": "ABX9TyMHsZbW7zZzvbRCRJfl5ylD", + "authorship_tag": "ABX9TyP2kd402f3j+b2iMsCFjp0y", "include_colab_link": true }, "kernelspec": { @@ -113,7 +113,7 @@ "![images.png](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPEAAADRCAMAAAAquaQNAAAAkFBMVEX////u7u7t7e0AAAD29vb19fX39/f5+fn09PTy8vL4+Pj+/v78/Pzv7+/7+/vx8fGdnZ1MTEySkpLb29vCwsIiIiLm5ubMzMy2trZHR0dmZmZeXl7T09OCgoJpaWmsrKxzc3N5eXmIiIg3NzcsLCyPj49AQEBQUFCkpKRXV1e8vLyysrImJiYREREYGBhBQUGmRLyKAAAZEUlEQVR4nO1di3riKhCGkAu5YtXGetdWW7WXff+3OzMQQ4zEJGpdu6ec821R4h/+BIaBGQZCMHEKyZdZzFkB5iILsyFmbfxWyHKBXzqYC2V5gllPZjUU11BeDZStoSIJheW0GirRt3JqoAIN5Wso8sv4Wxgn/zvGd/iOLUgZY8xmjDGpamIuVtiYlYyJLM8YY9JQXJd7JiihobJqYoqaQCW63NFQsQkqwFzGWEMRjsn1IAUyi7nExpwjs7rck9kAc66+1MGcrS8N2kElRiivOVShvA5KlVe0FytvLzF+6Zbbi6XbC2T3LyJv5c2g5Dt3MRvrpulUQ3G81Ym+VwflqVo3YUyNjBV2oYdUM/aNUOVqSqgaxgVpQ42Mdb8+gvqBjA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vEDgxIJ4gevE2cIF57LDhFkrlFdKNTifEjr8sO/h9nV3/Brta8UdKH8bk1Lfuzv7MT0VHM8yPLzCsqiDNpu+rpUN2ldaZEyNGsh1GNNzGV944rNI0yKUb51jP65r1ZX2jWP7sZFxCerCEyazNZE2UW5Kp8DXnRJfyLp1l94Qqlx+4tJWUW7yF2W2vleOx9ePcqM9GVpEuUlurYFcc/+x7KE/YS3zQsaH8vX/wPjwHV+yXl3Y4UWzke7wt4XdP1ruGxnTYo/JoYyMFZSrb1VifARVWqEvvGNV6wKUMEEVBr7GUW7IlezHBaizotz8i/bjGijFuAbqh9mPfxlfm7HufN+1Qm+1tx9XR7lpYT8+3n9cONHK3weJSXRomqQQ5cbfnw2VuKVyR5dnG1a+A8oxQRVqXYayS7dSUJf7c9F6LfP6UW6Mfe8botxUMf7VMn+AlpljW8eMrYq5Uwvf21NQ550wWTl3qoWixig3iY4nk+hyY+iZRMeTSXR5MyivEsprDlUor4M6J8oNuenoVB3l5iLvJoV92EN+tcx/UedqybiA3Wgts8U7LlTzilAl+3HOGLOZb1hIQumkb+GBPfsFSCzP3jF8HVLFOMwZ51BcZukeipyAsktQWTUPoHLf28ZQkYRSsjkkud0A7cf/AVViUTH0Ig0MAAAAAElFTkSuQmCC)" ], "metadata": { - "id": "oDGmdgLmsTqg" + "id": "2yt7H_bus9_F" } }, { @@ -322,7 +322,7 @@ "id": "8zWetFK_jYaV", "outputId": "14e0deb8-d331-4abc-e57d-3a7da276eb5b" }, - "execution_count": 1, + "execution_count": null, "outputs": [ { "output_type": "stream", @@ -398,7 +398,7 @@ "id": "ONmpyBm7jYgu", "outputId": "d4d2c6ef-eccc-49de-d5de-53749e109885" }, - "execution_count": 2, + "execution_count": null, "outputs": [ { "output_type": "stream", @@ -450,7 +450,7 @@ "id": "dEo8TmUrjYm4", "outputId": "e53c18fc-cd24-4ce5-a941-3a5be8e796f6" }, - "execution_count": 3, + "execution_count": null, "outputs": [ { "output_type": "stream", @@ -485,7 +485,7 @@ "id": "ihlEKtTkjYqZ", "outputId": "5e545238-e6c4-46f6-a842-f2080603e830" }, - "execution_count": 4, + "execution_count": null, "outputs": [ { "output_type": "execute_result", @@ -1326,7 +1326,7 @@ }, "outputId": "11561dd5-fedd-41c7-ef6f-bb3f6ad3dc47" }, - "execution_count": 7, + "execution_count": null, "outputs": [ { "output_type": "stream", @@ -1369,7 +1369,7 @@ }, "outputId": "75cd0678-3ec5-40c9-d098-4111751dbafc" }, - "execution_count": 9, + "execution_count": null, "outputs": [ { "output_type": "stream", @@ -1419,7 +1419,7 @@ }, "outputId": "eec061b1-ee31-4d7e-f8ba-f1dd1da1c4cc" }, - "execution_count": 11, + "execution_count": null, "outputs": [ { "output_type": "stream", @@ -1474,7 +1474,7 @@ }, "outputId": "4bf27783-d58c-4c1f-e4d0-7c27facf9660" }, - "execution_count": 12, + "execution_count": null, "outputs": [ { "output_type": "stream", @@ -1530,7 +1530,7 @@ "id": "oPC-pQ-6pHjG", "outputId": "42a5e9ee-9f92-4d37-8ae7-644e8917633f" }, - "execution_count": 14, + "execution_count": null, "outputs": [ { "output_type": "stream", @@ -1572,7 +1572,7 @@ "id": "JXKlgsH3pHfM", "outputId": "1797dce0-732a-4bf7-e9b6-e0e35eabe351" }, - "execution_count": 15, + "execution_count": null, "outputs": [ { "output_type": "stream", @@ -1604,7 +1604,7 @@ "id": "UOIwHBwapHbk", "outputId": "077130cf-6183-480a-dd05-5e8a328268c4" }, - "execution_count": 16, + "execution_count": null, "outputs": [ { "output_type": "stream", @@ -1636,7 +1636,7 @@ "id": "YHFua1IhpHZ4", "outputId": "48b24b00-99d4-4c68-c358-bfa3e6f6a9e8" }, - "execution_count": 17, + "execution_count": null, "outputs": [ { "output_type": "stream", @@ -1686,12 +1686,12 @@ "metadata": { "colab": { "base_uri": "https://localhost:8080/", - "height": 70 + "height": 87 }, "id": "RvN8M8FPpHUW", "outputId": "9c2932a2-a8ba-4d3f-e7b3-4015e0125df1" }, - "execution_count": 19, + "execution_count": null, "outputs": [ { "output_type": "stream", @@ -1735,7 +1735,7 @@ "id": "4N1KqUMKpHR5", "outputId": "1660e017-f31f-4787-b2fc-7218a18398d2" }, - "execution_count": 20, + "execution_count": null, "outputs": [ { "output_type": "stream", @@ -1768,7 +1768,7 @@ "id": "jXGbNHkgpHMz", "outputId": "c80e2a99-ec48-40ab-facb-388ef623d52d" }, - "execution_count": 23, + "execution_count": null, "outputs": [ { "output_type": "stream", @@ -1809,7 +1809,7 @@ "id": "c8rQx8SupHJR", "outputId": "82e8cfde-3194-4498-dd0d-e2a37f196ae9" }, - "execution_count": 25, + "execution_count": null, "outputs": [ { "output_type": "stream", @@ -1842,7 +1842,7 @@ }, "outputId": "3a4393ac-61a4-4a55-f49b-3ca6d601d021" }, - "execution_count": 26, + "execution_count": null, "outputs": [ { "output_type": "stream", @@ -1892,8 +1892,7 @@ "\n", " return True #The number is prime\n", "\n", - "print(is_prime(17)) # o/p-True = 17\n", - "" + "print(is_prime(17)) # o/p-True = 17\n" ], "metadata": { "id": "lJ6x0YjsLOCS" @@ -1965,7 +1964,7 @@ "id": "Ef7NVRLLLOF0", "outputId": "433fbb7b-1d8a-48c8-d1f0-49c1b92680aa" }, - "execution_count": 29, + "execution_count": null, "outputs": [ { "output_type": "stream", @@ -2028,7 +2027,7 @@ "id": "jIdYqCnmdLTO", "outputId": "b09e4e96-0c6d-4f72-b2b4-e66bc791a494" }, - "execution_count": 31, + "execution_count": null, "outputs": [ { "output_type": "stream", @@ -2105,7 +2104,7 @@ "id": "LJYRWVoCdLZk", "outputId": "b14be30d-f991-4b9b-cccc-aa7fb142d397" }, - "execution_count": 35, + "execution_count": null, "outputs": [ { "output_type": "stream", @@ -2147,7 +2146,112 @@ "id": "f5i3M89mdLo7", "outputId": "4ea11c9f-ef7c-4777-dac5-bb146773bfc8" }, - "execution_count": 36, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "True\n", + "False\n", + "False\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "#Level 3" + ], + "metadata": { + "id": "vbqXoVDOtIJw" + } + }, + { + "cell_type": "markdown", + "source": [ + "Q 2)Call your function factorial, it takes a whole number as a parameter and it return a factorial of the number" + ], + "metadata": { + "id": "9XpKxXqYtRZT" + } + }, + { + "cell_type": "code", + "source": [ + "def factorial(number):\n", + "\n", + " if number < 0:\n", + " raise ValueError(\"Factorial is not defined for negative numbers.\")\n", + "\n", + " elif number == 0:\n", + " return 1\n", + " else:\n", + " result = 1\n", + " for i in range(1,number + 1):\n", + " result *= i\n", + " return result\n", + "\n", + "# Example usage:\n", + "result = factorial(10) # Factorial of 5: 5! = 5*4*3*2*1\n", + "print(result)" + ], + "metadata": { + "id": "jpzCVcPDLOTK", + "colab": { + "base_uri": "https://localhost:8080/" + }, + "outputId": "5303ada1-bd68-41d8-9025-3da99e15ac31" + }, + "execution_count": 2, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "3628800\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "Q 3)Call your function is_empty, it takes a parameter and it checks if it is empty or not" + ], + "metadata": { + "id": "58B1HzApTJK7" + } + }, + { + "cell_type": "code", + "source": [ + "def is_empty(parameter):\n", + " if not parameter:\n", + " return True\n", + " else:\n", + " return False\n", + "\n", + "# Example usage:\n", + "empty_string = \"\"\n", + "non_empty_string = \"Hello, World!\"\n", + "empty_list = []\n", + "non_empty_list = [1,2,3]\n", + "\n", + "print(is_empty(empty_string))\n", + "print(is_empty(non_empty_string))\n", + "print(is_empty(empty_list))\n", + "print(is_empty(non_empty_list))" + ], + "metadata": { + "id": "5Nk42T9wtHAY", + "colab": { + "base_uri": "https://localhost:8080/" + }, + "outputId": "f5743907-d41d-4f9a-d30d-b3d72e09d624" + }, + "execution_count": 4, "outputs": [ { "output_type": "stream", @@ -2155,16 +2259,108 @@ "text": [ "True\n", "False\n", + "True\n", "False\n" ] } ] }, + { + "cell_type": "markdown", + "source": [ + "Q 4)Write different functions which take lists. They should calculate_mean, calculate_median, calculate_mode, calculate_range, calculate_variance, calculate_std (standard deviation)." + ], + "metadata": { + "id": "86Wm5hfBUu4k" + } + }, + { + "cell_type": "code", + "source": [ + "import statistics\n", + "\n", + "def calculate_mean(numbers):\n", + " \"\"\"\n", + " Calculate the mean (avg) of a list of numbers.\n", + "\n", + " parameters:\n", + " numbers (list): The list of numbers.\n", + "\n", + " Returns:\n", + " float: The mean of the numbers.\n", + " \"\"\"\n", + " return sum(numbers)/len(numbers)\n", + "\n", + "def calculate_meadian(numbers):\n", + " return statistics.median(numbers)\n", + "\n", + "\n", + "def calculate_mode(numbers):\n", + " return statistics.mode(numbers)\n", + "\n", + "\n", + "def calculate_range(numbers):\n", + " return max(numbers)- min(numbers)\n", + "\n", + "\n", + "def calculate_variance(numbers):\n", + " return statistics.variance(numbers)\n", + "\n", + "\n", + "def calculate_std(numbers):\n", + " return statistics.stdev(numbers)\n", + "\n", + "\n", + "# Example usage:\n", + "print('==================================================')\n", + "data = [1,2,3,4,5,6,7,8,9]\n", + "print(\"Mean:\",calculate_mean(data))\n", + "print(\"Median:\", calculate_meadian(data))\n", + "print(\"Mode:\", calculate_mode(data))\n", + "print(\"Range:\", calculate_range(data))\n", + "print(\"Variance:\", calculate_variance(data))\n", + "print(\"Standard Deviation:\", calculate_std(data))\n", + "print('===================================================')" + ], + "metadata": { + "id": "kmmyI6-xtHDs", + "colab": { + "base_uri": "https://localhost:8080/" + }, + "outputId": "d6be0e28-81d4-441f-9355-f0c9e4cb3efe" + }, + "execution_count": 11, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "==================================================\n", + "Mean: 5.0\n", + "Median: 5\n", + "Mode: 1\n", + "Range: 8\n", + "Variance: 7.5\n", + "Standard Deviation: 2.7386127875258306\n", + "===================================================\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "XJjUDPrutHHC" + }, + "execution_count": null, + "outputs": [] + }, { "cell_type": "code", "source": [], "metadata": { - "id": "jpzCVcPDLOTK" + "id": "piXRTJy5tHK3" }, "execution_count": null, "outputs": []