├── .gitignore ├── 01_Python_Basics.ipynb ├── LICENSE ├── README.md ├── if_logic.ipynb ├── python02.ipynb └── python_03.ipynb /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | -------------------------------------------------------------------------------- /01_Python_Basics.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "name": "01.Python Basics.ipynb", 7 | "provenance": [] 8 | }, 9 | "kernelspec": { 10 | "name": "python3", 11 | "display_name": "Python 3" 12 | }, 13 | "language_info": { 14 | "name": "python" 15 | } 16 | }, 17 | "cells": [ 18 | { 19 | "cell_type": "code", 20 | "execution_count": 1, 21 | "metadata": { 22 | "id": "sPpydNkUpAUP", 23 | "colab": { 24 | "base_uri": "https://localhost:8080/" 25 | }, 26 | "outputId": "e943604a-98cb-4323-c47b-31956cb0ec4a" 27 | }, 28 | "outputs": [ 29 | { 30 | "output_type": "execute_result", 31 | "data": { 32 | "text/plain": [ 33 | "18" 34 | ] 35 | }, 36 | "metadata": {}, 37 | "execution_count": 1 38 | } 39 | ], 40 | "source": [ 41 | "10+8" 42 | ] 43 | }, 44 | { 45 | "cell_type": "code", 46 | "source": [ 47 | "50*40" 48 | ], 49 | "metadata": { 50 | "colab": { 51 | "base_uri": "https://localhost:8080/" 52 | }, 53 | "id": "3rIaWQNPt447", 54 | "outputId": "df4509ec-28cf-4ee9-cc4d-787d46773598" 55 | }, 56 | "execution_count": 2, 57 | "outputs": [ 58 | { 59 | "output_type": "execute_result", 60 | "data": { 61 | "text/plain": [ 62 | "2000" 63 | ] 64 | }, 65 | "metadata": {}, 66 | "execution_count": 2 67 | } 68 | ] 69 | }, 70 | { 71 | "cell_type": "code", 72 | "source": [ 73 | "25-15" 74 | ], 75 | "metadata": { 76 | "colab": { 77 | "base_uri": "https://localhost:8080/" 78 | }, 79 | "id": "KB9g1N4juFev", 80 | "outputId": "db247e42-33de-4586-ca34-b8e88b60dfa6" 81 | }, 82 | "execution_count": 3, 83 | "outputs": [ 84 | { 85 | "output_type": "execute_result", 86 | "data": { 87 | "text/plain": [ 88 | "10" 89 | ] 90 | }, 91 | "metadata": {}, 92 | "execution_count": 3 93 | } 94 | ] 95 | }, 96 | { 97 | "cell_type": "code", 98 | "source": [ 99 | "60/23" 100 | ], 101 | "metadata": { 102 | "colab": { 103 | "base_uri": "https://localhost:8080/" 104 | }, 105 | "id": "fRbQ-hM8uOln", 106 | "outputId": "9ddd15e1-e1bb-4b08-eac5-aee21f4ab2b1" 107 | }, 108 | "execution_count": 4, 109 | "outputs": [ 110 | { 111 | "output_type": "execute_result", 112 | "data": { 113 | "text/plain": [ 114 | "2.608695652173913" 115 | ] 116 | }, 117 | "metadata": {}, 118 | "execution_count": 4 119 | } 120 | ] 121 | }, 122 | { 123 | "cell_type": "code", 124 | "source": [ 125 | "x=10" 126 | ], 127 | "metadata": { 128 | "id": "OLJMfCDquWDf" 129 | }, 130 | "execution_count": 5, 131 | "outputs": [] 132 | }, 133 | { 134 | "cell_type": "code", 135 | "source": [ 136 | "x" 137 | ], 138 | "metadata": { 139 | "colab": { 140 | "base_uri": "https://localhost:8080/" 141 | }, 142 | "id": "LYTkfGkJu0sm", 143 | "outputId": "216e2fe3-a144-4ad7-f580-125068805c98" 144 | }, 145 | "execution_count": 6, 146 | "outputs": [ 147 | { 148 | "output_type": "execute_result", 149 | "data": { 150 | "text/plain": [ 151 | "10" 152 | ] 153 | }, 154 | "metadata": {}, 155 | "execution_count": 6 156 | } 157 | ] 158 | }, 159 | { 160 | "cell_type": "code", 161 | "source": [ 162 | "x=202" 163 | ], 164 | "metadata": { 165 | "id": "RfX9gGcFu-C-" 166 | }, 167 | "execution_count": 7, 168 | "outputs": [] 169 | }, 170 | { 171 | "cell_type": "code", 172 | "source": [ 173 | "x" 174 | ], 175 | "metadata": { 176 | "colab": { 177 | "base_uri": "https://localhost:8080/" 178 | }, 179 | "id": "yRVGOoFQvEym", 180 | "outputId": "c74747d5-48ad-4a24-f01b-4d8af6bece12" 181 | }, 182 | "execution_count": 8, 183 | "outputs": [ 184 | { 185 | "output_type": "execute_result", 186 | "data": { 187 | "text/plain": [ 188 | "202" 189 | ] 190 | }, 191 | "metadata": {}, 192 | "execution_count": 8 193 | } 194 | ] 195 | }, 196 | { 197 | "cell_type": "code", 198 | "source": [ 199 | "x=86" 200 | ], 201 | "metadata": { 202 | "id": "0m9rUQ-4vF9u" 203 | }, 204 | "execution_count": 9, 205 | "outputs": [] 206 | }, 207 | { 208 | "cell_type": "code", 209 | "source": [ 210 | "x" 211 | ], 212 | "metadata": { 213 | "colab": { 214 | "base_uri": "https://localhost:8080/" 215 | }, 216 | "id": "XfCiEf8bvSii", 217 | "outputId": "330d8085-a202-4a57-a814-adc77ccbd4d1" 218 | }, 219 | "execution_count": 10, 220 | "outputs": [ 221 | { 222 | "output_type": "execute_result", 223 | "data": { 224 | "text/plain": [ 225 | "86" 226 | ] 227 | }, 228 | "metadata": {}, 229 | "execution_count": 10 230 | } 231 | ] 232 | }, 233 | { 234 | "cell_type": "code", 235 | "source": [ 236 | "x=99" 237 | ], 238 | "metadata": { 239 | "id": "3pJGsChgvT9C" 240 | }, 241 | "execution_count": 11, 242 | "outputs": [] 243 | }, 244 | { 245 | "cell_type": "code", 246 | "source": [ 247 | "x" 248 | ], 249 | "metadata": { 250 | "colab": { 251 | "base_uri": "https://localhost:8080/" 252 | }, 253 | "id": "ItiCm8sjvZMO", 254 | "outputId": "dbcdf141-d5ff-4c7f-b752-f6ea594392e3" 255 | }, 256 | "execution_count": 12, 257 | "outputs": [ 258 | { 259 | "output_type": "execute_result", 260 | "data": { 261 | "text/plain": [ 262 | "99" 263 | ] 264 | }, 265 | "metadata": {}, 266 | "execution_count": 12 267 | } 268 | ] 269 | }, 270 | { 271 | "cell_type": "code", 272 | "source": [ 273 | "x=10" 274 | ], 275 | "metadata": { 276 | "id": "R8T5cbNAvaWV" 277 | }, 278 | "execution_count": 13, 279 | "outputs": [] 280 | }, 281 | { 282 | "cell_type": "code", 283 | "source": [ 284 | "y=20" 285 | ], 286 | "metadata": { 287 | "id": "4ZNx3GJHwHHW" 288 | }, 289 | "execution_count": 14, 290 | "outputs": [] 291 | }, 292 | { 293 | "cell_type": "code", 294 | "source": [ 295 | "x+y" 296 | ], 297 | "metadata": { 298 | "colab": { 299 | "base_uri": "https://localhost:8080/" 300 | }, 301 | "id": "Up70IJb-wJkO", 302 | "outputId": "c20a250c-5f3d-4f98-af1c-9a4ea5f5a73f" 303 | }, 304 | "execution_count": 15, 305 | "outputs": [ 306 | { 307 | "output_type": "execute_result", 308 | "data": { 309 | "text/plain": [ 310 | "30" 311 | ] 312 | }, 313 | "metadata": {}, 314 | "execution_count": 15 315 | } 316 | ] 317 | }, 318 | { 319 | "cell_type": "code", 320 | "source": [ 321 | "x-y" 322 | ], 323 | "metadata": { 324 | "colab": { 325 | "base_uri": "https://localhost:8080/" 326 | }, 327 | "id": "AnIdsX_ywLlO", 328 | "outputId": "8f2e07d8-d55c-497e-985b-e539ee8fe8b3" 329 | }, 330 | "execution_count": 16, 331 | "outputs": [ 332 | { 333 | "output_type": "execute_result", 334 | "data": { 335 | "text/plain": [ 336 | "-10" 337 | ] 338 | }, 339 | "metadata": {}, 340 | "execution_count": 16 341 | } 342 | ] 343 | }, 344 | { 345 | "cell_type": "code", 346 | "source": [ 347 | "x*y" 348 | ], 349 | "metadata": { 350 | "colab": { 351 | "base_uri": "https://localhost:8080/" 352 | }, 353 | "id": "Om5n9PWnxJWr", 354 | "outputId": "7a5ba68a-6bcf-4e50-bb3e-3235a955942b" 355 | }, 356 | "execution_count": 17, 357 | "outputs": [ 358 | { 359 | "output_type": "execute_result", 360 | "data": { 361 | "text/plain": [ 362 | "200" 363 | ] 364 | }, 365 | "metadata": {}, 366 | "execution_count": 17 367 | } 368 | ] 369 | }, 370 | { 371 | "cell_type": "code", 372 | "source": [ 373 | "x/y" 374 | ], 375 | "metadata": { 376 | "colab": { 377 | "base_uri": "https://localhost:8080/" 378 | }, 379 | "id": "4Frqo9oCxP7w", 380 | "outputId": "2d84993e-92ff-44f5-c42b-fe9bdee76fc2" 381 | }, 382 | "execution_count": 18, 383 | "outputs": [ 384 | { 385 | "output_type": "execute_result", 386 | "data": { 387 | "text/plain": [ 388 | "0.5" 389 | ] 390 | }, 391 | "metadata": {}, 392 | "execution_count": 18 393 | } 394 | ] 395 | }, 396 | { 397 | "cell_type": "code", 398 | "source": [ 399 | "x=8" 400 | ], 401 | "metadata": { 402 | "id": "kr89t4E9xTDQ" 403 | }, 404 | "execution_count": 19, 405 | "outputs": [] 406 | }, 407 | { 408 | "cell_type": "code", 409 | "source": [ 410 | "y=4" 411 | ], 412 | "metadata": { 413 | "id": "eBT6lFmkyGnI" 414 | }, 415 | "execution_count": 20, 416 | "outputs": [] 417 | }, 418 | { 419 | "cell_type": "code", 420 | "source": [ 421 | "z=6" 422 | ], 423 | "metadata": { 424 | "id": "fZZJbD1QyIXI" 425 | }, 426 | "execution_count": 21, 427 | "outputs": [] 428 | }, 429 | { 430 | "cell_type": "code", 431 | "source": [ 432 | "x+y-z" 433 | ], 434 | "metadata": { 435 | "colab": { 436 | "base_uri": "https://localhost:8080/" 437 | }, 438 | "id": "th1nFIOKyLFv", 439 | "outputId": "042f3d67-0773-439e-c847-ddb47a98297d" 440 | }, 441 | "execution_count": 22, 442 | "outputs": [ 443 | { 444 | "output_type": "execute_result", 445 | "data": { 446 | "text/plain": [ 447 | "6" 448 | ] 449 | }, 450 | "metadata": {}, 451 | "execution_count": 22 452 | } 453 | ] 454 | }, 455 | { 456 | "cell_type": "code", 457 | "source": [ 458 | "p=10000" 459 | ], 460 | "metadata": { 461 | "id": "x1cOpLxHyPhw" 462 | }, 463 | "execution_count": 23, 464 | "outputs": [] 465 | }, 466 | { 467 | "cell_type": "code", 468 | "source": [ 469 | "n=5" 470 | ], 471 | "metadata": { 472 | "id": "84JjF5-rzbE8" 473 | }, 474 | "execution_count": 24, 475 | "outputs": [] 476 | }, 477 | { 478 | "cell_type": "code", 479 | "source": [ 480 | "r=9/100" 481 | ], 482 | "metadata": { 483 | "id": "JT-5L3Klzc5u" 484 | }, 485 | "execution_count": 25, 486 | "outputs": [] 487 | }, 488 | { 489 | "cell_type": "code", 490 | "source": [ 491 | "i=p*n*r" 492 | ], 493 | "metadata": { 494 | "id": "0oZRxOBu3c28" 495 | }, 496 | "execution_count": 26, 497 | "outputs": [] 498 | }, 499 | { 500 | "cell_type": "code", 501 | "source": [ 502 | "i" 503 | ], 504 | "metadata": { 505 | "colab": { 506 | "base_uri": "https://localhost:8080/" 507 | }, 508 | "id": "J_7e3HNh3ids", 509 | "outputId": "022c34a1-c40f-4c46-9f88-89dee803b4e6" 510 | }, 511 | "execution_count": 27, 512 | "outputs": [ 513 | { 514 | "output_type": "execute_result", 515 | "data": { 516 | "text/plain": [ 517 | "4500.0" 518 | ] 519 | }, 520 | "metadata": {}, 521 | "execution_count": 27 522 | } 523 | ] 524 | }, 525 | { 526 | "cell_type": "code", 527 | "source": [ 528 | "p+i" 529 | ], 530 | "metadata": { 531 | "colab": { 532 | "base_uri": "https://localhost:8080/" 533 | }, 534 | "id": "AcJ2wEv03kwU", 535 | "outputId": "24a9b185-c2df-44b9-c3ca-bb04a41be90b" 536 | }, 537 | "execution_count": 28, 538 | "outputs": [ 539 | { 540 | "output_type": "execute_result", 541 | "data": { 542 | "text/plain": [ 543 | "14500.0" 544 | ] 545 | }, 546 | "metadata": {}, 547 | "execution_count": 28 548 | } 549 | ] 550 | }, 551 | { 552 | "cell_type": "code", 553 | "source": [ 554 | "x=\"india\"" 555 | ], 556 | "metadata": { 557 | "id": "9eCPk1ad9mqp" 558 | }, 559 | "execution_count": 29, 560 | "outputs": [] 561 | }, 562 | { 563 | "cell_type": "code", 564 | "source": [ 565 | "x" 566 | ], 567 | "metadata": { 568 | "colab": { 569 | "base_uri": "https://localhost:8080/", 570 | "height": 35 571 | }, 572 | "id": "uerjuygm95rI", 573 | "outputId": "d8cac5d8-4931-4f2a-cfc9-4ee91667c1da" 574 | }, 575 | "execution_count": 30, 576 | "outputs": [ 577 | { 578 | "output_type": "execute_result", 579 | "data": { 580 | "application/vnd.google.colaboratory.intrinsic+json": { 581 | "type": "string" 582 | }, 583 | "text/plain": [ 584 | "'india'" 585 | ] 586 | }, 587 | "metadata": {}, 588 | "execution_count": 30 589 | } 590 | ] 591 | }, 592 | { 593 | "cell_type": "code", 594 | "source": [ 595 | "x=10" 596 | ], 597 | "metadata": { 598 | "id": "a_ECfA699-j4" 599 | }, 600 | "execution_count": 31, 601 | "outputs": [] 602 | }, 603 | { 604 | "cell_type": "code", 605 | "source": [ 606 | "y=10.5" 607 | ], 608 | "metadata": { 609 | "id": "ORNE5w7--yZ4" 610 | }, 611 | "execution_count": 32, 612 | "outputs": [] 613 | }, 614 | { 615 | "cell_type": "code", 616 | "source": [ 617 | "z=\"india\"" 618 | ], 619 | "metadata": { 620 | "id": "TRlWaJCG-1c2" 621 | }, 622 | "execution_count": 33, 623 | "outputs": [] 624 | }, 625 | { 626 | "cell_type": "code", 627 | "source": [ 628 | "type(x)" 629 | ], 630 | "metadata": { 631 | "colab": { 632 | "base_uri": "https://localhost:8080/" 633 | }, 634 | "id": "TjHgbrvS--S-", 635 | "outputId": "182a1715-4833-4681-e893-90da9b535d78" 636 | }, 637 | "execution_count": 34, 638 | "outputs": [ 639 | { 640 | "output_type": "execute_result", 641 | "data": { 642 | "text/plain": [ 643 | "int" 644 | ] 645 | }, 646 | "metadata": {}, 647 | "execution_count": 34 648 | } 649 | ] 650 | }, 651 | { 652 | "cell_type": "code", 653 | "source": [ 654 | "type(y)" 655 | ], 656 | "metadata": { 657 | "colab": { 658 | "base_uri": "https://localhost:8080/" 659 | }, 660 | "id": "zTpY1181_XFA", 661 | "outputId": "3aaf4f77-6887-488d-a784-def287068999" 662 | }, 663 | "execution_count": 35, 664 | "outputs": [ 665 | { 666 | "output_type": "execute_result", 667 | "data": { 668 | "text/plain": [ 669 | "float" 670 | ] 671 | }, 672 | "metadata": {}, 673 | "execution_count": 35 674 | } 675 | ] 676 | }, 677 | { 678 | "cell_type": "code", 679 | "source": [ 680 | "type(z)" 681 | ], 682 | "metadata": { 683 | "colab": { 684 | "base_uri": "https://localhost:8080/" 685 | }, 686 | "id": "OFrSXxIF__QH", 687 | "outputId": "3310d805-95cf-41d9-8c5e-b153828c429a" 688 | }, 689 | "execution_count": 36, 690 | "outputs": [ 691 | { 692 | "output_type": "execute_result", 693 | "data": { 694 | "text/plain": [ 695 | "str" 696 | ] 697 | }, 698 | "metadata": {}, 699 | "execution_count": 36 700 | } 701 | ] 702 | }, 703 | { 704 | "cell_type": "code", 705 | "source": [ 706 | "x=input(\"enter a name\")" 707 | ], 708 | "metadata": { 709 | "colab": { 710 | "base_uri": "https://localhost:8080/" 711 | }, 712 | "id": "iDycyZSyAxA3", 713 | "outputId": "bef903a0-6574-456b-d21e-9b41c62f40a3" 714 | }, 715 | "execution_count": 37, 716 | "outputs": [ 717 | { 718 | "name": "stdout", 719 | "output_type": "stream", 720 | "text": [ 721 | "enter a nameanjo\n" 722 | ] 723 | } 724 | ] 725 | }, 726 | { 727 | "cell_type": "code", 728 | "source": [ 729 | "x" 730 | ], 731 | "metadata": { 732 | "colab": { 733 | "base_uri": "https://localhost:8080/", 734 | "height": 35 735 | }, 736 | "id": "stZsSwTZdCBV", 737 | "outputId": "7c1e5cbd-f60d-4b14-eb94-012034c219e1" 738 | }, 739 | "execution_count": 38, 740 | "outputs": [ 741 | { 742 | "output_type": "execute_result", 743 | "data": { 744 | "application/vnd.google.colaboratory.intrinsic+json": { 745 | "type": "string" 746 | }, 747 | "text/plain": [ 748 | "'anjo'" 749 | ] 750 | }, 751 | "metadata": {}, 752 | "execution_count": 38 753 | } 754 | ] 755 | }, 756 | { 757 | "cell_type": "code", 758 | "source": [ 759 | "" 760 | ], 761 | "metadata": { 762 | "id": "EOAVGlVOdK39" 763 | }, 764 | "execution_count": 38, 765 | "outputs": [] 766 | } 767 | ] 768 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 anjobaiju 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Introduction-to-Python 2 | Python is a popular programming language. Python can be used on a server to create web applications. 3 | -------------------------------------------------------------------------------- /if_logic.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "name": "if logic.ipynb", 7 | "provenance": [] 8 | }, 9 | "kernelspec": { 10 | "name": "python3", 11 | "display_name": "Python 3" 12 | }, 13 | "language_info": { 14 | "name": "python" 15 | } 16 | }, 17 | "cells": [ 18 | { 19 | "cell_type": "code", 20 | "execution_count": 5, 21 | "metadata": { 22 | "id": "tloZqZunxZtt" 23 | }, 24 | "outputs": [], 25 | "source": [ 26 | "x=20" 27 | ] 28 | }, 29 | { 30 | "cell_type": "code", 31 | "source": [ 32 | "if x>10:\n", 33 | " print(\"x>10\")" 34 | ], 35 | "metadata": { 36 | "colab": { 37 | "base_uri": "https://localhost:8080/" 38 | }, 39 | "id": "kCW9EovH0UKD", 40 | "outputId": "1c71a76b-427e-4c98-825f-d8c661dd0d3e" 41 | }, 42 | "execution_count": 6, 43 | "outputs": [ 44 | { 45 | "output_type": "stream", 46 | "name": "stdout", 47 | "text": [ 48 | "x>10\n" 49 | ] 50 | } 51 | ] 52 | }, 53 | { 54 | "cell_type": "code", 55 | "source": [ 56 | "x=20" 57 | ], 58 | "metadata": { 59 | "id": "l7fGwH5g08WR" 60 | }, 61 | "execution_count": 7, 62 | "outputs": [] 63 | }, 64 | { 65 | "cell_type": "code", 66 | "source": [ 67 | "if x>10:\n", 68 | " print(\"x>10\")\n", 69 | "if x<10:\n", 70 | " print(\"x<10\")\n", 71 | "if x==10:\n", 72 | " print(\"x=10\")" 73 | ], 74 | "metadata": { 75 | "colab": { 76 | "base_uri": "https://localhost:8080/" 77 | }, 78 | "id": "rWUFPmbz3H95", 79 | "outputId": "845cea9c-5bb5-48e5-bcf0-39a507b4cc39" 80 | }, 81 | "execution_count": 11, 82 | "outputs": [ 83 | { 84 | "output_type": "stream", 85 | "name": "stdout", 86 | "text": [ 87 | "x>10\n" 88 | ] 89 | } 90 | ] 91 | }, 92 | { 93 | "cell_type": "code", 94 | "source": [ 95 | "x=int(input(\"Enter your value \"))\n", 96 | "if x>10:\n", 97 | " print(\"Pass\")\n", 98 | "if x<10:\n", 99 | " print(\"Fail\")\n", 100 | "if x==10:\n", 101 | " print(\"Just Pass\")" 102 | ], 103 | "metadata": { 104 | "colab": { 105 | "base_uri": "https://localhost:8080/" 106 | }, 107 | "id": "cy-rr8O96FGm", 108 | "outputId": "a871ee8d-e7f1-4729-a369-bae69f0e3976" 109 | }, 110 | "execution_count": 20, 111 | "outputs": [ 112 | { 113 | "output_type": "stream", 114 | "name": "stdout", 115 | "text": [ 116 | "Enter your value 58\n", 117 | "Pass\n" 118 | ] 119 | } 120 | ] 121 | }, 122 | { 123 | "cell_type": "code", 124 | "source": [ 125 | "x=int(input(\"enter your salary \"))\n", 126 | "if x<250000:\n", 127 | " print(\"you are not taxable\")\n", 128 | "if x>250000:\n", 129 | " print(\"your are taxable\")\n", 130 | " print (x*10/100)" 131 | ], 132 | "metadata": { 133 | "colab": { 134 | "base_uri": "https://localhost:8080/" 135 | }, 136 | "id": "A2mgyYVa_IlU", 137 | "outputId": "22266d44-01cd-4bc0-ab0b-471295b6c304" 138 | }, 139 | "execution_count": 21, 140 | "outputs": [ 141 | { 142 | "output_type": "stream", 143 | "name": "stdout", 144 | "text": [ 145 | "enter your salary 5500000\n", 146 | "your are taxable\n", 147 | "550000.0\n" 148 | ] 149 | } 150 | ] 151 | }, 152 | { 153 | "cell_type": "code", 154 | "source": [ 155 | "" 156 | ], 157 | "metadata": { 158 | "id": "CrJUrpLAEztk" 159 | }, 160 | "execution_count": 21, 161 | "outputs": [] 162 | } 163 | ] 164 | } -------------------------------------------------------------------------------- /python02.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "name": "python02.ipynb", 7 | "provenance": [] 8 | }, 9 | "kernelspec": { 10 | "name": "python3", 11 | "display_name": "Python 3" 12 | }, 13 | "language_info": { 14 | "name": "python" 15 | } 16 | }, 17 | "cells": [ 18 | { 19 | "cell_type": "code", 20 | "source": [ 21 | "x=\"india\"" 22 | ], 23 | "metadata": { 24 | "id": "UZWWY6CrHJNZ" 25 | }, 26 | "execution_count": 4, 27 | "outputs": [] 28 | }, 29 | { 30 | "cell_type": "code", 31 | "source": [ 32 | "y=\"kerala\"" 33 | ], 34 | "metadata": { 35 | "id": "N1piI18MHT5A" 36 | }, 37 | "execution_count": 5, 38 | "outputs": [] 39 | }, 40 | { 41 | "cell_type": "code", 42 | "source": [ 43 | "x+y" 44 | ], 45 | "metadata": { 46 | "colab": { 47 | "base_uri": "https://localhost:8080/", 48 | "height": 35 49 | }, 50 | "id": "858ZBUPsHXQI", 51 | "outputId": "4184cdfa-0bd1-4877-f64d-a9f7b3c5ded0" 52 | }, 53 | "execution_count": 6, 54 | "outputs": [ 55 | { 56 | "output_type": "execute_result", 57 | "data": { 58 | "text/plain": [ 59 | "'indiakerala'" 60 | ], 61 | "application/vnd.google.colaboratory.intrinsic+json": { 62 | "type": "string" 63 | } 64 | }, 65 | "metadata": {}, 66 | "execution_count": 6 67 | } 68 | ] 69 | }, 70 | { 71 | "cell_type": "code", 72 | "source": [ 73 | "x=input(\"enter the first number\")" 74 | ], 75 | "metadata": { 76 | "colab": { 77 | "base_uri": "https://localhost:8080/" 78 | }, 79 | "id": "iNMu0uWdHZ7A", 80 | "outputId": "4ef865c9-a635-41f1-f1bd-e6b4ac6d2fb8" 81 | }, 82 | "execution_count": 7, 83 | "outputs": [ 84 | { 85 | "name": "stdout", 86 | "output_type": "stream", 87 | "text": [ 88 | "enter the first number8\n" 89 | ] 90 | } 91 | ] 92 | }, 93 | { 94 | "cell_type": "code", 95 | "source": [ 96 | "y=input(\"enter the second number\")" 97 | ], 98 | "metadata": { 99 | "colab": { 100 | "base_uri": "https://localhost:8080/" 101 | }, 102 | "id": "FED8MzgCIuZe", 103 | "outputId": "2cb3be00-cc38-4615-b3dc-8df05399166c" 104 | }, 105 | "execution_count": 8, 106 | "outputs": [ 107 | { 108 | "name": "stdout", 109 | "output_type": "stream", 110 | "text": [ 111 | "enter the second number12\n" 112 | ] 113 | } 114 | ] 115 | }, 116 | { 117 | "cell_type": "code", 118 | "source": [ 119 | "x+y" 120 | ], 121 | "metadata": { 122 | "colab": { 123 | "base_uri": "https://localhost:8080/", 124 | "height": 35 125 | }, 126 | "id": "RoYKJGvXJFuf", 127 | "outputId": "ed05e031-0b74-433b-82e8-ef099981543f" 128 | }, 129 | "execution_count": 9, 130 | "outputs": [ 131 | { 132 | "output_type": "execute_result", 133 | "data": { 134 | "text/plain": [ 135 | "'812'" 136 | ], 137 | "application/vnd.google.colaboratory.intrinsic+json": { 138 | "type": "string" 139 | } 140 | }, 141 | "metadata": {}, 142 | "execution_count": 9 143 | } 144 | ] 145 | }, 146 | { 147 | "cell_type": "code", 148 | "source": [ 149 | "type(x)" 150 | ], 151 | "metadata": { 152 | "colab": { 153 | "base_uri": "https://localhost:8080/" 154 | }, 155 | "id": "a0wif00ULRHX", 156 | "outputId": "896a585d-bb04-4325-de33-b03e49b132da" 157 | }, 158 | "execution_count": 10, 159 | "outputs": [ 160 | { 161 | "output_type": "execute_result", 162 | "data": { 163 | "text/plain": [ 164 | "str" 165 | ] 166 | }, 167 | "metadata": {}, 168 | "execution_count": 10 169 | } 170 | ] 171 | }, 172 | { 173 | "cell_type": "code", 174 | "source": [ 175 | "type(y)" 176 | ], 177 | "metadata": { 178 | "colab": { 179 | "base_uri": "https://localhost:8080/" 180 | }, 181 | "id": "5aTk-amKLZ8e", 182 | "outputId": "96214bdf-37ad-40d3-b30f-73d8831b1673" 183 | }, 184 | "execution_count": 11, 185 | "outputs": [ 186 | { 187 | "output_type": "execute_result", 188 | "data": { 189 | "text/plain": [ 190 | "str" 191 | ] 192 | }, 193 | "metadata": {}, 194 | "execution_count": 11 195 | } 196 | ] 197 | }, 198 | { 199 | "cell_type": "code", 200 | "source": [ 201 | "int(x)+int(y)" 202 | ], 203 | "metadata": { 204 | "colab": { 205 | "base_uri": "https://localhost:8080/" 206 | }, 207 | "id": "WUCAIorFLcRW", 208 | "outputId": "76127d4a-d364-4cbc-c917-adea2aad5f85" 209 | }, 210 | "execution_count": 12, 211 | "outputs": [ 212 | { 213 | "output_type": "execute_result", 214 | "data": { 215 | "text/plain": [ 216 | "20" 217 | ] 218 | }, 219 | "metadata": {}, 220 | "execution_count": 12 221 | } 222 | ] 223 | }, 224 | { 225 | "cell_type": "code", 226 | "source": [ 227 | "int(x)-int(y)" 228 | ], 229 | "metadata": { 230 | "colab": { 231 | "base_uri": "https://localhost:8080/" 232 | }, 233 | "id": "DHkL9-cKO9xd", 234 | "outputId": "1357f1cd-d9e8-408f-b7ec-ecac3bd07728" 235 | }, 236 | "execution_count": 15, 237 | "outputs": [ 238 | { 239 | "output_type": "execute_result", 240 | "data": { 241 | "text/plain": [ 242 | "-4" 243 | ] 244 | }, 245 | "metadata": {}, 246 | "execution_count": 15 247 | } 248 | ] 249 | }, 250 | { 251 | "cell_type": "code", 252 | "source": [ 253 | "int(x)*int(y)" 254 | ], 255 | "metadata": { 256 | "colab": { 257 | "base_uri": "https://localhost:8080/" 258 | }, 259 | "id": "933aL4X5PQP1", 260 | "outputId": "fc2ea2a5-355c-4d41-bf1c-1679661e2885" 261 | }, 262 | "execution_count": 16, 263 | "outputs": [ 264 | { 265 | "output_type": "execute_result", 266 | "data": { 267 | "text/plain": [ 268 | "96" 269 | ] 270 | }, 271 | "metadata": {}, 272 | "execution_count": 16 273 | } 274 | ] 275 | }, 276 | { 277 | "cell_type": "code", 278 | "source": [ 279 | "int(x)/int(y)" 280 | ], 281 | "metadata": { 282 | "colab": { 283 | "base_uri": "https://localhost:8080/" 284 | }, 285 | "id": "QsEx4vr9Ppwk", 286 | "outputId": "27f6eab0-9e31-4132-feb7-7609032f2886" 287 | }, 288 | "execution_count": 17, 289 | "outputs": [ 290 | { 291 | "output_type": "execute_result", 292 | "data": { 293 | "text/plain": [ 294 | "0.6666666666666666" 295 | ] 296 | }, 297 | "metadata": {}, 298 | "execution_count": 17 299 | } 300 | ] 301 | }, 302 | { 303 | "cell_type": "code", 304 | "source": [ 305 | "x=input(\"enter a number\")\n", 306 | "y=input(\"enter a number\")\n", 307 | "print(int(x)+int(y))\n", 308 | "print(int(x)-int(y))\n", 309 | "print(int(x)*int(y))\n", 310 | "print(int(x)/int(y))" 311 | ], 312 | "metadata": { 313 | "colab": { 314 | "base_uri": "https://localhost:8080/" 315 | }, 316 | "id": "saDiX5nrQkbu", 317 | "outputId": "84bc8c5d-9bbf-4334-e516-691db5f5771a" 318 | }, 319 | "execution_count": 21, 320 | "outputs": [ 321 | { 322 | "output_type": "stream", 323 | "name": "stdout", 324 | "text": [ 325 | "enter a number45\n", 326 | "enter a number65\n", 327 | "110\n", 328 | "-20\n", 329 | "2925\n", 330 | "0.6923076923076923\n" 331 | ] 332 | } 333 | ] 334 | }, 335 | { 336 | "cell_type": "code", 337 | "source": [ 338 | "" 339 | ], 340 | "metadata": { 341 | "id": "bCjDsO3hVpar" 342 | }, 343 | "execution_count": 21, 344 | "outputs": [] 345 | } 346 | ] 347 | } -------------------------------------------------------------------------------- /python_03.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "name": "python 03.ipynb", 7 | "provenance": [] 8 | }, 9 | "kernelspec": { 10 | "name": "python3", 11 | "display_name": "Python 3" 12 | }, 13 | "language_info": { 14 | "name": "python" 15 | } 16 | }, 17 | "cells": [ 18 | { 19 | "cell_type": "code", 20 | "execution_count": null, 21 | "metadata": { 22 | "colab": { 23 | "base_uri": "https://localhost:8080/" 24 | }, 25 | "id": "hAIipKVuIZct", 26 | "outputId": "343cb24f-3067-4c3d-8d69-21d82802b05e" 27 | }, 28 | "outputs": [ 29 | { 30 | "name": "stdout", 31 | "output_type": "stream", 32 | "text": [ 33 | "enter your basic salary800000\n" 34 | ] 35 | } 36 | ], 37 | "source": [ 38 | "x=int(input(\"enter your basic salary\"))" 39 | ] 40 | }, 41 | { 42 | "cell_type": "code", 43 | "source": [ 44 | "if x>300000:\n", 45 | " print(\"you are taxable\")\n", 46 | "if x<300000:\n", 47 | " print(\"you are not taxable\")\n" 48 | ], 49 | "metadata": { 50 | "colab": { 51 | "base_uri": "https://localhost:8080/" 52 | }, 53 | "id": "N5evcWrZK8LY", 54 | "outputId": "25b0a5b7-6e1c-494a-f852-b142b58624cf" 55 | }, 56 | "execution_count": null, 57 | "outputs": [ 58 | { 59 | "output_type": "stream", 60 | "name": "stdout", 61 | "text": [ 62 | "you are taxable\n" 63 | ] 64 | } 65 | ] 66 | }, 67 | { 68 | "cell_type": "code", 69 | "source": [ 70 | "x=int(input(\"enter your basic salary\"))\n", 71 | "if x>300000:\n", 72 | " print(\"you are taxable\")\n", 73 | " print((x-300000)*10/100)\n", 74 | "if x<300000:\n", 75 | " print(\"you are not taxable\")\n" 76 | ], 77 | "metadata": { 78 | "colab": { 79 | "base_uri": "https://localhost:8080/" 80 | }, 81 | "id": "Pe60dkvrN7JC", 82 | "outputId": "3610ea87-b48c-4e09-f2c8-fefe9f6a649d" 83 | }, 84 | "execution_count": null, 85 | "outputs": [ 86 | { 87 | "output_type": "stream", 88 | "name": "stdout", 89 | "text": [ 90 | "enter your basic salary900000\n", 91 | "you are taxable\n", 92 | "60000.0\n" 93 | ] 94 | } 95 | ] 96 | }, 97 | { 98 | "cell_type": "code", 99 | "source": [ 100 | "x=int(input(\"enter your basic salary\"))\n", 101 | "if 300000900000:\n", 105 | " print((((x-300000)*10/100)-900000)*20/100)\n", 106 | "if x<300000:\n", 107 | " print(\"you are not taxable\")\n", 108 | " " 109 | ], 110 | "metadata": { 111 | "colab": { 112 | "base_uri": "https://localhost:8080/" 113 | }, 114 | "id": "py1jxN8uV-xK", 115 | "outputId": "5bfc3c1a-1e8a-4609-b00b-784c801cf28c" 116 | }, 117 | "execution_count": null, 118 | "outputs": [ 119 | { 120 | "output_type": "stream", 121 | "name": "stdout", 122 | "text": [ 123 | "enter your basic salary10000000\n", 124 | "14000.0\n" 125 | ] 126 | } 127 | ] 128 | } 129 | ] 130 | } --------------------------------------------------------------------------------