├── Assignment_2.docx ├── Assignment_2.pdf ├── ~$signment_2.docx ├── Code ├── Class5 │ ├── QUIZ.PNG │ ├── .ipynb_checkpoints │ │ ├── Conditional Statements-checkpoint.ipynb │ │ └── Quiz 1-checkpoint.ipynb │ ├── Quiz 1.ipynb │ └── Conditional Statements.ipynb ├── .ipynb_checkpoints │ └── Untitled-checkpoint.ipynb ├── Class9 │ ├── .ipynb_checkpoints │ │ └── Functions-checkpoint.ipynb │ └── Functions.ipynb ├── class 7 │ ├── .ipynb_checkpoints │ │ └── Iterative Statements-checkpoint.ipynb │ └── Iterative Statements.ipynb ├── class10 │ └── age_glucose_level.csv ├── Untitled.ipynb ├── Class 6 │ └── Conditional_Statement_II.ipynb ├── Class2 │ └── Class2.ipynb ├── Class1 │ ├── Day1.ipynb │ └── Week1_Day1.md ├── Class4 │ ├── .ipynb_checkpoints │ │ └── Tuples_Dictionary-checkpoint.ipynb │ └── Tuples_Dictionary.ipynb ├── Class3 │ └── Class3.ipynb └── class13 │ └── diabetes.csv ├── Assignment 1_Variables_operators.pdf └── Lectures ├── Coding-with-Python-Week-2.pptx └── Coding_with_Python-Week-1.pdf /Assignment_2.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SajidMajeed92/Python_for_BioTech/main/Assignment_2.docx -------------------------------------------------------------------------------- /Assignment_2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SajidMajeed92/Python_for_BioTech/main/Assignment_2.pdf -------------------------------------------------------------------------------- /~$signment_2.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SajidMajeed92/Python_for_BioTech/main/~$signment_2.docx -------------------------------------------------------------------------------- /Code/Class5/QUIZ.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SajidMajeed92/Python_for_BioTech/main/Code/Class5/QUIZ.PNG -------------------------------------------------------------------------------- /Assignment 1_Variables_operators.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SajidMajeed92/Python_for_BioTech/main/Assignment 1_Variables_operators.pdf -------------------------------------------------------------------------------- /Code/.ipynb_checkpoints/Untitled-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 5 6 | } 7 | -------------------------------------------------------------------------------- /Lectures/Coding-with-Python-Week-2.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SajidMajeed92/Python_for_BioTech/main/Lectures/Coding-with-Python-Week-2.pptx -------------------------------------------------------------------------------- /Lectures/Coding_with_Python-Week-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SajidMajeed92/Python_for_BioTech/main/Lectures/Coding_with_Python-Week-1.pdf -------------------------------------------------------------------------------- /Code/Class9/.ipynb_checkpoints/Functions-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 5 6 | } 7 | -------------------------------------------------------------------------------- /Code/Class5/.ipynb_checkpoints/Conditional Statements-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 5 6 | } 7 | -------------------------------------------------------------------------------- /Code/class 7/.ipynb_checkpoints/Iterative Statements-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 5 6 | } 7 | -------------------------------------------------------------------------------- /Code/class10/age_glucose_level.csv: -------------------------------------------------------------------------------- 1 | Age,Glucose Level 2 | 25,90 3 | 30,110 4 | 45,120 5 | 50,140 6 | 60,160 7 | 35,100 8 | 40,130 9 | 55,150 10 | 65,170 11 | 70,180 12 | -------------------------------------------------------------------------------- /Code/Untitled.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "id": "a4165a88-e40d-4960-a98f-33c4160c95ee", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [] 10 | } 11 | ], 12 | "metadata": { 13 | "kernelspec": { 14 | "display_name": "", 15 | "name": "" 16 | }, 17 | "language_info": { 18 | "name": "" 19 | } 20 | }, 21 | "nbformat": 4, 22 | "nbformat_minor": 5 23 | } 24 | -------------------------------------------------------------------------------- /Code/Class5/.ipynb_checkpoints/Quiz 1-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "raw", 5 | "id": "315ea4d3", 6 | "metadata": {}, 7 | "source": [ 8 | "Consider the dna sequence, AGTTAGCTAGGAG\n", 9 | "\n", 10 | "How many nucleotides are present?\n", 11 | "Calculate the percentage GC in the sequence.(Try to round the result till 2 decimal places)\n", 12 | "How many purines are present?\n", 13 | "How many pyrimidines are present?\n", 14 | "Calculate the percentage of purines in the sequence" 15 | ] 16 | }, 17 | { 18 | "cell_type": "raw", 19 | "id": "38dd2df2", 20 | "metadata": {}, 21 | "source": [ 22 | "Consider the dna sequence, AGTTAGCTAGGAGGCTAG\n", 23 | "\n", 24 | "How many nucleotides are present?\n", 25 | "Calculate the percentage GC in the sequence.(Try to round the result till 2 decimal places)\n", 26 | "How many purines are present?\n", 27 | "How many pyrimidines are present?\n", 28 | "Calculate the percentage of purines in the sequence" 29 | ] 30 | }, 31 | { 32 | "cell_type": "code", 33 | "execution_count": null, 34 | "id": "cf78cc2a", 35 | "metadata": {}, 36 | "outputs": [], 37 | "source": [ 38 | "Consider the dna sequence, AGTTAGCTAGGAGGTTAG\n", 39 | "\n", 40 | "How many nucleotides are present?\n", 41 | "Calculate the percentage GC in the sequence.(Try to round the result till 2 decimal places)\n", 42 | "How many purines are present?\n", 43 | "How many pyrimidines are present?\n", 44 | "Calculate the percentage of purines in the sequence" 45 | ] 46 | } 47 | ], 48 | "metadata": { 49 | "kernelspec": { 50 | "display_name": "Python 3", 51 | "language": "python", 52 | "name": "python3" 53 | }, 54 | "language_info": { 55 | "codemirror_mode": { 56 | "name": "ipython", 57 | "version": 3 58 | }, 59 | "file_extension": ".py", 60 | "mimetype": "text/x-python", 61 | "name": "python", 62 | "nbconvert_exporter": "python", 63 | "pygments_lexer": "ipython3", 64 | "version": "3.8.8" 65 | } 66 | }, 67 | "nbformat": 4, 68 | "nbformat_minor": 5 69 | } 70 | -------------------------------------------------------------------------------- /Code/Class5/Quiz 1.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "raw", 5 | "id": "b1fd4acf", 6 | "metadata": {}, 7 | "source": [ 8 | "Consider the dna sequence, AGTTAGCTAGGAG\n", 9 | "How many nucleotides are present?\n", 10 | "Calculate the percentage GC in the sequence.(Try to round the result till 2 decimal places)\n", 11 | "How many purines are present?\n", 12 | "How many pyrimidines are present?\n", 13 | "Calculate the percentage of purines in the sequence" 14 | ] 15 | }, 16 | { 17 | "cell_type": "raw", 18 | "id": "adad139b", 19 | "metadata": {}, 20 | "source": [ 21 | "Consider the dna sequence, AGTTAGCTAGGAGGCTAG\n", 22 | "How many nucleotides are present?\n", 23 | "Calculate the percentage GC in the sequence.(Try to round the result till 2 decimal places)\n", 24 | "How many purines are present?\n", 25 | "How many pyrimidines are present?\n", 26 | "Calculate the percentage of purines in the sequence" 27 | ] 28 | }, 29 | { 30 | "cell_type": "raw", 31 | "id": "05d36d9c", 32 | "metadata": {}, 33 | "source": [ 34 | "Consider the dna sequence, AGTTAGCTAGGAGGTTAG\n", 35 | "How many nucleotides are present?\n", 36 | "Calculate the percentage GC in the sequence.(Try to round the result till 2 decimal places)\n", 37 | "How many purines are present?\n", 38 | "How many pyrimidines are present?\n", 39 | "Calculate the percentage of purines in the sequence" 40 | ] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": 41, 45 | "id": "3050c13c", 46 | "metadata": {}, 47 | "outputs": [ 48 | { 49 | "name": "stdout", 50 | "output_type": "stream", 51 | "text": [ 52 | "13\n", 53 | "5\n", 54 | "1\n", 55 | "38.46153846153847\n", 56 | "7.6923076923076925\n", 57 | "46.15384615384616\n" 58 | ] 59 | } 60 | ], 61 | "source": [ 62 | "DNA ='AGTTAGCTAGGAG'\n", 63 | "sequence = len (DNA) \n", 64 | "print (sequence)\n", 65 | "G = DNA.count ('G')\n", 66 | "print (G)\n", 67 | "C = DNA.count ('C')\n", 68 | "print (C)\n", 69 | "per_of_G = G/sequence*100\n", 70 | "print (per_of_G) \n", 71 | "per_of_C = C/sequence*100\n", 72 | "print (per_of_C)\n", 73 | "per_of_GC = per_of_G+per_of_C\n", 74 | "print(per_of_GC) \n" 75 | ] 76 | }, 77 | { 78 | "cell_type": "code", 79 | "execution_count": null, 80 | "id": "d556449a", 81 | "metadata": {}, 82 | "outputs": [], 83 | "source": [] 84 | } 85 | ], 86 | "metadata": { 87 | "kernelspec": { 88 | "display_name": "Python 3", 89 | "language": "python", 90 | "name": "python3" 91 | }, 92 | "language_info": { 93 | "codemirror_mode": { 94 | "name": "ipython", 95 | "version": 3 96 | }, 97 | "file_extension": ".py", 98 | "mimetype": "text/x-python", 99 | "name": "python", 100 | "nbconvert_exporter": "python", 101 | "pygments_lexer": "ipython3", 102 | "version": "3.8.8" 103 | } 104 | }, 105 | "nbformat": 4, 106 | "nbformat_minor": 5 107 | } 108 | -------------------------------------------------------------------------------- /Code/Class5/Conditional Statements.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "e9477abe", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "# if \n", 11 | "# if - else\n", 12 | "# elif \n", 13 | "# nested if" 14 | ] 15 | }, 16 | { 17 | "cell_type": "code", 18 | "execution_count": 2, 19 | "id": "2722a803", 20 | "metadata": {}, 21 | "outputs": [], 22 | "source": [ 23 | "# if condition:\n", 24 | " #statements" 25 | ] 26 | }, 27 | { 28 | "cell_type": "code", 29 | "execution_count": 11, 30 | "id": "693be563", 31 | "metadata": {}, 32 | "outputs": [ 33 | { 34 | "name": "stdout", 35 | "output_type": "stream", 36 | "text": [ 37 | "You failed the Quiz\n" 38 | ] 39 | } 40 | ], 41 | "source": [ 42 | "# >,< ,==,>=,<=,!= ,not,and,or\n", 43 | "number=3 \n", 44 | "if number>5:\n", 45 | " print(\"You passed the Quiz\")\n", 46 | "else:\n", 47 | " print(\"You failed the Quiz\")" 48 | ] 49 | }, 50 | { 51 | "cell_type": "code", 52 | "execution_count": 13, 53 | "id": "af773b0c", 54 | "metadata": {}, 55 | "outputs": [ 56 | { 57 | "name": "stdout", 58 | "output_type": "stream", 59 | "text": [ 60 | "Enter your age:6\n", 61 | "You can't cast a Vote\n" 62 | ] 63 | } 64 | ], 65 | "source": [ 66 | "age = int(input(\"Enter your age:\"))\n", 67 | "if age>18:\n", 68 | " print(\"You can cast a Vote\")\n", 69 | "else:\n", 70 | " print(\"You can't cast a Vote\")" 71 | ] 72 | }, 73 | { 74 | "cell_type": "code", 75 | "execution_count": null, 76 | "id": "a5bcffc2", 77 | "metadata": {}, 78 | "outputs": [], 79 | "source": [ 80 | "# if user enter no > 0 (\"you entered a positive No\")\n", 81 | "# if user enter no == 0 (\"you entered a Zero \")\n", 82 | "# if user enter no < 0 (\"you entered a Negitive No\")" 83 | ] 84 | }, 85 | { 86 | "cell_type": "code", 87 | "execution_count": 19, 88 | "id": "e976ddc1", 89 | "metadata": {}, 90 | "outputs": [ 91 | { 92 | "name": "stdout", 93 | "output_type": "stream", 94 | "text": [ 95 | "Enter your Number:0\n", 96 | "you entered a Zero\n" 97 | ] 98 | } 99 | ], 100 | "source": [ 101 | "number = int(input(\"Enter your Number:\"))\n", 102 | "if number>0:\n", 103 | " print(\"you entered a positive No\")\n", 104 | "elif number == 0:\n", 105 | " print(\"you entered a Zero\")\n", 106 | "else:\n", 107 | " print(\"you entered a Negitive No\")" 108 | ] 109 | }, 110 | { 111 | "cell_type": "code", 112 | "execution_count": null, 113 | "id": "1172d176", 114 | "metadata": {}, 115 | "outputs": [], 116 | "source": [ 117 | "ishandome='true'\n", 118 | "good_salary='true'\n", 119 | "\"you can marry to any super model\"\n", 120 | "ishandome='false'\n", 121 | "good_salary='true'\n", 122 | "\"you can marry to any beautiful model\"\n", 123 | "ishandome='true'\n", 124 | "good_salary='false'\n", 125 | "\"you can marry to girl\"\n", 126 | "ishandome='false'\n", 127 | "good_salary='false'\n", 128 | "\"Allah Malik ha\"" 129 | ] 130 | }, 131 | { 132 | "cell_type": "code", 133 | "execution_count": null, 134 | "id": "e35d5144", 135 | "metadata": {}, 136 | "outputs": [], 137 | "source": [ 138 | "ishandsome=input(\"Enter Handsome: \")\n", 139 | "good_salary=input(\"Enter good_salary: \")\n", 140 | "if ishandsome=='true' and good_salary == 'true':\n", 141 | " print(\"you can marry to any super model\")\n", 142 | "elif ishandsome=='false' and good_salary == 'true':\n", 143 | " print(\"you can marry to any beautiful model\")\n", 144 | "elif ishandsome=='true' and good_salary == 'false':\n", 145 | " print(\"you can marry to a girl\")\n", 146 | "else:\n", 147 | " print(\"Allah Malik ha\")" 148 | ] 149 | }, 150 | { 151 | "cell_type": "code", 152 | "execution_count": null, 153 | "id": "c3913931", 154 | "metadata": {}, 155 | "outputs": [], 156 | "source": [] 157 | } 158 | ], 159 | "metadata": { 160 | "kernelspec": { 161 | "display_name": "Python 3", 162 | "language": "python", 163 | "name": "python3" 164 | }, 165 | "language_info": { 166 | "codemirror_mode": { 167 | "name": "ipython", 168 | "version": 3 169 | }, 170 | "file_extension": ".py", 171 | "mimetype": "text/x-python", 172 | "name": "python", 173 | "nbconvert_exporter": "python", 174 | "pygments_lexer": "ipython3", 175 | "version": "3.8.8" 176 | } 177 | }, 178 | "nbformat": 4, 179 | "nbformat_minor": 5 180 | } 181 | -------------------------------------------------------------------------------- /Code/Class 6/Conditional_Statement_II.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "provenance": [] 7 | }, 8 | "kernelspec": { 9 | "name": "python3", 10 | "display_name": "Python 3" 11 | }, 12 | "language_info": { 13 | "name": "python" 14 | } 15 | }, 16 | "cells": [ 17 | { 18 | "cell_type": "code", 19 | "execution_count": 10, 20 | "metadata": { 21 | "colab": { 22 | "base_uri": "https://localhost:8080/" 23 | }, 24 | "id": "ilqx41BFaNil", 25 | "outputId": "4826bcf3-41c5-4223-f268-c0adc6c82adc" 26 | }, 27 | "outputs": [ 28 | { 29 | "output_type": "stream", 30 | "name": "stdout", 31 | "text": [ 32 | "Enter a Day today:Monday\n", 33 | "Lunch served on Monday is Biryani\n" 34 | ] 35 | } 36 | ], 37 | "source": [ 38 | "# Lunch served in a Week days\n", 39 | "day=input(\"Enter a Day today:\")\n", 40 | "if day == \"Monday\" or day==\"monday\":\n", 41 | " print(\"Lunch served on Monday is Biryani\")\n", 42 | "elif day == \"Tuesday\" or day==\"tuesday\":\n", 43 | " print(\"Lunch served on Tuesday is Rice\")\n", 44 | "elif day == \"Wednesday\" or day==\"wednesday\":\n", 45 | " print(\"Lunch served on Wednesday is Chicken\")\n", 46 | "elif day == \"Thursday\" or day==\"thursday\":\n", 47 | " print(\"Lunch served on Thursday is Salad\")\n", 48 | "elif day == \"Friday\" or day==\"friday\":\n", 49 | " print(\"Lunch served on Friday is Soup\")\n", 50 | "elif day == \"Saturday\" or day==\"saturday\":\n", 51 | " print(\"Lunch served on Saturday is Salad\")\n", 52 | "elif day == \"Sunday\" or day==\"sunday\":\n", 53 | " print(\"Lunch served on Sunday is Salad\")\n", 54 | "else:\n", 55 | " (print(\"valid Day\"))" 56 | ] 57 | }, 58 | { 59 | "cell_type": "code", 60 | "source": [ 61 | "day=input(\"Enter a Day today:\")\n", 62 | "print(day)\n", 63 | "day = day.upper()\n", 64 | "print(day)\n", 65 | "if day==\"MONDAY\":\n", 66 | " print(\"Lunch served on Monday is Biryani\")" 67 | ], 68 | "metadata": { 69 | "colab": { 70 | "base_uri": "https://localhost:8080/" 71 | }, 72 | "id": "6hi5vKwIeobb", 73 | "outputId": "6fcceee0-e071-44ed-c442-94ce4b1c7094" 74 | }, 75 | "execution_count": 13, 76 | "outputs": [ 77 | { 78 | "output_type": "stream", 79 | "name": "stdout", 80 | "text": [ 81 | "Enter a Day today:monday\n", 82 | "monday\n", 83 | "MONDAY\n", 84 | "Lunch served on Monday is Biryani\n" 85 | ] 86 | } 87 | ] 88 | }, 89 | { 90 | "cell_type": "code", 91 | "source": [ 92 | "# user_email and password (email='abc@gmail.com,pass='12345')\n", 93 | "user_email = input(\"Enter your Email address: \")\n", 94 | "if '@gmail.com'in user_email:\n", 95 | " password = input (\"Enter your password: \")\n", 96 | " if user_email == 'abc@gmail.com' and password =='12345':\n", 97 | " print(\"Welcome to Dashboard\")\n", 98 | " elif user_email == 'abc@gmail.com' and password !='12345':\n", 99 | " print(\"Password is Incorrect.Re-Enter your password\")\n", 100 | " password = input(\"Enter your password again:\")\n", 101 | " if password=='12345':\n", 102 | " print(\"Welcome to Dashboard in 2nd Attempt\")\n", 103 | " else:\n", 104 | " print(\"you account has been blocked\")\n", 105 | " else:\n", 106 | " print(\"Invalid Credentials\")\n", 107 | "else:\n", 108 | " (print(\"Email is not valid\"))" 109 | ], 110 | "metadata": { 111 | "colab": { 112 | "base_uri": "https://localhost:8080/" 113 | }, 114 | "id": "ir2dlJStfbsR", 115 | "outputId": "bf93cea1-d872-4d8f-c552-b89a873bf47e" 116 | }, 117 | "execution_count": 25, 118 | "outputs": [ 119 | { 120 | "output_type": "stream", 121 | "name": "stdout", 122 | "text": [ 123 | "Enter your Email address: abc@yahoo.com\n", 124 | "Email is not valid\n" 125 | ] 126 | } 127 | ] 128 | }, 129 | { 130 | "cell_type": "code", 131 | "source": [ 132 | "number1= int(input(\"Enter a number:\"))\n", 133 | "number2= int(input(\"Enter a number:\"))\n", 134 | "option = input('''\n", 135 | "1- Addition\n", 136 | "2-Substraction\n", 137 | "3-Multiplication\n", 138 | "4-Division\n", 139 | "5-Square\n", 140 | "''')\n", 141 | "if option == '1':\n", 142 | " print(\"The sum of \",number1,\"and\",number2,\"is\",number1+number2)\n", 143 | "elif option == '2':\n", 144 | " print(\"The difference of \",number1,\"and\",number2,\"is\",number1-number2)\n", 145 | "elif option == '3':\n", 146 | " print(\"The product of \",number1,\"and\",number2,\"is\",number1*number2)\n", 147 | "elif option == '4':\n", 148 | " print(\"The division of \",number1,\"and\",number2,\"is\",number1/number2)\n", 149 | "else:\n", 150 | " print(\"Invalid option\")" 151 | ], 152 | "metadata": { 153 | "colab": { 154 | "base_uri": "https://localhost:8080/" 155 | }, 156 | "id": "oi9-Fm8Ci2wj", 157 | "outputId": "24c5e985-a4f8-4d77-bf2e-410cce0779b9" 158 | }, 159 | "execution_count": 3, 160 | "outputs": [ 161 | { 162 | "output_type": "stream", 163 | "name": "stdout", 164 | "text": [ 165 | "Enter a number:67\n", 166 | "Enter a number:78\n", 167 | "\n", 168 | "1- Addition\n", 169 | "2-Substraction\n", 170 | "3-Multiplication\n", 171 | "4-Division\n", 172 | "5-Square\n", 173 | "4\n", 174 | "The division of 67 and 78 is 0.8589743589743589\n" 175 | ] 176 | } 177 | ] 178 | }, 179 | { 180 | "cell_type": "code", 181 | "source": [], 182 | "metadata": { 183 | "id": "STB2N5mxsTqI" 184 | }, 185 | "execution_count": null, 186 | "outputs": [] 187 | } 188 | ] 189 | } -------------------------------------------------------------------------------- /Code/class 7/Iterative Statements.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 2, 6 | "id": "06f5231c", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "Hello world\n", 14 | "Hello world\n", 15 | "Hello world\n", 16 | "Hello world\n", 17 | "Hello world\n" 18 | ] 19 | } 20 | ], 21 | "source": [ 22 | "print(\"Hello world\")\n", 23 | "print(\"Hello world\")\n", 24 | "print(\"Hello world\")\n", 25 | "print(\"Hello world\")\n", 26 | "print(\"Hello world\")" 27 | ] 28 | }, 29 | { 30 | "cell_type": "code", 31 | "execution_count": 3, 32 | "id": "7c43d066", 33 | "metadata": {}, 34 | "outputs": [], 35 | "source": [ 36 | "# Loops for , while\n", 37 | "# for iterator in iterable:\n", 38 | "# statement" 39 | ] 40 | }, 41 | { 42 | "cell_type": "code", 43 | "execution_count": 11, 44 | "id": "0bda34b7", 45 | "metadata": {}, 46 | "outputs": [ 47 | { 48 | "name": "stdout", 49 | "output_type": "stream", 50 | "text": [ 51 | "1\n", 52 | "3\n", 53 | "5\n", 54 | "7\n", 55 | "9\n", 56 | "outside from the body of a loop\n" 57 | ] 58 | } 59 | ], 60 | "source": [ 61 | "for num in range(1,11,2):\n", 62 | " print(num)\n", 63 | " \n", 64 | "print(\"outside from the body of a loop\")" 65 | ] 66 | }, 67 | { 68 | "cell_type": "code", 69 | "execution_count": 15, 70 | "id": "000b5a40", 71 | "metadata": {}, 72 | "outputs": [ 73 | { 74 | "name": "stdout", 75 | "output_type": "stream", 76 | "text": [ 77 | "1\n", 78 | "3\n", 79 | "6\n", 80 | "10\n", 81 | "15\n", 82 | "21\n", 83 | "28\n", 84 | "36\n", 85 | "45\n", 86 | "55\n", 87 | "55\n" 88 | ] 89 | } 90 | ], 91 | "source": [ 92 | "sum = 0 \n", 93 | "for num in range(1,11):\n", 94 | " sum=sum+num\n", 95 | " print(sum)\n", 96 | "print(sum)" 97 | ] 98 | }, 99 | { 100 | "cell_type": "code", 101 | "execution_count": 16, 102 | "id": "827d8ea1", 103 | "metadata": {}, 104 | "outputs": [ 105 | { 106 | "name": "stdout", 107 | "output_type": "stream", 108 | "text": [ 109 | "55\n" 110 | ] 111 | } 112 | ], 113 | "source": [ 114 | "sum = 0 \n", 115 | "for num in range(1,11):\n", 116 | " sum=sum+num\n", 117 | "print(sum)" 118 | ] 119 | }, 120 | { 121 | "cell_type": "code", 122 | "execution_count": 18, 123 | "id": "ff9af12f", 124 | "metadata": {}, 125 | "outputs": [ 126 | { 127 | "name": "stdout", 128 | "output_type": "stream", 129 | "text": [ 130 | "3628800\n" 131 | ] 132 | } 133 | ], 134 | "source": [ 135 | "product = 1 \n", 136 | "for num in range(1,11):\n", 137 | " product=product*num\n", 138 | "print(product)" 139 | ] 140 | }, 141 | { 142 | "cell_type": "code", 143 | "execution_count": 23, 144 | "id": "4acbaf10", 145 | "metadata": {}, 146 | "outputs": [ 147 | { 148 | "name": "stdout", 149 | "output_type": "stream", 150 | "text": [ 151 | "1 - Hello world\n", 152 | "2 - Hello world\n", 153 | "3 - Hello world\n", 154 | "4 - Hello world\n", 155 | "5 - Hello world\n", 156 | "6 - Hello world\n", 157 | "7 - Hello world\n", 158 | "8 - Hello world\n", 159 | "9 - Hello world\n", 160 | "10 - Hello world\n" 161 | ] 162 | } 163 | ], 164 | "source": [ 165 | "for num in range(1,11):\n", 166 | " print(num,\"-\",\"Hello world\")" 167 | ] 168 | }, 169 | { 170 | "cell_type": "code", 171 | "execution_count": 28, 172 | "id": "09644c36", 173 | "metadata": {}, 174 | "outputs": [ 175 | { 176 | "name": "stdout", 177 | "output_type": "stream", 178 | "text": [ 179 | "['Abdul waheed', 'Asma', 'Muqaddas']\n" 180 | ] 181 | } 182 | ], 183 | "source": [ 184 | "student_list = [\"Abdul waheed\",\"Asma\",\"Muqaddas\"]\n", 185 | "print(student_list)" 186 | ] 187 | }, 188 | { 189 | "cell_type": "code", 190 | "execution_count": 54, 191 | "id": "9418e7e3", 192 | "metadata": {}, 193 | "outputs": [ 194 | { 195 | "name": "stdout", 196 | "output_type": "stream", 197 | "text": [ 198 | "1 Abdul waheed\n", 199 | "2 Asma\n", 200 | "3 Muqaddas\n" 201 | ] 202 | } 203 | ], 204 | "source": [ 205 | "for num,student in enumerate(student_list,start=1):\n", 206 | " print(num,student)" 207 | ] 208 | }, 209 | { 210 | "cell_type": "code", 211 | "execution_count": 60, 212 | "id": "c50ea992", 213 | "metadata": {}, 214 | "outputs": [ 215 | { 216 | "name": "stdout", 217 | "output_type": "stream", 218 | "text": [ 219 | "0 Abdul waheed\n", 220 | "1 Asma\n", 221 | "2 Muqaddas\n" 222 | ] 223 | } 224 | ], 225 | "source": [ 226 | "for student in range(len(student_list)):\n", 227 | " index = student_list[student]\n", 228 | " print(student,index)" 229 | ] 230 | }, 231 | { 232 | "cell_type": "code", 233 | "execution_count": 51, 234 | "id": "47c7e6af", 235 | "metadata": {}, 236 | "outputs": [ 237 | { 238 | "name": "stdout", 239 | "output_type": "stream", 240 | "text": [ 241 | "P\n", 242 | "y\n", 243 | "t\n", 244 | "h\n", 245 | "o\n", 246 | "n\n" 247 | ] 248 | } 249 | ], 250 | "source": [ 251 | "lang = 'Python'\n", 252 | "for char in lang:\n", 253 | " print(char)" 254 | ] 255 | }, 256 | { 257 | "cell_type": "code", 258 | "execution_count": 68, 259 | "id": "7ff8b938", 260 | "metadata": {}, 261 | "outputs": [ 262 | { 263 | "name": "stdout", 264 | "output_type": "stream", 265 | "text": [ 266 | "Fruits in sample list ['apple', 'banana', 'cherry']\n", 267 | "Fruit in fruits list ['apple', 'banana', 'cherry']\n" 268 | ] 269 | } 270 | ], 271 | "source": [ 272 | "sample = []\n", 273 | "fruits = ['apple','banana','cherry']\n", 274 | "for fruit in fruits:\n", 275 | " sample.append(fruit)\n", 276 | "print(\"Fruits in sample list\",sample)\n", 277 | "print(\"Fruit in fruits list\",fruits)" 278 | ] 279 | }, 280 | { 281 | "cell_type": "code", 282 | "execution_count": 73, 283 | "id": "fa8b99d0", 284 | "metadata": {}, 285 | "outputs": [ 286 | { 287 | "name": "stdout", 288 | "output_type": "stream", 289 | "text": [ 290 | "[1, 3, 7, 9]\n", 291 | "[1, 9, 49, 81]\n" 292 | ] 293 | } 294 | ], 295 | "source": [ 296 | "num_list = [1,3,7,9]\n", 297 | "sq_num = []\n", 298 | "for num in num_list:\n", 299 | " sq_num.append(num**2)\n", 300 | "print(num_list)\n", 301 | "print(sq_num)" 302 | ] 303 | }, 304 | { 305 | "cell_type": "code", 306 | "execution_count": null, 307 | "id": "8a9a0d34", 308 | "metadata": {}, 309 | "outputs": [], 310 | "source": [] 311 | } 312 | ], 313 | "metadata": { 314 | "kernelspec": { 315 | "display_name": "Python 3", 316 | "language": "python", 317 | "name": "python3" 318 | }, 319 | "language_info": { 320 | "codemirror_mode": { 321 | "name": "ipython", 322 | "version": 3 323 | }, 324 | "file_extension": ".py", 325 | "mimetype": "text/x-python", 326 | "name": "python", 327 | "nbconvert_exporter": "python", 328 | "pygments_lexer": "ipython3", 329 | "version": "3.8.8" 330 | } 331 | }, 332 | "nbformat": 4, 333 | "nbformat_minor": 5 334 | } 335 | -------------------------------------------------------------------------------- /Code/Class2/Class2.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "f67af0c9", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "Welcome to python class\n" 14 | ] 15 | } 16 | ], 17 | "source": [ 18 | "print(\"Welcome to python class\")" 19 | ] 20 | }, 21 | { 22 | "cell_type": "code", 23 | "execution_count": 1, 24 | "id": "10050412", 25 | "metadata": {}, 26 | "outputs": [ 27 | { 28 | "name": "stdout", 29 | "output_type": "stream", 30 | "text": [ 31 | "Sajid\n", 32 | "Majeed\n", 33 | "Sajid Majeed\n" 34 | ] 35 | } 36 | ], 37 | "source": [ 38 | "first_name = \"Sajid\"\n", 39 | "Last_name = \"Majeed\"\n", 40 | "print(first_name)\n", 41 | "print(Last_name)\n", 42 | "print(first_name,Last_name)" 43 | ] 44 | }, 45 | { 46 | "cell_type": "code", 47 | "execution_count": 2, 48 | "id": "b6a77e0c", 49 | "metadata": {}, 50 | "outputs": [ 51 | { 52 | "name": "stdout", 53 | "output_type": "stream", 54 | "text": [ 55 | "\n" 56 | ] 57 | } 58 | ], 59 | "source": [ 60 | "print(type(first_name))" 61 | ] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": 1, 66 | "id": "1f0f56a7", 67 | "metadata": {}, 68 | "outputs": [ 69 | { 70 | "name": "stdout", 71 | "output_type": "stream", 72 | "text": [ 73 | "\n", 74 | "\n" 75 | ] 76 | } 77 | ], 78 | "source": [ 79 | "num1= 89\n", 80 | "num2=45.5\n", 81 | "print(type(num1))\n", 82 | "print(type(num2))" 83 | ] 84 | }, 85 | { 86 | "cell_type": "code", 87 | "execution_count": 2, 88 | "id": "a961bc13", 89 | "metadata": {}, 90 | "outputs": [ 91 | { 92 | "name": "stdout", 93 | "output_type": "stream", 94 | "text": [ 95 | "89\n", 96 | "89.0\n", 97 | "\n" 98 | ] 99 | } 100 | ], 101 | "source": [ 102 | "print(num1)\n", 103 | "num1=float(num1)\n", 104 | "print(num1)\n", 105 | "print(type(num1))" 106 | ] 107 | }, 108 | { 109 | "cell_type": "code", 110 | "execution_count": 10, 111 | "id": "6e29d029", 112 | "metadata": {}, 113 | "outputs": [ 114 | { 115 | "name": "stdout", 116 | "output_type": "stream", 117 | "text": [ 118 | "121\n", 119 | "\n" 120 | ] 121 | } 122 | ], 123 | "source": [ 124 | "num1='121'\n", 125 | "num1= int(num1)\n", 126 | "print(num1)\n", 127 | "print(type(num1))" 128 | ] 129 | }, 130 | { 131 | "cell_type": "code", 132 | "execution_count": 6, 133 | "id": "f9f4798b", 134 | "metadata": {}, 135 | "outputs": [ 136 | { 137 | "data": { 138 | "text/plain": [ 139 | "'22'" 140 | ] 141 | }, 142 | "execution_count": 6, 143 | "metadata": {}, 144 | "output_type": "execute_result" 145 | } 146 | ], 147 | "source": [ 148 | "'2'+'2'" 149 | ] 150 | }, 151 | { 152 | "cell_type": "markdown", 153 | "id": "6ca92036", 154 | "metadata": {}, 155 | "source": [ 156 | "# Arithmetic Operators (+,-,*,/)" 157 | ] 158 | }, 159 | { 160 | "cell_type": "code", 161 | "execution_count": 20, 162 | "id": "914ab281", 163 | "metadata": {}, 164 | "outputs": [ 165 | { 166 | "name": "stdout", 167 | "output_type": "stream", 168 | "text": [ 169 | "The sum of 67 and 70 is 137\n", 170 | "The Difference of 67 and 70 is -3\n", 171 | "The Product of 67 and 70 is 4690\n", 172 | "The Division of 67 and 70 is 0.957\n" 173 | ] 174 | } 175 | ], 176 | "source": [ 177 | "num1=67\n", 178 | "num2=70\n", 179 | "sum = num1+num2\n", 180 | "difference = num1 -num2\n", 181 | "product = num1 * num2\n", 182 | "division = round(num1/num2,3)\n", 183 | "print('The sum of',num1,'and',num2,'is',sum)\n", 184 | "print('The Difference of',num1,'and',num2,'is',difference)\n", 185 | "print('The Product of',num1,'and',num2,'is',product)\n", 186 | "print('The Division of',num1,'and',num2,'is',division)" 187 | ] 188 | }, 189 | { 190 | "cell_type": "code", 191 | "execution_count": 24, 192 | "id": "639ccad8", 193 | "metadata": {}, 194 | "outputs": [ 195 | { 196 | "name": "stdout", 197 | "output_type": "stream", 198 | "text": [ 199 | "sajid\n" 200 | ] 201 | }, 202 | { 203 | "data": { 204 | "text/plain": [ 205 | "'sajid'" 206 | ] 207 | }, 208 | "execution_count": 24, 209 | "metadata": {}, 210 | "output_type": "execute_result" 211 | } 212 | ], 213 | "source": [ 214 | "input()" 215 | ] 216 | }, 217 | { 218 | "cell_type": "code", 219 | "execution_count": 2, 220 | "id": "d35806b1", 221 | "metadata": {}, 222 | "outputs": [], 223 | "source": [ 224 | "name = 'Ahmed'\n", 225 | "age =34" 226 | ] 227 | }, 228 | { 229 | "cell_type": "code", 230 | "execution_count": 5, 231 | "id": "f33c5aab", 232 | "metadata": {}, 233 | "outputs": [ 234 | { 235 | "name": "stdout", 236 | "output_type": "stream", 237 | "text": [ 238 | "Enter your Name: Ali\n", 239 | "Enter your Age: 33\n", 240 | "Ali\n", 241 | "33.0\n", 242 | "\n", 243 | "\n" 244 | ] 245 | } 246 | ], 247 | "source": [ 248 | "name = input(\"Enter your Name: \")\n", 249 | "age = float(input(\"Enter your Age: \"))\n", 250 | "print(name)\n", 251 | "print(age)\n", 252 | "print(type(name))\n", 253 | "print(type(age))" 254 | ] 255 | }, 256 | { 257 | "cell_type": "code", 258 | "execution_count": 18, 259 | "id": "7a77a524", 260 | "metadata": {}, 261 | "outputs": [ 262 | { 263 | "name": "stdout", 264 | "output_type": "stream", 265 | "text": [ 266 | "Enter Mass Value: 72\n", 267 | "Enter Acc Value: 20.8\n", 268 | "The force is 1497.6\n" 269 | ] 270 | } 271 | ], 272 | "source": [ 273 | "# force = ? mass = 72 acc = 20.8 => f=ma\n", 274 | "mass = float(input(\"Enter Mass Value: \"))\n", 275 | "acc = float(input(\"Enter Acc Value: \"))\n", 276 | "force = mass * acc\n", 277 | "print(\"The force is\",round(force,2))" 278 | ] 279 | }, 280 | { 281 | "cell_type": "code", 282 | "execution_count": 17, 283 | "id": "33abb3b9", 284 | "metadata": {}, 285 | "outputs": [ 286 | { 287 | "name": "stdout", 288 | "output_type": "stream", 289 | "text": [ 290 | "Hello Pakistan\n" 291 | ] 292 | } 293 | ], 294 | "source": [ 295 | "a='Pakistan'\n", 296 | "b='Hello'\n", 297 | "print(b+' '+a)" 298 | ] 299 | }, 300 | { 301 | "cell_type": "code", 302 | "execution_count": 43, 303 | "id": "b36e6045", 304 | "metadata": {}, 305 | "outputs": [ 306 | { 307 | "data": { 308 | "text/plain": [ 309 | "58" 310 | ] 311 | }, 312 | "execution_count": 43, 313 | "metadata": {}, 314 | "output_type": "execute_result" 315 | } 316 | ], 317 | "source": [ 318 | "DNA='ATCGATCGATCGATCGATCGATCGACGACGATCGATCGATCGATCGATCGATCGATCG'\n", 319 | "len(DNA)" 320 | ] 321 | }, 322 | { 323 | "cell_type": "code", 324 | "execution_count": 44, 325 | "id": "8fa89409", 326 | "metadata": {}, 327 | "outputs": [], 328 | "source": [ 329 | "gt= DNA.count('GAT') " 330 | ] 331 | }, 332 | { 333 | "cell_type": "code", 334 | "execution_count": 45, 335 | "id": "61c28e7f", 336 | "metadata": {}, 337 | "outputs": [ 338 | { 339 | "name": "stdout", 340 | "output_type": "stream", 341 | "text": [ 342 | "Orignal: AGTCAGTCGTACGTAGTA\n", 343 | "updated agtcagtcgtacgtagta\n" 344 | ] 345 | }, 346 | { 347 | "data": { 348 | "text/plain": [ 349 | "'agtcagtcgtacgtagta'" 350 | ] 351 | }, 352 | "execution_count": 45, 353 | "metadata": {}, 354 | "output_type": "execute_result" 355 | } 356 | ], 357 | "source": [ 358 | "DNA1='agtcagtcgtacgtagta'\n", 359 | "DNA2=DNA1.upper()\n", 360 | "print(\"Orignal:\",DNA2)\n", 361 | "print(\"updated\",DNA1)\n", 362 | "DNA2.lower()" 363 | ] 364 | }, 365 | { 366 | "cell_type": "code", 367 | "execution_count": 46, 368 | "id": "9b92941d", 369 | "metadata": {}, 370 | "outputs": [], 371 | "source": [ 372 | "total_DNA_Length= len(DNA)\n", 373 | "count_of_G=DNA.count('G')\n", 374 | "perentage_of_G = (count_of_G/total_DNA_Length)*100\n", 375 | "print(perentage_of_G)" 376 | ] 377 | }, 378 | { 379 | "cell_type": "code", 380 | "execution_count": 54, 381 | "id": "1fd29128", 382 | "metadata": {}, 383 | "outputs": [ 384 | { 385 | "name": "stdout", 386 | "output_type": "stream", 387 | "text": [ 388 | "Total length of DNA 58\n", 389 | "GT present in DNA 28\n", 390 | "48.275862068965516\n" 391 | ] 392 | } 393 | ], 394 | "source": [ 395 | "total_DNA_Length= len(DNA)\n", 396 | "count_of_GT=DNA.count('G')+DNA.count('T')\n", 397 | "print(\"Total length of DNA\",total_DNA_Length)\n", 398 | "print(\"GT present in DNA\",count_of_GT)\n", 399 | "perentage_of_GT = (count_of_GT/total_DNA_Length)*100\n", 400 | "print(perentage_of_GT)" 401 | ] 402 | }, 403 | { 404 | "cell_type": "code", 405 | "execution_count": null, 406 | "id": "03a78c9b", 407 | "metadata": {}, 408 | "outputs": [], 409 | "source": [] 410 | } 411 | ], 412 | "metadata": { 413 | "kernelspec": { 414 | "display_name": "Python 3", 415 | "language": "python", 416 | "name": "python3" 417 | }, 418 | "language_info": { 419 | "codemirror_mode": { 420 | "name": "ipython", 421 | "version": 3 422 | }, 423 | "file_extension": ".py", 424 | "mimetype": "text/x-python", 425 | "name": "python", 426 | "nbconvert_exporter": "python", 427 | "pygments_lexer": "ipython3", 428 | "version": "3.8.8" 429 | } 430 | }, 431 | "nbformat": 4, 432 | "nbformat_minor": 5 433 | } 434 | -------------------------------------------------------------------------------- /Code/Class9/Functions.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "81df13c1", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "# Block of Code " 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": 9, 16 | "id": "e7d4a29d", 17 | "metadata": {}, 18 | "outputs": [ 19 | { 20 | "name": "stdout", 21 | "output_type": "stream", 22 | "text": [ 23 | "outside from function body\n" 24 | ] 25 | } 26 | ], 27 | "source": [ 28 | "# Keyword \n", 29 | "def greet():\n", 30 | " print('Hello World!')\n", 31 | " print('Hello World!')\n", 32 | " print('Hello World!')\n", 33 | "print(\"outside from function body\")" 34 | ] 35 | }, 36 | { 37 | "cell_type": "code", 38 | "execution_count": 10, 39 | "id": "7f0d20f9", 40 | "metadata": {}, 41 | "outputs": [ 42 | { 43 | "name": "stdout", 44 | "output_type": "stream", 45 | "text": [ 46 | "Hello World!\n", 47 | "Hello World!\n", 48 | "Hello World!\n" 49 | ] 50 | } 51 | ], 52 | "source": [ 53 | "greet()" 54 | ] 55 | }, 56 | { 57 | "cell_type": "code", 58 | "execution_count": 15, 59 | "id": "56e567c4", 60 | "metadata": {}, 61 | "outputs": [ 62 | { 63 | "name": "stdout", 64 | "output_type": "stream", 65 | "text": [ 66 | "Hello Ali\n" 67 | ] 68 | } 69 | ], 70 | "source": [ 71 | "def hello(user):\n", 72 | " print(\"Hello\",user)\n", 73 | "hello(\"Ali\")" 74 | ] 75 | }, 76 | { 77 | "cell_type": "code", 78 | "execution_count": 21, 79 | "id": "543de048", 80 | "metadata": {}, 81 | "outputs": [], 82 | "source": [ 83 | "def hello(fname,lname):\n", 84 | " print(\"Fname\",fname)\n", 85 | " print(\"Lname\",lname)" 86 | ] 87 | }, 88 | { 89 | "cell_type": "code", 90 | "execution_count": 22, 91 | "id": "836386ab", 92 | "metadata": {}, 93 | "outputs": [ 94 | { 95 | "name": "stdout", 96 | "output_type": "stream", 97 | "text": [ 98 | "Enter your First Name: Sajid\n", 99 | "Enter your Last Name: Majeed\n", 100 | "Fname Sajid\n", 101 | "Lname Majeed\n" 102 | ] 103 | } 104 | ], 105 | "source": [ 106 | "fname = input(\"Enter your First Name: \")\n", 107 | "lname = input(\"Enter your Last Name: \")\n", 108 | "\n", 109 | "hello(fname,lname)" 110 | ] 111 | }, 112 | { 113 | "cell_type": "code", 114 | "execution_count": 37, 115 | "id": "81752c40", 116 | "metadata": {}, 117 | "outputs": [], 118 | "source": [ 119 | "def sum(num1,num2):\n", 120 | " add = num1+num2\n", 121 | " avg = (num1+num2)/2\n", 122 | " prod = num1*num2\n", 123 | " return add,avg,prod" 124 | ] 125 | }, 126 | { 127 | "cell_type": "code", 128 | "execution_count": 38, 129 | "id": "8b0f071a", 130 | "metadata": {}, 131 | "outputs": [ 132 | { 133 | "name": "stdout", 134 | "output_type": "stream", 135 | "text": [ 136 | "Enter your No30\n", 137 | "Enter your No40\n" 138 | ] 139 | }, 140 | { 141 | "data": { 142 | "text/plain": [ 143 | "(70, 35.0, 1200)" 144 | ] 145 | }, 146 | "execution_count": 38, 147 | "metadata": {}, 148 | "output_type": "execute_result" 149 | } 150 | ], 151 | "source": [ 152 | "num1 = int(input(\"Enter your No\"))\n", 153 | "num2 = int(input(\"Enter your No\"))\n", 154 | "sum(num1,num2)" 155 | ] 156 | }, 157 | { 158 | "cell_type": "code", 159 | "execution_count": 39, 160 | "id": "0cbf5663", 161 | "metadata": {}, 162 | "outputs": [ 163 | { 164 | "name": "stdout", 165 | "output_type": "stream", 166 | "text": [ 167 | "Enter your No40\n", 168 | "Enter your No50\n" 169 | ] 170 | }, 171 | { 172 | "data": { 173 | "text/plain": [ 174 | "(90, 45.0, 2000)" 175 | ] 176 | }, 177 | "execution_count": 39, 178 | "metadata": {}, 179 | "output_type": "execute_result" 180 | } 181 | ], 182 | "source": [ 183 | "num1 = int(input(\"Enter your No\"))\n", 184 | "num2 = int(input(\"Enter your No\"))\n", 185 | "sum(num1,num2)" 186 | ] 187 | }, 188 | { 189 | "cell_type": "code", 190 | "execution_count": 44, 191 | "id": "af1a3697", 192 | "metadata": {}, 193 | "outputs": [ 194 | { 195 | "name": "stdout", 196 | "output_type": "stream", 197 | "text": [ 198 | "Enter your No34\n", 199 | "Enter your No45\n", 200 | "(79, 39.5, 1530)\n", 201 | "Enter your No56\n", 202 | "Enter your No67\n", 203 | "(123, 61.5, 3752)\n", 204 | "Enter your No56\n", 205 | "Enter your No78\n", 206 | "(134, 67.0, 4368)\n" 207 | ] 208 | } 209 | ], 210 | "source": [ 211 | "def sum(num1,num2):\n", 212 | " add = num1+num2\n", 213 | " avg = (num1+num2)/2\n", 214 | " prod = num1*num2\n", 215 | " return add,avg,prod\n", 216 | "\n", 217 | "for i in range(3):\n", 218 | " num1 = int(input(\"Enter your No\"))\n", 219 | " num2 = int(input(\"Enter your No\"))\n", 220 | " print(sum(num1,num2)) " 221 | ] 222 | }, 223 | { 224 | "cell_type": "code", 225 | "execution_count": 45, 226 | "id": "6077d321", 227 | "metadata": {}, 228 | "outputs": [ 229 | { 230 | "name": "stdout", 231 | "output_type": "stream", 232 | "text": [ 233 | "Enter your No1\n", 234 | "Enter your No2\n", 235 | "Enter your No3\n", 236 | "Enter your No4\n", 237 | "Enter your No5\n", 238 | "120\n" 239 | ] 240 | } 241 | ], 242 | "source": [ 243 | "def prod(num1,num2,num3,num4,num5):\n", 244 | " return num1*num2*num3*num4*num5\n", 245 | "\n", 246 | "for i in range(1):\n", 247 | " num1 = int(input(\"Enter your No\"))\n", 248 | " num2 = int(input(\"Enter your No\"))\n", 249 | " num3 = int(input(\"Enter your No\"))\n", 250 | " num4 = int(input(\"Enter your No\"))\n", 251 | " num5 = int(input(\"Enter your No\"))\n", 252 | " print(prod(num1,num2,num3,num4,num5)) " 253 | ] 254 | }, 255 | { 256 | "cell_type": "code", 257 | "execution_count": 46, 258 | "id": "56e69244", 259 | "metadata": {}, 260 | "outputs": [], 261 | "source": [ 262 | "def square_cube(num):\n", 263 | " sq = num**2\n", 264 | " cube = num**3\n", 265 | " return num,sq,cube" 266 | ] 267 | }, 268 | { 269 | "cell_type": "code", 270 | "execution_count": 47, 271 | "id": "875f774c", 272 | "metadata": {}, 273 | "outputs": [ 274 | { 275 | "name": "stdout", 276 | "output_type": "stream", 277 | "text": [ 278 | "Enter a number: 2\n" 279 | ] 280 | }, 281 | { 282 | "data": { 283 | "text/plain": [ 284 | "(2, 4, 8)" 285 | ] 286 | }, 287 | "execution_count": 47, 288 | "metadata": {}, 289 | "output_type": "execute_result" 290 | } 291 | ], 292 | "source": [ 293 | "num = int(input (\"Enter a number: \"))\n", 294 | "square_cube(num)" 295 | ] 296 | }, 297 | { 298 | "cell_type": "code", 299 | "execution_count": null, 300 | "id": "9a952cbb", 301 | "metadata": {}, 302 | "outputs": [], 303 | "source": [ 304 | "num = [2,3,4,5]\n", 305 | "sq_list = [4,9,16,25]" 306 | ] 307 | }, 308 | { 309 | "cell_type": "code", 310 | "execution_count": 57, 311 | "id": "88586c76", 312 | "metadata": {}, 313 | "outputs": [ 314 | { 315 | "name": "stdout", 316 | "output_type": "stream", 317 | "text": [ 318 | "[1, 4, 9, 16]\n" 319 | ] 320 | }, 321 | { 322 | "data": { 323 | "text/plain": [ 324 | "[1, 8, 27, 64]" 325 | ] 326 | }, 327 | "execution_count": 57, 328 | "metadata": {}, 329 | "output_type": "execute_result" 330 | } 331 | ], 332 | "source": [ 333 | "num = [1,2,3,4]\n", 334 | "print([x**2 for x in num])\n", 335 | "[x**3 for x in num]" 336 | ] 337 | }, 338 | { 339 | "cell_type": "code", 340 | "execution_count": 58, 341 | "id": "3cb0d6e3", 342 | "metadata": {}, 343 | "outputs": [ 344 | { 345 | "data": { 346 | "text/plain": [ 347 | "[4, 9, 16, 25]" 348 | ] 349 | }, 350 | "execution_count": 58, 351 | "metadata": {}, 352 | "output_type": "execute_result" 353 | } 354 | ], 355 | "source": [ 356 | "def sq_list(input_list):\n", 357 | " return [x**2 for x in input_list]\n", 358 | " \n", 359 | "input_list = [2,3,4,5]\n", 360 | "sq_list(input_list)" 361 | ] 362 | }, 363 | { 364 | "cell_type": "code", 365 | "execution_count": 66, 366 | "id": "0a8bc70a", 367 | "metadata": {}, 368 | "outputs": [ 369 | { 370 | "data": { 371 | "text/plain": [ 372 | "[1, 2, 3, 4]" 373 | ] 374 | }, 375 | "execution_count": 66, 376 | "metadata": {}, 377 | "output_type": "execute_result" 378 | } 379 | ], 380 | "source": [ 381 | "list= [1,2,3,4]\n", 382 | "[x for x in list]" 383 | ] 384 | }, 385 | { 386 | "cell_type": "code", 387 | "execution_count": 80, 388 | "id": "09408296", 389 | "metadata": {}, 390 | "outputs": [ 391 | { 392 | "name": "stdout", 393 | "output_type": "stream", 394 | "text": [ 395 | "10\n" 396 | ] 397 | } 398 | ], 399 | "source": [ 400 | "sum=0\n", 401 | "for i in list:\n", 402 | " sum=sum+i\n", 403 | "print(sum)" 404 | ] 405 | }, 406 | { 407 | "cell_type": "code", 408 | "execution_count": null, 409 | "id": "08fbd351", 410 | "metadata": {}, 411 | "outputs": [], 412 | "source": [] 413 | } 414 | ], 415 | "metadata": { 416 | "kernelspec": { 417 | "display_name": "Python 3", 418 | "language": "python", 419 | "name": "python3" 420 | }, 421 | "language_info": { 422 | "codemirror_mode": { 423 | "name": "ipython", 424 | "version": 3 425 | }, 426 | "file_extension": ".py", 427 | "mimetype": "text/x-python", 428 | "name": "python", 429 | "nbconvert_exporter": "python", 430 | "pygments_lexer": "ipython3", 431 | "version": "3.8.8" 432 | } 433 | }, 434 | "nbformat": 4, 435 | "nbformat_minor": 5 436 | } 437 | -------------------------------------------------------------------------------- /Code/Class1/Day1.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "a58f9f1c-ae0d-4a6b-b70e-38327650c912", 6 | "metadata": {}, 7 | "source": [ 8 | "## Week1 Day2" 9 | ] 10 | }, 11 | { 12 | "cell_type": "code", 13 | "execution_count": 1, 14 | "id": "5e0efbfd-8325-40b7-9dd0-ca3130be8558", 15 | "metadata": {}, 16 | "outputs": [ 17 | { 18 | "name": "stdout", 19 | "output_type": "stream", 20 | "text": [ 21 | "Sajid Majeed\n" 22 | ] 23 | } 24 | ], 25 | "source": [ 26 | "print('Sajid Majeed')" 27 | ] 28 | }, 29 | { 30 | "cell_type": "code", 31 | "execution_count": 2, 32 | "id": "67d24de9-3c44-48b9-9358-7fb87ad9537e", 33 | "metadata": {}, 34 | "outputs": [ 35 | { 36 | "name": "stdout", 37 | "output_type": "stream", 38 | "text": [ 39 | "Sajid Majeed\n" 40 | ] 41 | } 42 | ], 43 | "source": [ 44 | "print(\"Sajid Majeed\")" 45 | ] 46 | }, 47 | { 48 | "cell_type": "code", 49 | "execution_count": 3, 50 | "id": "328a661a-cdba-4716-b52d-737a62ea0bcb", 51 | "metadata": {}, 52 | "outputs": [ 53 | { 54 | "name": "stdout", 55 | "output_type": "stream", 56 | "text": [ 57 | "\n", 58 | "\n", 59 | "\n", 60 | "\n" 61 | ] 62 | } 63 | ], 64 | "source": [ 65 | "# Data types Integer, Float , String , Boolean\n", 66 | "# type() function used to check variable data type\n", 67 | "name = \"Ned Academy\"\n", 68 | "print(type(name))\n", 69 | "age = 30\n", 70 | "print(type((age)))\n", 71 | "salary = 20.5\n", 72 | "print(type((salary)))\n", 73 | "is_job= True\n", 74 | "print(type((is_job)))" 75 | ] 76 | }, 77 | { 78 | "cell_type": "code", 79 | "execution_count": 4, 80 | "id": "885feaf0-f958-4f2a-94ea-29757c9d6e13", 81 | "metadata": {}, 82 | "outputs": [ 83 | { 84 | "name": "stdout", 85 | "output_type": "stream", 86 | "text": [ 87 | "\n", 88 | "\n", 89 | "\n" 90 | ] 91 | } 92 | ], 93 | "source": [ 94 | "# Type casting\n", 95 | "x = str(3)\n", 96 | "y = int(3.0)\n", 97 | "z = float(3)\n", 98 | "print(type(x))\n", 99 | "print(type(y))\n", 100 | "print(type(z))" 101 | ] 102 | }, 103 | { 104 | "cell_type": "code", 105 | "execution_count": 5, 106 | "id": "c0c57b66-5bfc-40a9-93fb-4769a951bdd5", 107 | "metadata": {}, 108 | "outputs": [], 109 | "source": [ 110 | "# variable decleration not started from any number\n", 111 | "# firstName \n", 112 | "# FirstName\n", 113 | "# _First_Name\n", 114 | "# firstname" 115 | ] 116 | }, 117 | { 118 | "cell_type": "code", 119 | "execution_count": 27, 120 | "id": "da2b6226-8a87-4783-9817-11decbc18990", 121 | "metadata": {}, 122 | "outputs": [], 123 | "source": [ 124 | "# Assignment Solution\n", 125 | "first_name = \"Sajid\"\n", 126 | "last_name = \"Majeed\"\n", 127 | "age = 24\n", 128 | "gender = \"Male\"\n", 129 | "designation = \"Lecturer\"\n", 130 | "organization = \"NED\"\n", 131 | "cgpa = 3.9\n", 132 | "is_working = True" 133 | ] 134 | }, 135 | { 136 | "cell_type": "code", 137 | "execution_count": 34, 138 | "id": "00522e5f-b152-45f3-8d80-76be47ccd57a", 139 | "metadata": {}, 140 | "outputs": [ 141 | { 142 | "name": "stdout", 143 | "output_type": "stream", 144 | "text": [ 145 | "=================================================\n", 146 | "\t\t My Profile\n", 147 | "=================================================\n", 148 | "Name:\t\t Sajid Majeed\n", 149 | "Gender:\t\t Male\n", 150 | "Age:\t\t 24\n", 151 | "Designation:\t Lecturer\n", 152 | "Organization:\t NED\n", 153 | "Is Working:\t True\n", 154 | "CGPA:\t\t 3.9\n", 155 | "=================================================\n" 156 | ] 157 | } 158 | ], 159 | "source": [ 160 | "# printing all variable \n", 161 | "print(\"=================================================\")\n", 162 | "print(\"\\t\\t My Profile\")\n", 163 | "print(\"=================================================\")\n", 164 | "print(\"Name:\\t\\t\",first_name +' '+last_name)\n", 165 | "print(\"Gender:\\t\\t\" ,gender)\n", 166 | "print(\"Age:\\t\\t\" ,age)\n", 167 | "print(\"Designation:\\t\" ,designation)\n", 168 | "print(\"Organization:\\t\" ,organization)\n", 169 | "print(\"Is Working:\\t\" ,is_working)\n", 170 | "print(\"CGPA:\\t\\t\",cgpa)\n", 171 | "print(\"=================================================\")" 172 | ] 173 | }, 174 | { 175 | "cell_type": "code", 176 | "execution_count": 35, 177 | "id": "af7f4447-d2e8-4945-9999-4d007ca0b025", 178 | "metadata": {}, 179 | "outputs": [], 180 | "source": [ 181 | "x=4\n", 182 | "y=4\n", 183 | "z=4" 184 | ] 185 | }, 186 | { 187 | "cell_type": "code", 188 | "execution_count": 39, 189 | "id": "be45c762-5b45-4e5c-98ae-ef72aefdf3b1", 190 | "metadata": {}, 191 | "outputs": [ 192 | { 193 | "name": "stdout", 194 | "output_type": "stream", 195 | "text": [ 196 | "4\n", 197 | "4\n", 198 | "4\n" 199 | ] 200 | } 201 | ], 202 | "source": [ 203 | "# one value to multiple variables \n", 204 | "x = y = z = 4\n", 205 | "print(x)\n", 206 | "print(y)\n", 207 | "print(z)" 208 | ] 209 | }, 210 | { 211 | "cell_type": "code", 212 | "execution_count": 44, 213 | "id": "95156fa9-0081-4c7b-960d-2737317a24ac", 214 | "metadata": {}, 215 | "outputs": [ 216 | { 217 | "name": "stdout", 218 | "output_type": "stream", 219 | "text": [ 220 | "4\n", 221 | "5\n", 222 | "6\n" 223 | ] 224 | } 225 | ], 226 | "source": [ 227 | "# multiple values to multiple variables \n", 228 | "x , y , z = 4,5,6\n", 229 | "print(x)\n", 230 | "print(y)\n", 231 | "print(z)" 232 | ] 233 | }, 234 | { 235 | "cell_type": "markdown", 236 | "id": "c5b6effb-ab80-4b10-adc3-eda770c51489", 237 | "metadata": {}, 238 | "source": [ 239 | "## Dynamic Program" 240 | ] 241 | }, 242 | { 243 | "cell_type": "code", 244 | "execution_count": 47, 245 | "id": "8c432b31-7d1d-4c29-afe8-2059d4377cf7", 246 | "metadata": {}, 247 | "outputs": [ 248 | { 249 | "name": "stdin", 250 | "output_type": "stream", 251 | "text": [ 252 | "Enter your Name: Zeeshan\n" 253 | ] 254 | }, 255 | { 256 | "name": "stdout", 257 | "output_type": "stream", 258 | "text": [ 259 | "Name: Zeeshan\n" 260 | ] 261 | } 262 | ], 263 | "source": [ 264 | "# taking input from a user\n", 265 | "name = input(\"Enter your Name:\")\n", 266 | "print(\"Name:\",name) " 267 | ] 268 | }, 269 | { 270 | "cell_type": "code", 271 | "execution_count": 48, 272 | "id": "5eb04a5a-6c99-40e3-ab1f-705c556fec3e", 273 | "metadata": {}, 274 | "outputs": [ 275 | { 276 | "name": "stdout", 277 | "output_type": "stream", 278 | "text": [ 279 | "\n" 280 | ] 281 | } 282 | ], 283 | "source": [ 284 | "print(type(name))" 285 | ] 286 | }, 287 | { 288 | "cell_type": "code", 289 | "execution_count": 54, 290 | "id": "47210cb5-8d57-4f96-ad9c-430983d76e3d", 291 | "metadata": {}, 292 | "outputs": [ 293 | { 294 | "name": "stdin", 295 | "output_type": "stream", 296 | "text": [ 297 | "Enter your Age: 30\n" 298 | ] 299 | }, 300 | { 301 | "name": "stdout", 302 | "output_type": "stream", 303 | "text": [ 304 | "Age: 30\n" 305 | ] 306 | } 307 | ], 308 | "source": [ 309 | "age = input(\"Enter your Age:\")\n", 310 | "print(\"Age:\",age)" 311 | ] 312 | }, 313 | { 314 | "cell_type": "code", 315 | "execution_count": 55, 316 | "id": "c291a381-3da6-49d4-b357-919d70e87697", 317 | "metadata": {}, 318 | "outputs": [ 319 | { 320 | "name": "stdout", 321 | "output_type": "stream", 322 | "text": [ 323 | "\n" 324 | ] 325 | } 326 | ], 327 | "source": [ 328 | "print(type(age))" 329 | ] 330 | }, 331 | { 332 | "cell_type": "code", 333 | "execution_count": 61, 334 | "id": "45083c4e-ed04-4100-a654-def6ff4128c3", 335 | "metadata": {}, 336 | "outputs": [ 337 | { 338 | "name": "stdin", 339 | "output_type": "stream", 340 | "text": [ 341 | "Enter your Age: 30\n" 342 | ] 343 | }, 344 | { 345 | "name": "stdout", 346 | "output_type": "stream", 347 | "text": [ 348 | "Age: 30.0\n", 349 | "\n" 350 | ] 351 | } 352 | ], 353 | "source": [ 354 | "age = float(input(\"Enter your Age:\"))\n", 355 | "print(\"Age:\",age)\n", 356 | "print(type(age))" 357 | ] 358 | }, 359 | { 360 | "cell_type": "code", 361 | "execution_count": 66, 362 | "id": "213c8be7-05d5-4d68-8ce2-2bb33b630092", 363 | "metadata": {}, 364 | "outputs": [ 365 | { 366 | "name": "stdin", 367 | "output_type": "stream", 368 | "text": [ 369 | "Enter your Number 56\n", 370 | "Enter your Number 78\n" 371 | ] 372 | }, 373 | { 374 | "name": "stdout", 375 | "output_type": "stream", 376 | "text": [ 377 | "The Sum of two number is 134.0\n" 378 | ] 379 | } 380 | ], 381 | "source": [ 382 | "number1= float(input(\"Enter your Number\"))\n", 383 | "number2= float(input(\"Enter your Number\"))\n", 384 | "add = number2+number1\n", 385 | "print(\"The Sum of two number is\",add)" 386 | ] 387 | }, 388 | { 389 | "cell_type": "code", 390 | "execution_count": 67, 391 | "id": "8d639fb3-9725-4448-99fd-21e5e59c81ca", 392 | "metadata": {}, 393 | "outputs": [ 394 | { 395 | "name": "stdout", 396 | "output_type": "stream", 397 | "text": [ 398 | "we are learning python\n" 399 | ] 400 | } 401 | ], 402 | "source": [ 403 | "txt = \"we are learning python\"\n", 404 | "print(txt)" 405 | ] 406 | }, 407 | { 408 | "cell_type": "code", 409 | "execution_count": 68, 410 | "id": "39cb38cf-526b-4e57-9460-0ec4fbc07adb", 411 | "metadata": {}, 412 | "outputs": [ 413 | { 414 | "data": { 415 | "text/plain": [ 416 | "'WE ARE LEARNING PYTHON'" 417 | ] 418 | }, 419 | "execution_count": 68, 420 | "metadata": {}, 421 | "output_type": "execute_result" 422 | } 423 | ], 424 | "source": [ 425 | "txt.upper()" 426 | ] 427 | }, 428 | { 429 | "cell_type": "code", 430 | "execution_count": 69, 431 | "id": "3ad8d40e-b5a6-4e06-bf2f-6b4d9d4cdd23", 432 | "metadata": {}, 433 | "outputs": [ 434 | { 435 | "data": { 436 | "text/plain": [ 437 | "'we are learning python'" 438 | ] 439 | }, 440 | "execution_count": 69, 441 | "metadata": {}, 442 | "output_type": "execute_result" 443 | } 444 | ], 445 | "source": [ 446 | "txt1='WE ARE LEARNING PYTHON'\n", 447 | "txt1.lower()" 448 | ] 449 | }, 450 | { 451 | "cell_type": "code", 452 | "execution_count": null, 453 | "id": "c1c73164-3118-4b9e-a3de-0b69966b2a1b", 454 | "metadata": {}, 455 | "outputs": [], 456 | "source": [ 457 | "# Arithmatic operator (==,+,-,*)" 458 | ] 459 | } 460 | ], 461 | "metadata": { 462 | "kernelspec": { 463 | "display_name": "Python 3", 464 | "language": "python", 465 | "name": "python3" 466 | }, 467 | "language_info": { 468 | "codemirror_mode": { 469 | "name": "ipython", 470 | "version": 3 471 | }, 472 | "file_extension": ".py", 473 | "mimetype": "text/x-python", 474 | "name": "python", 475 | "nbconvert_exporter": "python", 476 | "pygments_lexer": "ipython3", 477 | "version": "3.8.8" 478 | } 479 | }, 480 | "nbformat": 4, 481 | "nbformat_minor": 5 482 | } 483 | -------------------------------------------------------------------------------- /Code/Class4/.ipynb_checkpoints/Tuples_Dictionary-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "4123aa28", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "('sajid', 'Ahmed', 'Ali', 'sajid')\n" 14 | ] 15 | } 16 | ], 17 | "source": [ 18 | "# List [],tuple(),dictinary{},set{}\n", 19 | "tuple_name = (\"sajid\",\"Ahmed\",\"Ali\",\"sajid\")\n", 20 | "print(tuple_name)" 21 | ] 22 | }, 23 | { 24 | "cell_type": "code", 25 | "execution_count": 2, 26 | "id": "36aa1610", 27 | "metadata": {}, 28 | "outputs": [ 29 | { 30 | "data": { 31 | "text/plain": [ 32 | "tuple" 33 | ] 34 | }, 35 | "execution_count": 2, 36 | "metadata": {}, 37 | "output_type": "execute_result" 38 | } 39 | ], 40 | "source": [ 41 | "type(tuple_name)" 42 | ] 43 | }, 44 | { 45 | "cell_type": "code", 46 | "execution_count": 3, 47 | "id": "35966803", 48 | "metadata": {}, 49 | "outputs": [ 50 | { 51 | "data": { 52 | "text/plain": [ 53 | "2" 54 | ] 55 | }, 56 | "execution_count": 3, 57 | "metadata": {}, 58 | "output_type": "execute_result" 59 | } 60 | ], 61 | "source": [ 62 | "tuple_name.count('sajid')" 63 | ] 64 | }, 65 | { 66 | "cell_type": "code", 67 | "execution_count": 4, 68 | "id": "49fbc5da", 69 | "metadata": {}, 70 | "outputs": [ 71 | { 72 | "data": { 73 | "text/plain": [ 74 | "('sajid', 'Ahmed', 'Ali', 'sajid')" 75 | ] 76 | }, 77 | "execution_count": 4, 78 | "metadata": {}, 79 | "output_type": "execute_result" 80 | } 81 | ], 82 | "source": [ 83 | "tuple_name" 84 | ] 85 | }, 86 | { 87 | "cell_type": "code", 88 | "execution_count": 5, 89 | "id": "6ea64370", 90 | "metadata": {}, 91 | "outputs": [ 92 | { 93 | "data": { 94 | "text/plain": [ 95 | "2" 96 | ] 97 | }, 98 | "execution_count": 5, 99 | "metadata": {}, 100 | "output_type": "execute_result" 101 | } 102 | ], 103 | "source": [ 104 | "tuple_name.index(\"Ali\")" 105 | ] 106 | }, 107 | { 108 | "cell_type": "code", 109 | "execution_count": 6, 110 | "id": "2b6faae9", 111 | "metadata": {}, 112 | "outputs": [], 113 | "source": [ 114 | "tuple_last_name=(\"Majeed\",\"Asad\",\"Ali\")" 115 | ] 116 | }, 117 | { 118 | "cell_type": "code", 119 | "execution_count": 7, 120 | "id": "43cbe6b8", 121 | "metadata": {}, 122 | "outputs": [ 123 | { 124 | "name": "stdout", 125 | "output_type": "stream", 126 | "text": [ 127 | "('sajid', 'Ahmed', 'Ali', 'sajid', 'Majeed', 'Asad', 'Ali')\n" 128 | ] 129 | } 130 | ], 131 | "source": [ 132 | "full_name = tuple_name+tuple_last_name\n", 133 | "print(full_name)" 134 | ] 135 | }, 136 | { 137 | "cell_type": "code", 138 | "execution_count": 8, 139 | "id": "b25960fc", 140 | "metadata": {}, 141 | "outputs": [], 142 | "source": [ 143 | "no_1=(1,2,3,4)\n", 144 | "no_2=(6,7,8,9)\n", 145 | "sum= no_1+no_2" 146 | ] 147 | }, 148 | { 149 | "cell_type": "code", 150 | "execution_count": 9, 151 | "id": "fa8677ae", 152 | "metadata": {}, 153 | "outputs": [ 154 | { 155 | "data": { 156 | "text/plain": [ 157 | "(1, 2, 3, 4, 6, 7, 8, 9)" 158 | ] 159 | }, 160 | "execution_count": 9, 161 | "metadata": {}, 162 | "output_type": "execute_result" 163 | } 164 | ], 165 | "source": [ 166 | "sum" 167 | ] 168 | }, 169 | { 170 | "cell_type": "code", 171 | "execution_count": 10, 172 | "id": "6e55bf3b", 173 | "metadata": {}, 174 | "outputs": [ 175 | { 176 | "name": "stdout", 177 | "output_type": "stream", 178 | "text": [ 179 | "1\n", 180 | "[2, 3, 7, 8]\n", 181 | "9\n" 182 | ] 183 | } 184 | ], 185 | "source": [ 186 | "# unpacking a tuple\n", 187 | "a,*b,c =(1, 2, 3,7,8,9)\n", 188 | "print(a)\n", 189 | "print(b)\n", 190 | "print(c)" 191 | ] 192 | }, 193 | { 194 | "cell_type": "code", 195 | "execution_count": 11, 196 | "id": "f6ff723b", 197 | "metadata": {}, 198 | "outputs": [], 199 | "source": [ 200 | "# key,value \n", 201 | "list1 = set()" 202 | ] 203 | }, 204 | { 205 | "cell_type": "code", 206 | "execution_count": 12, 207 | "id": "c1ceac92", 208 | "metadata": {}, 209 | "outputs": [ 210 | { 211 | "data": { 212 | "text/plain": [ 213 | "{1, 3, 4, 5, 6}" 214 | ] 215 | }, 216 | "execution_count": 12, 217 | "metadata": {}, 218 | "output_type": "execute_result" 219 | } 220 | ], 221 | "source": [ 222 | "list1={1,3,4,5,6,5,6}\n", 223 | "list1" 224 | ] 225 | }, 226 | { 227 | "cell_type": "code", 228 | "execution_count": 13, 229 | "id": "f62a692e", 230 | "metadata": {}, 231 | "outputs": [ 232 | { 233 | "data": { 234 | "text/plain": [ 235 | "set" 236 | ] 237 | }, 238 | "execution_count": 13, 239 | "metadata": {}, 240 | "output_type": "execute_result" 241 | } 242 | ], 243 | "source": [ 244 | "type(list1)" 245 | ] 246 | }, 247 | { 248 | "cell_type": "code", 249 | "execution_count": 14, 250 | "id": "2420364f", 251 | "metadata": {}, 252 | "outputs": [], 253 | "source": [ 254 | "student={\n", 255 | " 'name':'sajid Majeed',\n", 256 | " 'gender':'Male',\n", 257 | " 'major_program':'Bioteach',\n", 258 | " 'university':'DUHS',\n", 259 | " 'address':\"Ojha Campus\",\n", 260 | " 'expertise':[\"Genomics\",\"Programming\",\"Molecular Biology\",\"Python\"],\n", 261 | " 'age':31\n", 262 | "}" 263 | ] 264 | }, 265 | { 266 | "cell_type": "code", 267 | "execution_count": 15, 268 | "id": "9ffcc6ea", 269 | "metadata": {}, 270 | "outputs": [ 271 | { 272 | "name": "stdout", 273 | "output_type": "stream", 274 | "text": [ 275 | "{'name': 'sajid Majeed', 'gender': 'Male', 'major_program': 'Bioteach', 'university': 'DUHS', 'address': 'Ojha Campus', 'expertise': ['Genomics', 'Programming', 'Molecular Biology', 'Python'], 'age': 31}\n" 276 | ] 277 | } 278 | ], 279 | "source": [ 280 | "print(student)" 281 | ] 282 | }, 283 | { 284 | "cell_type": "code", 285 | "execution_count": 16, 286 | "id": "37018dd8", 287 | "metadata": {}, 288 | "outputs": [ 289 | { 290 | "data": { 291 | "text/plain": [ 292 | "dict_keys(['name', 'gender', 'major_program', 'university', 'address', 'expertise', 'age'])" 293 | ] 294 | }, 295 | "execution_count": 16, 296 | "metadata": {}, 297 | "output_type": "execute_result" 298 | } 299 | ], 300 | "source": [ 301 | "student.keys()" 302 | ] 303 | }, 304 | { 305 | "cell_type": "code", 306 | "execution_count": 17, 307 | "id": "71e2ef2e", 308 | "metadata": {}, 309 | "outputs": [ 310 | { 311 | "data": { 312 | "text/plain": [ 313 | "dict_values(['sajid Majeed', 'Male', 'Bioteach', 'DUHS', 'Ojha Campus', ['Genomics', 'Programming', 'Molecular Biology', 'Python'], 31])" 314 | ] 315 | }, 316 | "execution_count": 17, 317 | "metadata": {}, 318 | "output_type": "execute_result" 319 | } 320 | ], 321 | "source": [ 322 | "student.values()" 323 | ] 324 | }, 325 | { 326 | "cell_type": "code", 327 | "execution_count": 18, 328 | "id": "7c00b7ae", 329 | "metadata": {}, 330 | "outputs": [ 331 | { 332 | "data": { 333 | "text/plain": [ 334 | "dict_items([('name', 'sajid Majeed'), ('gender', 'Male'), ('major_program', 'Bioteach'), ('university', 'DUHS'), ('address', 'Ojha Campus'), ('expertise', ['Genomics', 'Programming', 'Molecular Biology', 'Python']), ('age', 31)])" 335 | ] 336 | }, 337 | "execution_count": 18, 338 | "metadata": {}, 339 | "output_type": "execute_result" 340 | } 341 | ], 342 | "source": [ 343 | "student.items()" 344 | ] 345 | }, 346 | { 347 | "cell_type": "code", 348 | "execution_count": 19, 349 | "id": "711bd2df", 350 | "metadata": {}, 351 | "outputs": [ 352 | { 353 | "data": { 354 | "text/plain": [ 355 | "7" 356 | ] 357 | }, 358 | "execution_count": 19, 359 | "metadata": {}, 360 | "output_type": "execute_result" 361 | } 362 | ], 363 | "source": [ 364 | "len(student)" 365 | ] 366 | }, 367 | { 368 | "cell_type": "code", 369 | "execution_count": 20, 370 | "id": "14d50bfc", 371 | "metadata": {}, 372 | "outputs": [ 373 | { 374 | "data": { 375 | "text/plain": [ 376 | "True" 377 | ] 378 | }, 379 | "execution_count": 20, 380 | "metadata": {}, 381 | "output_type": "execute_result" 382 | } 383 | ], 384 | "source": [ 385 | "'name' in student" 386 | ] 387 | }, 388 | { 389 | "cell_type": "code", 390 | "execution_count": 21, 391 | "id": "174e5244", 392 | "metadata": {}, 393 | "outputs": [], 394 | "source": [ 395 | "student['Specialization']=\"AI\"" 396 | ] 397 | }, 398 | { 399 | "cell_type": "code", 400 | "execution_count": 22, 401 | "id": "f9748671", 402 | "metadata": {}, 403 | "outputs": [ 404 | { 405 | "data": { 406 | "text/plain": [ 407 | "{'name': 'sajid Majeed',\n", 408 | " 'gender': 'Male',\n", 409 | " 'major_program': 'Bioteach',\n", 410 | " 'university': 'DUHS',\n", 411 | " 'address': 'Ojha Campus',\n", 412 | " 'expertise': ['Genomics', 'Programming', 'Molecular Biology', 'Python'],\n", 413 | " 'age': 31,\n", 414 | " 'Specialization': 'AI'}" 415 | ] 416 | }, 417 | "execution_count": 22, 418 | "metadata": {}, 419 | "output_type": "execute_result" 420 | } 421 | ], 422 | "source": [ 423 | "student" 424 | ] 425 | }, 426 | { 427 | "cell_type": "code", 428 | "execution_count": 23, 429 | "id": "7e769771", 430 | "metadata": {}, 431 | "outputs": [ 432 | { 433 | "data": { 434 | "text/plain": [ 435 | "31" 436 | ] 437 | }, 438 | "execution_count": 23, 439 | "metadata": {}, 440 | "output_type": "execute_result" 441 | } 442 | ], 443 | "source": [ 444 | "student.get('age')" 445 | ] 446 | }, 447 | { 448 | "cell_type": "code", 449 | "execution_count": 24, 450 | "id": "d77c3d60", 451 | "metadata": {}, 452 | "outputs": [ 453 | { 454 | "data": { 455 | "text/plain": [ 456 | "'sajid Majeed'" 457 | ] 458 | }, 459 | "execution_count": 24, 460 | "metadata": {}, 461 | "output_type": "execute_result" 462 | } 463 | ], 464 | "source": [ 465 | "student['name']" 466 | ] 467 | }, 468 | { 469 | "cell_type": "code", 470 | "execution_count": 25, 471 | "id": "b5ffeece", 472 | "metadata": {}, 473 | "outputs": [], 474 | "source": [ 475 | "student['expertise'].append('Dignostic')" 476 | ] 477 | }, 478 | { 479 | "cell_type": "code", 480 | "execution_count": 26, 481 | "id": "5e207602", 482 | "metadata": {}, 483 | "outputs": [ 484 | { 485 | "data": { 486 | "text/plain": [ 487 | "{'name': 'sajid Majeed',\n", 488 | " 'gender': 'Male',\n", 489 | " 'major_program': 'Bioteach',\n", 490 | " 'university': 'DUHS',\n", 491 | " 'address': 'Ojha Campus',\n", 492 | " 'expertise': ['Genomics',\n", 493 | " 'Programming',\n", 494 | " 'Molecular Biology',\n", 495 | " 'Python',\n", 496 | " 'Dignostic'],\n", 497 | " 'age': 31,\n", 498 | " 'Specialization': 'AI'}" 499 | ] 500 | }, 501 | "execution_count": 26, 502 | "metadata": {}, 503 | "output_type": "execute_result" 504 | } 505 | ], 506 | "source": [ 507 | "student" 508 | ] 509 | }, 510 | { 511 | "cell_type": "code", 512 | "execution_count": 27, 513 | "id": "daf9eee5", 514 | "metadata": {}, 515 | "outputs": [ 516 | { 517 | "data": { 518 | "text/plain": [ 519 | "{'name': 'sajid Majeed',\n", 520 | " 'gender': 'Male',\n", 521 | " 'major_program': 'Bioteach',\n", 522 | " 'university': 'DUHS',\n", 523 | " 'address': 'Ojha Campus',\n", 524 | " 'expertise': ['Genomics',\n", 525 | " 'Programming',\n", 526 | " 'Molecular Biology',\n", 527 | " 'Python',\n", 528 | " 'Dignostic'],\n", 529 | " 'age': 31,\n", 530 | " 'Specialization': 'AI'}" 531 | ] 532 | }, 533 | "execution_count": 27, 534 | "metadata": {}, 535 | "output_type": "execute_result" 536 | } 537 | ], 538 | "source": [ 539 | "student" 540 | ] 541 | }, 542 | { 543 | "cell_type": "code", 544 | "execution_count": 28, 545 | "id": "c783208d", 546 | "metadata": {}, 547 | "outputs": [], 548 | "source": [ 549 | "student['marks']={\"maths\":80,'bio':89}" 550 | ] 551 | }, 552 | { 553 | "cell_type": "code", 554 | "execution_count": 29, 555 | "id": "9db48cdc", 556 | "metadata": {}, 557 | "outputs": [ 558 | { 559 | "data": { 560 | "text/plain": [ 561 | "{'name': 'sajid Majeed',\n", 562 | " 'gender': 'Male',\n", 563 | " 'major_program': 'Bioteach',\n", 564 | " 'university': 'DUHS',\n", 565 | " 'address': 'Ojha Campus',\n", 566 | " 'expertise': ['Genomics',\n", 567 | " 'Programming',\n", 568 | " 'Molecular Biology',\n", 569 | " 'Python',\n", 570 | " 'Dignostic'],\n", 571 | " 'age': 31,\n", 572 | " 'Specialization': 'AI',\n", 573 | " 'marks': {'maths': 80, 'bio': 89}}" 574 | ] 575 | }, 576 | "execution_count": 29, 577 | "metadata": {}, 578 | "output_type": "execute_result" 579 | } 580 | ], 581 | "source": [ 582 | "student" 583 | ] 584 | }, 585 | { 586 | "cell_type": "code", 587 | "execution_count": 30, 588 | "id": "3259827b", 589 | "metadata": {}, 590 | "outputs": [], 591 | "source": [ 592 | "student['degree']=\"Mphil\"" 593 | ] 594 | }, 595 | { 596 | "cell_type": "code", 597 | "execution_count": 31, 598 | "id": "31d117ba", 599 | "metadata": {}, 600 | "outputs": [ 601 | { 602 | "data": { 603 | "text/plain": [ 604 | "{'name': 'sajid Majeed',\n", 605 | " 'gender': 'Male',\n", 606 | " 'major_program': 'Bioteach',\n", 607 | " 'university': 'DUHS',\n", 608 | " 'address': 'Ojha Campus',\n", 609 | " 'expertise': ['Genomics',\n", 610 | " 'Programming',\n", 611 | " 'Molecular Biology',\n", 612 | " 'Python',\n", 613 | " 'Dignostic'],\n", 614 | " 'age': 31,\n", 615 | " 'Specialization': 'AI',\n", 616 | " 'marks': {'maths': 80, 'bio': 89},\n", 617 | " 'degree': 'Mphil'}" 618 | ] 619 | }, 620 | "execution_count": 31, 621 | "metadata": {}, 622 | "output_type": "execute_result" 623 | } 624 | ], 625 | "source": [ 626 | "student" 627 | ] 628 | }, 629 | { 630 | "cell_type": "code", 631 | "execution_count": 32, 632 | "id": "2415652f", 633 | "metadata": {}, 634 | "outputs": [], 635 | "source": [ 636 | "student['marks']['Dignostic']=90" 637 | ] 638 | }, 639 | { 640 | "cell_type": "code", 641 | "execution_count": 33, 642 | "id": "f9ec2840", 643 | "metadata": {}, 644 | "outputs": [ 645 | { 646 | "data": { 647 | "text/plain": [ 648 | "{'name': 'sajid Majeed',\n", 649 | " 'gender': 'Male',\n", 650 | " 'major_program': 'Bioteach',\n", 651 | " 'university': 'DUHS',\n", 652 | " 'address': 'Ojha Campus',\n", 653 | " 'expertise': ['Genomics',\n", 654 | " 'Programming',\n", 655 | " 'Molecular Biology',\n", 656 | " 'Python',\n", 657 | " 'Dignostic'],\n", 658 | " 'age': 31,\n", 659 | " 'Specialization': 'AI',\n", 660 | " 'marks': {'maths': 80, 'bio': 89, 'Dignostic': 90},\n", 661 | " 'degree': 'Mphil'}" 662 | ] 663 | }, 664 | "execution_count": 33, 665 | "metadata": {}, 666 | "output_type": "execute_result" 667 | } 668 | ], 669 | "source": [ 670 | "student" 671 | ] 672 | }, 673 | { 674 | "cell_type": "code", 675 | "execution_count": 34, 676 | "id": "c4486a7c", 677 | "metadata": {}, 678 | "outputs": [], 679 | "source": [ 680 | "student.update({'name':'Anisa'})\n", 681 | "student.update({'name1':'Ayesha'})" 682 | ] 683 | }, 684 | { 685 | "cell_type": "code", 686 | "execution_count": 35, 687 | "id": "5cda0dbf", 688 | "metadata": {}, 689 | "outputs": [ 690 | { 691 | "data": { 692 | "text/plain": [ 693 | "{'name': 'Anisa',\n", 694 | " 'gender': 'Male',\n", 695 | " 'major_program': 'Bioteach',\n", 696 | " 'university': 'DUHS',\n", 697 | " 'address': 'Ojha Campus',\n", 698 | " 'expertise': ['Genomics',\n", 699 | " 'Programming',\n", 700 | " 'Molecular Biology',\n", 701 | " 'Python',\n", 702 | " 'Dignostic'],\n", 703 | " 'age': 31,\n", 704 | " 'Specialization': 'AI',\n", 705 | " 'marks': {'maths': 80, 'bio': 89, 'Dignostic': 90},\n", 706 | " 'degree': 'Mphil',\n", 707 | " 'name1': 'Ayesha'}" 708 | ] 709 | }, 710 | "execution_count": 35, 711 | "metadata": {}, 712 | "output_type": "execute_result" 713 | } 714 | ], 715 | "source": [ 716 | "student" 717 | ] 718 | }, 719 | { 720 | "cell_type": "code", 721 | "execution_count": 37, 722 | "id": "2d45c443", 723 | "metadata": {}, 724 | "outputs": [ 725 | { 726 | "data": { 727 | "text/plain": [ 728 | "False" 729 | ] 730 | }, 731 | "execution_count": 37, 732 | "metadata": {}, 733 | "output_type": "execute_result" 734 | } 735 | ], 736 | "source": [ 737 | "'name2' in student" 738 | ] 739 | }, 740 | { 741 | "cell_type": "code", 742 | "execution_count": null, 743 | "id": "c4cc1fff", 744 | "metadata": {}, 745 | "outputs": [], 746 | "source": [ 747 | "student." 748 | ] 749 | } 750 | ], 751 | "metadata": { 752 | "kernelspec": { 753 | "display_name": "Python 3", 754 | "language": "python", 755 | "name": "python3" 756 | }, 757 | "language_info": { 758 | "codemirror_mode": { 759 | "name": "ipython", 760 | "version": 3 761 | }, 762 | "file_extension": ".py", 763 | "mimetype": "text/x-python", 764 | "name": "python", 765 | "nbconvert_exporter": "python", 766 | "pygments_lexer": "ipython3", 767 | "version": "3.8.8" 768 | } 769 | }, 770 | "nbformat": 4, 771 | "nbformat_minor": 5 772 | } 773 | -------------------------------------------------------------------------------- /Code/Class3/Class3.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "provenance": [] 7 | }, 8 | "kernelspec": { 9 | "name": "python3", 10 | "display_name": "Python 3" 11 | }, 12 | "language_info": { 13 | "name": "python" 14 | } 15 | }, 16 | "cells": [ 17 | { 18 | "cell_type": "code", 19 | "execution_count": 1, 20 | "metadata": { 21 | "colab": { 22 | "base_uri": "https://localhost:8080/" 23 | }, 24 | "id": "JSpMF3MrSmHw", 25 | "outputId": "b6b85161-a2e2-493d-92f7-ab0442025d16" 26 | }, 27 | "outputs": [ 28 | { 29 | "output_type": "stream", 30 | "name": "stdout", 31 | "text": [ 32 | "['Apple', 'Banana', 'Grapes', 2, 2.0, True]\n", 33 | "\n" 34 | ] 35 | } 36 | ], 37 | "source": [ 38 | "# collection of items to store\n", 39 | "fruits_list= ['Apple','Banana','Grapes',2,2.0,True] # Items in a list\n", 40 | "print(fruits_list)\n", 41 | "print(type(fruits_list))" 42 | ] 43 | }, 44 | { 45 | "cell_type": "code", 46 | "source": [ 47 | "# Access with the help of index\n", 48 | "print(fruits_list[0])" 49 | ], 50 | "metadata": { 51 | "colab": { 52 | "base_uri": "https://localhost:8080/" 53 | }, 54 | "id": "hrU71Vu3S4E5", 55 | "outputId": "d50a816d-ee04-4982-830b-eeb39eca4496" 56 | }, 57 | "execution_count": 3, 58 | "outputs": [ 59 | { 60 | "output_type": "stream", 61 | "name": "stdout", 62 | "text": [ 63 | "Apple\n" 64 | ] 65 | } 66 | ] 67 | }, 68 | { 69 | "cell_type": "code", 70 | "source": [ 71 | "# Replace\n", 72 | "fruits_list[0]='Orange'\n", 73 | "print(fruits_list)" 74 | ], 75 | "metadata": { 76 | "colab": { 77 | "base_uri": "https://localhost:8080/" 78 | }, 79 | "id": "vpnsCGR8V74J", 80 | "outputId": "50da8eb5-f4d6-4ed6-e702-e8f58843b722" 81 | }, 82 | "execution_count": 4, 83 | "outputs": [ 84 | { 85 | "output_type": "stream", 86 | "name": "stdout", 87 | "text": [ 88 | "['Orange', 'Banana', 'Grapes', 2, 2.0, True]\n" 89 | ] 90 | } 91 | ] 92 | }, 93 | { 94 | "cell_type": "code", 95 | "source": [ 96 | "print(type(fruits_list[5]))" 97 | ], 98 | "metadata": { 99 | "colab": { 100 | "base_uri": "https://localhost:8080/" 101 | }, 102 | "id": "3Mq_r-2OWcWs", 103 | "outputId": "0da28b89-f9f1-4b46-ca58-a1713e4c0134" 104 | }, 105 | "execution_count": 5, 106 | "outputs": [ 107 | { 108 | "output_type": "stream", 109 | "name": "stdout", 110 | "text": [ 111 | "\n" 112 | ] 113 | } 114 | ] 115 | }, 116 | { 117 | "cell_type": "code", 118 | "source": [ 119 | "# Adding element in a list \"append\" ,\"insert\"\n", 120 | "fruits_list.append('Mango')\n", 121 | "print(fruits_list)" 122 | ], 123 | "metadata": { 124 | "colab": { 125 | "base_uri": "https://localhost:8080/" 126 | }, 127 | "id": "pTMyWJjdW7u0", 128 | "outputId": "a92c3c3a-04d6-4b48-bef0-355b8f02229e" 129 | }, 130 | "execution_count": 6, 131 | "outputs": [ 132 | { 133 | "output_type": "stream", 134 | "name": "stdout", 135 | "text": [ 136 | "['Orange', 'Banana', 'Grapes', 2, 2.0, True, 'Mango']\n" 137 | ] 138 | } 139 | ] 140 | }, 141 | { 142 | "cell_type": "code", 143 | "source": [ 144 | "fruits_list.insert(6,'Guava')\n", 145 | "print(fruits_list)" 146 | ], 147 | "metadata": { 148 | "colab": { 149 | "base_uri": "https://localhost:8080/" 150 | }, 151 | "id": "2urj4YYYYBr6", 152 | "outputId": "ef06fdb8-0208-42db-f993-a4ac929f8267" 153 | }, 154 | "execution_count": 7, 155 | "outputs": [ 156 | { 157 | "output_type": "stream", 158 | "name": "stdout", 159 | "text": [ 160 | "['Orange', 'Banana', 'Grapes', 2, 2.0, True, 'Guava', 'Mango']\n" 161 | ] 162 | } 163 | ] 164 | }, 165 | { 166 | "cell_type": "code", 167 | "source": [ 168 | "fruits_list.remove('Guava')\n", 169 | "print(fruits_list)" 170 | ], 171 | "metadata": { 172 | "colab": { 173 | "base_uri": "https://localhost:8080/" 174 | }, 175 | "id": "xMgjP9w_Yq_u", 176 | "outputId": "43cf9f30-5412-4492-da8a-1cf63e8269ed" 177 | }, 178 | "execution_count": 8, 179 | "outputs": [ 180 | { 181 | "output_type": "stream", 182 | "name": "stdout", 183 | "text": [ 184 | "['Orange', 'Banana', 'Grapes', 2, 2.0, True, 'Mango']\n" 185 | ] 186 | } 187 | ] 188 | }, 189 | { 190 | "cell_type": "code", 191 | "source": [ 192 | "# delete\n", 193 | "del fruits_list[0]\n", 194 | "print(fruits_list)" 195 | ], 196 | "metadata": { 197 | "colab": { 198 | "base_uri": "https://localhost:8080/" 199 | }, 200 | "id": "XCZ6oJ3WZImk", 201 | "outputId": "f78266a0-db21-4277-e1a0-e12c61e56f15" 202 | }, 203 | "execution_count": 9, 204 | "outputs": [ 205 | { 206 | "output_type": "stream", 207 | "name": "stdout", 208 | "text": [ 209 | "['Banana', 'Grapes', 2, 2.0, True, 'Mango']\n" 210 | ] 211 | } 212 | ] 213 | }, 214 | { 215 | "cell_type": "code", 216 | "source": [ 217 | "# deletion of a list\n", 218 | "del fruits_list\n", 219 | "print(fruits_list)" 220 | ], 221 | "metadata": { 222 | "colab": { 223 | "base_uri": "https://localhost:8080/", 224 | "height": 176 225 | }, 226 | "id": "m0f5Il_8ZzDI", 227 | "outputId": "8878e566-6583-4bc9-cc45-e77e1a27ca42" 228 | }, 229 | "execution_count": 10, 230 | "outputs": [ 231 | { 232 | "output_type": "error", 233 | "ename": "NameError", 234 | "evalue": "name 'fruits_list' is not defined", 235 | "traceback": [ 236 | "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", 237 | "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", 238 | "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# deletion of a list\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0;32mdel\u001b[0m \u001b[0mfruits_list\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfruits_list\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", 239 | "\u001b[0;31mNameError\u001b[0m: name 'fruits_list' is not defined" 240 | ] 241 | } 242 | ] 243 | }, 244 | { 245 | "cell_type": "code", 246 | "source": [ 247 | "fruits_list" 248 | ], 249 | "metadata": { 250 | "colab": { 251 | "base_uri": "https://localhost:8080/", 252 | "height": 141 253 | }, 254 | "id": "bk2zLcAbaZu9", 255 | "outputId": "0662ac3b-0e07-45f7-f313-6e1e91ea14ea" 256 | }, 257 | "execution_count": 11, 258 | "outputs": [ 259 | { 260 | "output_type": "error", 261 | "ename": "NameError", 262 | "evalue": "name 'fruits_list' is not defined", 263 | "traceback": [ 264 | "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", 265 | "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", 266 | "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mfruits_list\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", 267 | "\u001b[0;31mNameError\u001b[0m: name 'fruits_list' is not defined" 268 | ] 269 | } 270 | ] 271 | }, 272 | { 273 | "cell_type": "code", 274 | "source": [ 275 | "# indexing [inclusive:exclusive:step]\n", 276 | "print(fruits_list[0:3])\n", 277 | "print(fruits_list[2:5])" 278 | ], 279 | "metadata": { 280 | "id": "qQxWkjksa7RV" 281 | }, 282 | "execution_count": null, 283 | "outputs": [] 284 | }, 285 | { 286 | "cell_type": "code", 287 | "source": [ 288 | "len(fruits_list)" 289 | ], 290 | "metadata": { 291 | "id": "tqeBJ_kLbJ7E" 292 | }, 293 | "execution_count": null, 294 | "outputs": [] 295 | }, 296 | { 297 | "cell_type": "code", 298 | "source": [ 299 | "fruits_list.count('Apple')" 300 | ], 301 | "metadata": { 302 | "colab": { 303 | "base_uri": "https://localhost:8080/", 304 | "height": 141 305 | }, 306 | "id": "QC6VBiwjcgRq", 307 | "outputId": "914b8c00-df33-4291-c10f-8c796bb89b77" 308 | }, 309 | "execution_count": 12, 310 | "outputs": [ 311 | { 312 | "output_type": "error", 313 | "ename": "NameError", 314 | "evalue": "name 'fruits_list' is not defined", 315 | "traceback": [ 316 | "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", 317 | "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", 318 | "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mfruits_list\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcount\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Apple'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", 319 | "\u001b[0;31mNameError\u001b[0m: name 'fruits_list' is not defined" 320 | ] 321 | } 322 | ] 323 | }, 324 | { 325 | "cell_type": "code", 326 | "source": [ 327 | "print(fruits_list)\n", 328 | "print(fruits_list[0:6:2])\n", 329 | "print(fruits_list[0:6:5])\n", 330 | "print(fruits_list[:])\n", 331 | "print(fruits_list[::2])\n", 332 | "print(fruits_list[1::2])" 333 | ], 334 | "metadata": { 335 | "id": "WHpCkKhRcyAV" 336 | }, 337 | "execution_count": null, 338 | "outputs": [] 339 | }, 340 | { 341 | "cell_type": "code", 342 | "source": [ 343 | "name=\"Ahmed\"\n", 344 | "name[0:3]" 345 | ], 346 | "metadata": { 347 | "id": "1EVJ2v1ZdFGT" 348 | }, 349 | "execution_count": null, 350 | "outputs": [] 351 | }, 352 | { 353 | "cell_type": "code", 354 | "source": [ 355 | "print(fruits_list)\n", 356 | "fruits_list.pop()\n", 357 | "print(fruits_list)" 358 | ], 359 | "metadata": { 360 | "colab": { 361 | "base_uri": "https://localhost:8080/", 362 | "height": 176 363 | }, 364 | "id": "G6TZExp0fL2x", 365 | "outputId": "0ee4817c-1b65-425d-da8e-b7afb2d8c2af" 366 | }, 367 | "execution_count": 13, 368 | "outputs": [ 369 | { 370 | "output_type": "error", 371 | "ename": "NameError", 372 | "evalue": "name 'fruits_list' is not defined", 373 | "traceback": [ 374 | "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", 375 | "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", 376 | "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfruits_list\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mfruits_list\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpop\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfruits_list\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", 377 | "\u001b[0;31mNameError\u001b[0m: name 'fruits_list' is not defined" 378 | ] 379 | } 380 | ] 381 | }, 382 | { 383 | "cell_type": "code", 384 | "source": [ 385 | "fruits_list.reverse()\n", 386 | "print(fruits_list)\n" 387 | ], 388 | "metadata": { 389 | "id": "RgHh8rzsgge0" 390 | }, 391 | "execution_count": null, 392 | "outputs": [] 393 | }, 394 | { 395 | "cell_type": "code", 396 | "source": [ 397 | "num_list=[1,2,80,40,25]\n", 398 | "num_list.sort()\n", 399 | "print(num_list)" 400 | ], 401 | "metadata": { 402 | "id": "UBXjxPi-f0n2" 403 | }, 404 | "execution_count": null, 405 | "outputs": [] 406 | }, 407 | { 408 | "cell_type": "code", 409 | "source": [ 410 | "print(sorted(num_list))\n", 411 | "print(sorted(num_list,reverse=True))" 412 | ], 413 | "metadata": { 414 | "colab": { 415 | "base_uri": "https://localhost:8080/", 416 | "height": 159 417 | }, 418 | "id": "_4fEeN56gBS3", 419 | "outputId": "d8580492-b044-4d32-8924-4ac586de1eab" 420 | }, 421 | "execution_count": 14, 422 | "outputs": [ 423 | { 424 | "output_type": "error", 425 | "ename": "NameError", 426 | "evalue": "name 'num_list' is not defined", 427 | "traceback": [ 428 | "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", 429 | "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", 430 | "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msorted\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnum_list\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msorted\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnum_list\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mreverse\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", 431 | "\u001b[0;31mNameError\u001b[0m: name 'num_list' is not defined" 432 | ] 433 | } 434 | ] 435 | }, 436 | { 437 | "cell_type": "code", 438 | "source": [ 439 | "reversed(num_list)\n", 440 | "print(num_list)" 441 | ], 442 | "metadata": { 443 | "id": "1w0XkFpwhK0v" 444 | }, 445 | "execution_count": null, 446 | "outputs": [] 447 | }, 448 | { 449 | "cell_type": "code", 450 | "source": [ 451 | "event='Procom25'\n", 452 | "print(sorted(event))" 453 | ], 454 | "metadata": { 455 | "id": "C2x4dhmoh5gI" 456 | }, 457 | "execution_count": null, 458 | "outputs": [] 459 | }, 460 | { 461 | "cell_type": "code", 462 | "source": [ 463 | "fruits_list_2=['Apple','Banana','Grapes',[23,34,56,'Ahmed']]\n", 464 | "print(fruits_list_2)" 465 | ], 466 | "metadata": { 467 | "colab": { 468 | "base_uri": "https://localhost:8080/" 469 | }, 470 | "id": "V6VdkfvvimrO", 471 | "outputId": "dcf48e7c-4511-470f-c17c-8a34bded79ba" 472 | }, 473 | "execution_count": 15, 474 | "outputs": [ 475 | { 476 | "output_type": "stream", 477 | "name": "stdout", 478 | "text": [ 479 | "['Apple', 'Banana', 'Grapes', [23, 34, 56, 'Ahmed']]\n" 480 | ] 481 | } 482 | ] 483 | }, 484 | { 485 | "cell_type": "code", 486 | "source": [ 487 | "print(fruits_list_2[0:4])" 488 | ], 489 | "metadata": { 490 | "colab": { 491 | "base_uri": "https://localhost:8080/" 492 | }, 493 | "id": "td5C6_ivkF7o", 494 | "outputId": "1b1a414f-06cf-4bc7-8435-aa8a98dc8f0b" 495 | }, 496 | "execution_count": 16, 497 | "outputs": [ 498 | { 499 | "output_type": "stream", 500 | "name": "stdout", 501 | "text": [ 502 | "['Apple', 'Banana', 'Grapes', [23, 34, 56, 'Ahmed']]\n" 503 | ] 504 | } 505 | ] 506 | }, 507 | { 508 | "cell_type": "code", 509 | "source": [ 510 | "print(fruits_list_2[3][1:3])" 511 | ], 512 | "metadata": { 513 | "colab": { 514 | "base_uri": "https://localhost:8080/" 515 | }, 516 | "id": "Xtwsbvn7kQxG", 517 | "outputId": "c3885ae9-cfa0-457a-dc5a-3f011b228bb0" 518 | }, 519 | "execution_count": 17, 520 | "outputs": [ 521 | { 522 | "output_type": "stream", 523 | "name": "stdout", 524 | "text": [ 525 | "[34, 56]\n" 526 | ] 527 | } 528 | ] 529 | }, 530 | { 531 | "cell_type": "code", 532 | "source": [ 533 | "print(fruits_list_2)\n", 534 | "print(fruits_list_2[3][::1])" 535 | ], 536 | "metadata": { 537 | "colab": { 538 | "base_uri": "https://localhost:8080/" 539 | }, 540 | "id": "VrmRq_4tktjK", 541 | "outputId": "6c5e3834-98e1-42c2-9599-ea1010b97048" 542 | }, 543 | "execution_count": 38, 544 | "outputs": [ 545 | { 546 | "output_type": "stream", 547 | "name": "stdout", 548 | "text": [ 549 | "['Apple', 'Banana', 'Grapes', [23, 34, 56, 'Ahmed']]\n", 550 | "[23, 34, 56, 'Ahmed']\n" 551 | ] 552 | } 553 | ] 554 | }, 555 | { 556 | "cell_type": "code", 557 | "source": [], 558 | "metadata": { 559 | "id": "MLsYpLBxmF9b" 560 | }, 561 | "execution_count": 18, 562 | "outputs": [] 563 | } 564 | ] 565 | } -------------------------------------------------------------------------------- /Code/Class1/Week1_Day1.md: -------------------------------------------------------------------------------- 1 | # Let's Start Python 2 | # Chapter No # 1 Introduction to Python Language: 3 | 4 | 1. What is Python 5 | 2. Uses of Python Programming Language / Python Applications 6 | 3. Python for Software development 7 | 4. Python for Networking 8 | 5. Python for Automated Testing 9 | 6. Features of Python Programming Language 10 | 7. Implementations of Python & its career opportunities 11 | 12 | ## `1. What is Python?` 13 | 14 | 1991 marked the birth of many amazing inventions, events, accomplishments, etc. One of the most important computer programming languages – Python – was built by Guido van Rossum in the very same year. 15 | 16 | Many developers will think the programming language’s name was dubbed after the longest reptile in the world but actually, the word “Python” came from a British comedy series called “Monty Python’s Flying Circus”. 17 | 18 | ## `What is Python used for? ` 19 | 20 | Since it has so many advantages in comparison with other programming languages, Python programming is practiced in various big and small tech companies such as: 21 | 22 | * Google, to operate the search engine and the video-sharing website YouTube. In fact, the founders of Google stated: “Python where we can, C++ where we must”. 23 | * Mozilla, they have written more than 230,000 lines of code in Python. 24 | * Microsoft, this company uses Python to develop its IDE and Visual Studio Code. 25 | * Netflix, Python is applied in every product and experiment from data science to its regional failover monitoring software. 26 | * Reddit, the 4th most used social networking site, uses Python to develop the entire website. 27 | 28 | Comes to the world as a superhero that can resolve mostly everything regarding technology, the uses of Python just are not just a few listed above, instead, this versatile programming language also enables developers to: 29 | 30 | * program CGI for web apps. 31 | * work on data science. 32 | * build RSS readers. 33 | * read from and write to MySQL, PostgreSQL. 34 | * develop various AI projects. 35 | * program software and applications like Blender, Calibre, etc. 36 | * read and modify files. 37 | 38 | So, in short, you can use Python for mostly every idea that comes to your mind. 39 | 40 | ## `2. | 3. Uses of Python Programming Language / Python Applications?` 41 | 42 | Python's versatility enables it to be used in a wide range of applications across various industries. Let's take a look at some of the ways Python is used. 43 | 44 | `Data scientists and analysts:` 45 | Data science is one of the most popular uses for Python. Data scientists use programming languages like Python and R to manipulate data for reporting, predictive analysis, and more. Python's simple syntax and extensive selection of third-party libraries make it a great choice for anyone considering a career in data science. 46 | 47 | `Machine learning:` 48 | Machine learning involves training systems to learn independently by using algorithms that constantly update themselves based on input data. These systems gradually learn to handle new situations by generating an output based on past datasets. Then, based on the outcome of this new situation, they update themselves to deal with new variables, thus constantly evolving. 49 | 50 | `Web development:` 51 | Python is also widely used for back-end development, where it runs in the server of web applications and interacts with databases and APIs after a user requests data from the app's front-end in the browser. 52 | Much of Python's popularity in web development stems from frameworks and libraries like Django and Flask that extend the language's utility. 53 | 54 | `Scripting and utility software:` 55 | Many of the tools and software built into Linux operating systems are written in Python. Python started as a language for writing utility scripts, and it's still widely used for this purpose. 56 | 57 | ## `4. Python for Networking` 58 | 59 | Python provides two levels of access to network programming. These are – 60 | 61 | `Low-Level Access:` 62 | At the low level, you can access the basic socket support of the operating system. You can implement client and server for both connection-oriented and connectionless protocols. 63 | 64 | `High-Level Access:` At the high level allows to implement protocols like HTTP, FTP, etc. 65 | 66 | ## `5. Python for Automated Testing` 67 | 68 | Python already comes with a set of tools and libraries to help you create automated tests for your application. Automated testing is the execution of your test plan (the parts of your application you want to test, the order in which you want them to be tested, and the expected responses) by a script instead of a human. 69 | 70 | ## `6. Features of Python Programming Language` 71 | 72 | There are many features in Python, some of which are discussed below as follows: 73 | 74 | `1. Easy to code:` Python is a high-level programming language. Python is very easy to learn the language as compared to other languages like C, C#, Javascript, Java, etc. It is very easy to code in python language and anybody can learn python basics in a few hours or days. It is also a developer-friendly language. 75 | 76 | `2. Free and Open Source: `Python language is freely available at the official website and you can download it from the given download link below click on the Download Python keyword. Download Python Since it is open-source, this means that source code is also available to the public. So you can download it as, use it as well as share it. 77 | 78 | `3. Object-Oriented Language:` One of the key features of python is Object-Oriented programming. Python supports object-oriented language and concepts of classes, objects encapsulation, etc. 79 | 80 | `4. GUI Programming Support:` Graphical User interfaces can be made using a module such as PyQt5, PyQt4, wxPython, or Tk in python. PyQt5 is the most popular option for creating graphical apps with Python. 81 | 82 | `5. High-Level Language:` Python is a high-level language. When we write programs in python, we do not need to remember the system architecture, nor do we need to manage the memory. 83 | 84 | `6. Extensible feature:` Python is a Extensible language. We can write some Python code into C or C++ language and also we can compile that code in C/C++ language. 85 | 86 | `7. Python is Portable language:` Python language is also a portable language. For example, if we have python code for windows and if we want to run this code on other platforms such as Linux, Unix, and Mac then we do not need to change it, we can run this code on any platform. 87 | 88 | `8. Python is Integrated language:` Python is also an Integrated language because we can easily integrated python with other languages like c, c++, etc. 89 | 90 | `9. Interpreted Language:` Python is an Interpreted Language because Python code is executed line by line at a time. like other languages C, C++, Java, etc. there is no need to compile python code this makes it easier to debug our code. The source code of python is converted into an immediate form called bytecode. 91 | 92 | `10. Large Standard Library:` Python has a large standard library that provides a rich set of modules and functions so you do not have to write your own code for every single thing. There are many libraries present in python for such as regular expressions, unit-testing, web browsers, etc. 93 | 94 | `11. Dynamically Typed Language:` Python is a dynamically-typed language. That means the type (for example- int, double, long, etc.) for a variable is decided at run time not in advance because of this feature we don’t need to specify the type of variable. 95 | 96 | `12. Frontend and backend development:` With a new project pyscript you can run and write python codes in html with the help of some simple tags etc. This will help you do frontend development work in python like javascript. Backend is the strong forte of python it’s extensively used for this work cause of its framework like django and flask. 97 | 98 | ## `7. Implementations of Python & its career opportunities` 99 | 100 | There's a high demand for Python developers in world wide but the supply is really, really low. This is what makes it a great opportunity for Pakistanis to get skilled in python. One of Pakistan's software companies faced a dilemma after winning a $200 million (Rs. 1200 crore) contract with a large US bank. Instead, they hired a group of freelance Python programmers in the US instead. 101 | 102 |
103 | 104 | # Chapter No 3 Downloading & Installation 105 | 106 | 1. Download Python IDLE & Installation Python IDE 107 | 2. Download PyCharm IDE & Installation PyCharm IDE 108 | 3. Download Annaconda Navigator & also Installation 109 | 110 | ## `1. Download Python IDLE & Installation Python IDE:` 111 | 112 | `Step 1):` 113 | To download and install Python, visit the official website of python https://www.python.org/downloads/ and choose your version. We have chosen Python version 3.10.0 114 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/3f5747de-ac28-4a0c-b319-68d2393def73) 115 | 116 | `Step 2):` 117 | Once the download is completed, run the .exe file to install Python. Now click on Install Now. 118 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/fb315fa8-6ddb-4050-9337-2cf262703760) 119 | 120 | `Step 3):` 121 | You can see Python installing at this point. 122 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/e01a0cae-c871-4bbb-a452-d28d77ac93bd) 123 | 124 | `Step 4):` 125 | When it finishes, you can see a screen that says the Setup was successful. Now click on “Close”. 126 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/8b8b57c6-4084-4307-9ea3-948f26e343c5) 127 | 128 | *************************************** 129 | 130 | 131 | ## `2. Download PyCharm IDE & Installation PyCharm IDE` 132 | 133 | Here is a step by step process on how to download and install Pycharm IDE on Windows: 134 | `Step 1):` 135 | To download PyCharm visit the website https://www.jetbrains.com/pycharm/download/ and Click the 136 | “DOWNLOAD” link under the Community Section. 137 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/90843a06-5df2-412e-86be-11d5971d2aa3) 138 | 139 | `Step 2):` 140 | Once the download is complete, run the exe for install PyCharm. The setup wizard should have started.Click “Next”. 141 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/44a5ddce-e110-4e50-9e2e-27de09309342) 142 | 143 | `Step 3):` 144 | On the next screen, Change the installation path if required. Click “Next”. 145 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/d8d8fd45-59c8-48b5-b271-f2d040cf49fb) 146 | 147 | `Step 4):` 148 | On the next screen, you can create a desktop shortcut if you want and click on “Next”. 149 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/355289e1-341d-4133-b440-6a2d0659e7b3) 150 | 151 | `Step 5):` 152 | Choose the start menu folder. Keep selected JetBrains and click on “Install”. 153 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/55d6fc6a-ec98-4ed8-912c-2d30a09de76e) 154 | 155 | `Step 6):` 156 | Wait for the installation to finish. 157 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/0a76a2bc-c40d-4b93-9170-90a1084e6e28) 158 | 159 | `Step 7):` 160 | Once installation finished, you should receive a message screen that PyCharm is installed. If you want to go ahead and run it, click the “Run PyCharm Community Edition” box first and click “Finish”. 161 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/2b5f6940-2cae-42fb-91e1-d2f50ab360b7) 162 | 163 | `Step 8):` 164 | After you click on “Finish,” the Following screen will appear. 165 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/37b9d04b-09cf-4672-b151-416a4d66ee8a) 166 | 167 | *************************************** 168 | 169 | ## `3. Download Annaconda Navigator & also Installation ` 170 | 171 | Anaconda Download & Installation Steps Please open this link: https://www.anaconda.com/products/individual Or https://www.anaconda.com/products/individual#Downloads 172 | 173 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/23f6ba06-4a07-4420-9e41-c93ac51c254e) 174 | Click ‘Download’ 175 | 176 | After Downloading Open Setup 177 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/dc61f6aa-f66d-48d2-a897-73546fd8e179) 178 | 179 | Click ‘I Agree’ 180 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/76fdd8b0-9441-4836-9b73-cfe5428b2d53) 181 | 182 | Select ‘Just Me’ and Click ‘Next’ 183 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/a9005898-6658-4ac8-a7b7-f42cf0b72d76) 184 | 185 | Click ‘Next’ 186 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/7648a920-5542-41d5-872d-75d943d050da) 187 | 188 | Click ‘Install’ 189 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/987090b1-a60f-4100-b5e3-66b7590cfb2a) 190 | 191 | Installation is in Progress (Might take time) 192 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/d14bfa19-8ad2-440d-a80a-c8ad3b925200) 193 | 194 | Click ‘Next’ 195 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/65f75da3-bd89-44a4-be0d-1257e8ae03c2) 196 | 197 | Click ‘Next’ 198 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/49628abc-b107-4bfb-ba7b-5b503a3e49a0) 199 | 200 | Click ‘Finish’ 201 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/483dfbdc-8571-4c9c-ab13-347ba037872f) 202 | 203 | Click "window" button and search for ‘Jupyter Notebook (Anaconda 3)’ and click ‘Open’ 204 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/d76a0fbf-71c4-462f-adcd-673b6a0b5195) 205 | 206 | It will open a prompt like below and launch the default web browser 207 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/929216e1-2433-47ec-bed8-6209fca9051c) 208 | 209 | It will open in the default web browser like below: 210 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/3be0d5e8-a233-414c-9cc5-6f4831edbc50) 211 | 212 | goto "Desktop" 213 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/7cb326d9-b99b-44f9-8ebd-019502accec2) 214 | 215 | click there & create folder 216 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/e551f08e-ea18-4531-b4a2-cf683a81f3f2) 217 | 218 | You can see untitle project just select and rename it 219 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/8c343eeb-c8d3-47f6-8723-bab569366037) 220 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/6d49dc25-e4ad-4be3-9205-35ee2a9cda61) 221 | 222 | 223 | Here you can see the directory of your computer which you rename it, goto folders. 224 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/4bedcff7-8bb3-4af3-b8a3-a061d6debfda) 225 | 226 | Interface of jupyter python file 227 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/a1cfb5e9-04eb-4d00-9c98-a5969013a52d) 228 | 229 | The Jupyter Notebook Toolbar 230 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/11beb8ed-ec2f-40b0-849c-89659e135ffb) 231 | 232 | File: It will show list of options like ‘Save’ , ‘Save as’, ‘New’, ‘Make a copy’, ‘Download as’ etc. 233 | Download as option will show options to download the current notebook as HTML version by default. For other options, you can look up to Jupyter Notebook documentation 234 | Edit: It will show ‘Cut’, ‘Copy’ ,’Paste’, ‘Delete’, ‘Move Up’, ‘Move Down’ etc. for Cells. 235 | Cells here refer to the fields where the code is written. 236 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/cb617165-c698-4def-ae1b-2f930ded6fbe) 237 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/ba5c2f63-9482-47c8-9b53-b3ecf8f79e48) 238 | Cell: It will show ‘Run Cell’, ‘Run All’, etc. options. 239 | Kernel: When your notebook hangs or is in an endless loop (while loop)- you can click on Kernel and ‘Interrupt’, ‘Restart’ the Python Kernel. 240 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/bcc2e355-0909-453b-a8c5-353ac7beb8f7) 241 | ![image](https://github.com/MuhammadRaheelNaseem/Learn-Python-By-Sir-Raheel/assets/63813881/55b3da86-88b1-443c-8d0d-a16a86d3be75) 242 | 243 | 244 |

SummaryHow to set up Visual Studio Code for Python.

A quick introduction to the Visual Studio Code

Visual Studio Code is a lightweight source code editor. The Visual Studio Code is often called VS Code. The VS Code runs on your desktop. It’s available for Windows, macOS, and Linux.

VS Code comes with many features such as IntelliSense, code editing, and extensions that allow you to edit Python source code effectively. The best part is that the VS Code is open-source and free.

Besides the desktop version, VS Code also has a browser version that you can use directly in your web browser without installing it.

This tutorial teaches you how to set up Visual Studio Code for a Python environment so that you can edit, run, and debug Python code.

Setting up Visual Studio Code

To set up the VS Code, you follow these steps:

First, navigate to the VS Code official website and download the VS code based on your platform (Windows, macOS, or Linux).

Second, launch the setup wizard and follow the steps.

Once the installation completes, you can launch the VS code application:

Install Python Extension

To make the VS Code works with Python, you need to install the Python extension from the Visual Studio Marketplace.

The following picture illustrates the steps:

  • First, click the Extensions tab.
  • Second, type the python keyword on the search input.
  • Third, click the Python extension. It’ll show detailed information on the right pane.
  • Finally, click the Install button to install the Python extension.

Now, you’re ready to develop the first program in Python.

245 | -------------------------------------------------------------------------------- /Code/class13/diabetes.csv: -------------------------------------------------------------------------------- 1 | Pregnancies,Glucose,BloodPressure,SkinThickness,Insulin,BMI,DiabetesPedigreeFunction,Age,Outcome 2 | 6,148,72,35,0,33.6,0.627,50,1 3 | 1,85,66,29,0,26.6,0.351,31,0 4 | 8,183,64,0,0,23.3,0.672,32,1 5 | 1,89,66,23,94,28.1,0.167,21,0 6 | 0,137,40,35,168,43.1,2.288,33,1 7 | 5,116,74,0,0,25.6,0.201,30,0 8 | 3,78,50,32,88,31,0.248,26,1 9 | 10,115,0,0,0,35.3,0.134,29,0 10 | 2,197,70,45,543,30.5,0.158,53,1 11 | 8,125,96,0,0,0,0.232,54,1 12 | 4,110,92,0,0,37.6,0.191,30,0 13 | 10,168,74,0,0,38,0.537,34,1 14 | 10,139,80,0,0,27.1,1.441,57,0 15 | 1,189,60,23,846,30.1,0.398,59,1 16 | 5,166,72,19,175,25.8,0.587,51,1 17 | 7,100,0,0,0,30,0.484,32,1 18 | 0,118,84,47,230,45.8,0.551,31,1 19 | 7,107,74,0,0,29.6,0.254,31,1 20 | 1,103,30,38,83,43.3,0.183,33,0 21 | 1,115,70,30,96,34.6,0.529,32,1 22 | 3,126,88,41,235,39.3,0.704,27,0 23 | 8,99,84,0,0,35.4,0.388,50,0 24 | 7,196,90,0,0,39.8,0.451,41,1 25 | 9,119,80,35,0,29,0.263,29,1 26 | 11,143,94,33,146,36.6,0.254,51,1 27 | 10,125,70,26,115,31.1,0.205,41,1 28 | 7,147,76,0,0,39.4,0.257,43,1 29 | 1,97,66,15,140,23.2,0.487,22,0 30 | 13,145,82,19,110,22.2,0.245,57,0 31 | 5,117,92,0,0,34.1,0.337,38,0 32 | 5,109,75,26,0,36,0.546,60,0 33 | 3,158,76,36,245,31.6,0.851,28,1 34 | 3,88,58,11,54,24.8,0.267,22,0 35 | 6,92,92,0,0,19.9,0.188,28,0 36 | 10,122,78,31,0,27.6,0.512,45,0 37 | 4,103,60,33,192,24,0.966,33,0 38 | 11,138,76,0,0,33.2,0.42,35,0 39 | 9,102,76,37,0,32.9,0.665,46,1 40 | 2,90,68,42,0,38.2,0.503,27,1 41 | 4,111,72,47,207,37.1,1.39,56,1 42 | 3,180,64,25,70,34,0.271,26,0 43 | 7,133,84,0,0,40.2,0.696,37,0 44 | 7,106,92,18,0,22.7,0.235,48,0 45 | 9,171,110,24,240,45.4,0.721,54,1 46 | 7,159,64,0,0,27.4,0.294,40,0 47 | 0,180,66,39,0,42,1.893,25,1 48 | 1,146,56,0,0,29.7,0.564,29,0 49 | 2,71,70,27,0,28,0.586,22,0 50 | 7,103,66,32,0,39.1,0.344,31,1 51 | 7,105,0,0,0,0,0.305,24,0 52 | 1,103,80,11,82,19.4,0.491,22,0 53 | 1,101,50,15,36,24.2,0.526,26,0 54 | 5,88,66,21,23,24.4,0.342,30,0 55 | 8,176,90,34,300,33.7,0.467,58,1 56 | 7,150,66,42,342,34.7,0.718,42,0 57 | 1,73,50,10,0,23,0.248,21,0 58 | 7,187,68,39,304,37.7,0.254,41,1 59 | 0,100,88,60,110,46.8,0.962,31,0 60 | 0,146,82,0,0,40.5,1.781,44,0 61 | 0,105,64,41,142,41.5,0.173,22,0 62 | 2,84,0,0,0,0,0.304,21,0 63 | 8,133,72,0,0,32.9,0.27,39,1 64 | 5,44,62,0,0,25,0.587,36,0 65 | 2,141,58,34,128,25.4,0.699,24,0 66 | 7,114,66,0,0,32.8,0.258,42,1 67 | 5,99,74,27,0,29,0.203,32,0 68 | 0,109,88,30,0,32.5,0.855,38,1 69 | 2,109,92,0,0,42.7,0.845,54,0 70 | 1,95,66,13,38,19.6,0.334,25,0 71 | 4,146,85,27,100,28.9,0.189,27,0 72 | 2,100,66,20,90,32.9,0.867,28,1 73 | 5,139,64,35,140,28.6,0.411,26,0 74 | 13,126,90,0,0,43.4,0.583,42,1 75 | 4,129,86,20,270,35.1,0.231,23,0 76 | 1,79,75,30,0,32,0.396,22,0 77 | 1,0,48,20,0,24.7,0.14,22,0 78 | 7,62,78,0,0,32.6,0.391,41,0 79 | 5,95,72,33,0,37.7,0.37,27,0 80 | 0,131,0,0,0,43.2,0.27,26,1 81 | 2,112,66,22,0,25,0.307,24,0 82 | 3,113,44,13,0,22.4,0.14,22,0 83 | 2,74,0,0,0,0,0.102,22,0 84 | 7,83,78,26,71,29.3,0.767,36,0 85 | 0,101,65,28,0,24.6,0.237,22,0 86 | 5,137,108,0,0,48.8,0.227,37,1 87 | 2,110,74,29,125,32.4,0.698,27,0 88 | 13,106,72,54,0,36.6,0.178,45,0 89 | 2,100,68,25,71,38.5,0.324,26,0 90 | 15,136,70,32,110,37.1,0.153,43,1 91 | 1,107,68,19,0,26.5,0.165,24,0 92 | 1,80,55,0,0,19.1,0.258,21,0 93 | 4,123,80,15,176,32,0.443,34,0 94 | 7,81,78,40,48,46.7,0.261,42,0 95 | 4,134,72,0,0,23.8,0.277,60,1 96 | 2,142,82,18,64,24.7,0.761,21,0 97 | 6,144,72,27,228,33.9,0.255,40,0 98 | 2,92,62,28,0,31.6,0.13,24,0 99 | 1,71,48,18,76,20.4,0.323,22,0 100 | 6,93,50,30,64,28.7,0.356,23,0 101 | 1,122,90,51,220,49.7,0.325,31,1 102 | 1,163,72,0,0,39,1.222,33,1 103 | 1,151,60,0,0,26.1,0.179,22,0 104 | 0,125,96,0,0,22.5,0.262,21,0 105 | 1,81,72,18,40,26.6,0.283,24,0 106 | 2,85,65,0,0,39.6,0.93,27,0 107 | 1,126,56,29,152,28.7,0.801,21,0 108 | 1,96,122,0,0,22.4,0.207,27,0 109 | 4,144,58,28,140,29.5,0.287,37,0 110 | 3,83,58,31,18,34.3,0.336,25,0 111 | 0,95,85,25,36,37.4,0.247,24,1 112 | 3,171,72,33,135,33.3,0.199,24,1 113 | 8,155,62,26,495,34,0.543,46,1 114 | 1,89,76,34,37,31.2,0.192,23,0 115 | 4,76,62,0,0,34,0.391,25,0 116 | 7,160,54,32,175,30.5,0.588,39,1 117 | 4,146,92,0,0,31.2,0.539,61,1 118 | 5,124,74,0,0,34,0.22,38,1 119 | 5,78,48,0,0,33.7,0.654,25,0 120 | 4,97,60,23,0,28.2,0.443,22,0 121 | 4,99,76,15,51,23.2,0.223,21,0 122 | 0,162,76,56,100,53.2,0.759,25,1 123 | 6,111,64,39,0,34.2,0.26,24,0 124 | 2,107,74,30,100,33.6,0.404,23,0 125 | 5,132,80,0,0,26.8,0.186,69,0 126 | 0,113,76,0,0,33.3,0.278,23,1 127 | 1,88,30,42,99,55,0.496,26,1 128 | 3,120,70,30,135,42.9,0.452,30,0 129 | 1,118,58,36,94,33.3,0.261,23,0 130 | 1,117,88,24,145,34.5,0.403,40,1 131 | 0,105,84,0,0,27.9,0.741,62,1 132 | 4,173,70,14,168,29.7,0.361,33,1 133 | 9,122,56,0,0,33.3,1.114,33,1 134 | 3,170,64,37,225,34.5,0.356,30,1 135 | 8,84,74,31,0,38.3,0.457,39,0 136 | 2,96,68,13,49,21.1,0.647,26,0 137 | 2,125,60,20,140,33.8,0.088,31,0 138 | 0,100,70,26,50,30.8,0.597,21,0 139 | 0,93,60,25,92,28.7,0.532,22,0 140 | 0,129,80,0,0,31.2,0.703,29,0 141 | 5,105,72,29,325,36.9,0.159,28,0 142 | 3,128,78,0,0,21.1,0.268,55,0 143 | 5,106,82,30,0,39.5,0.286,38,0 144 | 2,108,52,26,63,32.5,0.318,22,0 145 | 10,108,66,0,0,32.4,0.272,42,1 146 | 4,154,62,31,284,32.8,0.237,23,0 147 | 0,102,75,23,0,0,0.572,21,0 148 | 9,57,80,37,0,32.8,0.096,41,0 149 | 2,106,64,35,119,30.5,1.4,34,0 150 | 5,147,78,0,0,33.7,0.218,65,0 151 | 2,90,70,17,0,27.3,0.085,22,0 152 | 1,136,74,50,204,37.4,0.399,24,0 153 | 4,114,65,0,0,21.9,0.432,37,0 154 | 9,156,86,28,155,34.3,1.189,42,1 155 | 1,153,82,42,485,40.6,0.687,23,0 156 | 8,188,78,0,0,47.9,0.137,43,1 157 | 7,152,88,44,0,50,0.337,36,1 158 | 2,99,52,15,94,24.6,0.637,21,0 159 | 1,109,56,21,135,25.2,0.833,23,0 160 | 2,88,74,19,53,29,0.229,22,0 161 | 17,163,72,41,114,40.9,0.817,47,1 162 | 4,151,90,38,0,29.7,0.294,36,0 163 | 7,102,74,40,105,37.2,0.204,45,0 164 | 0,114,80,34,285,44.2,0.167,27,0 165 | 2,100,64,23,0,29.7,0.368,21,0 166 | 0,131,88,0,0,31.6,0.743,32,1 167 | 6,104,74,18,156,29.9,0.722,41,1 168 | 3,148,66,25,0,32.5,0.256,22,0 169 | 4,120,68,0,0,29.6,0.709,34,0 170 | 4,110,66,0,0,31.9,0.471,29,0 171 | 3,111,90,12,78,28.4,0.495,29,0 172 | 6,102,82,0,0,30.8,0.18,36,1 173 | 6,134,70,23,130,35.4,0.542,29,1 174 | 2,87,0,23,0,28.9,0.773,25,0 175 | 1,79,60,42,48,43.5,0.678,23,0 176 | 2,75,64,24,55,29.7,0.37,33,0 177 | 8,179,72,42,130,32.7,0.719,36,1 178 | 6,85,78,0,0,31.2,0.382,42,0 179 | 0,129,110,46,130,67.1,0.319,26,1 180 | 5,143,78,0,0,45,0.19,47,0 181 | 5,130,82,0,0,39.1,0.956,37,1 182 | 6,87,80,0,0,23.2,0.084,32,0 183 | 0,119,64,18,92,34.9,0.725,23,0 184 | 1,0,74,20,23,27.7,0.299,21,0 185 | 5,73,60,0,0,26.8,0.268,27,0 186 | 4,141,74,0,0,27.6,0.244,40,0 187 | 7,194,68,28,0,35.9,0.745,41,1 188 | 8,181,68,36,495,30.1,0.615,60,1 189 | 1,128,98,41,58,32,1.321,33,1 190 | 8,109,76,39,114,27.9,0.64,31,1 191 | 5,139,80,35,160,31.6,0.361,25,1 192 | 3,111,62,0,0,22.6,0.142,21,0 193 | 9,123,70,44,94,33.1,0.374,40,0 194 | 7,159,66,0,0,30.4,0.383,36,1 195 | 11,135,0,0,0,52.3,0.578,40,1 196 | 8,85,55,20,0,24.4,0.136,42,0 197 | 5,158,84,41,210,39.4,0.395,29,1 198 | 1,105,58,0,0,24.3,0.187,21,0 199 | 3,107,62,13,48,22.9,0.678,23,1 200 | 4,109,64,44,99,34.8,0.905,26,1 201 | 4,148,60,27,318,30.9,0.15,29,1 202 | 0,113,80,16,0,31,0.874,21,0 203 | 1,138,82,0,0,40.1,0.236,28,0 204 | 0,108,68,20,0,27.3,0.787,32,0 205 | 2,99,70,16,44,20.4,0.235,27,0 206 | 6,103,72,32,190,37.7,0.324,55,0 207 | 5,111,72,28,0,23.9,0.407,27,0 208 | 8,196,76,29,280,37.5,0.605,57,1 209 | 5,162,104,0,0,37.7,0.151,52,1 210 | 1,96,64,27,87,33.2,0.289,21,0 211 | 7,184,84,33,0,35.5,0.355,41,1 212 | 2,81,60,22,0,27.7,0.29,25,0 213 | 0,147,85,54,0,42.8,0.375,24,0 214 | 7,179,95,31,0,34.2,0.164,60,0 215 | 0,140,65,26,130,42.6,0.431,24,1 216 | 9,112,82,32,175,34.2,0.26,36,1 217 | 12,151,70,40,271,41.8,0.742,38,1 218 | 5,109,62,41,129,35.8,0.514,25,1 219 | 6,125,68,30,120,30,0.464,32,0 220 | 5,85,74,22,0,29,1.224,32,1 221 | 5,112,66,0,0,37.8,0.261,41,1 222 | 0,177,60,29,478,34.6,1.072,21,1 223 | 2,158,90,0,0,31.6,0.805,66,1 224 | 7,119,0,0,0,25.2,0.209,37,0 225 | 7,142,60,33,190,28.8,0.687,61,0 226 | 1,100,66,15,56,23.6,0.666,26,0 227 | 1,87,78,27,32,34.6,0.101,22,0 228 | 0,101,76,0,0,35.7,0.198,26,0 229 | 3,162,52,38,0,37.2,0.652,24,1 230 | 4,197,70,39,744,36.7,2.329,31,0 231 | 0,117,80,31,53,45.2,0.089,24,0 232 | 4,142,86,0,0,44,0.645,22,1 233 | 6,134,80,37,370,46.2,0.238,46,1 234 | 1,79,80,25,37,25.4,0.583,22,0 235 | 4,122,68,0,0,35,0.394,29,0 236 | 3,74,68,28,45,29.7,0.293,23,0 237 | 4,171,72,0,0,43.6,0.479,26,1 238 | 7,181,84,21,192,35.9,0.586,51,1 239 | 0,179,90,27,0,44.1,0.686,23,1 240 | 9,164,84,21,0,30.8,0.831,32,1 241 | 0,104,76,0,0,18.4,0.582,27,0 242 | 1,91,64,24,0,29.2,0.192,21,0 243 | 4,91,70,32,88,33.1,0.446,22,0 244 | 3,139,54,0,0,25.6,0.402,22,1 245 | 6,119,50,22,176,27.1,1.318,33,1 246 | 2,146,76,35,194,38.2,0.329,29,0 247 | 9,184,85,15,0,30,1.213,49,1 248 | 10,122,68,0,0,31.2,0.258,41,0 249 | 0,165,90,33,680,52.3,0.427,23,0 250 | 9,124,70,33,402,35.4,0.282,34,0 251 | 1,111,86,19,0,30.1,0.143,23,0 252 | 9,106,52,0,0,31.2,0.38,42,0 253 | 2,129,84,0,0,28,0.284,27,0 254 | 2,90,80,14,55,24.4,0.249,24,0 255 | 0,86,68,32,0,35.8,0.238,25,0 256 | 12,92,62,7,258,27.6,0.926,44,1 257 | 1,113,64,35,0,33.6,0.543,21,1 258 | 3,111,56,39,0,30.1,0.557,30,0 259 | 2,114,68,22,0,28.7,0.092,25,0 260 | 1,193,50,16,375,25.9,0.655,24,0 261 | 11,155,76,28,150,33.3,1.353,51,1 262 | 3,191,68,15,130,30.9,0.299,34,0 263 | 3,141,0,0,0,30,0.761,27,1 264 | 4,95,70,32,0,32.1,0.612,24,0 265 | 3,142,80,15,0,32.4,0.2,63,0 266 | 4,123,62,0,0,32,0.226,35,1 267 | 5,96,74,18,67,33.6,0.997,43,0 268 | 0,138,0,0,0,36.3,0.933,25,1 269 | 2,128,64,42,0,40,1.101,24,0 270 | 0,102,52,0,0,25.1,0.078,21,0 271 | 2,146,0,0,0,27.5,0.24,28,1 272 | 10,101,86,37,0,45.6,1.136,38,1 273 | 2,108,62,32,56,25.2,0.128,21,0 274 | 3,122,78,0,0,23,0.254,40,0 275 | 1,71,78,50,45,33.2,0.422,21,0 276 | 13,106,70,0,0,34.2,0.251,52,0 277 | 2,100,70,52,57,40.5,0.677,25,0 278 | 7,106,60,24,0,26.5,0.296,29,1 279 | 0,104,64,23,116,27.8,0.454,23,0 280 | 5,114,74,0,0,24.9,0.744,57,0 281 | 2,108,62,10,278,25.3,0.881,22,0 282 | 0,146,70,0,0,37.9,0.334,28,1 283 | 10,129,76,28,122,35.9,0.28,39,0 284 | 7,133,88,15,155,32.4,0.262,37,0 285 | 7,161,86,0,0,30.4,0.165,47,1 286 | 2,108,80,0,0,27,0.259,52,1 287 | 7,136,74,26,135,26,0.647,51,0 288 | 5,155,84,44,545,38.7,0.619,34,0 289 | 1,119,86,39,220,45.6,0.808,29,1 290 | 4,96,56,17,49,20.8,0.34,26,0 291 | 5,108,72,43,75,36.1,0.263,33,0 292 | 0,78,88,29,40,36.9,0.434,21,0 293 | 0,107,62,30,74,36.6,0.757,25,1 294 | 2,128,78,37,182,43.3,1.224,31,1 295 | 1,128,48,45,194,40.5,0.613,24,1 296 | 0,161,50,0,0,21.9,0.254,65,0 297 | 6,151,62,31,120,35.5,0.692,28,0 298 | 2,146,70,38,360,28,0.337,29,1 299 | 0,126,84,29,215,30.7,0.52,24,0 300 | 14,100,78,25,184,36.6,0.412,46,1 301 | 8,112,72,0,0,23.6,0.84,58,0 302 | 0,167,0,0,0,32.3,0.839,30,1 303 | 2,144,58,33,135,31.6,0.422,25,1 304 | 5,77,82,41,42,35.8,0.156,35,0 305 | 5,115,98,0,0,52.9,0.209,28,1 306 | 3,150,76,0,0,21,0.207,37,0 307 | 2,120,76,37,105,39.7,0.215,29,0 308 | 10,161,68,23,132,25.5,0.326,47,1 309 | 0,137,68,14,148,24.8,0.143,21,0 310 | 0,128,68,19,180,30.5,1.391,25,1 311 | 2,124,68,28,205,32.9,0.875,30,1 312 | 6,80,66,30,0,26.2,0.313,41,0 313 | 0,106,70,37,148,39.4,0.605,22,0 314 | 2,155,74,17,96,26.6,0.433,27,1 315 | 3,113,50,10,85,29.5,0.626,25,0 316 | 7,109,80,31,0,35.9,1.127,43,1 317 | 2,112,68,22,94,34.1,0.315,26,0 318 | 3,99,80,11,64,19.3,0.284,30,0 319 | 3,182,74,0,0,30.5,0.345,29,1 320 | 3,115,66,39,140,38.1,0.15,28,0 321 | 6,194,78,0,0,23.5,0.129,59,1 322 | 4,129,60,12,231,27.5,0.527,31,0 323 | 3,112,74,30,0,31.6,0.197,25,1 324 | 0,124,70,20,0,27.4,0.254,36,1 325 | 13,152,90,33,29,26.8,0.731,43,1 326 | 2,112,75,32,0,35.7,0.148,21,0 327 | 1,157,72,21,168,25.6,0.123,24,0 328 | 1,122,64,32,156,35.1,0.692,30,1 329 | 10,179,70,0,0,35.1,0.2,37,0 330 | 2,102,86,36,120,45.5,0.127,23,1 331 | 6,105,70,32,68,30.8,0.122,37,0 332 | 8,118,72,19,0,23.1,1.476,46,0 333 | 2,87,58,16,52,32.7,0.166,25,0 334 | 1,180,0,0,0,43.3,0.282,41,1 335 | 12,106,80,0,0,23.6,0.137,44,0 336 | 1,95,60,18,58,23.9,0.26,22,0 337 | 0,165,76,43,255,47.9,0.259,26,0 338 | 0,117,0,0,0,33.8,0.932,44,0 339 | 5,115,76,0,0,31.2,0.343,44,1 340 | 9,152,78,34,171,34.2,0.893,33,1 341 | 7,178,84,0,0,39.9,0.331,41,1 342 | 1,130,70,13,105,25.9,0.472,22,0 343 | 1,95,74,21,73,25.9,0.673,36,0 344 | 1,0,68,35,0,32,0.389,22,0 345 | 5,122,86,0,0,34.7,0.29,33,0 346 | 8,95,72,0,0,36.8,0.485,57,0 347 | 8,126,88,36,108,38.5,0.349,49,0 348 | 1,139,46,19,83,28.7,0.654,22,0 349 | 3,116,0,0,0,23.5,0.187,23,0 350 | 3,99,62,19,74,21.8,0.279,26,0 351 | 5,0,80,32,0,41,0.346,37,1 352 | 4,92,80,0,0,42.2,0.237,29,0 353 | 4,137,84,0,0,31.2,0.252,30,0 354 | 3,61,82,28,0,34.4,0.243,46,0 355 | 1,90,62,12,43,27.2,0.58,24,0 356 | 3,90,78,0,0,42.7,0.559,21,0 357 | 9,165,88,0,0,30.4,0.302,49,1 358 | 1,125,50,40,167,33.3,0.962,28,1 359 | 13,129,0,30,0,39.9,0.569,44,1 360 | 12,88,74,40,54,35.3,0.378,48,0 361 | 1,196,76,36,249,36.5,0.875,29,1 362 | 5,189,64,33,325,31.2,0.583,29,1 363 | 5,158,70,0,0,29.8,0.207,63,0 364 | 5,103,108,37,0,39.2,0.305,65,0 365 | 4,146,78,0,0,38.5,0.52,67,1 366 | 4,147,74,25,293,34.9,0.385,30,0 367 | 5,99,54,28,83,34,0.499,30,0 368 | 6,124,72,0,0,27.6,0.368,29,1 369 | 0,101,64,17,0,21,0.252,21,0 370 | 3,81,86,16,66,27.5,0.306,22,0 371 | 1,133,102,28,140,32.8,0.234,45,1 372 | 3,173,82,48,465,38.4,2.137,25,1 373 | 0,118,64,23,89,0,1.731,21,0 374 | 0,84,64,22,66,35.8,0.545,21,0 375 | 2,105,58,40,94,34.9,0.225,25,0 376 | 2,122,52,43,158,36.2,0.816,28,0 377 | 12,140,82,43,325,39.2,0.528,58,1 378 | 0,98,82,15,84,25.2,0.299,22,0 379 | 1,87,60,37,75,37.2,0.509,22,0 380 | 4,156,75,0,0,48.3,0.238,32,1 381 | 0,93,100,39,72,43.4,1.021,35,0 382 | 1,107,72,30,82,30.8,0.821,24,0 383 | 0,105,68,22,0,20,0.236,22,0 384 | 1,109,60,8,182,25.4,0.947,21,0 385 | 1,90,62,18,59,25.1,1.268,25,0 386 | 1,125,70,24,110,24.3,0.221,25,0 387 | 1,119,54,13,50,22.3,0.205,24,0 388 | 5,116,74,29,0,32.3,0.66,35,1 389 | 8,105,100,36,0,43.3,0.239,45,1 390 | 5,144,82,26,285,32,0.452,58,1 391 | 3,100,68,23,81,31.6,0.949,28,0 392 | 1,100,66,29,196,32,0.444,42,0 393 | 5,166,76,0,0,45.7,0.34,27,1 394 | 1,131,64,14,415,23.7,0.389,21,0 395 | 4,116,72,12,87,22.1,0.463,37,0 396 | 4,158,78,0,0,32.9,0.803,31,1 397 | 2,127,58,24,275,27.7,1.6,25,0 398 | 3,96,56,34,115,24.7,0.944,39,0 399 | 0,131,66,40,0,34.3,0.196,22,1 400 | 3,82,70,0,0,21.1,0.389,25,0 401 | 3,193,70,31,0,34.9,0.241,25,1 402 | 4,95,64,0,0,32,0.161,31,1 403 | 6,137,61,0,0,24.2,0.151,55,0 404 | 5,136,84,41,88,35,0.286,35,1 405 | 9,72,78,25,0,31.6,0.28,38,0 406 | 5,168,64,0,0,32.9,0.135,41,1 407 | 2,123,48,32,165,42.1,0.52,26,0 408 | 4,115,72,0,0,28.9,0.376,46,1 409 | 0,101,62,0,0,21.9,0.336,25,0 410 | 8,197,74,0,0,25.9,1.191,39,1 411 | 1,172,68,49,579,42.4,0.702,28,1 412 | 6,102,90,39,0,35.7,0.674,28,0 413 | 1,112,72,30,176,34.4,0.528,25,0 414 | 1,143,84,23,310,42.4,1.076,22,0 415 | 1,143,74,22,61,26.2,0.256,21,0 416 | 0,138,60,35,167,34.6,0.534,21,1 417 | 3,173,84,33,474,35.7,0.258,22,1 418 | 1,97,68,21,0,27.2,1.095,22,0 419 | 4,144,82,32,0,38.5,0.554,37,1 420 | 1,83,68,0,0,18.2,0.624,27,0 421 | 3,129,64,29,115,26.4,0.219,28,1 422 | 1,119,88,41,170,45.3,0.507,26,0 423 | 2,94,68,18,76,26,0.561,21,0 424 | 0,102,64,46,78,40.6,0.496,21,0 425 | 2,115,64,22,0,30.8,0.421,21,0 426 | 8,151,78,32,210,42.9,0.516,36,1 427 | 4,184,78,39,277,37,0.264,31,1 428 | 0,94,0,0,0,0,0.256,25,0 429 | 1,181,64,30,180,34.1,0.328,38,1 430 | 0,135,94,46,145,40.6,0.284,26,0 431 | 1,95,82,25,180,35,0.233,43,1 432 | 2,99,0,0,0,22.2,0.108,23,0 433 | 3,89,74,16,85,30.4,0.551,38,0 434 | 1,80,74,11,60,30,0.527,22,0 435 | 2,139,75,0,0,25.6,0.167,29,0 436 | 1,90,68,8,0,24.5,1.138,36,0 437 | 0,141,0,0,0,42.4,0.205,29,1 438 | 12,140,85,33,0,37.4,0.244,41,0 439 | 5,147,75,0,0,29.9,0.434,28,0 440 | 1,97,70,15,0,18.2,0.147,21,0 441 | 6,107,88,0,0,36.8,0.727,31,0 442 | 0,189,104,25,0,34.3,0.435,41,1 443 | 2,83,66,23,50,32.2,0.497,22,0 444 | 4,117,64,27,120,33.2,0.23,24,0 445 | 8,108,70,0,0,30.5,0.955,33,1 446 | 4,117,62,12,0,29.7,0.38,30,1 447 | 0,180,78,63,14,59.4,2.42,25,1 448 | 1,100,72,12,70,25.3,0.658,28,0 449 | 0,95,80,45,92,36.5,0.33,26,0 450 | 0,104,64,37,64,33.6,0.51,22,1 451 | 0,120,74,18,63,30.5,0.285,26,0 452 | 1,82,64,13,95,21.2,0.415,23,0 453 | 2,134,70,0,0,28.9,0.542,23,1 454 | 0,91,68,32,210,39.9,0.381,25,0 455 | 2,119,0,0,0,19.6,0.832,72,0 456 | 2,100,54,28,105,37.8,0.498,24,0 457 | 14,175,62,30,0,33.6,0.212,38,1 458 | 1,135,54,0,0,26.7,0.687,62,0 459 | 5,86,68,28,71,30.2,0.364,24,0 460 | 10,148,84,48,237,37.6,1.001,51,1 461 | 9,134,74,33,60,25.9,0.46,81,0 462 | 9,120,72,22,56,20.8,0.733,48,0 463 | 1,71,62,0,0,21.8,0.416,26,0 464 | 8,74,70,40,49,35.3,0.705,39,0 465 | 5,88,78,30,0,27.6,0.258,37,0 466 | 10,115,98,0,0,24,1.022,34,0 467 | 0,124,56,13,105,21.8,0.452,21,0 468 | 0,74,52,10,36,27.8,0.269,22,0 469 | 0,97,64,36,100,36.8,0.6,25,0 470 | 8,120,0,0,0,30,0.183,38,1 471 | 6,154,78,41,140,46.1,0.571,27,0 472 | 1,144,82,40,0,41.3,0.607,28,0 473 | 0,137,70,38,0,33.2,0.17,22,0 474 | 0,119,66,27,0,38.8,0.259,22,0 475 | 7,136,90,0,0,29.9,0.21,50,0 476 | 4,114,64,0,0,28.9,0.126,24,0 477 | 0,137,84,27,0,27.3,0.231,59,0 478 | 2,105,80,45,191,33.7,0.711,29,1 479 | 7,114,76,17,110,23.8,0.466,31,0 480 | 8,126,74,38,75,25.9,0.162,39,0 481 | 4,132,86,31,0,28,0.419,63,0 482 | 3,158,70,30,328,35.5,0.344,35,1 483 | 0,123,88,37,0,35.2,0.197,29,0 484 | 4,85,58,22,49,27.8,0.306,28,0 485 | 0,84,82,31,125,38.2,0.233,23,0 486 | 0,145,0,0,0,44.2,0.63,31,1 487 | 0,135,68,42,250,42.3,0.365,24,1 488 | 1,139,62,41,480,40.7,0.536,21,0 489 | 0,173,78,32,265,46.5,1.159,58,0 490 | 4,99,72,17,0,25.6,0.294,28,0 491 | 8,194,80,0,0,26.1,0.551,67,0 492 | 2,83,65,28,66,36.8,0.629,24,0 493 | 2,89,90,30,0,33.5,0.292,42,0 494 | 4,99,68,38,0,32.8,0.145,33,0 495 | 4,125,70,18,122,28.9,1.144,45,1 496 | 3,80,0,0,0,0,0.174,22,0 497 | 6,166,74,0,0,26.6,0.304,66,0 498 | 5,110,68,0,0,26,0.292,30,0 499 | 2,81,72,15,76,30.1,0.547,25,0 500 | 7,195,70,33,145,25.1,0.163,55,1 501 | 6,154,74,32,193,29.3,0.839,39,0 502 | 2,117,90,19,71,25.2,0.313,21,0 503 | 3,84,72,32,0,37.2,0.267,28,0 504 | 6,0,68,41,0,39,0.727,41,1 505 | 7,94,64,25,79,33.3,0.738,41,0 506 | 3,96,78,39,0,37.3,0.238,40,0 507 | 10,75,82,0,0,33.3,0.263,38,0 508 | 0,180,90,26,90,36.5,0.314,35,1 509 | 1,130,60,23,170,28.6,0.692,21,0 510 | 2,84,50,23,76,30.4,0.968,21,0 511 | 8,120,78,0,0,25,0.409,64,0 512 | 12,84,72,31,0,29.7,0.297,46,1 513 | 0,139,62,17,210,22.1,0.207,21,0 514 | 9,91,68,0,0,24.2,0.2,58,0 515 | 2,91,62,0,0,27.3,0.525,22,0 516 | 3,99,54,19,86,25.6,0.154,24,0 517 | 3,163,70,18,105,31.6,0.268,28,1 518 | 9,145,88,34,165,30.3,0.771,53,1 519 | 7,125,86,0,0,37.6,0.304,51,0 520 | 13,76,60,0,0,32.8,0.18,41,0 521 | 6,129,90,7,326,19.6,0.582,60,0 522 | 2,68,70,32,66,25,0.187,25,0 523 | 3,124,80,33,130,33.2,0.305,26,0 524 | 6,114,0,0,0,0,0.189,26,0 525 | 9,130,70,0,0,34.2,0.652,45,1 526 | 3,125,58,0,0,31.6,0.151,24,0 527 | 3,87,60,18,0,21.8,0.444,21,0 528 | 1,97,64,19,82,18.2,0.299,21,0 529 | 3,116,74,15,105,26.3,0.107,24,0 530 | 0,117,66,31,188,30.8,0.493,22,0 531 | 0,111,65,0,0,24.6,0.66,31,0 532 | 2,122,60,18,106,29.8,0.717,22,0 533 | 0,107,76,0,0,45.3,0.686,24,0 534 | 1,86,66,52,65,41.3,0.917,29,0 535 | 6,91,0,0,0,29.8,0.501,31,0 536 | 1,77,56,30,56,33.3,1.251,24,0 537 | 4,132,0,0,0,32.9,0.302,23,1 538 | 0,105,90,0,0,29.6,0.197,46,0 539 | 0,57,60,0,0,21.7,0.735,67,0 540 | 0,127,80,37,210,36.3,0.804,23,0 541 | 3,129,92,49,155,36.4,0.968,32,1 542 | 8,100,74,40,215,39.4,0.661,43,1 543 | 3,128,72,25,190,32.4,0.549,27,1 544 | 10,90,85,32,0,34.9,0.825,56,1 545 | 4,84,90,23,56,39.5,0.159,25,0 546 | 1,88,78,29,76,32,0.365,29,0 547 | 8,186,90,35,225,34.5,0.423,37,1 548 | 5,187,76,27,207,43.6,1.034,53,1 549 | 4,131,68,21,166,33.1,0.16,28,0 550 | 1,164,82,43,67,32.8,0.341,50,0 551 | 4,189,110,31,0,28.5,0.68,37,0 552 | 1,116,70,28,0,27.4,0.204,21,0 553 | 3,84,68,30,106,31.9,0.591,25,0 554 | 6,114,88,0,0,27.8,0.247,66,0 555 | 1,88,62,24,44,29.9,0.422,23,0 556 | 1,84,64,23,115,36.9,0.471,28,0 557 | 7,124,70,33,215,25.5,0.161,37,0 558 | 1,97,70,40,0,38.1,0.218,30,0 559 | 8,110,76,0,0,27.8,0.237,58,0 560 | 11,103,68,40,0,46.2,0.126,42,0 561 | 11,85,74,0,0,30.1,0.3,35,0 562 | 6,125,76,0,0,33.8,0.121,54,1 563 | 0,198,66,32,274,41.3,0.502,28,1 564 | 1,87,68,34,77,37.6,0.401,24,0 565 | 6,99,60,19,54,26.9,0.497,32,0 566 | 0,91,80,0,0,32.4,0.601,27,0 567 | 2,95,54,14,88,26.1,0.748,22,0 568 | 1,99,72,30,18,38.6,0.412,21,0 569 | 6,92,62,32,126,32,0.085,46,0 570 | 4,154,72,29,126,31.3,0.338,37,0 571 | 0,121,66,30,165,34.3,0.203,33,1 572 | 3,78,70,0,0,32.5,0.27,39,0 573 | 2,130,96,0,0,22.6,0.268,21,0 574 | 3,111,58,31,44,29.5,0.43,22,0 575 | 2,98,60,17,120,34.7,0.198,22,0 576 | 1,143,86,30,330,30.1,0.892,23,0 577 | 1,119,44,47,63,35.5,0.28,25,0 578 | 6,108,44,20,130,24,0.813,35,0 579 | 2,118,80,0,0,42.9,0.693,21,1 580 | 10,133,68,0,0,27,0.245,36,0 581 | 2,197,70,99,0,34.7,0.575,62,1 582 | 0,151,90,46,0,42.1,0.371,21,1 583 | 6,109,60,27,0,25,0.206,27,0 584 | 12,121,78,17,0,26.5,0.259,62,0 585 | 8,100,76,0,0,38.7,0.19,42,0 586 | 8,124,76,24,600,28.7,0.687,52,1 587 | 1,93,56,11,0,22.5,0.417,22,0 588 | 8,143,66,0,0,34.9,0.129,41,1 589 | 6,103,66,0,0,24.3,0.249,29,0 590 | 3,176,86,27,156,33.3,1.154,52,1 591 | 0,73,0,0,0,21.1,0.342,25,0 592 | 11,111,84,40,0,46.8,0.925,45,1 593 | 2,112,78,50,140,39.4,0.175,24,0 594 | 3,132,80,0,0,34.4,0.402,44,1 595 | 2,82,52,22,115,28.5,1.699,25,0 596 | 6,123,72,45,230,33.6,0.733,34,0 597 | 0,188,82,14,185,32,0.682,22,1 598 | 0,67,76,0,0,45.3,0.194,46,0 599 | 1,89,24,19,25,27.8,0.559,21,0 600 | 1,173,74,0,0,36.8,0.088,38,1 601 | 1,109,38,18,120,23.1,0.407,26,0 602 | 1,108,88,19,0,27.1,0.4,24,0 603 | 6,96,0,0,0,23.7,0.19,28,0 604 | 1,124,74,36,0,27.8,0.1,30,0 605 | 7,150,78,29,126,35.2,0.692,54,1 606 | 4,183,0,0,0,28.4,0.212,36,1 607 | 1,124,60,32,0,35.8,0.514,21,0 608 | 1,181,78,42,293,40,1.258,22,1 609 | 1,92,62,25,41,19.5,0.482,25,0 610 | 0,152,82,39,272,41.5,0.27,27,0 611 | 1,111,62,13,182,24,0.138,23,0 612 | 3,106,54,21,158,30.9,0.292,24,0 613 | 3,174,58,22,194,32.9,0.593,36,1 614 | 7,168,88,42,321,38.2,0.787,40,1 615 | 6,105,80,28,0,32.5,0.878,26,0 616 | 11,138,74,26,144,36.1,0.557,50,1 617 | 3,106,72,0,0,25.8,0.207,27,0 618 | 6,117,96,0,0,28.7,0.157,30,0 619 | 2,68,62,13,15,20.1,0.257,23,0 620 | 9,112,82,24,0,28.2,1.282,50,1 621 | 0,119,0,0,0,32.4,0.141,24,1 622 | 2,112,86,42,160,38.4,0.246,28,0 623 | 2,92,76,20,0,24.2,1.698,28,0 624 | 6,183,94,0,0,40.8,1.461,45,0 625 | 0,94,70,27,115,43.5,0.347,21,0 626 | 2,108,64,0,0,30.8,0.158,21,0 627 | 4,90,88,47,54,37.7,0.362,29,0 628 | 0,125,68,0,0,24.7,0.206,21,0 629 | 0,132,78,0,0,32.4,0.393,21,0 630 | 5,128,80,0,0,34.6,0.144,45,0 631 | 4,94,65,22,0,24.7,0.148,21,0 632 | 7,114,64,0,0,27.4,0.732,34,1 633 | 0,102,78,40,90,34.5,0.238,24,0 634 | 2,111,60,0,0,26.2,0.343,23,0 635 | 1,128,82,17,183,27.5,0.115,22,0 636 | 10,92,62,0,0,25.9,0.167,31,0 637 | 13,104,72,0,0,31.2,0.465,38,1 638 | 5,104,74,0,0,28.8,0.153,48,0 639 | 2,94,76,18,66,31.6,0.649,23,0 640 | 7,97,76,32,91,40.9,0.871,32,1 641 | 1,100,74,12,46,19.5,0.149,28,0 642 | 0,102,86,17,105,29.3,0.695,27,0 643 | 4,128,70,0,0,34.3,0.303,24,0 644 | 6,147,80,0,0,29.5,0.178,50,1 645 | 4,90,0,0,0,28,0.61,31,0 646 | 3,103,72,30,152,27.6,0.73,27,0 647 | 2,157,74,35,440,39.4,0.134,30,0 648 | 1,167,74,17,144,23.4,0.447,33,1 649 | 0,179,50,36,159,37.8,0.455,22,1 650 | 11,136,84,35,130,28.3,0.26,42,1 651 | 0,107,60,25,0,26.4,0.133,23,0 652 | 1,91,54,25,100,25.2,0.234,23,0 653 | 1,117,60,23,106,33.8,0.466,27,0 654 | 5,123,74,40,77,34.1,0.269,28,0 655 | 2,120,54,0,0,26.8,0.455,27,0 656 | 1,106,70,28,135,34.2,0.142,22,0 657 | 2,155,52,27,540,38.7,0.24,25,1 658 | 2,101,58,35,90,21.8,0.155,22,0 659 | 1,120,80,48,200,38.9,1.162,41,0 660 | 11,127,106,0,0,39,0.19,51,0 661 | 3,80,82,31,70,34.2,1.292,27,1 662 | 10,162,84,0,0,27.7,0.182,54,0 663 | 1,199,76,43,0,42.9,1.394,22,1 664 | 8,167,106,46,231,37.6,0.165,43,1 665 | 9,145,80,46,130,37.9,0.637,40,1 666 | 6,115,60,39,0,33.7,0.245,40,1 667 | 1,112,80,45,132,34.8,0.217,24,0 668 | 4,145,82,18,0,32.5,0.235,70,1 669 | 10,111,70,27,0,27.5,0.141,40,1 670 | 6,98,58,33,190,34,0.43,43,0 671 | 9,154,78,30,100,30.9,0.164,45,0 672 | 6,165,68,26,168,33.6,0.631,49,0 673 | 1,99,58,10,0,25.4,0.551,21,0 674 | 10,68,106,23,49,35.5,0.285,47,0 675 | 3,123,100,35,240,57.3,0.88,22,0 676 | 8,91,82,0,0,35.6,0.587,68,0 677 | 6,195,70,0,0,30.9,0.328,31,1 678 | 9,156,86,0,0,24.8,0.23,53,1 679 | 0,93,60,0,0,35.3,0.263,25,0 680 | 3,121,52,0,0,36,0.127,25,1 681 | 2,101,58,17,265,24.2,0.614,23,0 682 | 2,56,56,28,45,24.2,0.332,22,0 683 | 0,162,76,36,0,49.6,0.364,26,1 684 | 0,95,64,39,105,44.6,0.366,22,0 685 | 4,125,80,0,0,32.3,0.536,27,1 686 | 5,136,82,0,0,0,0.64,69,0 687 | 2,129,74,26,205,33.2,0.591,25,0 688 | 3,130,64,0,0,23.1,0.314,22,0 689 | 1,107,50,19,0,28.3,0.181,29,0 690 | 1,140,74,26,180,24.1,0.828,23,0 691 | 1,144,82,46,180,46.1,0.335,46,1 692 | 8,107,80,0,0,24.6,0.856,34,0 693 | 13,158,114,0,0,42.3,0.257,44,1 694 | 2,121,70,32,95,39.1,0.886,23,0 695 | 7,129,68,49,125,38.5,0.439,43,1 696 | 2,90,60,0,0,23.5,0.191,25,0 697 | 7,142,90,24,480,30.4,0.128,43,1 698 | 3,169,74,19,125,29.9,0.268,31,1 699 | 0,99,0,0,0,25,0.253,22,0 700 | 4,127,88,11,155,34.5,0.598,28,0 701 | 4,118,70,0,0,44.5,0.904,26,0 702 | 2,122,76,27,200,35.9,0.483,26,0 703 | 6,125,78,31,0,27.6,0.565,49,1 704 | 1,168,88,29,0,35,0.905,52,1 705 | 2,129,0,0,0,38.5,0.304,41,0 706 | 4,110,76,20,100,28.4,0.118,27,0 707 | 6,80,80,36,0,39.8,0.177,28,0 708 | 10,115,0,0,0,0,0.261,30,1 709 | 2,127,46,21,335,34.4,0.176,22,0 710 | 9,164,78,0,0,32.8,0.148,45,1 711 | 2,93,64,32,160,38,0.674,23,1 712 | 3,158,64,13,387,31.2,0.295,24,0 713 | 5,126,78,27,22,29.6,0.439,40,0 714 | 10,129,62,36,0,41.2,0.441,38,1 715 | 0,134,58,20,291,26.4,0.352,21,0 716 | 3,102,74,0,0,29.5,0.121,32,0 717 | 7,187,50,33,392,33.9,0.826,34,1 718 | 3,173,78,39,185,33.8,0.97,31,1 719 | 10,94,72,18,0,23.1,0.595,56,0 720 | 1,108,60,46,178,35.5,0.415,24,0 721 | 5,97,76,27,0,35.6,0.378,52,1 722 | 4,83,86,19,0,29.3,0.317,34,0 723 | 1,114,66,36,200,38.1,0.289,21,0 724 | 1,149,68,29,127,29.3,0.349,42,1 725 | 5,117,86,30,105,39.1,0.251,42,0 726 | 1,111,94,0,0,32.8,0.265,45,0 727 | 4,112,78,40,0,39.4,0.236,38,0 728 | 1,116,78,29,180,36.1,0.496,25,0 729 | 0,141,84,26,0,32.4,0.433,22,0 730 | 2,175,88,0,0,22.9,0.326,22,0 731 | 2,92,52,0,0,30.1,0.141,22,0 732 | 3,130,78,23,79,28.4,0.323,34,1 733 | 8,120,86,0,0,28.4,0.259,22,1 734 | 2,174,88,37,120,44.5,0.646,24,1 735 | 2,106,56,27,165,29,0.426,22,0 736 | 2,105,75,0,0,23.3,0.56,53,0 737 | 4,95,60,32,0,35.4,0.284,28,0 738 | 0,126,86,27,120,27.4,0.515,21,0 739 | 8,65,72,23,0,32,0.6,42,0 740 | 2,99,60,17,160,36.6,0.453,21,0 741 | 1,102,74,0,0,39.5,0.293,42,1 742 | 11,120,80,37,150,42.3,0.785,48,1 743 | 3,102,44,20,94,30.8,0.4,26,0 744 | 1,109,58,18,116,28.5,0.219,22,0 745 | 9,140,94,0,0,32.7,0.734,45,1 746 | 13,153,88,37,140,40.6,1.174,39,0 747 | 12,100,84,33,105,30,0.488,46,0 748 | 1,147,94,41,0,49.3,0.358,27,1 749 | 1,81,74,41,57,46.3,1.096,32,0 750 | 3,187,70,22,200,36.4,0.408,36,1 751 | 6,162,62,0,0,24.3,0.178,50,1 752 | 4,136,70,0,0,31.2,1.182,22,1 753 | 1,121,78,39,74,39,0.261,28,0 754 | 3,108,62,24,0,26,0.223,25,0 755 | 0,181,88,44,510,43.3,0.222,26,1 756 | 8,154,78,32,0,32.4,0.443,45,1 757 | 1,128,88,39,110,36.5,1.057,37,1 758 | 7,137,90,41,0,32,0.391,39,0 759 | 0,123,72,0,0,36.3,0.258,52,1 760 | 1,106,76,0,0,37.5,0.197,26,0 761 | 6,190,92,0,0,35.5,0.278,66,1 762 | 2,88,58,26,16,28.4,0.766,22,0 763 | 9,170,74,31,0,44,0.403,43,1 764 | 9,89,62,0,0,22.5,0.142,33,0 765 | 10,101,76,48,180,32.9,0.171,63,0 766 | 2,122,70,27,0,36.8,0.34,27,0 767 | 5,121,72,23,112,26.2,0.245,30,0 768 | 1,126,60,0,0,30.1,0.349,47,1 769 | 1,93,70,31,0,30.4,0.315,23,0 -------------------------------------------------------------------------------- /Code/Class4/Tuples_Dictionary.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "4123aa28", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "('sajid', 'Ahmed', 'Ali', 'sajid')\n" 14 | ] 15 | } 16 | ], 17 | "source": [ 18 | "# List [],tuple(),dictinary{},set{}\n", 19 | "tuple_name = (\"sajid\",\"Ahmed\",\"Ali\",\"sajid\")\n", 20 | "print(tuple_name)" 21 | ] 22 | }, 23 | { 24 | "cell_type": "code", 25 | "execution_count": 2, 26 | "id": "36aa1610", 27 | "metadata": {}, 28 | "outputs": [ 29 | { 30 | "data": { 31 | "text/plain": [ 32 | "tuple" 33 | ] 34 | }, 35 | "execution_count": 2, 36 | "metadata": {}, 37 | "output_type": "execute_result" 38 | } 39 | ], 40 | "source": [ 41 | "type(tuple_name)" 42 | ] 43 | }, 44 | { 45 | "cell_type": "code", 46 | "execution_count": 3, 47 | "id": "35966803", 48 | "metadata": {}, 49 | "outputs": [ 50 | { 51 | "data": { 52 | "text/plain": [ 53 | "2" 54 | ] 55 | }, 56 | "execution_count": 3, 57 | "metadata": {}, 58 | "output_type": "execute_result" 59 | } 60 | ], 61 | "source": [ 62 | "tuple_name.count('sajid')" 63 | ] 64 | }, 65 | { 66 | "cell_type": "code", 67 | "execution_count": 4, 68 | "id": "49fbc5da", 69 | "metadata": {}, 70 | "outputs": [ 71 | { 72 | "data": { 73 | "text/plain": [ 74 | "('sajid', 'Ahmed', 'Ali', 'sajid')" 75 | ] 76 | }, 77 | "execution_count": 4, 78 | "metadata": {}, 79 | "output_type": "execute_result" 80 | } 81 | ], 82 | "source": [ 83 | "tuple_name" 84 | ] 85 | }, 86 | { 87 | "cell_type": "code", 88 | "execution_count": 5, 89 | "id": "6ea64370", 90 | "metadata": {}, 91 | "outputs": [ 92 | { 93 | "data": { 94 | "text/plain": [ 95 | "2" 96 | ] 97 | }, 98 | "execution_count": 5, 99 | "metadata": {}, 100 | "output_type": "execute_result" 101 | } 102 | ], 103 | "source": [ 104 | "tuple_name.index(\"Ali\")" 105 | ] 106 | }, 107 | { 108 | "cell_type": "code", 109 | "execution_count": 6, 110 | "id": "2b6faae9", 111 | "metadata": {}, 112 | "outputs": [], 113 | "source": [ 114 | "tuple_last_name=(\"Majeed\",\"Asad\",\"Ali\")" 115 | ] 116 | }, 117 | { 118 | "cell_type": "code", 119 | "execution_count": 7, 120 | "id": "43cbe6b8", 121 | "metadata": {}, 122 | "outputs": [ 123 | { 124 | "name": "stdout", 125 | "output_type": "stream", 126 | "text": [ 127 | "('sajid', 'Ahmed', 'Ali', 'sajid', 'Majeed', 'Asad', 'Ali')\n" 128 | ] 129 | } 130 | ], 131 | "source": [ 132 | "full_name = tuple_name+tuple_last_name\n", 133 | "print(full_name)" 134 | ] 135 | }, 136 | { 137 | "cell_type": "code", 138 | "execution_count": 8, 139 | "id": "b25960fc", 140 | "metadata": {}, 141 | "outputs": [], 142 | "source": [ 143 | "no_1=(1,2,3,4)\n", 144 | "no_2=(6,7,8,9)\n", 145 | "sum= no_1+no_2" 146 | ] 147 | }, 148 | { 149 | "cell_type": "code", 150 | "execution_count": 9, 151 | "id": "fa8677ae", 152 | "metadata": {}, 153 | "outputs": [ 154 | { 155 | "data": { 156 | "text/plain": [ 157 | "(1, 2, 3, 4, 6, 7, 8, 9)" 158 | ] 159 | }, 160 | "execution_count": 9, 161 | "metadata": {}, 162 | "output_type": "execute_result" 163 | } 164 | ], 165 | "source": [ 166 | "sum" 167 | ] 168 | }, 169 | { 170 | "cell_type": "code", 171 | "execution_count": 10, 172 | "id": "6e55bf3b", 173 | "metadata": {}, 174 | "outputs": [ 175 | { 176 | "name": "stdout", 177 | "output_type": "stream", 178 | "text": [ 179 | "1\n", 180 | "[2, 3, 7, 8]\n", 181 | "9\n" 182 | ] 183 | } 184 | ], 185 | "source": [ 186 | "# unpacking a tuple\n", 187 | "a,*b,c =(1, 2, 3,7,8,9)\n", 188 | "print(a)\n", 189 | "print(b)\n", 190 | "print(c)" 191 | ] 192 | }, 193 | { 194 | "cell_type": "code", 195 | "execution_count": 11, 196 | "id": "f6ff723b", 197 | "metadata": {}, 198 | "outputs": [], 199 | "source": [ 200 | "# key,value \n", 201 | "list1 = set()" 202 | ] 203 | }, 204 | { 205 | "cell_type": "code", 206 | "execution_count": 12, 207 | "id": "c1ceac92", 208 | "metadata": {}, 209 | "outputs": [ 210 | { 211 | "data": { 212 | "text/plain": [ 213 | "{1, 3, 4, 5, 6}" 214 | ] 215 | }, 216 | "execution_count": 12, 217 | "metadata": {}, 218 | "output_type": "execute_result" 219 | } 220 | ], 221 | "source": [ 222 | "list1={1,3,4,5,6,5,6}\n", 223 | "list1" 224 | ] 225 | }, 226 | { 227 | "cell_type": "code", 228 | "execution_count": 13, 229 | "id": "f62a692e", 230 | "metadata": {}, 231 | "outputs": [ 232 | { 233 | "data": { 234 | "text/plain": [ 235 | "set" 236 | ] 237 | }, 238 | "execution_count": 13, 239 | "metadata": {}, 240 | "output_type": "execute_result" 241 | } 242 | ], 243 | "source": [ 244 | "type(list1)" 245 | ] 246 | }, 247 | { 248 | "cell_type": "code", 249 | "execution_count": 14, 250 | "id": "2420364f", 251 | "metadata": {}, 252 | "outputs": [], 253 | "source": [ 254 | "student={\n", 255 | " 'name':'sajid Majeed',\n", 256 | " 'gender':'Male',\n", 257 | " 'major_program':'Bioteach',\n", 258 | " 'university':'DUHS',\n", 259 | " 'address':\"Ojha Campus\",\n", 260 | " 'expertise':[\"Genomics\",\"Programming\",\"Molecular Biology\",\"Python\"],\n", 261 | " 'age':31\n", 262 | "}" 263 | ] 264 | }, 265 | { 266 | "cell_type": "code", 267 | "execution_count": 15, 268 | "id": "9ffcc6ea", 269 | "metadata": {}, 270 | "outputs": [ 271 | { 272 | "name": "stdout", 273 | "output_type": "stream", 274 | "text": [ 275 | "{'name': 'sajid Majeed', 'gender': 'Male', 'major_program': 'Bioteach', 'university': 'DUHS', 'address': 'Ojha Campus', 'expertise': ['Genomics', 'Programming', 'Molecular Biology', 'Python'], 'age': 31}\n" 276 | ] 277 | } 278 | ], 279 | "source": [ 280 | "print(student)" 281 | ] 282 | }, 283 | { 284 | "cell_type": "code", 285 | "execution_count": 16, 286 | "id": "37018dd8", 287 | "metadata": {}, 288 | "outputs": [ 289 | { 290 | "data": { 291 | "text/plain": [ 292 | "dict_keys(['name', 'gender', 'major_program', 'university', 'address', 'expertise', 'age'])" 293 | ] 294 | }, 295 | "execution_count": 16, 296 | "metadata": {}, 297 | "output_type": "execute_result" 298 | } 299 | ], 300 | "source": [ 301 | "student.keys()" 302 | ] 303 | }, 304 | { 305 | "cell_type": "code", 306 | "execution_count": 17, 307 | "id": "71e2ef2e", 308 | "metadata": {}, 309 | "outputs": [ 310 | { 311 | "data": { 312 | "text/plain": [ 313 | "dict_values(['sajid Majeed', 'Male', 'Bioteach', 'DUHS', 'Ojha Campus', ['Genomics', 'Programming', 'Molecular Biology', 'Python'], 31])" 314 | ] 315 | }, 316 | "execution_count": 17, 317 | "metadata": {}, 318 | "output_type": "execute_result" 319 | } 320 | ], 321 | "source": [ 322 | "student.values()" 323 | ] 324 | }, 325 | { 326 | "cell_type": "code", 327 | "execution_count": 18, 328 | "id": "7c00b7ae", 329 | "metadata": {}, 330 | "outputs": [ 331 | { 332 | "data": { 333 | "text/plain": [ 334 | "dict_items([('name', 'sajid Majeed'), ('gender', 'Male'), ('major_program', 'Bioteach'), ('university', 'DUHS'), ('address', 'Ojha Campus'), ('expertise', ['Genomics', 'Programming', 'Molecular Biology', 'Python']), ('age', 31)])" 335 | ] 336 | }, 337 | "execution_count": 18, 338 | "metadata": {}, 339 | "output_type": "execute_result" 340 | } 341 | ], 342 | "source": [ 343 | "student.items()" 344 | ] 345 | }, 346 | { 347 | "cell_type": "code", 348 | "execution_count": 19, 349 | "id": "711bd2df", 350 | "metadata": {}, 351 | "outputs": [ 352 | { 353 | "data": { 354 | "text/plain": [ 355 | "7" 356 | ] 357 | }, 358 | "execution_count": 19, 359 | "metadata": {}, 360 | "output_type": "execute_result" 361 | } 362 | ], 363 | "source": [ 364 | "len(student)" 365 | ] 366 | }, 367 | { 368 | "cell_type": "code", 369 | "execution_count": 20, 370 | "id": "14d50bfc", 371 | "metadata": {}, 372 | "outputs": [ 373 | { 374 | "data": { 375 | "text/plain": [ 376 | "True" 377 | ] 378 | }, 379 | "execution_count": 20, 380 | "metadata": {}, 381 | "output_type": "execute_result" 382 | } 383 | ], 384 | "source": [ 385 | "'name' in student" 386 | ] 387 | }, 388 | { 389 | "cell_type": "code", 390 | "execution_count": 21, 391 | "id": "174e5244", 392 | "metadata": {}, 393 | "outputs": [], 394 | "source": [ 395 | "student['Specialization']=\"AI\"" 396 | ] 397 | }, 398 | { 399 | "cell_type": "code", 400 | "execution_count": 22, 401 | "id": "f9748671", 402 | "metadata": {}, 403 | "outputs": [ 404 | { 405 | "data": { 406 | "text/plain": [ 407 | "{'name': 'sajid Majeed',\n", 408 | " 'gender': 'Male',\n", 409 | " 'major_program': 'Bioteach',\n", 410 | " 'university': 'DUHS',\n", 411 | " 'address': 'Ojha Campus',\n", 412 | " 'expertise': ['Genomics', 'Programming', 'Molecular Biology', 'Python'],\n", 413 | " 'age': 31,\n", 414 | " 'Specialization': 'AI'}" 415 | ] 416 | }, 417 | "execution_count": 22, 418 | "metadata": {}, 419 | "output_type": "execute_result" 420 | } 421 | ], 422 | "source": [ 423 | "student" 424 | ] 425 | }, 426 | { 427 | "cell_type": "code", 428 | "execution_count": 23, 429 | "id": "7e769771", 430 | "metadata": {}, 431 | "outputs": [ 432 | { 433 | "data": { 434 | "text/plain": [ 435 | "31" 436 | ] 437 | }, 438 | "execution_count": 23, 439 | "metadata": {}, 440 | "output_type": "execute_result" 441 | } 442 | ], 443 | "source": [ 444 | "student.get('age')" 445 | ] 446 | }, 447 | { 448 | "cell_type": "code", 449 | "execution_count": 24, 450 | "id": "d77c3d60", 451 | "metadata": {}, 452 | "outputs": [ 453 | { 454 | "data": { 455 | "text/plain": [ 456 | "'sajid Majeed'" 457 | ] 458 | }, 459 | "execution_count": 24, 460 | "metadata": {}, 461 | "output_type": "execute_result" 462 | } 463 | ], 464 | "source": [ 465 | "student['name']" 466 | ] 467 | }, 468 | { 469 | "cell_type": "code", 470 | "execution_count": 25, 471 | "id": "b5ffeece", 472 | "metadata": {}, 473 | "outputs": [], 474 | "source": [ 475 | "student['expertise'].append('Dignostic')" 476 | ] 477 | }, 478 | { 479 | "cell_type": "code", 480 | "execution_count": 26, 481 | "id": "5e207602", 482 | "metadata": {}, 483 | "outputs": [ 484 | { 485 | "data": { 486 | "text/plain": [ 487 | "{'name': 'sajid Majeed',\n", 488 | " 'gender': 'Male',\n", 489 | " 'major_program': 'Bioteach',\n", 490 | " 'university': 'DUHS',\n", 491 | " 'address': 'Ojha Campus',\n", 492 | " 'expertise': ['Genomics',\n", 493 | " 'Programming',\n", 494 | " 'Molecular Biology',\n", 495 | " 'Python',\n", 496 | " 'Dignostic'],\n", 497 | " 'age': 31,\n", 498 | " 'Specialization': 'AI'}" 499 | ] 500 | }, 501 | "execution_count": 26, 502 | "metadata": {}, 503 | "output_type": "execute_result" 504 | } 505 | ], 506 | "source": [ 507 | "student" 508 | ] 509 | }, 510 | { 511 | "cell_type": "code", 512 | "execution_count": 27, 513 | "id": "daf9eee5", 514 | "metadata": {}, 515 | "outputs": [ 516 | { 517 | "data": { 518 | "text/plain": [ 519 | "{'name': 'sajid Majeed',\n", 520 | " 'gender': 'Male',\n", 521 | " 'major_program': 'Bioteach',\n", 522 | " 'university': 'DUHS',\n", 523 | " 'address': 'Ojha Campus',\n", 524 | " 'expertise': ['Genomics',\n", 525 | " 'Programming',\n", 526 | " 'Molecular Biology',\n", 527 | " 'Python',\n", 528 | " 'Dignostic'],\n", 529 | " 'age': 31,\n", 530 | " 'Specialization': 'AI'}" 531 | ] 532 | }, 533 | "execution_count": 27, 534 | "metadata": {}, 535 | "output_type": "execute_result" 536 | } 537 | ], 538 | "source": [ 539 | "student" 540 | ] 541 | }, 542 | { 543 | "cell_type": "code", 544 | "execution_count": 28, 545 | "id": "c783208d", 546 | "metadata": {}, 547 | "outputs": [], 548 | "source": [ 549 | "student['marks']={\"maths\":80,'bio':89}" 550 | ] 551 | }, 552 | { 553 | "cell_type": "code", 554 | "execution_count": 29, 555 | "id": "9db48cdc", 556 | "metadata": {}, 557 | "outputs": [ 558 | { 559 | "data": { 560 | "text/plain": [ 561 | "{'name': 'sajid Majeed',\n", 562 | " 'gender': 'Male',\n", 563 | " 'major_program': 'Bioteach',\n", 564 | " 'university': 'DUHS',\n", 565 | " 'address': 'Ojha Campus',\n", 566 | " 'expertise': ['Genomics',\n", 567 | " 'Programming',\n", 568 | " 'Molecular Biology',\n", 569 | " 'Python',\n", 570 | " 'Dignostic'],\n", 571 | " 'age': 31,\n", 572 | " 'Specialization': 'AI',\n", 573 | " 'marks': {'maths': 80, 'bio': 89}}" 574 | ] 575 | }, 576 | "execution_count": 29, 577 | "metadata": {}, 578 | "output_type": "execute_result" 579 | } 580 | ], 581 | "source": [ 582 | "student" 583 | ] 584 | }, 585 | { 586 | "cell_type": "code", 587 | "execution_count": 30, 588 | "id": "3259827b", 589 | "metadata": {}, 590 | "outputs": [], 591 | "source": [ 592 | "student['degree']=\"Mphil\"" 593 | ] 594 | }, 595 | { 596 | "cell_type": "code", 597 | "execution_count": 31, 598 | "id": "31d117ba", 599 | "metadata": {}, 600 | "outputs": [ 601 | { 602 | "data": { 603 | "text/plain": [ 604 | "{'name': 'sajid Majeed',\n", 605 | " 'gender': 'Male',\n", 606 | " 'major_program': 'Bioteach',\n", 607 | " 'university': 'DUHS',\n", 608 | " 'address': 'Ojha Campus',\n", 609 | " 'expertise': ['Genomics',\n", 610 | " 'Programming',\n", 611 | " 'Molecular Biology',\n", 612 | " 'Python',\n", 613 | " 'Dignostic'],\n", 614 | " 'age': 31,\n", 615 | " 'Specialization': 'AI',\n", 616 | " 'marks': {'maths': 80, 'bio': 89},\n", 617 | " 'degree': 'Mphil'}" 618 | ] 619 | }, 620 | "execution_count": 31, 621 | "metadata": {}, 622 | "output_type": "execute_result" 623 | } 624 | ], 625 | "source": [ 626 | "student" 627 | ] 628 | }, 629 | { 630 | "cell_type": "code", 631 | "execution_count": 32, 632 | "id": "2415652f", 633 | "metadata": {}, 634 | "outputs": [], 635 | "source": [ 636 | "student['marks']['Dignostic']=90" 637 | ] 638 | }, 639 | { 640 | "cell_type": "code", 641 | "execution_count": 33, 642 | "id": "f9ec2840", 643 | "metadata": {}, 644 | "outputs": [ 645 | { 646 | "data": { 647 | "text/plain": [ 648 | "{'name': 'sajid Majeed',\n", 649 | " 'gender': 'Male',\n", 650 | " 'major_program': 'Bioteach',\n", 651 | " 'university': 'DUHS',\n", 652 | " 'address': 'Ojha Campus',\n", 653 | " 'expertise': ['Genomics',\n", 654 | " 'Programming',\n", 655 | " 'Molecular Biology',\n", 656 | " 'Python',\n", 657 | " 'Dignostic'],\n", 658 | " 'age': 31,\n", 659 | " 'Specialization': 'AI',\n", 660 | " 'marks': {'maths': 80, 'bio': 89, 'Dignostic': 90},\n", 661 | " 'degree': 'Mphil'}" 662 | ] 663 | }, 664 | "execution_count": 33, 665 | "metadata": {}, 666 | "output_type": "execute_result" 667 | } 668 | ], 669 | "source": [ 670 | "student" 671 | ] 672 | }, 673 | { 674 | "cell_type": "code", 675 | "execution_count": 34, 676 | "id": "c4486a7c", 677 | "metadata": {}, 678 | "outputs": [], 679 | "source": [ 680 | "student.update({'name':'Anisa'})\n", 681 | "student.update({'name1':'Ayesha'})" 682 | ] 683 | }, 684 | { 685 | "cell_type": "code", 686 | "execution_count": 35, 687 | "id": "5cda0dbf", 688 | "metadata": {}, 689 | "outputs": [ 690 | { 691 | "data": { 692 | "text/plain": [ 693 | "{'name': 'Anisa',\n", 694 | " 'gender': 'Male',\n", 695 | " 'major_program': 'Bioteach',\n", 696 | " 'university': 'DUHS',\n", 697 | " 'address': 'Ojha Campus',\n", 698 | " 'expertise': ['Genomics',\n", 699 | " 'Programming',\n", 700 | " 'Molecular Biology',\n", 701 | " 'Python',\n", 702 | " 'Dignostic'],\n", 703 | " 'age': 31,\n", 704 | " 'Specialization': 'AI',\n", 705 | " 'marks': {'maths': 80, 'bio': 89, 'Dignostic': 90},\n", 706 | " 'degree': 'Mphil',\n", 707 | " 'name1': 'Ayesha'}" 708 | ] 709 | }, 710 | "execution_count": 35, 711 | "metadata": {}, 712 | "output_type": "execute_result" 713 | } 714 | ], 715 | "source": [ 716 | "student" 717 | ] 718 | }, 719 | { 720 | "cell_type": "code", 721 | "execution_count": 37, 722 | "id": "2d45c443", 723 | "metadata": {}, 724 | "outputs": [ 725 | { 726 | "data": { 727 | "text/plain": [ 728 | "False" 729 | ] 730 | }, 731 | "execution_count": 37, 732 | "metadata": {}, 733 | "output_type": "execute_result" 734 | } 735 | ], 736 | "source": [ 737 | "'name2' in student" 738 | ] 739 | }, 740 | { 741 | "cell_type": "code", 742 | "execution_count": 38, 743 | "id": "9af6d786", 744 | "metadata": {}, 745 | "outputs": [ 746 | { 747 | "data": { 748 | "text/plain": [ 749 | "{'name': 'Anisa',\n", 750 | " 'gender': 'Male',\n", 751 | " 'major_program': 'Bioteach',\n", 752 | " 'university': 'DUHS',\n", 753 | " 'address': 'Ojha Campus',\n", 754 | " 'expertise': ['Genomics',\n", 755 | " 'Programming',\n", 756 | " 'Molecular Biology',\n", 757 | " 'Python',\n", 758 | " 'Dignostic'],\n", 759 | " 'age': 31,\n", 760 | " 'Specialization': 'AI',\n", 761 | " 'marks': {'maths': 80, 'bio': 89, 'Dignostic': 90},\n", 762 | " 'degree': 'Mphil',\n", 763 | " 'name1': 'Ayesha'}" 764 | ] 765 | }, 766 | "execution_count": 38, 767 | "metadata": {}, 768 | "output_type": "execute_result" 769 | } 770 | ], 771 | "source": [ 772 | "student" 773 | ] 774 | }, 775 | { 776 | "cell_type": "code", 777 | "execution_count": 39, 778 | "id": "74b53388", 779 | "metadata": {}, 780 | "outputs": [ 781 | { 782 | "data": { 783 | "text/plain": [ 784 | "('name1', 'Ayesha')" 785 | ] 786 | }, 787 | "execution_count": 39, 788 | "metadata": {}, 789 | "output_type": "execute_result" 790 | } 791 | ], 792 | "source": [ 793 | "student.popitem()" 794 | ] 795 | }, 796 | { 797 | "cell_type": "code", 798 | "execution_count": 42, 799 | "id": "184b7cca", 800 | "metadata": {}, 801 | "outputs": [ 802 | { 803 | "data": { 804 | "text/plain": [ 805 | "'Mphil'" 806 | ] 807 | }, 808 | "execution_count": 42, 809 | "metadata": {}, 810 | "output_type": "execute_result" 811 | } 812 | ], 813 | "source": [ 814 | "student.pop('degree')" 815 | ] 816 | }, 817 | { 818 | "cell_type": "code", 819 | "execution_count": 43, 820 | "id": "28261965", 821 | "metadata": {}, 822 | "outputs": [ 823 | { 824 | "data": { 825 | "text/plain": [ 826 | "{'name': 'Anisa',\n", 827 | " 'gender': 'Male',\n", 828 | " 'major_program': 'Bioteach',\n", 829 | " 'university': 'DUHS',\n", 830 | " 'address': 'Ojha Campus',\n", 831 | " 'expertise': ['Genomics',\n", 832 | " 'Programming',\n", 833 | " 'Molecular Biology',\n", 834 | " 'Python',\n", 835 | " 'Dignostic'],\n", 836 | " 'age': 31,\n", 837 | " 'Specialization': 'AI',\n", 838 | " 'marks': {'maths': 80, 'bio': 89, 'Dignostic': 90}}" 839 | ] 840 | }, 841 | "execution_count": 43, 842 | "metadata": {}, 843 | "output_type": "execute_result" 844 | } 845 | ], 846 | "source": [ 847 | "student" 848 | ] 849 | }, 850 | { 851 | "cell_type": "code", 852 | "execution_count": 44, 853 | "id": "4162722b", 854 | "metadata": {}, 855 | "outputs": [ 856 | { 857 | "data": { 858 | "text/plain": [ 859 | "dict_keys(['name', 'gender', 'major_program', 'university', 'address', 'expertise', 'age', 'Specialization', 'marks'])" 860 | ] 861 | }, 862 | "execution_count": 44, 863 | "metadata": {}, 864 | "output_type": "execute_result" 865 | } 866 | ], 867 | "source": [ 868 | "student.keys()" 869 | ] 870 | }, 871 | { 872 | "cell_type": "code", 873 | "execution_count": 45, 874 | "id": "4ec5dc15", 875 | "metadata": {}, 876 | "outputs": [ 877 | { 878 | "data": { 879 | "text/plain": [ 880 | "dict_values(['Anisa', 'Male', 'Bioteach', 'DUHS', 'Ojha Campus', ['Genomics', 'Programming', 'Molecular Biology', 'Python', 'Dignostic'], 31, 'AI', {'maths': 80, 'bio': 89, 'Dignostic': 90}])" 881 | ] 882 | }, 883 | "execution_count": 45, 884 | "metadata": {}, 885 | "output_type": "execute_result" 886 | } 887 | ], 888 | "source": [ 889 | "student.values()" 890 | ] 891 | }, 892 | { 893 | "cell_type": "code", 894 | "execution_count": 46, 895 | "id": "3a1c23d2", 896 | "metadata": {}, 897 | "outputs": [ 898 | { 899 | "data": { 900 | "text/plain": [ 901 | "dict_items([('name', 'Anisa'), ('gender', 'Male'), ('major_program', 'Bioteach'), ('university', 'DUHS'), ('address', 'Ojha Campus'), ('expertise', ['Genomics', 'Programming', 'Molecular Biology', 'Python', 'Dignostic']), ('age', 31), ('Specialization', 'AI'), ('marks', {'maths': 80, 'bio': 89, 'Dignostic': 90})])" 902 | ] 903 | }, 904 | "execution_count": 46, 905 | "metadata": {}, 906 | "output_type": "execute_result" 907 | } 908 | ], 909 | "source": [ 910 | "student.items()" 911 | ] 912 | }, 913 | { 914 | "cell_type": "code", 915 | "execution_count": 47, 916 | "id": "0f940734", 917 | "metadata": {}, 918 | "outputs": [], 919 | "source": [ 920 | "del student['name']" 921 | ] 922 | }, 923 | { 924 | "cell_type": "code", 925 | "execution_count": 48, 926 | "id": "4747df69", 927 | "metadata": {}, 928 | "outputs": [ 929 | { 930 | "data": { 931 | "text/plain": [ 932 | "{'gender': 'Male',\n", 933 | " 'major_program': 'Bioteach',\n", 934 | " 'university': 'DUHS',\n", 935 | " 'address': 'Ojha Campus',\n", 936 | " 'expertise': ['Genomics',\n", 937 | " 'Programming',\n", 938 | " 'Molecular Biology',\n", 939 | " 'Python',\n", 940 | " 'Dignostic'],\n", 941 | " 'age': 31,\n", 942 | " 'Specialization': 'AI',\n", 943 | " 'marks': {'maths': 80, 'bio': 89, 'Dignostic': 90}}" 944 | ] 945 | }, 946 | "execution_count": 48, 947 | "metadata": {}, 948 | "output_type": "execute_result" 949 | } 950 | ], 951 | "source": [ 952 | "student" 953 | ] 954 | }, 955 | { 956 | "cell_type": "code", 957 | "execution_count": 49, 958 | "id": "c03038e7", 959 | "metadata": {}, 960 | "outputs": [ 961 | { 962 | "name": "stdout", 963 | "output_type": "stream", 964 | "text": [ 965 | "{}\n" 966 | ] 967 | } 968 | ], 969 | "source": [ 970 | "student.clear()\n", 971 | "print(student)" 972 | ] 973 | }, 974 | { 975 | "cell_type": "code", 976 | "execution_count": 50, 977 | "id": "36945549", 978 | "metadata": {}, 979 | "outputs": [], 980 | "source": [ 981 | "del student" 982 | ] 983 | }, 984 | { 985 | "cell_type": "code", 986 | "execution_count": 51, 987 | "id": "5222e54c", 988 | "metadata": {}, 989 | "outputs": [ 990 | { 991 | "ename": "NameError", 992 | "evalue": "name 'student' is not defined", 993 | "output_type": "error", 994 | "traceback": [ 995 | "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", 996 | "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", 997 | "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mstudent\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", 998 | "\u001b[1;31mNameError\u001b[0m: name 'student' is not defined" 999 | ] 1000 | } 1001 | ], 1002 | "source": [ 1003 | "print(student)" 1004 | ] 1005 | }, 1006 | { 1007 | "cell_type": "code", 1008 | "execution_count": null, 1009 | "id": "9b4845e2", 1010 | "metadata": {}, 1011 | "outputs": [], 1012 | "source": [] 1013 | } 1014 | ], 1015 | "metadata": { 1016 | "kernelspec": { 1017 | "display_name": "Python 3", 1018 | "language": "python", 1019 | "name": "python3" 1020 | }, 1021 | "language_info": { 1022 | "codemirror_mode": { 1023 | "name": "ipython", 1024 | "version": 3 1025 | }, 1026 | "file_extension": ".py", 1027 | "mimetype": "text/x-python", 1028 | "name": "python", 1029 | "nbconvert_exporter": "python", 1030 | "pygments_lexer": "ipython3", 1031 | "version": "3.8.8" 1032 | } 1033 | }, 1034 | "nbformat": 4, 1035 | "nbformat_minor": 5 1036 | } 1037 | --------------------------------------------------------------------------------