{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"authorship_tag":"ABX9TyMPJmN54FOfvQbMeIHbzVyc"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"code","execution_count":2,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"lD61AtyNuufU","executionInfo":{"status":"ok","timestamp":1717697410634,"user_tz":-330,"elapsed":671,"user":{"displayName":"Amit Sachan","userId":"17076119069500437280"}},"outputId":"5af75f0a-4a00-45b6-8039-15c3d232a3f1"},"outputs":[{"output_type":"stream","name":"stdout","text":["[24, 76, 28]\n"]}],"source":["# Filtering even numbers from a list:\n","numbers = [11, 23, 13, 41, 24, 35, 76, 17, 28, 19]\n","even_numbers = list(filter(lambda x: x % 2 == 0, numbers))\n","print(even_numbers)"]},{"cell_type":"code","source":["# Computing the square of each number in a list:\n","numbers = [11, 23, 13, 41, 24, 35, 76, 17, 28, 19]\n","squared_numbers = list(map(lambda x: x**2, numbers))\n","print(squared_numbers)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"sIPlREK8vgkL","executionInfo":{"status":"ok","timestamp":1717697410634,"user_tz":-330,"elapsed":30,"user":{"displayName":"Amit Sachan","userId":"17076119069500437280"}},"outputId":"ca548a4a-de36-43e3-cb2a-1d43cfc073e3"},"execution_count":3,"outputs":[{"output_type":"stream","name":"stdout","text":["[121, 529, 169, 1681, 576, 1225, 5776, 289, 784, 361]\n"]}]},{"cell_type":"code","source":["from functools import reduce\n","sum_of_10 = reduce(lambda x, y: x + y, numbers)\n","print(sum_of_10)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"WwVRZbJ7vgnz","executionInfo":{"status":"ok","timestamp":1717697410635,"user_tz":-330,"elapsed":25,"user":{"displayName":"Amit Sachan","userId":"17076119069500437280"}},"outputId":"24919c55-ba3c-49aa-bfd4-f36ee1f62fa1"},"execution_count":4,"outputs":[{"output_type":"stream","name":"stdout","text":["287\n"]}]},{"cell_type":"code","source":["from statistics import mean, median, mode, stdev, variance\n","data = [11, 23, 13, 41, 24, 35, 76, 17, 28, 19]\n","\n","mean = mean(data)\n","median = median(data)\n","mode = mode(data)\n","std_dev = stdev(data)\n","variance = variance(data)\n","\n","\n","\n","print(\"Mean:\", mean)\n","print(\"Median:\", median)\n","print(\"Mode:\", mode)\n","print(\"Standard Deviation:\", std_dev)\n","print(\"Variance:\", variance)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"I85KAOkavgrA","executionInfo":{"status":"ok","timestamp":1717697410635,"user_tz":-330,"elapsed":19,"user":{"displayName":"Amit Sachan","userId":"17076119069500437280"}},"outputId":"a8ec29af-d5ff-4c4f-dcc5-c11ccfbde5c2"},"execution_count":5,"outputs":[{"output_type":"stream","name":"stdout","text":["Mean: 28.7\n","Median: 23.5\n","Mode: 11\n","Standard Deviation: 19.073250611494856\n","Variance: 363.7888888888889\n"]}]},{"cell_type":"code","source":[],"metadata":{"id":"YpPwjMLfvguI","executionInfo":{"status":"ok","timestamp":1717697410635,"user_tz":-330,"elapsed":14,"user":{"displayName":"Amit Sachan","userId":"17076119069500437280"}}},"execution_count":5,"outputs":[]},{"cell_type":"code","source":[],"metadata":{"id":"YkY8PmT4vgxh","executionInfo":{"status":"ok","timestamp":1717697410636,"user_tz":-330,"elapsed":14,"user":{"displayName":"Amit Sachan","userId":"17076119069500437280"}}},"execution_count":5,"outputs":[]}]}