diff --git a/Extra_questions/.ipynb_checkpoints/04_Lists-checkpoint.ipynb b/Extra_questions/.ipynb_checkpoints/04_Lists-checkpoint.ipynb index 5349ab1..997c204 100644 --- a/Extra_questions/.ipynb_checkpoints/04_Lists-checkpoint.ipynb +++ b/Extra_questions/.ipynb_checkpoints/04_Lists-checkpoint.ipynb @@ -150,6 +150,34 @@ "```" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "- Write a program to find the least positive integer missing from a list of input integers.\n", + "\n", + " **Example :** \n", + "\n", + "```Python\n", + "\n", + "def least_positive_integer(input_list):\n", + " # your code here\n", + "\n", + "\n", + "\n", + "List_1 = [1,-2,3,0,7,8,5,2,-6]\n", + "\n", + "least_positive_integer(List_1)\n", + ">>> 4\n", + " \n", + "List_2 = [3,7,-1,8,9,10]\n", + "\n", + "least_positive_integer(List_2)\n", + ">>> 1\n", + " \n", + "```" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -231,7 +259,7 @@ "provenance": [] }, "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -245,7 +273,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.6" + "version": "3.8.10" } }, "nbformat": 4, diff --git a/Extra_questions/04_Lists.ipynb b/Extra_questions/04_Lists.ipynb index 5349ab1..997c204 100644 --- a/Extra_questions/04_Lists.ipynb +++ b/Extra_questions/04_Lists.ipynb @@ -150,6 +150,34 @@ "```" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "- Write a program to find the least positive integer missing from a list of input integers.\n", + "\n", + " **Example :** \n", + "\n", + "```Python\n", + "\n", + "def least_positive_integer(input_list):\n", + " # your code here\n", + "\n", + "\n", + "\n", + "List_1 = [1,-2,3,0,7,8,5,2,-6]\n", + "\n", + "least_positive_integer(List_1)\n", + ">>> 4\n", + " \n", + "List_2 = [3,7,-1,8,9,10]\n", + "\n", + "least_positive_integer(List_2)\n", + ">>> 1\n", + " \n", + "```" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -231,7 +259,7 @@ "provenance": [] }, "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -245,7 +273,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.6" + "version": "3.8.10" } }, "nbformat": 4,