From 33997e8096b3b900097f09496010b772029a15e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Mon, 5 Jul 2021 14:19:19 +0530 Subject: [PATCH 01/49] Update README.md --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 51208c8..64988c2 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,17 @@ +

+ milaan9 + milaan9 + +Stars Badge +Forks Badge + +Pull Requests Badge +Issues Badge +

+ + + + # 04_Python_Functions ## Introduction ๐Ÿ‘‹ From 462602acf3d90c8ea1dc2a31695881bf3f502511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Mon, 5 Jul 2021 23:38:19 +0530 Subject: [PATCH 02/49] Update README.md --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 64988c2..951f6a8 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,19 @@

- milaan9 - milaan9 - -Stars Badge +Last Commit + + +Stars Badge Forks Badge - -Pull Requests Badge -Issues Badge +Size +Pull Requests Badge +Issues Badge +Language

+ # 04_Python_Functions ## Introduction ๐Ÿ‘‹ From 13b73b049395eddb5168300b9bfb49bc2ea25769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Mon, 5 Jul 2021 23:43:44 +0530 Subject: [PATCH 03/49] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 951f6a8..1d3f55b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Last Commit -Stars Badge +Stars Badge Forks Badge Size Pull Requests Badge From f8f8d7e3e9c51e0120fac7378896e2422f54ee83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Wed, 7 Jul 2021 19:39:26 +0530 Subject: [PATCH 04/49] Update README.md --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1d3f55b..6bb1101 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,18 @@

-Last Commit +Last Commit +Last Commit - -Stars Badge + +Stars Badge Forks Badge Size Pull Requests Badge Issues Badge -Language +Language

- - # 04_Python_Functions ## Introduction ๐Ÿ‘‹ From ce9080f8ea574c956732b4d4634067c001ddd2a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Sun, 1 Aug 2021 21:30:34 +0530 Subject: [PATCH 05/49] Create README.md --- 002_Python_Functions_Built_in/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 002_Python_Functions_Built_in/README.md diff --git a/002_Python_Functions_Built_in/README.md b/002_Python_Functions_Built_in/README.md new file mode 100644 index 0000000..acd18c6 --- /dev/null +++ b/002_Python_Functions_Built_in/README.md @@ -0,0 +1,10 @@ +

+Last Commit + +

+ + + +# 01 Python Built-in Functions + +In this class, you'll learn how to Convert IPython to PDF using python. From b5bccabf83514c83bb06a9e189df9dd3d364769e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Sun, 1 Aug 2021 21:31:44 +0530 Subject: [PATCH 06/49] Update README.md --- 002_Python_Functions_Built_in/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/002_Python_Functions_Built_in/README.md b/002_Python_Functions_Built_in/README.md index acd18c6..40165da 100644 --- a/002_Python_Functions_Built_in/README.md +++ b/002_Python_Functions_Built_in/README.md @@ -7,4 +7,4 @@ # 01 Python Built-in Functions -In this class, you'll learn how to Convert IPython to PDF using python. +In this class, you'll learn about python built-in functions. From 9f12e7a0abdd9a1ef56b53838aca6e63c5919ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Sun, 1 Aug 2021 21:31:59 +0530 Subject: [PATCH 07/49] Update README.md --- 002_Python_Functions_Built_in/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/002_Python_Functions_Built_in/README.md b/002_Python_Functions_Built_in/README.md index 40165da..1a346bf 100644 --- a/002_Python_Functions_Built_in/README.md +++ b/002_Python_Functions_Built_in/README.md @@ -5,6 +5,6 @@ -# 01 Python Built-in Functions +# Python Built-in Functions In this class, you'll learn about python built-in functions. From 5422df8949946847fdfecb5fa8e9e1886170755e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Tue, 10 Aug 2021 10:21:48 +0530 Subject: [PATCH 08/49] Update LICENSE --- LICENSE | 70 +++++++++++++++++---------------------------------------- 1 file changed, 21 insertions(+), 49 deletions(-) diff --git a/LICENSE b/LICENSE index 1642570..257d417 100644 --- a/LICENSE +++ b/LICENSE @@ -1,49 +1,21 @@ -The instructions and text in this tutorial (the "software") are licensed -under the zlib License. - - (C) 2019-2021 milaan9 - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - - -The code examples (the "software") are unlicensed: - - This is free and unencumbered software released into the public domain. - - Anyone is free to copy, modify, publish, use, compile, sell, or - distribute this software, either in source code form or as a compiled - binary, for any purpose, commercial or non-commercial, and by any - means. - - In jurisdictions that recognize copyright laws, the author or authors - of this software dedicate any and all copyright interest in the - software to the public domain. We make this dedication for the benefit - of the public at large and to the detriment of our heirs and - successors. We intend this dedication to be an overt act of - relinquishment in perpetuity of all present and future rights to this - software under copyright law. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR - OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - OTHER DEALINGS IN THE SOFTWARE. - - For more information, please refer to +MIT License + +Copyright (c) 2021 milaan9 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 28b190e74dfce0e9de2746bfe061a09c1f189f0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Wed, 18 Aug 2021 21:42:12 +0530 Subject: [PATCH 09/49] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6bb1101..fffcf12 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,10 @@ Language

- + +

+binder +

# 04_Python_Functions From c105d78ca3efae13de80665a0f5014fb212af67b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Wed, 18 Aug 2021 22:23:48 +0530 Subject: [PATCH 10/49] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fffcf12..657b3ec 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@

-binder +binder

# 04_Python_Functions From ed4710e0633a42953ec13403403803d8c83085c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Thu, 26 Aug 2021 12:07:51 +0530 Subject: [PATCH 11/49] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 657b3ec..e28fa1d 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Pull Requests Badge Issues Badge Language +MIT License

From b0b29e29483ace38d3e21860a6645ca78fb63f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Thu, 26 Aug 2021 12:12:22 +0530 Subject: [PATCH 12/49] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e28fa1d..946eb28 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Size Pull Requests Badge Issues Badge -Language +Language MIT License

From 5875e07f55794e0a10e5f2744c1f01df5194cbe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Sat, 28 Aug 2021 12:59:31 +0530 Subject: [PATCH 13/49] Update README.md --- README.md | 53 ++++++++++++++++++----------------------------------- 1 file changed, 18 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 946eb28..34213ca 100644 --- a/README.md +++ b/README.md @@ -30,41 +30,24 @@ Function improves efficiency and reduces errors because of the reusability of a ## Table of contents ๐Ÿ“‹ - -[001_Python_Functions](https://github.com/milaan9/04_Python_Functions/blob/main/001_Python_Functions.ipynb) - - -[002_Python_Function_Global_Local_Nonlocal](https://github.com/milaan9/04_Python_Functions/blob/main/002_Python_Function_Global_Local_Nonlocal.ipynb) - - -[003_Python_Function_global_Keywords](https://github.com/milaan9/04_Python_Functions/blob/main/003_Python_Function_global_Keywords.ipynb) - - -[004_Python_Function_Arguments](https://github.com/milaan9/04_Python_Functions/blob/main/004_Python_Function_Arguments.ipynb) - - -[005_Python_Function_Recursion](https://github.com/milaan9/04_Python_Functions/blob/main/005_Python_Function_Recursion.ipynb) - - -[006_Python_Function_Anonymous](https://github.com/milaan9/04_Python_Functions/blob/main/006_Python_Function_Anonymous.ipynb) - - -[007_Python_Function_Module](https://github.com/milaan9/04_Python_Functions/blob/main/007_Python_Function_Module.ipynb) - - -[008_Python_Function_random_Module](https://github.com/milaan9/04_Python_Functions/blob/main/008_Python_Function_random_Module.ipynb) - - -[009_Python_Function_math_Module.ipynb](https://github.com/milaan9/04_Python_Functions/blob/main/009_Python_Function_math_Module.ipynb.ipynb) - - -[010_Python_Function_Package](https://github.com/milaan9/04_Python_Functions/blob/main/010_Python_Function_Package.ipynb) - - -[Python_Docstrings](https://github.com/milaan9/04_Python_Functions/blob/main/Python_Docstrings.ipynb) - - -These are online read-only versions. +| **No.** | **Name** | +| ------- | -------- | +| 01 | **[Python_Functions](https://github.com/milaan9/04_Python_Functions/blob/main/001_Python_Functions.ipynb)** | +| | 1.1 **[Python_Docstrings](https://github.com/milaan9/04_Python_Functions/blob/main/Python_Docstrings.ipynb)** | +| | 1.2 **[Python_Built-In_Functions](https://github.com/milaan9/04_Python_Functions/tree/main/002_Python_Functions_Built_in)** | +| | 1.3 **[Python_User-Defined_Functions](https://github.com/milaan9/04_Python_Functions/blob/main/Python_User_defined_Functions.ipynb)** | +| 02 | **[002_Python_Function_Global_Local_Nonlocal](https://github.com/milaan9/04_Python_Functions/blob/main/002_Python_Function_Global_Local_Nonlocal.ipynb)** | +| 03 | **[003_Python_Function_global_Keywords](https://github.com/milaan9/04_Python_Functions/blob/main/003_Python_Function_global_Keywords.ipynb)** | +| 04 | **[004_Python_Function_Arguments](https://github.com/milaan9/04_Python_Functions/blob/main/004_Python_Function_Arguments.ipynb)** | +| 05 | **[005_Python_Function_Recursion](https://github.com/milaan9/04_Python_Functions/blob/main/005_Python_Function_Recursion.ipynb)** | +| 06 | **[006_Python_Function_Anonymous](https://github.com/milaan9/04_Python_Functions/blob/main/006_Python_Function_Anonymous.ipynb)** | +| 07 | **[007_Python_Function_Module](https://github.com/milaan9/04_Python_Functions/blob/main/007_Python_Function_Module.ipynb)** | +| 08 | **[008_Python_Function_random_Module](https://github.com/milaan9/04_Python_Functions/blob/main/008_Python_Function_random_Module.ipynb)** | +| 09 | **[009_Python_Function_math_Module.ipynb](https://github.com/milaan9/04_Python_Functions/blob/main/009_Python_Function_math_Module.ipynb.ipynb)** | +| 10 | **[010_Python_Function_Package](https://github.com/milaan9/04_Python_Functions/blob/main/010_Python_Function_Package.ipynb)** | + + +These are online **read-only** versions. However you can "Run โ–ถ" the code **online** by clicking here → binder ## Frequently asked questions โ” From 333196530627106344d22a624a65718fe8414d32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Sat, 28 Aug 2021 13:01:16 +0530 Subject: [PATCH 14/49] Update README.md --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 34213ca..943228f 100644 --- a/README.md +++ b/README.md @@ -36,15 +36,15 @@ Function improves efficiency and reduces errors because of the reusability of a | | 1.1 **[Python_Docstrings](https://github.com/milaan9/04_Python_Functions/blob/main/Python_Docstrings.ipynb)** | | | 1.2 **[Python_Built-In_Functions](https://github.com/milaan9/04_Python_Functions/tree/main/002_Python_Functions_Built_in)** | | | 1.3 **[Python_User-Defined_Functions](https://github.com/milaan9/04_Python_Functions/blob/main/Python_User_defined_Functions.ipynb)** | -| 02 | **[002_Python_Function_Global_Local_Nonlocal](https://github.com/milaan9/04_Python_Functions/blob/main/002_Python_Function_Global_Local_Nonlocal.ipynb)** | -| 03 | **[003_Python_Function_global_Keywords](https://github.com/milaan9/04_Python_Functions/blob/main/003_Python_Function_global_Keywords.ipynb)** | -| 04 | **[004_Python_Function_Arguments](https://github.com/milaan9/04_Python_Functions/blob/main/004_Python_Function_Arguments.ipynb)** | -| 05 | **[005_Python_Function_Recursion](https://github.com/milaan9/04_Python_Functions/blob/main/005_Python_Function_Recursion.ipynb)** | -| 06 | **[006_Python_Function_Anonymous](https://github.com/milaan9/04_Python_Functions/blob/main/006_Python_Function_Anonymous.ipynb)** | -| 07 | **[007_Python_Function_Module](https://github.com/milaan9/04_Python_Functions/blob/main/007_Python_Function_Module.ipynb)** | -| 08 | **[008_Python_Function_random_Module](https://github.com/milaan9/04_Python_Functions/blob/main/008_Python_Function_random_Module.ipynb)** | -| 09 | **[009_Python_Function_math_Module.ipynb](https://github.com/milaan9/04_Python_Functions/blob/main/009_Python_Function_math_Module.ipynb.ipynb)** | -| 10 | **[010_Python_Function_Package](https://github.com/milaan9/04_Python_Functions/blob/main/010_Python_Function_Package.ipynb)** | +| 02 | **[Python_Function_Global_Local_Nonlocal](https://github.com/milaan9/04_Python_Functions/blob/main/002_Python_Function_Global_Local_Nonlocal.ipynb)** | +| 03 | **[Python_Function_global_Keywords](https://github.com/milaan9/04_Python_Functions/blob/main/003_Python_Function_global_Keywords.ipynb)** | +| 04 | **[Python_Function_Arguments](https://github.com/milaan9/04_Python_Functions/blob/main/004_Python_Function_Arguments.ipynb)** | +| 05 | **[Python_Function_Recursion](https://github.com/milaan9/04_Python_Functions/blob/main/005_Python_Function_Recursion.ipynb)** | +| 06 | **[Python_Function_Anonymous](https://github.com/milaan9/04_Python_Functions/blob/main/006_Python_Function_Anonymous.ipynb)** | +| 07 | **[Python_Function_Module](https://github.com/milaan9/04_Python_Functions/blob/main/007_Python_Function_Module.ipynb)** | +| 08 | **[Python_Function_random_Module](https://github.com/milaan9/04_Python_Functions/blob/main/008_Python_Function_random_Module.ipynb)** | +| 09 | **[Python_Function_math_Module.ipynb](https://github.com/milaan9/04_Python_Functions/blob/main/009_Python_Function_math_Module.ipynb.ipynb)** | +| 10 | **[Python_Function_Package](https://github.com/milaan9/04_Python_Functions/blob/main/010_Python_Function_Package.ipynb)** | These are online **read-only** versions. However you can "Run โ–ถ" the code **online** by clicking here → binder From d2ae2b0483b60dda896bfd9c5f117052de0ba38e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Sat, 28 Aug 2021 16:19:03 +0530 Subject: [PATCH 15/49] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 943228f..86f69ff 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ Python has a DRY principle like other programming languages. DRY stands for Don Function improves efficiency and reduces errors because of the reusability of a code. Once we create a function, we can call it anywhere and anytime. The benefit of using a function is reusability and modularity. +--- ## Table of contents ๐Ÿ“‹ @@ -49,6 +50,7 @@ Function improves efficiency and reduces errors because of the reusability of a These are online **read-only** versions. However you can "Run โ–ถ" the code **online** by clicking here → binder +--- ## Frequently asked questions โ” @@ -58,6 +60,8 @@ You can โญ star this tutorial. Starring is free for you, but it tells me and ot Go [here](https://github.com/milaan9/04_Python_Functions) if you aren't here already and click the "โญ Star" button in the top right corner. You will be asked to create a GitHub account if you don't already have one. +--- + ### How can I read this tutorial without an Internet connection? ๐Ÿค” 1. Go [here](https://github.com/milaan9/04_Python_Functions) if you aren't here already. @@ -76,6 +80,7 @@ This will clear all the outputs and now you can understand each statement and le If you have git and you know how to use it, you can also clone the repository instead of downloading a zip and extracting it. An advantage with doing it this way is that you don't need to download the whole tutorial again to get the latest version of it, all you need to do is to pull with git and run ipython notebook again. +--- ## Authors โœ๏ธ @@ -87,6 +92,7 @@ If you have trouble with this tutorial please tell me about it by [Create an iss If you like this tutorial, please [give it a โญ star](https://github.com/milaan9/04_Python_Functions). +--- ## Licence ๐Ÿ“œ From 23c19cf8fba02435842dc0376914aafe62d1ed58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Tue, 21 Sep 2021 22:52:56 +0530 Subject: [PATCH 16/49] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 86f69ff..041ac3e 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ Go [here](https://github.com/milaan9/04_Python_Functions) if you aren't here alr 1. Go [here](https://github.com/milaan9/04_Python_Functions) if you aren't here already. -2. Click the big green "Clone or download" button in the top right of the page, then click "[Download ZIP](https://github.com/milaan9/04_Python_Functions/archive/refs/heads/main.zip)". +2. Click the big green "Code" button in the top right of the page, then click "[Download ZIP](https://github.com/milaan9/04_Python_Functions/archive/refs/heads/main.zip)". ![Download ZIP](img/dnld_rep.png) @@ -74,7 +74,7 @@ Go [here](https://github.com/milaan9/04_Python_Functions) if you aren't here alr 4. Launch ipython notebook from the folder which contains the notebooks. Open each one of them - `Cell > All Output > Clear` + `Kernel > Restart & Clear Output` This will clear all the outputs and now you can understand each statement and learn interactively. From 54ae7962b71cd1c3016b08f60576214d52389ed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Thu, 23 Sep 2021 15:37:19 +0530 Subject: [PATCH 17/49] Update README.md --- README.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 041ac3e..9f6fc67 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Function improves efficiency and reduces errors because of the reusability of a | 10 | **[Python_Function_Package](https://github.com/milaan9/04_Python_Functions/blob/main/010_Python_Function_Package.ipynb)** | -These are online **read-only** versions. However you can "Run โ–ถ" the code **online** by clicking here → binder +These are online **read-only** versions. However you can **`Run โ–ถ`** the code **online** by clicking here โžž binder --- @@ -56,17 +56,15 @@ These are online **read-only** versions. However you can "Run โ–ถ" the code **on ### How can I thank you for writing and sharing this tutorial? ๐ŸŒท -You can โญ star this tutorial. Starring is free for you, but it tells me and other people that it was helpful and you like this tutorial. +You can Star Badge and Fork Badge Starring and Forking is free for you, but it tells me and other people that it was helpful and you like this tutorial. -Go [here](https://github.com/milaan9/04_Python_Functions) if you aren't here already and click the "โญ Star" button in the top right corner. You will be asked to create a GitHub account if you don't already have one. +Go [**`here`**](https://github.com/milaan9/04_Python_Functions) if you aren't here already and click โžž **`โœฐ Star`** and **`โต– Fork`** button in the top right corner. You will be asked to create a GitHub account if you don't already have one. --- ### How can I read this tutorial without an Internet connection? ๐Ÿค” -1. Go [here](https://github.com/milaan9/04_Python_Functions) if you aren't here already. - -2. Click the big green "Code" button in the top right of the page, then click "[Download ZIP](https://github.com/milaan9/04_Python_Functions/archive/refs/heads/main.zip)". +1. Go [**`here`**](https://github.com/milaan9/04_Python_Functions) and click the big green โžž **`Code`** button in the top right of the page, then click โžž [**`Download ZIP`**](https://github.com/milaan9/04_Python_Functions/archive/refs/heads/main.zip). ![Download ZIP](img/dnld_rep.png) @@ -74,7 +72,7 @@ Go [here](https://github.com/milaan9/04_Python_Functions) if you aren't here alr 4. Launch ipython notebook from the folder which contains the notebooks. Open each one of them - `Kernel > Restart & Clear Output` + **`Kernel > Restart & Clear Output`** This will clear all the outputs and now you can understand each statement and learn interactively. From 3320aa271b86b0ecb52015ee62a951b128b6c1ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Thu, 23 Sep 2021 15:38:55 +0530 Subject: [PATCH 18/49] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f6fc67..8524b5f 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Function improves efficiency and reduces errors because of the reusability of a | 10 | **[Python_Function_Package](https://github.com/milaan9/04_Python_Functions/blob/main/010_Python_Function_Package.ipynb)** | -These are online **read-only** versions. However you can **`Run โ–ถ`** the code **online** by clicking here โžž binder +These are online **read-only** versions. However you can **`Run โ–ถ`** all the codes **online** by clicking here โžž binder --- From ab253b3bd7066358a56e7605d2550bdd31807611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Thu, 23 Sep 2021 16:20:00 +0530 Subject: [PATCH 19/49] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8524b5f..f7eec54 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ Go [**`here`**](https://github.com/milaan9/04_Python_Functions) if you aren't he --- -### How can I read this tutorial without an Internet connection? ๐Ÿค” +### How can I read this tutorial without an Internet connection? GIF 1. Go [**`here`**](https://github.com/milaan9/04_Python_Functions) and click the big green โžž **`Code`** button in the top right of the page, then click โžž [**`Download ZIP`**](https://github.com/milaan9/04_Python_Functions/archive/refs/heads/main.zip). From 09bcc22a5596fef91b8c59c018588b3791140cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Thu, 23 Sep 2021 21:09:49 +0530 Subject: [PATCH 20/49] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f7eec54..1d8d5b9 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,8 @@

-binder +binder +colab

# 04_Python_Functions @@ -48,7 +49,7 @@ Function improves efficiency and reduces errors because of the reusability of a | 10 | **[Python_Function_Package](https://github.com/milaan9/04_Python_Functions/blob/main/010_Python_Function_Package.ipynb)** | -These are online **read-only** versions. However you can **`Run โ–ถ`** all the codes **online** by clicking here โžž binder +These are online **read-only** versions. However you can **`Run โ–ถ`** all the codes **online** by clicking here โžž binder --- From 5b7ab2d58216fd87a80048bd78d6bb116a55e898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Thu, 7 Oct 2021 00:51:56 +0530 Subject: [PATCH 21/49] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1d8d5b9..817a87b 100644 --- a/README.md +++ b/README.md @@ -69,9 +69,9 @@ Go [**`here`**](https://github.com/milaan9/04_Python_Functions) if you aren't he ![Download ZIP](img/dnld_rep.png) -3. Extract the ZIP and open it. Unfortunately I don't have any more specific instructions because how exactly this is done depends on which operating system you run. +2. Extract the ZIP and open it. Unfortunately I don't have any more specific instructions because how exactly this is done depends on which operating system you run. -4. Launch ipython notebook from the folder which contains the notebooks. Open each one of them +3. Launch ipython notebook from the folder which contains the notebooks. Open each one of them **`Kernel > Restart & Clear Output`** From 0d107c1ecdec2841389ddb5e551e278d3d5b8fd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Tue, 12 Oct 2021 18:58:51 +0530 Subject: [PATCH 22/49] Add files via upload --- img/anaconda_prompt.png | Bin 0 -> 12711 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 img/anaconda_prompt.png diff --git a/img/anaconda_prompt.png b/img/anaconda_prompt.png new file mode 100644 index 0000000000000000000000000000000000000000..8ba667336e0328960a7bf9c65e304cf877a175d8 GIT binary patch literal 12711 zcmeHucUV(dyKfvv(P5Oa0ZNG@ASgma1w_Q2G(8 z^aD~kXPoX_;MQP7-Q$rI|Fikfbb9f|&Xno<%{HqbkRu@djM`nMjjB|iT&-utxp&Dts71$Fg6$*sV@fmXQ>S6- z~gBM*reDI89cuqiN%NN9=8|9b`Gv1upc#4N8aM{nn zNEV6RY!aG;5Wy=9T#+JpH>rZ(#9JU$9CJmn17<5F{MWOqtJbVc!YO?;FOzT#DrUOo zw#{|T%0jv6JRCtlnI(wU9A1b2B*mRm!LiWBS*=kb6M3x)kmt+0-a4f8b95FTCn-1a@9;>e~C)H3QdD15= zh@{IPe9ZIB_|-!!gZ343Qz0;2+)~S|iUQPMw`p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C!`Aa5AdcE@`=GQ8!Oc#e_dsJbOn*wMyxS z6A)N)QNw(_G`La3A@@u~QedoSaYWVFZj;r|XCpTL&Yl6|-j>vo3;J*)|#cVcRT@BC2Q<^B32vyRHUU79QX|n$}4tSgNY=x^?Qu zy~6UPi}zvHlo^yJyqtzuX??$5%RlX*maS~np$>eVv1ElWvp;soDt%f>>G@8c#h=g5 zWFJ|V_U_=stwB4}dOPNxPB(RQnu$4cuhm0!VwyWq!;GmjkuIxZA`!AW98#{wBRcGN zsvBJr@40kH3q#0=Om{DuPS@ZCs;(;+DBJ1$kFxqcX<0q|r%ufocPDkU%j%G`!;_6X zs+v{G`qu?{%AMJIAMK;pEO)B&$ZCh?G_9D}j0;CbrB%^VG3n~y6!O7;>X+2aTmRI+ mXu05k)uY1b*}W{uh8I2Yw>WiZ>8BU~fR&m3xr#Ga@BR-afyk8r literal 0 HcmV?d00001 From 9057c31d81d6f31d9d60e0095bb31df093b40efa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Tue, 12 Oct 2021 18:59:15 +0530 Subject: [PATCH 23/49] Add files via upload --- script.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 script.py diff --git a/script.py b/script.py new file mode 100644 index 0000000..38ebc2b --- /dev/null +++ b/script.py @@ -0,0 +1,7 @@ +import sys +#print(sys.argv[0], argv[1],sys.argv[2]) # this line would print out: filename argument1 argument2 +print('Welcome {}. Enjoy {} for Data Science ^_^'.format(sys.argv[1], sys.argv[2])) + + + + From d9f8903612fff29212e08fab19e25c0c7757a095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Wed, 13 Oct 2021 19:31:16 +0530 Subject: [PATCH 24/49] Delete 001_Python_Functions.ipynb --- 001_Python_Functions.ipynb | 778 ------------------------------------- 1 file changed, 778 deletions(-) delete mode 100644 001_Python_Functions.ipynb diff --git a/001_Python_Functions.ipynb b/001_Python_Functions.ipynb deleted file mode 100644 index 3066e9a..0000000 --- a/001_Python_Functions.ipynb +++ /dev/null @@ -1,778 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "All the IPython Notebooks in this lecture series by Dr. Milan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Python Functions\n", - "\n", - "In this class, you'll learn about functions, what a function is, the syntax, components, and types of functions. Also, you'll learn to create a function in Python." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# What is a function in Python?\n", - "\n", - "In Python, a **function is a block of organized, reusable (DRY- Donโ€™t Repeat Yourself) code with a name** that is used to perform a single, specific task. It can take arguments and returns the value.\n", - "\n", - "Functions help break our program into smaller and modular chunks. As our program grows larger and larger, functions make it more organized and manageable.\n", - "\n", - "Furthermore, it improves efficiency and reduces errors because of the reusability of a code." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Types of Functions\n", - "\n", - "Python support two types of functions\n", - "\n", - "1. **[Built-in](https://github.com/milaan9/04_Python_Functions/tree/main/002_Python_Functions_Built_in)** function\n", - "2. **[User-defined](https://github.com/milaan9/04_Python_Functions/blob/main/Python_User_defined_Functions.ipynb)** function\n", - "\n", - "1.**Built-in function**\n", - "\n", - "The functions which are come along with Python itself are called a built-in function or predefined function. Some of them are:\n", - "**`range()`**, **`print()`**, **`input()`**, **`type()`**, **`id()`**, **`eval()`** etc.\n", - "\n", - "**Example:** Python **`range()`** function generates the immutable sequence of numbers starting from the given start integer to the stop integer.\n", - "\n", - "```python\n", - ">>> for i in range(1, 10):\n", - ">>> print(i, end=' ')\n", - "\n", - "1 2 3 4 5 6 7 8 9\n", - "```\n", - "\n", - "2. **User-defined function**\n", - "\n", - "Functions which are created by programmer explicitly according to the requirement are called a user-defined function." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**Syntax:**\n", - "\n", - "```python\n", - "def function_name(parameter1, parameter2):\n", - " \"\"\"docstring\"\"\"\n", - " # function body \n", - " # write some action\n", - "return value\n", - "```\n", - "\n", - "
\n", - "\n", - "
" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Defining a Function\n", - "\n", - "1. **`def`** is a keyword that marks the start of the function header.\n", - "\n", - "2. **`function_name`** to uniquely identify the function. Function naming follows the same **[rules of writing identifiers in Python](https://github.com/milaan9/01_Python_Introduction/blob/main/005_Python_Keywords_and_Identifiers.ipynb)**.\n", - "\n", - "2. **`parameter`** is the value passed to the function. They are optional.\n", - "\n", - "3. **`:`** (colon) to mark the end of the function header.\n", - "\n", - "4. **`function body`** is a block of code that performs some task and all the statements in **`function body`** must have the same **indentation** level (usually 4 spaces). \n", - "\n", - "5. **\"\"\"docstring\"\"\"** documentation string is used to describe what the function does.\n", - "\n", - "6. **`return`** is a keyword to return a value from the function.. A return statement with no arguments is the same as return **`None`**.\n", - "\n", - ">**Note:** While defining a function, we use two keywords, **`def`** (mandatory) and **`return`** (optional).\n", - "\n", - "**Example:**\n", - "\n", - "```python\n", - ">>> def add(num1,num2): # Function name: 'add', Parameters: 'num1', 'num2'\n", - ">>> print(\"Number 1: \", num1) # Function body\n", - ">>> print(\"Number 2: \", num2) # Function body\n", - ">>> addition = num1 + num2 # Function body\n", - ">>> return addition # return value\n", - "\n", - "\n", - ">>> res = add(2, 4) # Function call\n", - ">>> print(\"Result: \", res)\n", - "```" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Defining a function without any parameters" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:00:05.220839Z", - "start_time": "2021-06-13T16:00:05.201310Z" - }, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Welcome to Data Science\n" - ] - } - ], - "source": [ - "# Example 1: \n", - " \n", - "def greet():\n", - " print(\"Welcome to Data Science\")\n", - "\n", - "# call function using its name\n", - "greet()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Defining a function with parameters" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:00:05.682263Z", - "start_time": "2021-06-13T16:00:05.659804Z" - }, - "scrolled": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Hello Arthur Welcome to Data Science\n", - "Your course name is Python\n" - ] - } - ], - "source": [ - "# Example 1: \n", - "\n", - "def course(name, course_name):\n", - " print(\"Hello\", name, \"Welcome to Data Science\")\n", - " print(\"Your course name is\", course_name)\n", - "\n", - "course('Arthur', 'Python') # call function" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:00:05.898573Z", - "start_time": "2021-06-13T16:00:05.878064Z" - } - }, - "outputs": [], - "source": [ - "# Example 2: Gereeting\n", - "\n", - "def greet(name):\n", - " \"\"\"\n", - " This function greets to the person passed in as a parameter\n", - " \"\"\"\n", - " print(\"Hello, \" + name + \". Good morning!\") # No output!" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Defining a function with parameters and `return` value" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:00:06.545535Z", - "start_time": "2021-06-13T16:00:06.531378Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Addition : 36\n" - ] - } - ], - "source": [ - "# Example 1: \n", - "\n", - "def calculator(a, b):\n", - " add = a + b \n", - " return add # return the addition\n", - "\n", - "result = calculator(30, 6) # call function & take return value in variable\n", - "print(\"Addition :\", result) # Output Addition : 36" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## How to call a function in python?\n", - "\n", - "Once we have defined a function, we can call it from another function, program or even the Python prompt. To call a function we simply type the function name with appropriate parameters.\n", - "\n", - "
\n", - "\n", - "
" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:00:08.206658Z", - "start_time": "2021-06-13T16:00:08.192987Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Hello, Alan. Good morning!\n" - ] - } - ], - "source": [ - "greet('Alan')" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - ">**Note:** Try running the above code in the Python program with the function definition to see the output." - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:00:09.270122Z", - "start_time": "2021-06-13T16:00:09.248641Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Happy birthday, Bill. Hope you have a wonderful day!\n" - ] - } - ], - "source": [ - "# Example 1: \n", - "\n", - "def wish(name):\n", - " \"\"\"\n", - " This function wishes to the person passed in as a parameter\n", - " \"\"\"\n", - " print(\"Happy birthday, \" + name + \". Hope you have a wonderful day!\")\n", - "\n", - "wish('Bill')" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:00:09.499124Z", - "start_time": "2021-06-13T16:00:09.479595Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "value of x is: 9\n", - "value of y is: 6\n" - ] - } - ], - "source": [ - "# Example 2: \n", - "\n", - "def swap(x, y):\n", - " \"\"\"\n", - " This function swaps the value of two variables\n", - " \"\"\"\n", - " temp = x; # value of x will go inside temp\n", - " x = y; # value of y will go inside x\n", - " y = temp; # value of temp will go inside y\n", - " print(\"value of x is:\", x)\n", - " print(\"value of y is:\", y)\n", - " return # \"return\" is optional\n", - "\n", - "x = 6\n", - "y = 9\n", - "swap(x, y) #call function" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:00:09.683206Z", - "start_time": "2021-06-13T16:00:09.662702Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "9 is a Odd Number\n" - ] - } - ], - "source": [ - "# Example 3: \n", - "\n", - "def even_odd(n): \n", - " if n % 2 == 0: # check number is even or odd\n", - " print(n, 'is a Even number')\n", - " else:\n", - " print(n, 'is a Odd Number')\n", - "\n", - "even_odd(9) # calling function by its name" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "## Docstrings\n", - "\n", - "The first string after the function header is called the **docstring** and is short for documentation string. It is a descriptive text (like a comment) written by a programmer to let others know what block of code does.\n", - "\n", - "Although **optional**, documentation is a good programming practice. Unless you can remember what you had for dinner last week, always document your code.\n", - "\n", - "It is being declared using triple single quotes **`''' '''`** or triple-double quote **`\"\"\" \"\"\"`** so that docstring can extend up to multiple lines.\n", - "\n", - "We can access docstring using doc attribute **`__doc__`** for any object like list, tuple, dict, and user-defined function, etc.\n", - "\n", - "In the above example, we have a docstring immediately below the function header." - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:00:10.052344Z", - "start_time": "2021-06-13T16:00:10.042580Z" - }, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - " This function greets to the person passed in as a parameter\n", - " \n" - ] - } - ], - "source": [ - "print(greet.__doc__)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "To learn more about docstrings in Python, visit **[Python Docstrings](https://github.com/milaan9/04_Python_Functions/blob/main/Python_Docstrings.ipynb)**." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Function `return` Statement\n", - "\n", - "In Python, to return value from the function, a **`return`** statement is used. It returns the value of the expression following the returns keyword.\n", - "\n", - "**Syntax:**\n", - "\n", - "```python\n", - "def fun():\n", - " statement-1\n", - " statement-2\n", - " statement-3\n", - " . \n", - " . \n", - " return [expression]\n", - "```\n", - "\n", - "The **`return`** value is nothing but a outcome of function.\n", - "\n", - "* The **`return`** statement ends the function execution.\n", - "* For a function, it is not mandatory to return a value.\n", - "* If a **`return`** statement is used without any expression, then the **`None`** is returned.\n", - "* The **`return`** statement should be inside of the function block." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Return Single Value" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:00:10.975677Z", - "start_time": "2021-06-13T16:00:10.969818Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Hello, Cory. Good morning!\n", - "None\n" - ] - } - ], - "source": [ - "print(greet(\"Cory\"))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Here, **`None`** is the returned value since **`greet()`** directly prints the name and no **`return`** statement is used." - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:00:11.393151Z", - "start_time": "2021-06-13T16:00:11.374603Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "2\n", - "4\n" - ] - } - ], - "source": [ - "# Example 1:\n", - "\n", - "def absolute_value(num):\n", - " \"\"\"This function returns the absolute\n", - " value of the entered number\"\"\"\n", - "\n", - " if num >= 0:\n", - " return num\n", - " else:\n", - " return -num\n", - "\n", - "\n", - "print(absolute_value(2))\n", - "\n", - "print(absolute_value(-4))" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:00:12.436114Z", - "start_time": "2021-06-13T16:00:12.426349Z" - }, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Adding the two values\n", - "Printing within Function\n", - "30\n", - "total : 30\n", - "Hello\n", - "Rest of code\n" - ] - } - ], - "source": [ - "# Example 2:\n", - "\n", - "def sum(a,b): # Function 1\n", - " print(\"Adding the two values\")\n", - " print(\"Printing within Function\")\n", - " print(a+b)\n", - " return a+b\n", - "\n", - "def msg(): # Function 2\n", - " print(\"Hello\")\n", - " return\n", - "\n", - "total=sum(10,20)\n", - "print('total : ',total)\n", - "msg()\n", - "print(\"Rest of code\")" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:00:13.204660Z", - "start_time": "2021-06-13T16:00:13.184155Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Even numbers are: [2, 46, 72, 90]\n" - ] - } - ], - "source": [ - "# Example 3:\n", - "\n", - "def is_even(list1):\n", - " even_num = []\n", - " for n in list1:\n", - " if n % 2 == 0:\n", - " even_num.append(n)\n", - " # return a list\n", - " return even_num\n", - "\n", - "# Pass list to the function\n", - "even_num = is_even([2, 3, 46, 63, 72, 83, 90, 19])\n", - "print(\"Even numbers are:\", even_num)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Return Multiple Values\n", - "\n", - "You can also return multiple values from a function. Use the return statement by separating each expression by a comma." - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:00:14.680235Z", - "start_time": "2021-06-13T16:00:14.656801Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Addition: 12\n", - "Subtraction: 8\n", - "Multiplication: 20\n", - "Division: 5.0\n" - ] - } - ], - "source": [ - "# Example 1:\n", - "\n", - "def arithmetic(num1, num2):\n", - " add = num1 + num2\n", - " sub = num1 - num2\n", - " multiply = num1 * num2\n", - " division = num1 / num2\n", - " # return four values\n", - " return add, sub, multiply, division\n", - "\n", - "a, b, c, d = arithmetic(10, 2) # read four return values in four variables\n", - "\n", - "print(\"Addition: \", a)\n", - "print(\"Subtraction: \", b)\n", - "print(\"Multiplication: \", c)\n", - "print(\"Division: \", d)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Function `pass` Statement\n", - "\n", - "In Python, the **`pass`** is the keyword, which wonโ€™t do anything. Sometimes there is a situation where we need to define a syntactically empty block. We can define that block using the **`pass`** keyword.\n", - "\n", - "When the interpreter finds a **`pass`** statement in the program, it returns no operation." - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:00:16.710491Z", - "start_time": "2021-06-13T16:00:16.704636Z" - } - }, - "outputs": [], - "source": [ - "# Example 1:\n", - "\n", - "def addition(num1, num2):\n", - " # Implementation of addition function in comming release\n", - " # Pass statement \n", - " pass\n", - "\n", - "addition(10, 2)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "gist": { - "data": { - "description": "01_Learn_Python4Data/04_Python_Functions/001_Python_Functions.ipynb", - "public": true - }, - "id": "" - }, - "hide_input": false, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.8" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false - }, - "varInspector": { - "cols": { - "lenName": 16, - "lenType": 16, - "lenVar": 40 - }, - "kernels_config": { - "python": { - "delete_cmd_postfix": "", - "delete_cmd_prefix": "del ", - "library": "var_list.py", - "varRefreshCmd": "print(var_dic_list())" - }, - "r": { - "delete_cmd_postfix": ") ", - "delete_cmd_prefix": "rm(", - "library": "var_list.r", - "varRefreshCmd": "cat(var_dic_list()) " - } - }, - "types_to_exclude": [ - "module", - "function", - "builtin_function_or_method", - "instance", - "_Feature" - ], - "window_display": false - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From 80ce00de272c5246d57bd13dff85a714995e44c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Wed, 13 Oct 2021 19:31:25 +0530 Subject: [PATCH 25/49] Delete 002_Python_Function_Global_Local_Nonlocal.ipynb --- ...ython_Function_Global_Local_Nonlocal.ipynb | 707 ------------------ 1 file changed, 707 deletions(-) delete mode 100644 002_Python_Function_Global_Local_Nonlocal.ipynb diff --git a/002_Python_Function_Global_Local_Nonlocal.ipynb b/002_Python_Function_Global_Local_Nonlocal.ipynb deleted file mode 100644 index 619b25e..0000000 --- a/002_Python_Function_Global_Local_Nonlocal.ipynb +++ /dev/null @@ -1,707 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "All the IPython Notebooks in this lecture series by Dr. Milan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Python Global, Local and Nonlocal variables\n", - "\n", - "In this class, youโ€™ll learn about Python Global variables, Local variables, Nonlocal variables and where to use them.\n", - "\n", - "When we define a function with variables, then those variables scope is limited to that function. In Python, the scope of a variable is the portion of a program where the variable is declared. Parameters and variables defined inside a function are not visible from outside the function. Hence, it is called the variableโ€™s local scope.\n", - "\n", - ">**Note:** The inner function does have access to the outer functionโ€™s local scope.\n", - "\n", - "When we are executing a function, the life of the variables is up to running time. Once we return from the function, those variables get destroyed. So function does no need to remember the value of a variable from its previous call." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Global Variables\n", - "\n", - "In Python, a variable declared outside of the function or in global scope is known as a global variable. This means that a global variable can be accessed inside or outside of the function.\n", - "\n", - "For example:" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T14:51:35.962970Z", - "start_time": "2021-06-13T14:51:35.939538Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Value in 1st function: 999\n", - "Value in 2nd function: 999\n" - ] - } - ], - "source": [ - "# Example 1: Create a Global Variable\n", - "\n", - "global_var = 999\n", - "\n", - "def fun1():\n", - " print(\"Value in 1st function:\", global_var)\n", - "\n", - "def fun2():\n", - " print(\"Value in 2nd function:\", global_var)\n", - "\n", - "fun1()\n", - "fun2()" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T14:51:36.916090Z", - "start_time": "2021-06-13T14:51:36.897539Z" - }, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "x inside: global\n", - "x outside: global\n" - ] - } - ], - "source": [ - "# Example 2: \n", - "\n", - "x = \"global\"\n", - "\n", - "def fun():\n", - " print(\"x inside:\", x)\n", - "\n", - "fun()\n", - "print(\"x outside:\", x)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "In the above code, we created **`x`** as a global variable and defined a **`fun()`** to print the global variable **`x`**. Finally, we call the **`fun()`** which will print the value of **`x`**.\n", - "\n", - "What if you want to change the value of **`x`** inside a function?" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T14:51:38.791564Z", - "start_time": "2021-06-13T14:51:38.442450Z" - }, - "scrolled": true - }, - "outputs": [ - { - "ename": "UnboundLocalError", - "evalue": "local variable 'x' referenced before assignment", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mUnboundLocalError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mx\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 9\u001b[1;33m \u001b[0mfun\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[1;32m\u001b[0m in \u001b[0;36mfun\u001b[1;34m()\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mfun\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 6\u001b[1;33m \u001b[0mx\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mx\u001b[0m \u001b[1;33m*\u001b[0m \u001b[1;36m2\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 7\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mx\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;31mUnboundLocalError\u001b[0m: local variable 'x' referenced before assignment" - ] - } - ], - "source": [ - "# Example 3: \n", - "\n", - "x = \"global\"\n", - "\n", - "def fun():\n", - " x = x * 2\n", - " print(x)\n", - "\n", - "fun()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**Explanation:**\n", - "\n", - "The output shows an error because Python treats **`x`** as a local variable and **`x`** is also not defined inside **`fun()`**.\n", - "\n", - "To make this work, we use the **`global`** keyword. Visit **[Python Global Keyword](https://github.com/milaan9/04_Python_Functions/blob/main/003_Python_Function_global_Keywords.ipynb)** to learn more." - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T14:51:40.101612Z", - "start_time": "2021-06-13T14:51:40.073298Z" - }, - "scrolled": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Python\n", - "DataScience\n" - ] - }, - { - "ename": "NameError", - "evalue": "name 'local_lang' is not defined", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 12\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mglobal_lang\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m# Output 'DataScience'\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 13\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 14\u001b[1;33m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mlocal_lang\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m# NameError: name 'local_lang' is not defined\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[1;31mNameError\u001b[0m: name 'local_lang' is not defined" - ] - } - ], - "source": [ - "# Example 4: \n", - "\n", - "global_lang = 'DataScience'\n", - "\n", - "def var_scope_test():\n", - " local_lang = 'Python'\n", - " print(local_lang)\n", - "\n", - "var_scope_test() # Output 'Python'\n", - "\n", - "# outside of function\n", - "print(global_lang) # Output 'DataScience'\n", - "\n", - "print(local_lang) # NameError: name 'local_lang' is not defined" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T14:51:41.071823Z", - "start_time": "2021-06-13T14:51:41.049365Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "(a,b):( 6 , 30 )\n", - "Global a : 90\n" - ] - }, - { - "ename": "NameError", - "evalue": "name 'b' is not defined", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 10\u001b[0m \u001b[0mprint_data\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m#(a,b):( 5 , 10 )\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 11\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Global a :\"\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m#Global x : 50\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 12\u001b[1;33m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Local b : \"\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mb\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m#b is local veriable - throw NameError\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[1;31mNameError\u001b[0m: name 'b' is not defined" - ] - } - ], - "source": [ - "# Example 5: \n", - "\n", - "a=90 # 'a' is a variable defined outside of function, i.e., Global variable\n", - "\n", - "def print_data():\n", - " a=6 # 'a' is a variable defined inside of function, i.e., local variable\n", - " b=30\n", - " print(\"(a,b):(\",a,\",\",b,\")\")\n", - "\n", - "print_data() #(a,b):( 5 , 10 )\n", - "print(\"Global a :\",a) #Global x : 50\n", - "print(\"Local b : \",b) #b is local veriable - throw NameError" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Local Variables\n", - "\n", - "A variable declared inside the function's body or in the local scope is known as a local variable.\n", - "\n", - "If we try to access the local variable from the outside of the function, we will get the error as **`NameError`**." - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T14:51:45.055679Z", - "start_time": "2021-06-13T14:51:45.042009Z" - }, - "scrolled": true - }, - "outputs": [ - { - "ename": "NameError", - "evalue": "name 'y' is not defined", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[0mfun\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 7\u001b[1;33m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0my\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[1;31mNameError\u001b[0m: name 'y' is not defined" - ] - } - ], - "source": [ - "# Example 1: Accessing local variable outside the scope\n", - "\n", - "def fun():\n", - " y = \"local\"\n", - " \n", - "fun()\n", - "print(y)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The output shows an error because we are trying to access a local variable **`y`** in a global scope whereas the local variable only works inside **`fun()`** or local scope." - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T14:51:46.227056Z", - "start_time": "2021-06-13T14:51:46.209482Z" - }, - "scrolled": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "local\n" - ] - } - ], - "source": [ - "# Example 2: Create a Local Variable\n", - "\n", - "# Normally, we declare a variable inside the function to create a local variable.\n", - "\n", - "def fun():\n", - " y = \"local\"\n", - " print(y)\n", - "\n", - "fun()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Let's take a look at the cell **In [2]: # Example 3:** where **`x`** was a global variable and we wanted to modify **`x`** inside **`fun()`**." - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T14:51:47.257321Z", - "start_time": "2021-06-13T14:51:47.225098Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Value is : 999\n" - ] - }, - { - "ename": "NameError", - "evalue": "name 'loc_var' is not defined", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 9\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 10\u001b[0m \u001b[0mfun1\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 11\u001b[1;33m \u001b[0mfun2\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[1;32m\u001b[0m in \u001b[0;36mfun2\u001b[1;34m()\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mfun2\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 8\u001b[1;33m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Value is :\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mloc_var\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 9\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 10\u001b[0m \u001b[0mfun1\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;31mNameError\u001b[0m: name 'loc_var' is not defined" - ] - } - ], - "source": [ - "# Exercise 3: \n", - "\n", - "def fun1():\n", - " loc_var = 999 # local variable\n", - " print(\"Value is :\", loc_var)\n", - "\n", - "def fun2():\n", - " print(\"Value is :\", loc_var)\n", - "\n", - "fun1()\n", - "fun2()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Global and local variables\n", - "\n", - "Here, we will show how to use global variables and local variables in the same code." - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T14:51:48.270008Z", - "start_time": "2021-06-13T14:51:48.249505Z" - }, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "globalglobal\n", - "local\n" - ] - } - ], - "source": [ - "# Example 1: Using Global and Local variables in the same code\n", - "\n", - "x = \"global\"\n", - "\n", - "def fun():\n", - " global x\n", - " y = \"local\"\n", - " x = x * 2\n", - " print(x)\n", - " print(y)\n", - "\n", - "fun()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**Explanation**:\n", - "\n", - "In the above code, we declare **`x`** as a global and **`y`** as a local variable in the **`fun()`**. Then, we use multiplication operator **`*`** to modify the global variable **`x`** and we print both **`x`** and **`y`**.\n", - "\n", - "After calling the **`fun()`**, the value of **`x`** becomes **`global global`** because we used the **`x * 2`** to print two times **`global`**. After that, we print the value of local variable **`y`** i.e **`local`**." - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T14:51:49.331526Z", - "start_time": "2021-06-13T14:51:49.324692Z" - }, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "local x: 19\n", - "global x: 9\n" - ] - } - ], - "source": [ - "# Example 2: Global variable and Local variable with same name\n", - "\n", - "x = 9\n", - "\n", - "def fun():\n", - " x = 19\n", - " print(\"local x:\", x)\n", - "\n", - "\n", - "fun()\n", - "print(\"global x:\", x)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**Explanation**:\n", - "\n", - "In the above code, we used the same name **`x`** for both global variable and local variable. We get a different result when we print the same variable because the variable is declared in both scopes, i.e. the local scope inside **`fun()`** and global scope outside **`fun()`**.\n", - "\n", - "When we print the variable inside **`fun()`** it outputs **`local x: 19`**. This is called the local scope of the variable.\n", - "\n", - "Similarly, when we print the variable outside the **`fun()`**, it outputs **`global x: 9`**. This is called the global scope of the variable." - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T14:51:50.517064Z", - "start_time": "2021-06-13T14:51:50.505346Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Value inside the body of function: 10\n", - "Value outside of function: 20\n" - ] - } - ], - "source": [ - "# Exercise 3: \n", - "\n", - "def my_func(): # for this Function I am not writing any argument in parenthesis '()'\n", - " x = 10\n", - " print(\"Value inside the body of function:\",x)\n", - "\n", - "x = 20 # first, this line to execute\n", - "my_func() # second, the body of function will execute\n", - "print(\"Value outside of function:\",x) # finally, this line will execute" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**Explanation:**\n", - "\n", - "Here, we can see that the value of **`x`** is 20 initially. Even though the function **`my_func()`** changed the value of **`x`** to 10, it did not affect the value outside the function.\n", - "\n", - "This is because the variable **`x`** inside the function is different (local to the function) from the one outside. Although they have the same names, they are two different variables with different scopes.\n", - "\n", - "On the other hand, variables outside of the function are visible from inside. They have a global scope.\n", - "\n", - "We can read these values from inside the function but cannot change (write) them. In order to modify the value of variables outside the function, they must be declared as global variables using the keyword global." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Nonlocal Variables\n", - "\n", - "Nonlocal variables are used in nested functions whose local scope is not defined. This means that the variable can be neither in the local nor the global scope.\n", - "\n", - "Let's see an example of how a global variable is created in Python.\n", - "\n", - "We use **`nonlocal`** keywords to create nonlocal variables." - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T14:51:52.225056Z", - "start_time": "2021-06-13T14:51:52.202598Z" - }, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "variable type for Outer function: local\n", - "variable type for Inner function: nonlocal\n", - "Variable type of x1: global\n" - ] - } - ], - "source": [ - "# Example 1: Create a nonlocal variable\n", - "\n", - "x1 = \"global\" # Global variable\n", - "\n", - "def outer_fun(): # main function\n", - " x1 = \"local\" # 'x' is local variable for main function and it is nested variable for nested function\n", - " print(\"variable type for Outer function:\", x1)\n", - " \n", - " def inner_fun(): # nested fucntion\n", - " nonlocal x1 # using local variable 'x' in nested function as nonloval variable\n", - " x1 = \"nonlocal\" # changing the value of my 'x'\n", - " print(\"variable type for Inner function:\", x1) # print 'nonlocal'\n", - "\n", - " inner_fun() #print(\"outer:\", x1) # print 'nonlocal'\n", - " \n", - "outer_fun()\n", - "print(\"Variable type of x1:\", x1)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "In the above code, there is a nested **`inner()`** function. We use nonlocal keywords to create a **`nonlocal`** variable. The **`inner()`** function is defined in the scope of another function **`outer()`**.\n", - "\n", - "> **Note**: If we change the value of a nonlocal variable, the changes appear in the local variable." - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T14:51:53.794872Z", - "start_time": "2021-06-13T14:51:53.777294Z" - }, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "value of x inside inner function is: 900\n", - "value of x inside outer function is: 900\n" - ] - } - ], - "source": [ - "# Exercise 2: \n", - "\n", - "def outer_fun():\n", - " x = 999\n", - "\n", - " def inner_fun():\n", - " # local variable now acts as global variable\n", - " nonlocal x\n", - " x = 900\n", - " print(\"value of x inside inner function is:\", x)\n", - "\n", - " inner_fun()\n", - " print(\"value of x inside outer function is:\", x)\n", - "\n", - "outer_fun()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "hide_input": false, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.8" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false - }, - "varInspector": { - "cols": { - "lenName": 16, - "lenType": 16, - "lenVar": 40 - }, - "kernels_config": { - "python": { - "delete_cmd_postfix": "", - "delete_cmd_prefix": "del ", - "library": "var_list.py", - "varRefreshCmd": "print(var_dic_list())" - }, - "r": { - "delete_cmd_postfix": ") ", - "delete_cmd_prefix": "rm(", - "library": "var_list.r", - "varRefreshCmd": "cat(var_dic_list()) " - } - }, - "types_to_exclude": [ - "module", - "function", - "builtin_function_or_method", - "instance", - "_Feature" - ], - "window_display": false - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From 1428092d1321f429599d04135509e6752cf245bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Wed, 13 Oct 2021 19:31:33 +0530 Subject: [PATCH 26/49] Delete 003_Python_Function_global_Keywords.ipynb --- 003_Python_Function_global_Keywords.ipynb | 472 ---------------------- 1 file changed, 472 deletions(-) delete mode 100644 003_Python_Function_global_Keywords.ipynb diff --git a/003_Python_Function_global_Keywords.ipynb b/003_Python_Function_global_Keywords.ipynb deleted file mode 100644 index 1d9b62c..0000000 --- a/003_Python_Function_global_Keywords.ipynb +++ /dev/null @@ -1,472 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "All the IPython Notebooks in this lecture series by Dr. Milan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Python `global` Keyword\n", - "\n", - "In this class, youโ€™ll learn about the **`global`** keyword, global variable and when to use **`global`** keyword.\n", - "\n", - "Before reading this article, make sure you have got some basics of **[Python Global, Local and Nonlocal Variables](https://github.com/milaan9/04_Python_Functions/blob/main/002_Python_Function_Global_Local_Nonlocal.ipynb)**." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# What is `global` keyword?\n", - "\n", - "In Python, **`global`** keyword allows you to modify the variable outside of the current scope. It is used to create a global variable and make changes to the variable in a local context." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Rules of `global` Keyword\n", - "\n", - "The basic rules for **`global`** keyword in Python are:\n", - "\n", - "1. When we create a variable inside a function, it is local by default.\n", - "2. When we define a variable outside of a function, it is global by default. You don't have to use **`global`** keyword.\n", - "3. We use **`global`** keyword to read and write a global variable inside a function.\n", - "4. Use of **`global`** keyword outside a function has no effect." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Use of `global` Keyword" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T14:27:02.042929Z", - "start_time": "2021-06-13T14:27:02.025355Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "1\n" - ] - } - ], - "source": [ - "# Example 1: Accessing global Variable From Inside a Function\n", - "\n", - "a = 1 # global variable\n", - "\n", - "def add():\n", - " print(a)\n", - "\n", - "add()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "However, we may have some scenarios where we need to modify the global variable from inside a function." - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T14:27:05.239195Z", - "start_time": "2021-06-13T14:27:04.904238Z" - } - }, - "outputs": [ - { - "ename": "UnboundLocalError", - "evalue": "local variable 'a' referenced before assignment", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mUnboundLocalError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 9\u001b[1;33m \u001b[0madd\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[1;32m\u001b[0m in \u001b[0;36madd\u001b[1;34m()\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0madd\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 6\u001b[1;33m \u001b[0ma\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0ma\u001b[0m \u001b[1;33m+\u001b[0m \u001b[1;36m3\u001b[0m \u001b[1;31m# increment a by 3 (modifying my global variable)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 7\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;31mUnboundLocalError\u001b[0m: local variable 'a' referenced before assignment" - ] - } - ], - "source": [ - "# Example 2: Modifying Global Variable From Inside the Function\n", - "\n", - "a = 1 # global variable\n", - " \n", - "def add():\n", - " a = a + 3 # increment a by 3 (modifying my global variable)\n", - " print(a)\n", - "\n", - "add()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "This is because we can only access the global variable but cannot modify it from inside the function.\n", - "\n", - "The solution for this is to use the **`global`** keyword." - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T14:27:06.885175Z", - "start_time": "2021-06-13T14:27:06.863695Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Inside add(): 3\n", - "In main: 3\n" - ] - } - ], - "source": [ - "# Example 2: Changing Global Variable From Inside a Function using global\n", - "\n", - "a = 0 # global variable\n", - "\n", - "def add():\n", - " global a # using global variable inside my function\n", - " a = a + 3 # increment by 3\n", - " print(\"Inside add():\", a)\n", - "\n", - "add()\n", - "print(\"In main:\", a)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**Explanation:**\n", - "\n", - "In the above program, we define **`a`** as a global keyword inside the **`add()`** function.\n", - "\n", - "Then, we increment the variable **`a`** by 1, i.e **`a = a + 3`**. After that, we call the **`add()`** function. Finally, we print the global variable **`a`**.\n", - "\n", - "As we can see, change also occurred on the global variable outside the function, **`a = 3`**." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Letโ€™s see another example where we donโ€™t use **`global`** keyword to access the global variable in the function." - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T14:27:09.262597Z", - "start_time": "2021-06-13T14:27:09.239165Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Value in 1st function: 9\n", - "Value in 2nd function: 999\n", - "Value in 3rd function: 9\n" - ] - } - ], - "source": [ - "# Exercise 3: without `global` keyword.\n", - "\n", - "global_var = 9 # Global variable\n", - "\n", - "def fun1():\n", - " print(\"Value in 1st function:\", global_var)\n", - "\n", - "def fun2():\n", - " # Modify global variable\n", - " # function will treat it as a local variable\n", - " global_var = 999\n", - " print(\"Value in 2nd function:\", global_var)\n", - "\n", - "def fun3():\n", - " print(\"Value in 3rd function:\", global_var)\n", - "\n", - "fun1()\n", - "fun2()\n", - "fun3()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**Explanation:**\n", - "\n", - "As you can see, **`fun2()`** treated **`global_var`** as a new variable (local variable). To solve such issues or access/modify global variables inside a function, we use the **`global`** keyword." - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T14:27:11.122937Z", - "start_time": "2021-06-13T14:27:11.113174Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Value in 1st function: 9\n", - "Value in 2nd function: 999\n", - "Value in 3rd function: 999\n" - ] - } - ], - "source": [ - "# Exercise 3: use the `global` keyword.\n", - "\n", - "\n", - "x = 9 # Global variable\n", - "\n", - "# defining 1st function\n", - "def fun1():\n", - " print(\"Value in 1st function:\", x)\n", - "\n", - "# defining 2nd function\n", - "def fun2():\n", - " # Modify global variable using global keyword\n", - " global x\n", - " x = 999\n", - " print(\"Value in 2nd function:\", x)\n", - "\n", - "# defining 3rd function\n", - "def fun3():\n", - " print(\"Value in 3rd function:\", x)\n", - "\n", - "fun1()\n", - "fun2()\n", - "fun3()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Global Variables Across Python Modules\n", - "\n", - "In Python, we create a single module **config.py** to hold global variables and share information across Python modules within the same program.\n", - "\n", - "Here is how we can share global variables across the python modules." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Example : Share a global Variable Across Python Modules\n", - "\n", - "Create a **config.py** file, to store global variables\n", - "\n", - "```python\n", - ">>> a = 0\n", - ">>> b = \"empty\"\n", - "```\n", - "\n", - "Create a **update.py** file, to change global variables\n", - "\n", - "```python\n", - ">>> import config # import config.py here\n", - "\n", - ">>> config.a = 10 # change the value of 'a' from 0 to 10\n", - ">>> config.b = \"alphabet\" # change the value of 'b' from \"empty\" to \"alphabet\"\n", - "```\n", - "\n", - "Create a **main1.py** file, to test changes in value\n", - "\n", - "```python\n", - ">>> import config # import config.py here\n", - ">>> import update # import update.py here\n", - "\n", - ">>> print(config.a) # print the updated value of 'a'\n", - ">>> print(config.b) # print the updated value of 'b'\n", - "```\n", - "\n", - "When we run the **main.py** file, the output will be\n", - "\n", - "`\n", - "10\n", - "alphabet\n", - "`\n", - "\n", - "In the above, we have created three files: **config.py**, **update.py**, and **main.py**.\n", - "\n", - "The module **config.py** stores global variables of **`a`** and **`b`**. In the **update.py** file, we import the **config.py** module and modify the values of **`a`** and **`b`**. Similarly, in the **main.py** file, we import both **config.py** and **update.py** module. Finally, we print and test the values of global variables whether they are changed or not." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Global in Nested Functions\n", - "\n", - "Here is how you can use a global variable in nested function." - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T14:27:16.594081Z", - "start_time": "2021-06-13T14:27:16.570649Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Before calling bar function: 30\n", - "Calling bar function now\n", - "After calling bar function: 30\n", - "x in main function: 66\n" - ] - } - ], - "source": [ - "# Example 1: Using a Global Variable in Nested Function\n", - "\n", - "def fun(): # main function\n", - " x = 30\n", - "\n", - " def day(): # nested fucntion\n", - " global x\n", - " x = 66\n", - " \n", - " print(\"Before calling bar function:\", x) # check indentation\n", - " print(\"Calling bar function now\")\n", - " day()\n", - " print(\"After calling bar function:\", x)\n", - "\n", - "fun()\n", - "print(\"x in main function:\", x)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**Explanation:**\n", - "\n", - "In the above program, we declared a global variable inside the nested function **`day()`**. Inside **`fun()`** function, **`x`** has no effect of the global keyword.\n", - "\n", - "Before and after calling **`day()`**, the variable **`x`** takes the value of local variable i.e **`x = 30`**. Outside of the **`fun()`** function, the variable **`x`** will take value defined in the **`day()`** function i.e **`x = 66`**. This is because we have used global keyword in **`x`** to create global variable inside the **`day()`** function (local scope).\n", - "\n", - "If we make any changes inside the **`day()`** function, the changes appear outside the local scope, i.e. **`fun()`**." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "hide_input": false, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.8" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false - }, - "varInspector": { - "cols": { - "lenName": 16, - "lenType": 16, - "lenVar": 40 - }, - "kernels_config": { - "python": { - "delete_cmd_postfix": "", - "delete_cmd_prefix": "del ", - "library": "var_list.py", - "varRefreshCmd": "print(var_dic_list())" - }, - "r": { - "delete_cmd_postfix": ") ", - "delete_cmd_prefix": "rm(", - "library": "var_list.r", - "varRefreshCmd": "cat(var_dic_list()) " - } - }, - "types_to_exclude": [ - "module", - "function", - "builtin_function_or_method", - "instance", - "_Feature" - ], - "window_display": false - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From af7516acf45a835b9230d46c113272c6b99db80a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Wed, 13 Oct 2021 19:31:41 +0530 Subject: [PATCH 27/49] Delete 004_Python_Function_Arguments.ipynb --- 004_Python_Function_Arguments.ipynb | 861 ---------------------------- 1 file changed, 861 deletions(-) delete mode 100644 004_Python_Function_Arguments.ipynb diff --git a/004_Python_Function_Arguments.ipynb b/004_Python_Function_Arguments.ipynb deleted file mode 100644 index 5602630..0000000 --- a/004_Python_Function_Arguments.ipynb +++ /dev/null @@ -1,861 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "All the IPython Notebooks in this lecture series by Dr. Milan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Function Argument and Parameter\n", - "\n", - "The argument is a value, a variable, or an object that we pass to a function or method call. \n", - "\n", - "There can be two types of data passed in the function.\n", - "\n", - "* The First type of data is the data passed in the function call. This data is called **arguments**.\n", - "\n", - "* The second type of data is the data received in the function definition. This data is called **parameters**.\n", - "\n", - " - Arguments can be literals, variables and expressions. \n", - " - Parameters must be variable to hold incoming values.\n", - "\n", - "Alternatively, arguments can be called as **actual parameters** or **actual arguments** and parameters can be called as **formal parameters** or **formal arguments**." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Python Function Arguments\n", - "\n", - "In Python, you can define a function that takes variable number of arguments. In this article, you will learn to define such functions using default, keyword and arbitrary arguments.\n", - "\n", - "In Python, there are 2 types of arguments allowed.\n", - "\n", - "1. Positional Arguments (Basic)\n", - "2. Variable Function Arguments\n", - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Positional Arguments (Basic)\n", - "\n", - "In the **[User-defined function](https://github.com/milaan9/04_Python_Functions/blob/main/Python_User_defined_Functions.ipynb)** topic, we learned about defining a function and calling it. Otherwise, the function call will result in an error. For example:" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T15:56:57.276044Z", - "start_time": "2021-06-13T15:56:57.259443Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Hello Arthur, Good morning!\n" - ] - } - ], - "source": [ - "# Example 1:\n", - "\n", - "def greet(name, msg):\n", - " \"\"\"This function greets to the person with the provided message\"\"\"\n", - " print(\"Hello\", name + ', ' + msg)\n", - "\n", - "greet(\"Arthur\", \"Good morning!\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**Explanation:**\n", - "\n", - "Here, the function **`greet()`** has two parameters.\n", - "\n", - "Since we have called this function with two arguments, it runs smoothly and we do not get any error.\n", - "\n", - "If we call it with a different number of arguments, the interpreter will show an error message. Below is a call to this function with one and no arguments along with their respective error messages." - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T15:56:58.845367Z", - "start_time": "2021-06-13T15:56:58.523104Z" - } - }, - "outputs": [ - { - "ename": "TypeError", - "evalue": "greet() missing 1 required positional argument: 'msg'", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mgreet\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Arthur\"\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m# only one argument\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[1;31mTypeError\u001b[0m: greet() missing 1 required positional argument: 'msg'" - ] - } - ], - "source": [ - "greet(\"Arthur\") # only one argument" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T15:56:59.522119Z", - "start_time": "2021-06-13T15:56:59.506497Z" - } - }, - "outputs": [ - { - "ename": "TypeError", - "evalue": "greet() missing 2 required positional arguments: 'name' and 'msg'", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mgreet\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m# no arguments\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[1;31mTypeError\u001b[0m: greet() missing 2 required positional arguments: 'name' and 'msg'" - ] - } - ], - "source": [ - "greet() # no arguments" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T15:57:00.105611Z", - "start_time": "2021-06-13T15:57:00.098777Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "60\n", - "30\n" - ] - } - ], - "source": [ - "# Example 2:\n", - "\n", - "def add(a, b):\n", - " print(a - b)\n", - "\n", - "add(90, 30) # Output 60\n", - "add(60, 30) # Output -30" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T15:57:00.965469Z", - "start_time": "2021-06-13T15:57:00.945936Z" - } - }, - "outputs": [ - { - "ename": "TypeError", - "evalue": "add() takes 2 positional arguments but 3 were given", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0madd\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mb\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ma\u001b[0m \u001b[1;33m-\u001b[0m \u001b[0mb\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 5\u001b[1;33m \u001b[0madd\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m109\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m633\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m9\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[1;31mTypeError\u001b[0m: add() takes 2 positional arguments but 3 were given" - ] - } - ], - "source": [ - "# Example 2: If you try to use pass more parameters you will get an error.\n", - "\n", - "def add(a, b):\n", - " print(a - b)\n", - "add(109, 633, 9)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - ">**Note:** In the **Positional argument** number and position of arguments must be matched. If we change the order, then the result may change. Also, If we change the number of arguments, then we will get an error." - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T15:57:02.119756Z", - "start_time": "2021-06-13T15:57:02.109013Z" - }, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "even\n", - "odd\n" - ] - } - ], - "source": [ - "# Example 3:\n", - "\n", - "def evenodd(x): # x is parameters or formal parameters or formal arguments.\n", - " if (x % 2 == 0):\n", - " print(\"even\")\n", - " else:\n", - " print(\"odd\")\n", - "\n", - "# Driver code\n", - "evenodd(6) # here 2 is argument or actual perameter\n", - "evenodd(9) # here 3 is argument or actual perameter" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T15:57:02.782346Z", - "start_time": "2021-06-13T15:57:02.762817Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "8\n" - ] - } - ], - "source": [ - "# Example 4:\n", - "\n", - "def cube(x):\n", - " \"This x a passed num value into this function, return cube of x\"\n", - " y=x*x*x;\n", - " return y\n", - "\n", - "# Now you can call cube function\n", - "z=cube(2) #required to pass argument\n", - "print(z)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Variable Function Arguments\n", - "\n", - "Up until now, functions had a fixed number of arguments. In Python, there are other ways to define a function that can take variable number of arguments.\n", - "\n", - "Three different forms of this type are described below:\n", - "\n", - "1. Default Arguments\n", - "2. Keyword Arguments\n", - "3. Arbitrary/Variable-length Arguments\n", - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Python Default Arguments\n", - "\n", - "Default arguments are arguments that take the default value during the function call. If we do not pass any argument to the function, then the default argument will take place. We can assign default values using the **`=`** assignment operator. For example:" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T15:57:05.164654Z", - "start_time": "2021-06-13T15:57:05.155866Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Hello Alan, Good morning!\n", - "Hello Bruce, How do you do?\n", - "Hello Carson, Good night!\n" - ] - } - ], - "source": [ - "# Example 1:\n", - "\n", - "def greet(name, msg=\"Good morning!\"): # two arguments: `name` is fixed arg and 'msg' is variable arg\n", - "\n", - " print(\"Hello\", name + ', ' + msg)\n", - "\n", - "\n", - "greet(\"Alan\")\n", - "greet(\"Bruce\", \"How do you do?\")\n", - "greet(\"Carson\",\"Good night!\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**Explanation:**\n", - "\n", - "In this function, the parameter **`name`** does not have a default value and is required (mandatory) during a call.\n", - "\n", - "On the other hand, the parameter **`msg`** has a default value of **`\"Good morning!\"`**. So, it is optional during a call. If a value is provided, it will overwrite the default value.\n", - "\n", - "Any number of arguments in a function can have a default value. But once we have a default argument, all the arguments to its right must also have default values.\n", - "\n", - "This means to say, non-default arguments cannot follow default arguments. For example, if we had defined the function header above as:\n", - "\n", - "```python\n", - ">>> def greet(msg = \"Good morning!\", name):\n", - "```\n", - "\n", - "We would get an error as:\n", - "```python\n", - "SyntaxError: non-default argument follows default argument\n", - "```" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T15:57:06.149019Z", - "start_time": "2021-06-13T15:57:06.138278Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Hello David\n", - "Hello Everyone\n" - ] - } - ], - "source": [ - "# Example 2: function with default argument\n", - "\n", - "def message(name=\"Everyone\"):\n", - " print(\"Hello\", name)\n", - "\n", - "# calling function with argument\n", - "message(\"David\")\n", - "\n", - "# calling function without argument\n", - "message()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**Explanation:** \n", - "\n", - "When we call a function with an argument, it will be considered that value.\n", - "\n", - "Like in the above example, we passed **`name=\"David\"`** we pass to the function, then the function will consider that value. If we do not pass any argument, it will be considered **`\"name=Everyone\"`** as a default value." - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T15:57:07.271081Z", - "start_time": "2021-06-13T15:57:07.259364Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Details of: Bill\n", - "Empoyee Id : 101\n", - "Age : 21\n", - "Company : Samsung.com\n", - "-----------------------\n", - "Details of: Cory\n", - "Empoyee Id : 102\n", - "Age : 22\n", - "Company : Baidu.com\n" - ] - } - ], - "source": [ - "# Example 3: it prints default age if it is not passed\n", - "\n", - "def emp_data(name, emp_id, age, company=\"Baidu.com\"): # total 4 arguments (3 is fixed and 1 is variable)\n", - " print(\"Details of: \",name)\n", - " print(\"Empoyee Id : \",emp_id)\n", - " print(\"Age : \",age)\n", - " print(\"Company : \",company)\n", - "\n", - "#call emp_data fun\n", - "emp_data(\"Bill\",101,21,\"Samsung.com\")\n", - "print(\"-----------------------\")\n", - "emp_data(\"Cory\",102,22)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Python Keyword Arguments\n", - "\n", - "Keyword arguments are related to the function calls. A keyword argument is an argument value, passed to function preceded by the variable name and an equals sign.\n", - "\n", - "This allows you to skip arguments or place them out of order because the Python interpreter is able to use the keywords provided to match the values with parameters." - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T15:57:08.348221Z", - "start_time": "2021-06-13T15:57:08.339434Z" - }, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Hello Eric, How do you do?\n", - "Hello Eric, How do you do?\n", - "Hello Eric, How do you do?\n", - "Hello Eric, How do you do?\n" - ] - } - ], - "source": [ - "# Example 1:\n", - "\n", - "greet(\"Eric\", \"How do you do?\")\n", - "\n", - "# 2 keyword arguments\n", - "greet(name = \"Eric\",msg = \"How do you do?\")\n", - "\n", - "# 2 keyword arguments (out of order)\n", - "greet(msg = \"How do you do?\",name = \"Eric\") \n", - "\n", - "# 1 positional, 1 keyword argument\n", - "greet(\"Eric\", msg = \"How do you do?\") " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "As we can see, we can mix positional arguments with keyword arguments during a function call. But we must keep in mind that keyword arguments must follow positional arguments.\n", - "\n", - "Having a positional argument after keyword arguments will result in errors. For example, the function call as follows:" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T15:57:09.362862Z", - "start_time": "2021-06-13T15:57:09.354073Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Hello Eric, How do you do?\n" - ] - } - ], - "source": [ - "greet(\"Eric\",\"How do you do?\")" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T15:57:09.732971Z", - "start_time": "2021-06-13T15:57:09.717352Z" - }, - "scrolled": false - }, - "outputs": [ - { - "ename": "SyntaxError", - "evalue": "positional argument follows keyword argument (, line 1)", - "output_type": "error", - "traceback": [ - "\u001b[1;36m File \u001b[1;32m\"\"\u001b[1;36m, line \u001b[1;32m1\u001b[0m\n\u001b[1;33m greet(name=\"Eric\",\"How do you do?\") # Will result in an error\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m positional argument follows keyword argument\n" - ] - } - ], - "source": [ - "greet(name=\"Eric\",\"How do you do?\") # Will result in an error" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T15:57:10.010315Z", - "start_time": "2021-06-13T15:57:10.001529Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "remainder of 10/3 : 1\n" - ] - } - ], - "source": [ - "# Example 2:\n", - "\n", - "def remainder(dividend,divisor):\n", - " x=dividend%divisor\n", - " return x\n", - "\n", - "#rem = remainder(10,3)\n", - "rem = remainder(divisor = 3, dividend = 10) # keyword argument\n", - "print(\"remainder of 10/3 : \",rem)" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T15:57:10.441953Z", - "start_time": "2021-06-13T15:57:10.425353Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Hello Frank Harper\n", - "Hello Gretta Clayton\n" - ] - } - ], - "source": [ - "# Example 3:\n", - "\n", - "def message(name, surname):\n", - " print(\"Hello\", name, surname)\n", - "\n", - "message(name=\"Frank\", surname=\"Harper\")\n", - "message(surname=\"Clayton\", name=\"Gretta\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "In keyword arguments order of argument is not matter, but the number of arguments must match. Otherwise, we will get an error." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "While using keyword and positional argument simultaneously, we need to pass 1st arguments as positional arguments and then keyword arguments. Otherwise, we will get **`SyntaxError`**. See the following example." - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T15:57:15.269065Z", - "start_time": "2021-06-13T15:57:15.251487Z" - } - }, - "outputs": [ - { - "ename": "SyntaxError", - "evalue": "positional argument follows keyword argument (, line 10)", - "output_type": "error", - "traceback": [ - "\u001b[1;36m File \u001b[1;32m\"\"\u001b[1;36m, line \u001b[1;32m10\u001b[0m\n\u001b[1;33m message(first_nm=\"Frank\", \"Harper\") # SyntaxError: positional argument follows keyword argument\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m positional argument follows keyword argument\n" - ] - } - ], - "source": [ - "# Example 4:\n", - "\n", - "def message(first_nm, last_nm):\n", - " print(\"Hello..!\", first_nm, last_nm)\n", - "\n", - "# correct use\n", - "message(\"Frank\", \"Harper\")\n", - "message(\"Frank\", last_nm=\"Harper\")\n", - "\n", - "message(first_nm=\"Frank\", \"Harper\") # SyntaxError: positional argument follows keyword argument" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Python Arbitrary/Variable-length Arguments\n", - "\n", - "Sometimes, we do not know in advance the number of arguments that will be passed into a function. Python allows us to handle this kind of situation through function calls with an arbitrary number of arguments.\n", - "\n", - "We can pass any number of arguments to this function. Internally all these values are represented in the form of a **tuple**.\n", - "\n", - "In the function definition, we use an asterisk **`*`** before the parameter name to denote this kind of argument. For example:" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T15:57:33.873409Z", - "start_time": "2021-06-13T15:57:33.860717Z" - }, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Hello Gary\n", - "Hello Hank\n", - "Hello Ivan\n", - "Hello John\n" - ] - } - ], - "source": [ - "# Example 1: \n", - "\n", - "def greet(*names):\n", - " \"\"\"This function greets all the person in the names tuple.\"\"\"\n", - " # names is a tuple with arguments\n", - " for name in names:\n", - " print(\"Hello\", name)\n", - "\n", - "greet(\"Gary\", \"Hank\", \"Ivan\", \"John\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Here, we have called the function with multiple arguments. These arguments get wrapped up into a tuple before being passed into the function. Inside the function, we use a **`for`** loop to retrieve all the arguments back." - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T15:57:35.397812Z", - "start_time": "2021-06-13T15:57:35.381211Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Output is: \n", - "10\n", - "Output is: \n", - "70\n", - "40\n", - "20\n", - "Output is: \n", - "30\n", - "60\n", - "90\n", - "120\n" - ] - } - ], - "source": [ - "# Example 2: \n", - "\n", - "def printinfo( arg1, *vartuple ):\n", - " \"This prints a variable passed arguments\"\n", - " print (\"Output is: \")\n", - " print (arg1)\n", - " for var in vartuple:\n", - " print (var)\n", - " return\n", - "\n", - " # Now you can call printinfo function\n", - "printinfo( 10 ) # We have given only one value for the argument\n", - "printinfo( 70, 40, 20 )\n", - "printinfo( 30, 60, 90, 120 )" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T15:57:36.428079Z", - "start_time": "2021-06-13T15:57:36.411477Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Sum is: 0\n", - "Sum is: 33\n", - "Sum is: 176.6\n" - ] - } - ], - "source": [ - "# Example 3: \n", - "\n", - "def addition(*numbers):\n", - " total = 0\n", - " for no in numbers:\n", - " total = total + no\n", - " print(\"Sum is:\", total)\n", - "\n", - "addition() # 0 arguments\n", - "\n", - "addition(10, 5, 3, 6, 9) # 5 arguments\n", - "\n", - "addition(96, 77, 3.6) # 3 arguments" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "hide_input": false, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.8" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false - }, - "varInspector": { - "cols": { - "lenName": 16, - "lenType": 16, - "lenVar": 40 - }, - "kernels_config": { - "python": { - "delete_cmd_postfix": "", - "delete_cmd_prefix": "del ", - "library": "var_list.py", - "varRefreshCmd": "print(var_dic_list())" - }, - "r": { - "delete_cmd_postfix": ") ", - "delete_cmd_prefix": "rm(", - "library": "var_list.r", - "varRefreshCmd": "cat(var_dic_list()) " - } - }, - "types_to_exclude": [ - "module", - "function", - "builtin_function_or_method", - "instance", - "_Feature" - ], - "window_display": false - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From c3734503dd586648b2bc3c04aa161848a0da305e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Wed, 13 Oct 2021 19:31:49 +0530 Subject: [PATCH 28/49] Delete 005_Python_Function_Recursion.ipynb --- 005_Python_Function_Recursion.ipynb | 258 ---------------------------- 1 file changed, 258 deletions(-) delete mode 100644 005_Python_Function_Recursion.ipynb diff --git a/005_Python_Function_Recursion.ipynb b/005_Python_Function_Recursion.ipynb deleted file mode 100644 index 4524058..0000000 --- a/005_Python_Function_Recursion.ipynb +++ /dev/null @@ -1,258 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "All the IPython Notebooks in this lecture series by Dr. Milan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Python Recursion\n", - "\n", - "In this class, you will learn to create a recursive function (a function that calls itself again and again)." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# What is recursion?\n", - "\n", - "Recursion is the process of defining something in terms of itself.\n", - "\n", - "A physical world example would be to **place two parallel mirrors facing each other**. Any object in between them would be reflected recursively." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Python Recursive Function\n", - "\n", - "In Python, we know that a **[function](https://github.com/milaan9/04_Python_Functions/blob/main/001_Python_Functions.ipynb)** can call other functions. It is even possible for the function to call itself. These types of construct are termed as recursive functions.\n", - "\n", - "The following image shows the working of a recursive function called **`recurse`**.\n", - "\n", - "
\n", - "\n", - "
\n", - "\n", - "Following is an example of a recursive function to find the factorial of an integer.\n", - "\n", - "Factorial of a number is the product of all the integers from 1 to that number. For example, the factorial of 6 (denoted as 6!) is \n", - "\n", - "```python\n", - "1*2*3*4*5*6 = 720.\n", - "```" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:03:47.995819Z", - "start_time": "2021-06-13T16:03:47.984100Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "The factorial of 3 is 6\n" - ] - } - ], - "source": [ - "# Example 1:\n", - "\n", - "def factorial(n):\n", - " \"\"\"This is a recursive function to find the factorial of an integer\"\"\"\n", - "\n", - " if n == 1:\n", - " return 1\n", - " else:\n", - " return (n * factorial(n-1)) # 3 * 2 * 1 = 6\n", - "\n", - "\n", - "num = 3\n", - "print(\"The factorial of\", num, \"is\", factorial(num))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "In the above example, **`factorial()`** is a recursive function as it calls itself." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "When we call this function with a positive integer, it will recursively call itself by decreasing the number.\n", - "\n", - "Each function multiplies the number with the factorial of the number below it until it is equal to one. This recursive call can be explained in the following steps.\n", - "\n", - "```python\n", - "factorial(3) # 1st call with 3\n", - "3 * factorial(2) # 2nd call with 2\n", - "3 * 2 * factorial(1) # 3rd call with 1\n", - "3 * 2 * 1 # return from 3rd call as number=1\n", - "3 * 2 # return from 2nd call\n", - "6 # return from 1st call\n", - "```\n", - "\n", - "Let's look at an image that shows a step-by-step process of what is going on:\n", - "\n", - "
\n", - "\n", - "
" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Our recursion ends when the number reduces to 1. This is called the base condition.\n", - "\n", - "Every recursive function must have a base condition that stops the recursion or else the function calls itself infinitely.\n", - "\n", - "The Python interpreter limits the depths of recursion to help avoid infinite recursions, resulting in stack overflows.\n", - "\n", - "By default, the maximum depth of recursion is **`1000`**. If the limit is crossed, it results in **`RecursionError`**. Let's look at one such condition." - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:04:11.723151Z", - "start_time": "2021-06-13T16:04:05.119692Z" - } - }, - "outputs": [ - { - "ename": "RecursionError", - "evalue": "maximum recursion depth exceeded", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mRecursionError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mrecursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 2\u001b[0m \u001b[0mrecursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 3\u001b[1;33m \u001b[0mrecursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[1;32m\u001b[0m in \u001b[0;36mrecursor\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mrecursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mrecursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 3\u001b[0m \u001b[0mrecursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "... last 1 frames repeated, from the frame below ...\n", - "\u001b[1;32m\u001b[0m in \u001b[0;36mrecursor\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mrecursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mrecursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 3\u001b[0m \u001b[0mrecursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;31mRecursionError\u001b[0m: maximum recursion depth exceeded" - ] - } - ], - "source": [ - "def recursor():\n", - " recursor()\n", - "recursor()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Advantages of Recursion\n", - "\n", - "1. Recursive functions make the code look clean and elegant.\n", - "2. A complex task can be broken down into simpler sub-problems using recursion.\n", - "3. Sequence generation is easier with recursion than using some nested iteration." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Disadvantages of Recursion\n", - "\n", - "1. Sometimes the logic behind recursion is hard to follow through.\n", - "2. Recursive calls are expensive (inefficient) as they take up a lot of memory and time.\n", - "3. Recursive functions are hard to debug." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "hide_input": false, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.8" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false - }, - "varInspector": { - "cols": { - "lenName": 16, - "lenType": 16, - "lenVar": 40 - }, - "kernels_config": { - "python": { - "delete_cmd_postfix": "", - "delete_cmd_prefix": "del ", - "library": "var_list.py", - "varRefreshCmd": "print(var_dic_list())" - }, - "r": { - "delete_cmd_postfix": ") ", - "delete_cmd_prefix": "rm(", - "library": "var_list.r", - "varRefreshCmd": "cat(var_dic_list()) " - } - }, - "types_to_exclude": [ - "module", - "function", - "builtin_function_or_method", - "instance", - "_Feature" - ], - "window_display": false - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From a29907d4c141798c0f51578b53729aea92803cb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Wed, 13 Oct 2021 19:31:56 +0530 Subject: [PATCH 29/49] Delete 006_Python_Function_Anonymous.ipynb --- 006_Python_Function_Anonymous.ipynb | 455 ---------------------------- 1 file changed, 455 deletions(-) delete mode 100644 006_Python_Function_Anonymous.ipynb diff --git a/006_Python_Function_Anonymous.ipynb b/006_Python_Function_Anonymous.ipynb deleted file mode 100644 index 93a2c74..0000000 --- a/006_Python_Function_Anonymous.ipynb +++ /dev/null @@ -1,455 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "All the IPython Notebooks in this lecture series by Dr. Milan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Python Anonymous/**`lambda`** Function\n", - "\n", - "In this class, you'll learn about the anonymous function, also known as **`lambda`** functions. You'll learn what they are, their syntax and how to use them (with examples)." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## What are **`lambda`** functions in Python?\n", - "\n", - "In Python, an anonymous function is a **[function](https://github.com/milaan9/04_Python_Functions/blob/main/001_Python_Functions.ipynb)** that is defined without a name.\n", - "\n", - "While normal functions are defined using the **`def`** keyword in Python, anonymous functions are defined using the **`lambda`** keyword.\n", - "\n", - "In opposite to a normal function, a Python **`lambda`** function is a single expression. But, in a lambda body, we can expand with expressions over multiple lines using parentheses **`()`** or a multiline string **`\"\"\" \"\"\"`**.\n", - "\n", - "For example: **`lambda n:n+n`**\n", - "\n", - "The reason behind the using anonymous function is for instant use, that is, one-time usage and the code is very concise so that there is more readability in the code.\n", - "\n", - "Hence, anonymous functions are also called **`lambda`** functions.\n", - "\n", - "* Lambda forms can take any number of arguments but return just one value in the form of an expression. They cannot contain commands or multiple expressions.\n", - "\n", - "* An anonymous function cannot be a direct call to print because **lambda** requires an expression. \n", - "\n", - "* **`lambda`** functions have their own local namespace and cannot access variables other than those in their parameter list and those in the global namespace. \n", - "\n", - "* Although it appears that lambdas are a one-line version of a function, they are not equivalent to inline statements in C or C++, whose purpose is to stack allocation by passing function, during invocation for performance reasons.\n", - "\n", - "**Syntax:** \n", - "\n", - "```python\n", - "lambda argument_list: expression\n", - "```" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Letโ€™s see an example to print even numbers without a **`lambda`** function and with a **`lambda`** function. See the difference in line of code as well as readability of code." - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:39:39.033426Z", - "start_time": "2021-06-13T16:39:39.014872Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Even numbers are: [10, 16, 78, 2]\n" - ] - } - ], - "source": [ - "# Example 1: Program for even numbers without lambda function\n", - "\n", - "def even_numbers(nums):\n", - " even_list = []\n", - " for n in nums:\n", - " if n % 2 == 0:\n", - " even_list.append(n)\n", - " return even_list\n", - "\n", - "num_list = [10, 9, 16, 78, 2, 3, 7, 1]\n", - "ans = even_numbers(num_list)\n", - "print(\"Even numbers are:\", ans)" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:39:39.494358Z", - "start_time": "2021-06-13T16:39:39.474831Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Even numbers are: [10, 16, 78, 2]\n" - ] - } - ], - "source": [ - "# Example 1: Program for even number with a lambda function\n", - "\n", - "l = [10, 9, 16, 78, 2, 3, 7, 1]\n", - "even_nos = list(filter(lambda x: x % 2 == 0, l))\n", - "print(\"Even numbers are: \", even_nos)" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:39:39.879120Z", - "start_time": "2021-06-13T16:39:39.860569Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "12\n" - ] - } - ], - "source": [ - "# Example 2: Program to show the use of lambda functions\n", - "\n", - "double = lambda x: x * 2\n", - "\n", - "print(double(6))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**Explanation:**\n", - "\n", - "In the above program, lambda **`x: x * 2`** is the lambda function. Here **`x`** is the argument and **`x * 2`** is the expression that gets evaluated and returned.\n", - "\n", - "This function has no name. It returns a function object which is assigned to the identifier **`double`**. We can now call it as a normal function. The statement\n", - "\n", - "```python\n", - ">>> double = lambda x: x * 2\n", - "```\n", - "\n", - "is nearly the same as:\n", - "\n", - "```python\n", - ">>> def double(x):\n", - ">>> return x * 2\n", - "```" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:39:40.863492Z", - "start_time": "2021-06-13T16:39:40.847866Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Square of number is 100\n", - "Square of number is 4\n" - ] - } - ], - "source": [ - "# Example 3: Normal Function definition is here\n", - "\n", - "def square(x):\n", - " return x*x\n", - "\n", - "# anonymous function\n", - "sqr = lambda x: x*x\n", - "\n", - "#Calling square function\n", - "print(\"Square of number is\",square(10)) #call normal function\n", - "print(\"Square of number is\",sqr(2)) #call anonymous function" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Use of **`lambda`** Function in python\n", - "\n", - "We use **`lambda`** function when we require a nameless function for a short period of time.\n", - "\n", - "In Python, we generally use it as an argument to a higher-order function (a function that takes in other functions as **[arguments](https://github.com/milaan9/04_Python_Functions/blob/main/004_Python_Function_Arguments.ipynb)**). **`lambda`** function are used along with built-in functions like **`filter()`**, **`map()`**, **`reduce()`** etc." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### `lambda` function use with `filter()`\n", - "\n", - "The **`filter()`** function in Python takes in a function and a list as arguments.\n", - "\n", - "The function is called with all the items in the list and a new list is returned which contains items for which the function evaluates to **`True`**.\n", - "\n", - "Here is an example use of **`filter()`** function to filter out only even numbers from a list." - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:39:42.617383Z", - "start_time": "2021-06-13T16:39:42.602735Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Even numbers are: [4, 6, 8, 12]\n" - ] - } - ], - "source": [ - "# Example 1: Program to filter out only the even items from a list\n", - "\n", - "my_list = [1, 5, 4, 6, 8, 11, 3, 12] # total 8 elements\n", - "\n", - "new_list = list(filter(lambda x: (x%2 == 0), my_list)) # returns the output in form of a list\n", - "\n", - "print(\"Even numbers are: \", new_list)" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:39:43.496282Z", - "start_time": "2021-06-13T16:39:43.478704Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Positive numbers are: [5, 12, 6, 9]\n" - ] - } - ], - "source": [ - "# Example 2: \n", - "\n", - "l = [-10, 5, 12, -78, 6, -1, -7, 9]\n", - "positive_nos = list(filter(lambda x: x > 0, l))\n", - "print(\"Positive numbers are: \", positive_nos)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### `lambda` function with `map()`\n", - "\n", - "The **`map()`** function in Python takes in a function and a list.\n", - "\n", - "The function is called with all the items in the list and a new list is returned which contains items returned by that function for each item.\n", - "\n", - "Here is an example use of **`map()`** function to double all the items in a list." - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:39:45.093927Z", - "start_time": "2021-06-13T16:39:45.078304Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Double values are: [2, 10, 8, 12, 16, 22, 6, 24]\n" - ] - } - ], - "source": [ - "# Example 1: Program to double each item in a list using map()\n", - "\n", - "my_list = [1, 5, 4, 6, 8, 11, 3, 12] # total 8 elements\n", - "new_list = list(map(lambda x: x * 2, my_list)) # returns the output in form of a list\n", - "print(\"Double values are: \", new_list)" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:39:45.524588Z", - "start_time": "2021-06-13T16:39:45.512870Z" - }, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Cube values are: [8, 27, 64, 512, 729]\n" - ] - } - ], - "source": [ - "# Example 2:\n", - "\n", - "list1 = [2, 3, 4, 8, 9]\n", - "list2 = list(map(lambda x: x*x*x, list1))\n", - "print(\"Cube values are:\", list2)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### `lambda` function with `reduce()`\n", - "\n", - "The **`reduce()`** function is used to minimize sequence elements into a single value by applying the specified condition.\n", - "\n", - "The **`reduce()`** function is present in the **`functools`** module; hence, we need to import it using the import statement before using it." - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:39:46.968912Z", - "start_time": "2021-06-13T16:39:46.960127Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Addition of all list elements is : 54\n" - ] - } - ], - "source": [ - "# Example 1:\n", - "\n", - "from functools import reduce\n", - "list1 = [20, 13, 4, 8, 9]\n", - "add = reduce(lambda x, y: x+y, list1)\n", - "print(\"Addition of all list elements is : \", add)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "hide_input": false, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.8" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false - }, - "varInspector": { - "cols": { - "lenName": 16, - "lenType": 16, - "lenVar": 40 - }, - "kernels_config": { - "python": { - "delete_cmd_postfix": "", - "delete_cmd_prefix": "del ", - "library": "var_list.py", - "varRefreshCmd": "print(var_dic_list())" - }, - "r": { - "delete_cmd_postfix": ") ", - "delete_cmd_prefix": "rm(", - "library": "var_list.r", - "varRefreshCmd": "cat(var_dic_list()) " - } - }, - "types_to_exclude": [ - "module", - "function", - "builtin_function_or_method", - "instance", - "_Feature" - ], - "window_display": false - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From 98d2c389b76420944ee9814ef3037515f3173028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Wed, 13 Oct 2021 19:32:04 +0530 Subject: [PATCH 30/49] Delete 007_Python_Function_Module.ipynb --- 007_Python_Function_Module.ipynb | 1567 ------------------------------ 1 file changed, 1567 deletions(-) delete mode 100644 007_Python_Function_Module.ipynb diff --git a/007_Python_Function_Module.ipynb b/007_Python_Function_Module.ipynb deleted file mode 100644 index da4f911..0000000 --- a/007_Python_Function_Module.ipynb +++ /dev/null @@ -1,1567 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "All the IPython Notebooks in this lecture series by Dr. Milan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Python Modules\n", - "\n", - "In this class, you will learn to create and import custom modules in Python. Also, you will find different techniques to import and use custom and built-in modules in Python." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## What are modules in Python?\n", - "\n", - "Modules refer to the Python file, which contains Python code like Python statements, classes, functions, variables, etc. A file with Python code is defined with extension**`.py`**\n", - "\n", - "For example: In **`main.py`**, where the **`main`** is the module name.\n", - "\n", - "In Python, large code is divided into small modules. The benefit of modules is, it provides a way to share reusable functions." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Advantage\n", - "\n", - "* **Reusability**: Module can be used in some other python code. Hence it provides the facility of code reusability.\n", - "* **Categorization**: Similar type of attributes can be placed in one module." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Creating a module in Python\n", - "\n", - "A file containing Python code, for example: **`example.py`**, is called a module, and its module name would be **`example`**.\n", - "\n", - "We use modules to break down large programs into small manageable and organized files. Furthermore, modules provide reusability of code.\n", - "\n", - "We can define our most used functions in a module and import it, instead of copying their definitions into different programs.\n", - "\n", - "The module contains Python code like classes, functions, methods, but it also has variables. A variable can list, tuple, dict, etc.\n", - "\n", - "Let us create a module. Type the following and save it as **`example.py`**.\n", - "\n", - "```python\n", - "# Python Module example\n", - "\n", - ">>> def add(a, b):\n", - ">>> \"\"\"This program adds two numbers and return the result\"\"\"\n", - ">>> result = a + b\n", - ">>> return result\n", - "```\n", - "\n", - "Here, we have defined a **[function](https://github.com/milaan9/04_Python_Functions/blob/main/001_Python_Functions.ipynb)** **`add()`** inside a module named **`example`**. The function takes in two numbers and returns their sum." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## How to import modules in Python?\n", - "\n", - "We can import the definitions inside a module to another module or the interactive interpreter in Python.\n", - "\n", - "We use the **`import`** keyword to do this. To import our previously defined module example, we type the following in the Python prompt." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "```python\n", - ">>> import example\n", - "```\n", - "This does not import the names of the functions defined in **`example`** directly in the current symbol table. It only imports the module name **`example`** there.\n", - "\n", - "Using the module name we can access the function using the dot **`.`** operator. For example:\n", - "\n", - "**# Example 1:**" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:46:07.519826Z", - "start_time": "2021-06-14T07:46:07.484668Z" - } - }, - "outputs": [ - { - "data": { - "text/plain": [ - "9.6" - ] - }, - "execution_count": 1, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "import example\n", - "example.add(3,6.6)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Python has tons of standard modules. You can check out the full list of **[Python standard modules](https://docs.python.org/3/py-modindex.html)** and their use cases. These files are in the Lib directory inside the location where you installed Python.\n", - "\n", - "Standard modules can be imported the same way as we import our user-defined modules.\n", - "\n", - "There are various ways to import modules. They are listed below:" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**# Example 2:**\n", - "\n", - "The Python code for a module named a name normally resides in a file **main.py**. But first create a function in **test.py**. Here is an example of a simple module,\n", - "\n", - "**test.py** - \n", - "\n", - "```python\n", - ">>> def fun():\n", - ">>> print(\"something here inside fun()\")\n", - "```\n", - "**main.py** โˆ’\n", - "\n", - "```python\n", - ">>> import test\n", - ">>> from test import fun\n", - ">>> fun()\n", - "```\n", - "\n", - "Output of above example: Run **main.py**\n", - "\n", - "`something here inside fun()`\n", - "\n", - "----------------------------------------------------------------\n", - "For **test.ipynb** or **test1.ipynb** and **main.ipynb**\n", - "\n", - "Open anaconda prompt and type **`pip install import-ipynb`**\n", - "\n", - "see:\n", - "Downloading import-ipynb-0.1.3.tar.gz (4.0 kB)\n", - "\n", - "**test.py** or **test1.ipynb** - \n", - "\n", - "```python\n", - ">>> def fun():\n", - ">>> print(\"something here inside fun()\")\n", - "```\n", - "**main.ipynb** โˆ’\n", - "\n", - "```python\n", - ">>> import import_ipynb\n", - "\n", - ">>> import test1\n", - ">>> from test1 import fun\n", - ">>> fun()\n", - "```\n", - "\n", - "Output of above example: Run **main.ipynb**\n", - "\n", - "`something here inside fun()`" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**# Example 3:**\n", - "\n", - "**fibo.py** - \n", - "\n", - "```python\n", - "# Fibonacci numbers module\n", - ">>> def fib(n): # return Fibonacci series up to n\n", - ">>> result = []\n", - ">>> a, b = 0, 1\n", - ">>> while b < n:\n", - ">>> result.append(b)\n", - ">>> a, b = b, a + b\n", - ">>> return result\n", - "```\n", - "**main.py** โˆ’\n", - "\n", - "```python\n", - ">>> import fibo\n", - ">>> from fibo import fib\n", - ">>> print(fib(100))\n", - "```\n", - "\n", - "Output of above example: Run **main.py**\n", - "\n", - "`[1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]`\n", - "\n", - "----------------------------------------------------------------\n", - "For **test.ipynb** or **test1.ipynb** and **main.ipynb**\n", - "\n", - "Open anaconda prompt and type **`pip install import-ipynb`**\n", - "\n", - "see:\n", - "Downloading import-ipynb-0.1.3.tar.gz (4.0 kB)\n", - "\n", - "**fibo1.ipynb** or **fibo.py** - \n", - "\n", - "```python\n", - "# Fibonacci numbers module\n", - ">>> def fib(n): # return Fibonacci series up to n\n", - ">>> result = []\n", - ">>> a, b = 0, 1\n", - ">>> while b < n:\n", - ">>> result.append(b)\n", - ">>> a, b = b, a + b\n", - ">>> return result\n", - "```\n", - "**main.ipynb** โˆ’\n", - "\n", - "```python\n", - ">>> import import_ipynb\n", - "\n", - ">>> import fibo1\n", - ">>> from fibo1 import fib\n", - ">>> print(fib(100))\n", - "```\n", - "\n", - "Output of above example: Run **main.ipynb**\n", - "\n", - "`[1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]`" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**# Example 4:**\n", - "\n", - "**equal.py** - \n", - "\n", - "```python\n", - "#function definition\n", - ">>> def equal(a, b):\n", - ">>> if(a == b):\n", - ">>> return True\n", - "```\n", - "**main.py** โˆ’\n", - "\n", - "```python\n", - ">>> from equal import *\n", - ">>> a, b = 10, 10\n", - ">>> print(equal(a, b))\n", - "```\n", - "\n", - "Output of above example: Run **main.py**\n", - "\n", - "`True`\n", - "\n", - "----------------------------------------------------------------\n", - "For **equal.ipynb** or **equal1.ipynb** and **main.ipynb**\n", - "\n", - "Open anaconda prompt and type **`pip install import-ipynb`**\n", - "\n", - "see:\n", - "Downloading import-ipynb-0.1.3.tar.gz (4.0 kB)\n", - "\n", - "**equal.ipynb** or **equal1.ipynb** - \n", - "\n", - "```python\n", - "#function definition\n", - ">>> def equal(a, b):\n", - ">>> if(a == b):\n", - ">>> return True\n", - "```\n", - "**main.ipynb** โˆ’\n", - "\n", - "```python\n", - ">>> import import_ipynb\n", - "\n", - ">>> from equal1 import *\n", - ">>> a, b = 10, 10\n", - ">>> print(equal(a, b))\n", - "```\n", - "\n", - "Output of above example: Run **main.ipynb**\n", - "\n", - "`True`" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "In Python, each and every built-in module has a large number of predefined functions to perform specific tasks. For instance, Python has a built-in module named **`operator`**, inside which the function called **`eq()`** is defined. This function returns the boolean value of **`True`** if the given two input values are equal. Else, returns **`False`**.\n", - "\n", - "So now, we can make use of this operator module in our **`main()`** program to check if two numbers are equal. This means we would no longer need that **`equal.py`** module." - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:46:14.308906Z", - "start_time": "2021-06-14T07:46:14.293280Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "True\n" - ] - } - ], - "source": [ - "# Example 5: \n", - "\n", - "#main function\n", - "from operator import *\n", - "a, b = 10, 10\n", - "print(eq(a, b))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Python `import` statement\n", - "\n", - "We can import a module using the **`import`** statement and access the definitions inside it using the dot operator **`.`** as described above. Here is an example." - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:46:34.341189Z", - "start_time": "2021-06-14T07:46:34.332403Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "The value of pi is 3.141592653589793\n" - ] - } - ], - "source": [ - "# Example 1: \n", - "\n", - "# import statement example to import standard module math\n", - "import math\n", - "print(\"The value of pi is\", math.pi)" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:46:35.014041Z", - "start_time": "2021-06-14T07:46:34.996467Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "2.449489742783178\n" - ] - } - ], - "source": [ - "# Example 2:\n", - "\n", - "import math\n", - "\n", - "# use math module functions\n", - "print(math.sqrt(6)) # Output 2.449489742783178" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### `import` multiple modules\n", - "\n", - "If we want to use more than one module, then we can import multiple modules. This is the simplest form of **`import`** a keyword that we already use in the above example." - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:46:36.160041Z", - "start_time": "2021-06-14T07:46:36.149303Z" - }, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "720\n", - "15\n" - ] - } - ], - "source": [ - "# Example 1: Import two modules\n", - "\n", - "import math, random\n", - "\n", - "print(math.factorial(6))\n", - "print(random.randint(10, 30))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Python `from-import` statement\n", - "\n", - "To import particular classes or functions, we can use the **`from-import`** statement. It is an alternate way to **`import`**. By using this form, we can import individual attributes and methods directly into the program.We can import specific names from a module without importing the module as a whole." - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:46:37.423714Z", - "start_time": "2021-06-14T07:46:37.405165Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "720\n" - ] - } - ], - "source": [ - "# Example 1: import only factorial function from math module\n", - "from math import factorial\n", - "\n", - "print(factorial(6))" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:46:38.311414Z", - "start_time": "2021-06-14T07:46:38.292861Z" - } - }, - "outputs": [ - { - "data": { - "text/plain": [ - "2.718281828459045" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Example 2: \n", - "\n", - "from math import pi, e\n", - "e" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:46:38.781631Z", - "start_time": "2021-06-14T07:46:38.767960Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "The value of pi is 3.141592653589793\n" - ] - } - ], - "source": [ - "# Example 3: \n", - "\n", - "# import only pi from math module\n", - "from math import pi\n", - "print(\"The value of pi is\", pi)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Here, we imported only the **`pi`** attribute from the **`math`** module.\n", - "\n", - "In such cases, we don't use the dot operator. We can also import multiple attributes as follows:" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:46:39.456438Z", - "start_time": "2021-06-14T07:46:39.446672Z" - } - }, - "outputs": [ - { - "data": { - "text/plain": [ - "3.141592653589793" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Example 4: \n", - "\n", - "from math import pi, e\n", - "pi" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### `import` with renaming\n", - "\n", - "We can import a module by renaming it as follows:" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:46:40.576071Z", - "start_time": "2021-06-14T07:46:40.565331Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "The value of pi is 3.141592653589793\n" - ] - } - ], - "source": [ - "# Example 1: \n", - "\n", - "# import module by renaming it\n", - "import math as m\n", - "print(\"The value of pi is\", m.pi)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We have renamed the **`math`** module as **`m`**. This can save us typing time in some cases.\n", - "\n", - ">**Note:** that the name **`math`** is not recognized in our scope. Hence, **`math.pi`** is invalid, and **`m.pi`** is the correct implementation." - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:46:41.526267Z", - "start_time": "2021-06-14T07:46:41.517479Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "16\n" - ] - } - ], - "source": [ - "# Example 2: Import a module by renaming it\n", - "\n", - "import random as rand\n", - "\n", - "print(rand.randrange(10, 20, 2))" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:46:42.048239Z", - "start_time": "2021-06-14T07:46:42.031641Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "47\n" - ] - } - ], - "source": [ - "# Example 3: import a method by renaming it\n", - "\n", - "# rename randint as random_number\n", - "from random import randint as random_number\n", - "\n", - "# Gives any random number from range(10, 50)\n", - "print(random_number(30, 60))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### `import` all names\n", - "\n", - "We can **`import`** all functions and attributes of a specific module, then instead of writing all function names and attribute names, we can import all using an **asterisk** **`*`**." - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:46:43.349513Z", - "start_time": "2021-06-14T07:46:43.341704Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "The value of pi is 3.141592653589793\n" - ] - } - ], - "source": [ - "# Example 1: \n", - "\n", - "# import all names from the standard module math\n", - "\n", - "from math import *\n", - "print(\"The value of pi is\", pi)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Here, we have imported all the definitions from the **`math`** module. This includes all names visible in our scope except those beginning with an underscore(private definitions).\n", - "\n", - "Importing everything with the asterisk **`*`** symbol is not a good programming practice. This can lead to duplicate definitions for an identifier. It also hampers the readability of our code." - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:46:45.054109Z", - "start_time": "2021-06-14T07:46:45.045322Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "216.0\n", - "720\n", - "9.42477796076938\n", - "10.0\n" - ] - } - ], - "source": [ - "# Example 2: \n", - "\n", - "from math import *\n", - "print(pow(6,3))\n", - "print(factorial(6))\n", - "\n", - "print(pi*3)\n", - "print(sqrt(100))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Python Module Search Path\n", - "\n", - "While importing a module, Python looks at several places. Interpreter first looks for a built-in module. Then(if built-in module not found), Python looks into a list of directories defined in **`sys.path`**. The search is in this order.\n", - "\n", - "1. The current directory.\n", - "2. **`PYTHONPATH`** (an environment variable with a list of directories).\n", - "3. The installation-dependent default directory." - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:46:46.497469Z", - "start_time": "2021-06-14T07:46:46.478919Z" - } - }, - "outputs": [ - { - "data": { - "text/plain": [ - "['C:\\\\Users\\\\Deepak\\\\01_Learn_Python4Data\\\\04_Python_Functions',\n", - " 'C:\\\\ProgramData\\\\Anaconda3\\\\python38.zip',\n", - " 'C:\\\\ProgramData\\\\Anaconda3\\\\DLLs',\n", - " 'C:\\\\ProgramData\\\\Anaconda3\\\\lib',\n", - " 'C:\\\\ProgramData\\\\Anaconda3',\n", - " '',\n", - " 'C:\\\\Users\\\\Deepak\\\\AppData\\\\Roaming\\\\Python\\\\Python38\\\\site-packages',\n", - " 'C:\\\\ProgramData\\\\Anaconda3\\\\lib\\\\site-packages',\n", - " 'C:\\\\ProgramData\\\\Anaconda3\\\\lib\\\\site-packages\\\\locket-0.2.1-py3.8.egg',\n", - " 'C:\\\\ProgramData\\\\Anaconda3\\\\lib\\\\site-packages\\\\win32',\n", - " 'C:\\\\ProgramData\\\\Anaconda3\\\\lib\\\\site-packages\\\\win32\\\\lib',\n", - " 'C:\\\\ProgramData\\\\Anaconda3\\\\lib\\\\site-packages\\\\Pythonwin',\n", - " 'C:\\\\ProgramData\\\\Anaconda3\\\\lib\\\\site-packages\\\\IPython\\\\extensions',\n", - " 'C:\\\\Users\\\\Deepak\\\\.ipython']" - ] - }, - "execution_count": 15, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "import sys\n", - "sys.path" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We can add and modify this list to add our own path." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Reloading a module\n", - "\n", - "The Python interpreter imports a module only once during a session. This makes things more efficient. Foe example:" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**# Example 1:**\n", - "\n", - "Suppose we have the following code in a module named **`my_module`**.\n", - "\n", - "```python\n", - "# This module shows the effect of\n", - "# multiple imports and reload\n", - "\n", - "print(\"This code got executed\")\n", - "```" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:46:49.371505Z", - "start_time": "2021-06-14T07:46:49.356854Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "This code got executed\n" - ] - } - ], - "source": [ - "import my_module" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We can see that our code got executed only once. This goes to say that our module was imported only once.\n", - "\n", - "Now if our module changed during the course of the program, we would have to reload it.One way to do this is to restart the interpreter. But this does not help much.\n", - "\n", - "Python provides a more efficient way of doing this. We can use the **`reload()`** function inside the **`imp`** module to reload a module. We can do it in the following ways:" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:46:50.767992Z", - "start_time": "2021-06-14T07:46:50.749439Z" - } - }, - "outputs": [], - "source": [ - "import imp\n", - "import my_module" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:46:51.504810Z", - "start_time": "2021-06-14T07:46:51.484304Z" - }, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "This code got executed\n" - ] - }, - { - "data": { - "text/plain": [ - "" - ] - }, - "execution_count": 18, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "import my_module\n", - "imp.reload(my_module)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**# Example 2:**\n", - "\n", - "First, create a Python module with the name **`greet_module.pynb`**\n", - "and write the below code in that file.\n", - "\n", - "```python\n", - ">>> print(\"Welcome to Dr Parmar's Python4DataScience class\")\n", - "```\n", - "\n", - "Now, create a Python file with the name, **main.py** and write the below code in it and import the module test_module.py. See the following code.\n", - "\n", - "```python\n", - ">>> import import_ipynb\n", - ">>> import time\n", - ">>> from importlib import reload\n", - "\n", - ">>> # load 1st time\n", - ">>> import test_module\n", - ">>> time.sleep(25)\n", - ">>> # reload \n", - ">>> reload(test_module)\n", - ">>> time.sleep(25) \n", - "\n", - ">>> # reload again \n", - ">>> reload(test_module)\n", - ">>> print(\"This is test file..\")\n", - "```\n", - "\n", - "Output of above example: Run **main.py** \n", - "\n", - "```python\n", - "Welcome to Dr Parmar's Python4DataScience class\n", - "Welcome to Dr Parmar's Python4DataScience class\n", - "Welcome to Dr Parmar's Python4DataScience class\n", - "This is test file..\n", - "```" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## The `dir()` built-in function\n", - "\n", - "We can use the **`dir()`** function to find out names that are defined inside a module. When we use this function with any object (an object can be sequence like list, tuple, set, dict or can be class, function, module, etc. ), it returns properties, attributes, and method.\n", - "\n", - "For example, we have defined a function **`add()`** in the module example that we had in the beginning.\n", - "\n", - "We can use dir in example module in the following way:" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:46:55.339289Z", - "start_time": "2021-06-14T07:46:55.317811Z" - } - }, - "outputs": [ - { - "data": { - "text/plain": [ - "['__builtins__',\n", - " '__cached__',\n", - " '__doc__',\n", - " '__file__',\n", - " '__loader__',\n", - " '__name__',\n", - " '__package__',\n", - " '__spec__',\n", - " 'add']" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Example 1:\n", - "\n", - "dir(example)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Here, we can see a sorted list of names (along with **`add`**). All other names that begin with an underscore are default Python attributes associated with the module (not user-defined).\n", - "\n", - "For example, the **`__name__`** attribute contains the name of the module." - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:46:56.608826Z", - "start_time": "2021-06-14T07:46:56.597109Z" - } - }, - "outputs": [ - { - "data": { - "text/plain": [ - "'example'" - ] - }, - "execution_count": 20, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Example 2:\n", - "\n", - "import example\n", - "example.__name__" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "All the names defined in our current namespace can be found out using the **`dir()`** function without any arguments." - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:46:57.786076Z", - "start_time": "2021-06-14T07:46:57.774360Z" - } - }, - "outputs": [ - { - "data": { - "text/plain": [ - "['__builtins__', '__doc__', '__name__', 'a', 'b', 'math', 'pyscripter']" - ] - }, - "execution_count": 21, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Example 3:\n", - "\n", - "a = 1\n", - "b = \"hello\"\n", - "import math\n", - "dir()\n", - "['__builtins__', '__doc__', '__name__', 'a', 'b', 'math', 'pyscripter']" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:46:58.568301Z", - "start_time": "2021-06-14T07:46:58.549753Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "['__doc__', '__loader__', '__name__', '__package__', '__spec__', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'comb', 'copysign', 'cos', 'cosh', 'degrees', 'dist', 'e', 'erf', 'erfc', 'exp', 'expm1', 'fabs', 'factorial', 'floor', 'fmod', 'frexp', 'fsum', 'gamma', 'gcd', 'hypot', 'inf', 'isclose', 'isfinite', 'isinf', 'isnan', 'isqrt', 'ldexp', 'lgamma', 'log', 'log10', 'log1p', 'log2', 'modf', 'nan', 'perm', 'pi', 'pow', 'prod', 'radians', 'remainder', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'tau', 'trunc']\n" - ] - } - ], - "source": [ - "# Example 4:\n", - "\n", - "import math\n", - "\n", - "print(dir(math))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Python Modules List\n", - "\n", - "Using Python built-in function **`help()`**, we can obtain the list of built-in modules available in Python. On executing the line help ('modules') in Python IDE, you can see all the Python built-in modules. Some of the frequently used ones are discussed below.\n", - "\n", - "| Module | Description |\n", - "|:----| :--- |\n", - "| **`Operator`** | This module provides a set of pre-defined functions corresponding to operators in Python. | \n", - "| **`decimal`** | This module is used to print the complete decimal value when one number is divided by another number. | \n", - "| **[random](https://github.com/milaan9/04_Python_Functions/blob/main/008_Python_Function_random_Module.ipynb)** | random module is used to generate random numbers. Some of the pre-defined functions of this module are **`randint()`**, **`choice()`**, **`uniform`**, etc. | \n", - "| **`string`** | string module provides a set of functions that are used to perform certain operations on characters. This module has pre-defined functions like capwords, ascii_letters, etc. | \n", - "| **[math](https://github.com/milaan9/04_Python_Functions/blob/main/009_Python_Function_math_Module.ipynb.ipynb)** | math module is used to perform mathematical operations. This module provides some pre-defined mathematical functions like sqrt, factorial, etc. | " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Python Built-In Modules Examples\n", - "\n", - "There are many **built-in** modules in Python. Some of them are as follows: operator, **[random](https://github.com/milaan9/04_Python_Functions/blob/main/008_Python_Function_random_Module.ipynb)** , **[math](https://github.com/milaan9/04_Python_Functions/blob/main/009_Python_Function_math_Module.ipynb.ipynb)**, threading , collections , os , mailbox , string , time , tkinter etc." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Example Using Operator Module" - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:47:01.831496Z", - "start_time": "2021-06-14T07:47:01.822708Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "200\n", - "False\n", - "10\n", - "Hello World\n" - ] - } - ], - "source": [ - "# Example 1:\n", - "\n", - "from operator import *\n", - "a, b = 10, 20\n", - "#prints the product of the values 'a' and 'b'\n", - "print(mul(a, b))\n", - "#prints True if the value of 'a' is greater than 'b'. Else, False\n", - "print(gt(a, b))\n", - "#prints the remainder value, when the value of 'a' is divided by 'b'\n", - "print(mod(a, b))\n", - "#concatenates and prints the given two strings\n", - "print(concat(\"Hello \", \"World\"))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Example Using Decimal Module" - ] - }, - { - "cell_type": "code", - "execution_count": 24, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:47:04.034628Z", - "start_time": "2021-06-14T07:47:03.981892Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "3.3333333333333335\n", - "3.333333333333333481363069950020872056484222412109375\n" - ] - } - ], - "source": [ - "# Example 1:\n", - "\n", - "from decimal import *\n", - "a, b = 10, 3\n", - "c = a / b\n", - "print(c)\n", - "print(Decimal(c)) #prints the complete decimal value of c" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Example Using Random Module\n", - "\n", - "The **[random](https://github.com/milaan9/04_Python_Functions/blob/main/008_Python_Function_random_Module.ipynb)** module is used to generate the random numbers. It provides the following two built in functions:\n", - "\n", - "#### Comparision operators in Python\n", - "\n", - "| Function | Description |\n", - "|:----| :--- |\n", - "| **`random()`** | It returns a random number between 0.0 and 1.0 where 1.0 is exclusive. | \n", - "| **`randint(x,y)`** | It returns a random number between x and y where both the numbers are inclusive. | " - ] - }, - { - "cell_type": "code", - "execution_count": 25, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:47:05.474084Z", - "start_time": "2021-06-14T07:47:05.462368Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "16\n", - "56\n", - "14.946114032122827\n" - ] - } - ], - "source": [ - "# Example 1:\n", - "\n", - "from random import *\n", - "print(randint(10, 20)) #prints a random number between the given range\n", - "\n", - "list1 = [30, 23, 45, 16, 89, 56]\n", - "print(choice(list1)) #prints a random element from the given iterator\n", - "\n", - "print(uniform(10, 20)) #prints a random float number between two given values" - ] - }, - { - "cell_type": "code", - "execution_count": 26, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:47:06.164515Z", - "start_time": "2021-06-14T07:47:06.157682Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0.6730248317695879\n", - "3\n" - ] - } - ], - "source": [ - "# Example 2:\n", - "\n", - "import random\n", - "\n", - "print(random.random())\n", - "print(random.randint(2,8))" - ] - }, - { - "cell_type": "code", - "execution_count": 27, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:47:07.220182Z", - "start_time": "2021-06-14T07:47:07.214327Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "16\n" - ] - } - ], - "source": [ - "# Example 3:\n", - "\n", - "from random import randint # import randint function\n", - "\n", - "# call randint function to get random number\n", - "print(randint(10, 30)) " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Example Using String Module" - ] - }, - { - "cell_type": "code", - "execution_count": 28, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:47:09.181611Z", - "start_time": "2021-06-14T07:47:09.165991Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Hello World\n", - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n" - ] - } - ], - "source": [ - "# Example 1:\n", - "\n", - "from string import *\n", - "print(capwords(\"hello world\")) #capitalizes the first letter of each words\n", - "print(ascii_letters) #prints all lowercase and uppercase letters" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Example Using Math Module\n", - "\n", - "Using **[math](https://github.com/milaan9/04_Python_Functions/blob/main/009_Python_Function_math_Module.ipynb.ipynb)** module, you can use different built in mathematical functions.\n", - "\n", - "#### math module Functions:\n", - "\n", - "| Function | Description |\n", - "|:----| :--- |\n", - "| **`ceil(n)`** | It returns the next integer number of the given number. | \n", - "| **`sqrt(n)`** | It returns the Square root of the given number. | \n", - "| **`exp(n)`** | It returns the natural logarithm e raised to the given number. | \n", - "| **`floor(n)`** | It returns the previous integer number of the given number. | \n", - "| **`log(n,baseto)`** | It returns the previous integer number of the given number. | \n", - "| **`pow(baseto, exp)`** | It returns baseto raised to the exp power. | \n", - "| **`sin(n)`** | It returns sine of the given radian. | \n", - "| **`cos(n)`** | It returns cosine of the given radian. | \n", - "| **`tan(n)`** | It returns tangent of the given radian. | " - ] - }, - { - "cell_type": "code", - "execution_count": 29, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:47:10.976053Z", - "start_time": "2021-06-14T07:47:10.965311Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "4.0\n", - "120\n" - ] - } - ], - "source": [ - "# Example 1:\n", - "\n", - "from math import *\n", - "print(sqrt(16)) #prints the square root of the value 16 in the form of a floating-point value\n", - "print(factorial(5)) #prints the factorial of the value 5" - ] - }, - { - "cell_type": "code", - "execution_count": 30, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:47:11.779765Z", - "start_time": "2021-06-14T07:47:11.767073Z" - }, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "5\n", - "4\n", - "3.0\n", - "20.085536923187668\n", - "0.6931471805599453\n", - "8.0\n", - "0.0\n", - "1.0\n", - "1.6197751905438615\n" - ] - } - ], - "source": [ - "# Example 2:\n", - "\n", - "import math\n", - "\n", - "a=4.6\n", - "print(math.ceil(a))\n", - "print(math.floor(a))\n", - "b=9\n", - "print(math.sqrt(b))\n", - "print(math.exp(3.0))\n", - "print(math.log(2.0))\n", - "print(math.pow(2.0,3.0))\n", - "print(math.sin(0))\n", - "print(math.cos(0))\n", - "print (math.tan(45))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### Constants - \n", - "\n", - "The math module provides two constants for mathematical Operations:\n", - "\n", - "* **`math.pi`** : Returns constant Pi = 3.14159...\n", - "* **`math.e`** : Returns constant e= 2.71828..." - ] - }, - { - "cell_type": "code", - "execution_count": 31, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-14T07:47:13.590315Z", - "start_time": "2021-06-14T07:47:13.581529Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "math.pi : 3.141592653589793\n", - "math.e : 2.718281828459045\n" - ] - } - ], - "source": [ - "# Example 3:\n", - "\n", - "import math\n", - "\n", - "print(\"math.pi : \",math.pi)\n", - "print(\"math.e : \",math.e)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Wrap up\n", - "\n", - "Since Python provides a lot of built-in modules, it is advisable to use built-in modules rather than user-created modules to perform basic operations." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "hide_input": false, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.8" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": { - "height": "calc(100% - 180px)", - "left": "10px", - "top": "150px", - "width": "204.797px" - }, - "toc_section_display": true, - "toc_window_display": false - }, - "varInspector": { - "cols": { - "lenName": 16, - "lenType": 16, - "lenVar": 40 - }, - "kernels_config": { - "python": { - "delete_cmd_postfix": "", - "delete_cmd_prefix": "del ", - "library": "var_list.py", - "varRefreshCmd": "print(var_dic_list())" - }, - "r": { - "delete_cmd_postfix": ") ", - "delete_cmd_prefix": "rm(", - "library": "var_list.r", - "varRefreshCmd": "cat(var_dic_list()) " - } - }, - "types_to_exclude": [ - "module", - "function", - "builtin_function_or_method", - "instance", - "_Feature" - ], - "window_display": false - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From 07228cd52628966b18dddb76927509cbb23e9789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Wed, 13 Oct 2021 19:32:11 +0530 Subject: [PATCH 31/49] Delete 008_Python_Function_random_Module.ipynb --- 008_Python_Function_random_Module.ipynb | 170 ------------------------ 1 file changed, 170 deletions(-) delete mode 100644 008_Python_Function_random_Module.ipynb diff --git a/008_Python_Function_random_Module.ipynb b/008_Python_Function_random_Module.ipynb deleted file mode 100644 index a6bccb8..0000000 --- a/008_Python_Function_random_Module.ipynb +++ /dev/null @@ -1,170 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "All the IPython Notebooks in this lecture series by Dr. Milan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Python Random Module\n", - "\n", - "You can generate random numbers in Python by using random module.\n", - "\n", - "Python offers **`random`** module that can generate random numbers.\n", - "\n", - "These are pseudo-random number as the sequence of number generated depends on the seed.\n", - "\n", - "If the seeding value is same, the sequence will be the same. For example, if you use 2 as the seeding value, you will always see the following sequence." - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:48:05.271252Z", - "start_time": "2021-06-13T16:48:05.255627Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0.9560342718892494\n", - "0.9478274870593494\n", - "0.05655136772680869\n" - ] - } - ], - "source": [ - "import random\n", - "random.seed(2)\n", - "\n", - "print(random.random())\n", - "print(random.random())\n", - "print(random.random())" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**Not so random eh?** Since this generator is completely deterministic, it must not be used for encryption purpose.\n", - "\n", - "Here is the list of all the functions defined in random module with a brief explanation of what they do.\n", - "\n", - "**List of Functions in Python Random Module**\n", - "\n", - "| Function | Description |\n", - "|:----| :--- |\n", - "| **`seed(a=None, version=2)`** | Initialize the random number generator | \n", - "| **`getstate()`** | Returns an object capturing the current internal state of the generator | \n", - "| **`setstate(state)`** | Restores the internal state of the generator | \n", - "| **`getrandbits(k)`** | Returns a Python integer with k random bits | \n", - "| **`randrange(start, stop[, step])`** | Returns a random integer from the range | \n", - "| **`randint(a, b)`** | Returns a random integer between a and b inclusive | \n", - "| **`choice(seq)`** | Return a random element from the non-empty sequence | \n", - "| **`shuffle(seq)`** | Shuffle the sequence | \n", - "| **`sample(population, k)`** | Return a k length list of unique elements chosen from the population sequence | \n", - "| **`random()`** | Return the next random floating point number in the range [0.0, 1.0] | \n", - "| **`uniform(a, b)`** | Return a random floating point number between a and b inclusive | \n", - "| **`triangular(low, high, mode)`** | Return a random floating point number between low and high, with the specified mode between those bounds | \n", - "| **`betavariate(alpha, beta)`** | Beta distribution | \n", - "| **`expovariate(lambd)`** | Exponential distribution | \n", - "| **`gammavariate(alpha, beta)`** | Gamma distribution | \n", - "| **`gauss(mu, sigma)`** | Gaussian distribution | \n", - "| **`lognormvariate(mu, sigma)`** | Log normal distribution | \n", - "| **`normalvariate(mu, sigma)`** | Normal distribution | \n", - "| **`vonmisesvariate(mu, kappa)`** | Vonmises distribution | \n", - "| **`paretovariate(alpha)`** | Pareto distribution | \n", - "| **`weibullvariate(alpha, beta)`** | Weibull distribution | " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Visit this page to learn more on **[how you can generate pseudo-random numbers in Python](https://docs.python.org/3/library/random.html)**." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "hide_input": false, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.8" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false - }, - "varInspector": { - "cols": { - "lenName": 16, - "lenType": 16, - "lenVar": 40 - }, - "kernels_config": { - "python": { - "delete_cmd_postfix": "", - "delete_cmd_prefix": "del ", - "library": "var_list.py", - "varRefreshCmd": "print(var_dic_list())" - }, - "r": { - "delete_cmd_postfix": ") ", - "delete_cmd_prefix": "rm(", - "library": "var_list.r", - "varRefreshCmd": "cat(var_dic_list()) " - } - }, - "types_to_exclude": [ - "module", - "function", - "builtin_function_or_method", - "instance", - "_Feature" - ], - "window_display": false - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From 721e04a13cb410a2111b767175691e9ff049cbf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Wed, 13 Oct 2021 19:32:20 +0530 Subject: [PATCH 32/49] Delete 009_Python_Function_math_Module.ipynb.ipynb --- 009_Python_Function_math_Module.ipynb.ipynb | 204 -------------------- 1 file changed, 204 deletions(-) delete mode 100644 009_Python_Function_math_Module.ipynb.ipynb diff --git a/009_Python_Function_math_Module.ipynb.ipynb b/009_Python_Function_math_Module.ipynb.ipynb deleted file mode 100644 index f431b51..0000000 --- a/009_Python_Function_math_Module.ipynb.ipynb +++ /dev/null @@ -1,204 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "All the IPython Notebooks in this lecture series by Dr. Milan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Python Mathematical Functions\n", - "\n", - "Learn about all the mathematical functions available in Python and how you can use them in your program." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## What is `math` module in Python?\n", - "\n", - "The **`math`** **[module](https://github.com/milaan9/04_Python_Functions/blob/main/007_Python_Function_Module.ipynb)** is a standard module in Python and is always available. To use mathematical functions under this module, you have to import the module using **`import math`**.\n", - "\n", - "It gives access to the underlying C library functions. For example:" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T16:56:20.316916Z", - "start_time": "2021-06-13T16:56:20.289575Z" - } - }, - "outputs": [ - { - "data": { - "text/plain": [ - "2.0" - ] - }, - "execution_count": 1, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Square root calculation\n", - "\n", - "import math\n", - "math.sqrt(4)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "This module does not support complex datatypes. The **[cmath module](https://docs.python.org/3.0/library/cmath.html)** is the **`complex`** counterpart." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Functions in Python Math Module\n", - "\n", - "Here is the list of all the functions and attributes defined in **`math`** module with a brief explanation of what they do.\n", - "\n", - "**List of Functions in Python Math Module**\n", - "\n", - "| Function | Description |\n", - "|:----| :--- |\n", - "| **`ceil(x)`** | Returns the smallest integer greater than or equal to x. | \n", - "| **`copysign(x, y)`** | Returns x with the sign of y | \n", - "| **`fabs(x)`** | Returns the absolute value of x | \n", - "| **`factorial(x)`** | Returns the factorial of x | \n", - "| **`floor(x)`** | Returns the largest integer less than or equal to x | \n", - "| **`fmod(x, y)`** | Returns the remainder when x is divided by y | \n", - "| **`frexp(x)`** | Returns the mantissa and exponent of x as the pair (m, e) | \n", - "| **`fsum(iterable)`** | Returns an accurate floating point sum of values in the iterable | \n", - "| **`isfinite(x)`** | Returns True if x is neither an infinity nor a NaN (Not a Number) | \n", - "| **`isinf(x)`** | Returns True if x is a positive or negative infinity | \n", - "| **`isnan(x)`** | Returns True if x is a NaN | \n", - "| **`ldexp(x, i)`** | Returns x * (2**i) | \n", - "| **`modf(x)`** | Returns the fractional and integer parts of x | \n", - "| **`trunc(x)`** | Returns the truncated integer value of x | \n", - "| **`exp(x)`** | Returns e**x | \n", - "| **`expm1(x)`** | Returns e**x - 1 | \n", - "| **`log(x[, b])`** | Returns the logarithm of **`x`** to the base **`b`** (defaults to e) | \n", - "| **`log1p(x)`** | Returns the natural logarithm of 1+x | \n", - "| **`log2(x)`** | Returns the base-2 logarithm of x | \n", - "| **`log10(x)`** | Returns the base-10 logarithm of x | \n", - "| **`pow(x, y)`** | Returns x raised to the power y | \n", - "| **`sqrt(x)`** | Returns the square root of x | \n", - "| **`acos(x)`** | Returns the arc cosine of x | \n", - "| **`asin(x)`** | Returns the arc sine of x | \n", - "| **`atan(x)`** | Returns the arc tangent of x | \n", - "| **`atan2(y, x)`** | Returns atan(y / x) | \n", - "| **`cos(x)`** | Returns the cosine of x | \n", - "| **`hypot(x, y)`** | Returns the Euclidean norm, sqrt(x*x + y*y) | \n", - "| **`sin(x)`** | Returns the sine of x | \n", - "| **`tan(x)`** | Returns the tangent of x | \n", - "| **`degrees(x)`** | Converts angle x from radians to degrees | \n", - "| **`radians(x)`** | Converts angle x from degrees to radians | \n", - "| **`acosh(x)`** | Returns the inverse hyperbolic cosine of x | \n", - "| **`asinh(x)`** | Returns the inverse hyperbolic sine of x | \n", - "| **`atanh(x)`** | Returns the inverse hyperbolic tangent of x | \n", - "| **`cosh(x)`** | Returns the hyperbolic cosine of x | \n", - "| **`sinh(x)`** | Returns the hyperbolic cosine of x | \n", - "| **`tanh(x)`** | Returns the hyperbolic tangent of x | \n", - "| **`erf(x)`** | Returns the error function at x | \n", - "| **`erfc(x)`** | Returns the complementary error function at x | \n", - "| **`gamma(x)`** | Returns the Gamma function at x | \n", - "| **`lgamma(x)`** | Returns the natural logarithm of the absolute value of the Gamma function at x | \n", - "| **`pi`** | Mathematical constant, the ratio of circumference of a circle to it's diameter (3.14159...) | \n", - "| **`e`** | mathematical constant e (2.71828...) | " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Visit this page to learn about all the **[mathematical functions defined in Python 3](https://docs.python.org/3/library/math.html)**." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "hide_input": false, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.8" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false - }, - "varInspector": { - "cols": { - "lenName": 16, - "lenType": 16, - "lenVar": 40 - }, - "kernels_config": { - "python": { - "delete_cmd_postfix": "", - "delete_cmd_prefix": "del ", - "library": "var_list.py", - "varRefreshCmd": "print(var_dic_list())" - }, - "r": { - "delete_cmd_postfix": ") ", - "delete_cmd_prefix": "rm(", - "library": "var_list.r", - "varRefreshCmd": "cat(var_dic_list()) " - } - }, - "types_to_exclude": [ - "module", - "function", - "builtin_function_or_method", - "instance", - "_Feature" - ], - "window_display": false - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From 4694886bf57719f445d3cf78cb327bda5e4c74a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Wed, 13 Oct 2021 19:32:31 +0530 Subject: [PATCH 33/49] Delete 010_Python_Function_Package.ipynb --- 010_Python_Function_Package.ipynb | 165 ------------------------------ 1 file changed, 165 deletions(-) delete mode 100644 010_Python_Function_Package.ipynb diff --git a/010_Python_Function_Package.ipynb b/010_Python_Function_Package.ipynb deleted file mode 100644 index 66a3fbb..0000000 --- a/010_Python_Function_Package.ipynb +++ /dev/null @@ -1,165 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "All the IPython Notebooks in this lecture series by Dr. Milan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Python Package\n", - "\n", - "In this class, you'll learn to divide your code base into clean, efficient modules using Python packages. Also, you'll learn to import and use your own or third party packagesin your Python program." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## What are packages?\n", - "\n", - "We don't usually store all of our files on our computer in the same location. We use a well-organized hierarchy of directories for easier access.\n", - "\n", - "Similar files are kept in the same directory, for example, we may keep all the songs in the \"**music**\" directory. Analogous to this, Python has packages for directories and **[modules](https://github.com/milaan9/04_Python_Functions/blob/main/007_Python_Function_Module.ipynb)** for files.\n", - "\n", - "As our application program grows larger in size with a lot of modules, we place similar modules in one package and different modules in different packages. This makes a project (program) easy to manage and conceptually clear.\n", - "\n", - "Similarly, as a directory can contain subdirectories and files, a Python package can have sub-packages and modules.\n", - "\n", - "A directory must contain a file named **`__init__.py`** in order for Python to consider it as a package. This file can be left empty but we generally place the initialization code for that package in this file.\n", - "\n", - "Here is an example. Suppose we are developing a game. One possible organization of packages and modules could be as shown in the figure below.\n", - "\n", - "| | \n", - "|:--:| \n", - "| **Package Module Structure in Python Programming** |" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Importing module from a package\n", - "\n", - "We can import modules from packages using the dot **`.`** operator.\n", - "\n", - "For example, if we want to import the **`start`** module in the above example, it can be done as follows:\n", - "\n", - "```python\n", - ">>>import Game.Level.start\n", - "```\n", - "\n", - "Now, if this module contains a **[function](https://github.com/milaan9/04_Python_Functions/blob/main/001_Python_Functions.ipynb)** named **`select_difficulty()`**, we must use the full name to reference it.\n", - "\n", - "```python\n", - ">>>Game.Level.start.select_difficulty(2)\n", - "```\n", - "\n", - "If this construct seems lengthy, we can import the module without the package prefix as follows:\n", - "\n", - "```python\n", - ">>>from Game.Level import start\n", - "```\n", - "\n", - "We can now call the function simply as follows:\n", - "\n", - "```python\n", - ">>>start.select_difficulty(2)\n", - "```\n", - "\n", - "Another way of importing just the required function (or class or variable) from a module within a package would be as follows:\n", - "\n", - "```python\n", - ">>>from Game.Level.start import select_difficulty\n", - "```\n", - "\n", - "Now we can directly call this function.\n", - "\n", - "```python\n", - ">>>select_difficulty(2)\n", - "```\n", - "\n", - "Although easier, this method is not recommended. Using the full **[namespace](https://github.com/milaan9/01_Python_Introduction/blob/main/013_Python_Namespace_and_Scope.ipynb)** avoids confusion and prevents two same identifier names from colliding.\n", - "\n", - "While importing packages, Python looks in the list of directories defined in **`sys.path`**, similar as for **[module search path](https://github.com/milaan9/04_Python_Functions/blob/main/007_Python_Function_Module.ipynb)**." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "hide_input": false, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.8" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false - }, - "varInspector": { - "cols": { - "lenName": 16, - "lenType": 16, - "lenVar": 40 - }, - "kernels_config": { - "python": { - "delete_cmd_postfix": "", - "delete_cmd_prefix": "del ", - "library": "var_list.py", - "varRefreshCmd": "print(var_dic_list())" - }, - "r": { - "delete_cmd_postfix": ") ", - "delete_cmd_prefix": "rm(", - "library": "var_list.r", - "varRefreshCmd": "cat(var_dic_list()) " - } - }, - "types_to_exclude": [ - "module", - "function", - "builtin_function_or_method", - "instance", - "_Feature" - ], - "window_display": false - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From 52eca8ef7d817765e421a485fc9079768cf5e91d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Wed, 13 Oct 2021 19:32:43 +0530 Subject: [PATCH 34/49] Delete Python_Docstrings.ipynb --- Python_Docstrings.ipynb | 866 ---------------------------------------- 1 file changed, 866 deletions(-) delete mode 100644 Python_Docstrings.ipynb diff --git a/Python_Docstrings.ipynb b/Python_Docstrings.ipynb deleted file mode 100644 index bf814bd..0000000 --- a/Python_Docstrings.ipynb +++ /dev/null @@ -1,866 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "All the IPython Notebooks in this lecture series by Dr. Milan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Python Docstrings\n", - "\n", - "In this class, we will learn about Python docstrings. More specifically, we will learn how and why docstrings are used with the help of examples.\n", - "\n", - "Python docstrings are the string literals that appear right after the definition of a function, method, class, or module. For example:" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T08:11:06.380353Z", - "start_time": "2021-06-13T08:11:06.362780Z" - } - }, - "outputs": [], - "source": [ - "# Example 1: Docstrings\n", - "\n", - "def square(n):\n", - " '''Takes in a number n, returns the square of n'''\n", - " return n**2" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Here, the string literal:\n", - "```python\n", - " '''Takes in a number n, returns the square of n'''\n", - "```" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "inside the triple quotation marks is the **docstring** of the function **`square()`** as it appears right after its definition.\n", - "\n", - ">**Note:** We can also use triple **`'''`** quotations to create docstrings." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Python Comments vs Docstrings\n", - "\n", - "### Python Comments\n", - "\n", - "Comments are descriptions that help programmers better understand the intent and functionality of the program. They are completely ignored by the Python interpreter.\n", - "\n", - "In Python, we use the hash symbol **`#`** to write a single-line comment. For example, " - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T08:11:09.750448Z", - "start_time": "2021-06-13T08:11:09.730916Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Hello World\n" - ] - } - ], - "source": [ - "# Example 1: Program to print \"Hello World\"\n", - "\n", - "print(\"Hello World\") " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Python Comments Using Strings\n", - "\n", - "If we do not assign strings to any variable, they act as comments. For example," - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T08:11:10.920358Z", - "start_time": "2021-06-13T08:11:10.906691Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Hello World\n" - ] - } - ], - "source": [ - "# Example 1:\n", - "\n", - "\"I am a single-line comment\"\n", - "\n", - "'''\n", - "I am a\n", - "multi-line comment!\n", - "'''\n", - "\n", - "print(\"Hello World\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - ">**Note:** We use triple quotation marks for multi-line strings." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Python docstrings\n", - "\n", - "As mentioned above, Python docstrings are strings used right after the definition of a function, method, class, or module (like in Example \n", - "\n", - "**1. They are used to document our code**.\n", - "\n", - "We can access these docstrings using the **`__doc__`** attribute." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Python `__doc__` attribute\n", - "\n", - "Whenever string literals are present just after the definition of a function, module, class or a method, they are associated with the object as their **`__doc__`** attribute. We can later use this attribute to retrieve this docstring." - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T08:11:13.090263Z", - "start_time": "2021-06-13T08:11:13.082453Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Takes in a number n, returns the square of n\n" - ] - } - ], - "source": [ - "# Example 1: Printing docstring\n", - "\n", - "def square(n):\n", - " '''Takes in a number n, returns the square of n'''\n", - " return n**2\n", - "\n", - "print(square.__doc__)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Here, the documentation of our **`square()`** function can be accessed using the **`__doc__`** attribute." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Now, let's look at docstrings for the built-in function **`print()`**:" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T08:11:15.210361Z", - "start_time": "2021-06-13T08:11:15.202551Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "print(value, ..., sep=' ', end='\\n', file=sys.stdout, flush=False)\n", - "\n", - "Prints the values to a stream, or to sys.stdout by default.\n", - "Optional keyword arguments:\n", - "file: a file-like object (stream); defaults to the current sys.stdout.\n", - "sep: string inserted between values, default a space.\n", - "end: string appended after the last value, default a newline.\n", - "flush: whether to forcibly flush the stream.\n" - ] - } - ], - "source": [ - "# Example 2: Docstrings for the built-in `print()` function\n", - "\n", - "print(print.__doc__)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Here, we can see that the documentation of the **`print()`** function is present as the **`__doc__`** attribute of this function." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Single-line docstrings in Python\n", - "\n", - "Single line docstrings are the documents that fit in one line.\n", - "\n", - "**Standard conventions to write single-line docstrings:**\n", - "\n", - "* Even though they are single-lined, we still use the triple quotes around these docstrings as they can be expanded easily later.\n", - "* The closing quotes are on the same line as the opening quotes.\n", - "* There's no blank line either before or after the docstring.\n", - "* They should not be descriptive, rather they must follow \"Do this, return that\" structure ending with a period.\n", - "\n", - "Let's take an example." - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T08:11:17.116597Z", - "start_time": "2021-06-13T08:11:17.107811Z" - } - }, - "outputs": [], - "source": [ - "# Example 1: Write single-line docstrings for a function\n", - " \n", - "def multiplier(a, b):\n", - " \"\"\"Takes in two numbers, returns their product.\"\"\"\n", - " return a*b" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T08:11:18.790898Z", - "start_time": "2021-06-13T08:11:18.770883Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "This function returns the factorial of a given number.\n" - ] - } - ], - "source": [ - "# Example 2:\n", - "\n", - "def factorial(x):\n", - " \"\"\"This function returns the factorial of a given number.\"\"\"\n", - " return x\n", - "\n", - "# access doc string\n", - "print(factorial.__doc__)" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T08:11:43.163257Z", - "start_time": "2021-06-13T08:11:43.148615Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Help on function factorial in module __main__:\n", - "\n", - "factorial(x)\n", - " This function returns the factorial of a given number.\n", - "\n", - "None\n" - ] - } - ], - "source": [ - "# Example 3:\n", - "\n", - "# pass function name to help() function\n", - "print(help(factorial))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Multi-line Docstrings in Python\n", - "\n", - "Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description.\n", - "\n", - "The PEP 257 document provides the standard conventions to write multi-line docstrings for various objects.\n", - "\n", - "Some have been listed below:" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 1. Docstrings for Python Modules\n", - "\n", - "* The docstrings for Python Modules should list all the available classes, functions, objects and exceptions that are imported when the module is imported.\n", - "* They should also have a one-line summary for each item.\n", - "\n", - "They are written at the beginning of the Python file.\n", - "\n", - "Let's look at the docstrings for the builtin module in Python called pickle." - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T08:11:46.512840Z", - "start_time": "2021-06-13T08:11:46.499173Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Create portable serialized representations of Python objects.\n", - "\n", - "See module copyreg for a mechanism for registering custom picklers.\n", - "See module pickletools source for extensive comments.\n", - "\n", - "Classes:\n", - "\n", - " Pickler\n", - " Unpickler\n", - "\n", - "Functions:\n", - "\n", - " dump(object, file)\n", - " dumps(object) -> string\n", - " load(file) -> object\n", - " loads(string) -> object\n", - "\n", - "Misc variables:\n", - "\n", - " __version__\n", - " format_version\n", - " compatible_formats\n", - "\n", - "\n" - ] - } - ], - "source": [ - "# Example 1: Docstrings of Python module\n", - "\n", - "import pickle\n", - "print(pickle.__doc__)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Here, we can see that the docstring written at the beginning of the **pickle.py** module file can be accessed as its docstring." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 2. Docstrings for Python Functions\n", - "\n", - "* The docstring for a function or method should summarize its behavior and document its arguments and return values.\n", - "* It should also list all the exceptions that can be raised and other optional arguments." - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T08:11:50.215445Z", - "start_time": "2021-06-13T08:11:50.203731Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - " Returns the sum of two decimal numbers in binary digits.\n", - "\n", - " Parameters:\n", - " a (int): A decimal integer\n", - " b (int): Another decimal integer\n", - "\n", - " Returns:\n", - " binary_sum (str): Binary string of the sum of a and b\n", - " \n" - ] - } - ], - "source": [ - "# Example 1: Docstrings for Python functions\n", - "\n", - "def add_binary(a, b):\n", - " '''\n", - " Returns the sum of two decimal numbers in binary digits.\n", - "\n", - " Parameters:\n", - " a (int): A decimal integer\n", - " b (int): Another decimal integer\n", - "\n", - " Returns:\n", - " binary_sum (str): Binary string of the sum of a and b\n", - " '''\n", - " binary_sum = bin(a+b)[2:]\n", - " return binary_sum\n", - "\n", - "\n", - "print(add_binary.__doc__)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "As you can see, we have included a short description of what the function does, the parameter it takes in and the value it returns. The string literal is embedded to the function **`add_binary`** as its **`__doc__`** attribute." - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T08:11:55.625557Z", - "start_time": "2021-06-13T08:11:55.613350Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - " \n", - " Description of function\n", - " \n", - " Arguments: \n", - " parameter1(int):Description of parameter1\n", - " \n", - " Returns: \n", - " int value \n", - " \n" - ] - } - ], - "source": [ - "# Example 2:\n", - "\n", - "def any_fun(parameter1):\n", - " \"\"\" \n", - " Description of function\n", - " \n", - " Arguments: \n", - " parameter1(int):Description of parameter1\n", - " \n", - " Returns: \n", - " int value \n", - " \"\"\" \n", - "\n", - "print(any_fun.__doc__)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 3. Docstrings for Python Classes\n", - "\n", - "The docstrings for classes should summarize its behavior and list the public methods and instance variables.\n", - "The subclasses, constructors, and methods should each have their own docstrings." - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T08:11:58.791059Z", - "start_time": "2021-06-13T08:11:58.782272Z" - } - }, - "outputs": [], - "source": [ - "# Example 1: Docstrings for Python class\n", - "\n", - "# Suppose we have a Person.py file with the following code:\n", - "\n", - "class Person:\n", - " \"\"\"\n", - " A class to represent a person.\n", - "\n", - " ...\n", - "\n", - " Attributes\n", - " ----------\n", - " name : str\n", - " first name of the person\n", - " surname : str\n", - " family name of the person\n", - " age : int\n", - " age of the person\n", - "\n", - " Methods\n", - " -------\n", - " info(additional=\"\"):\n", - " Prints the person's name and age.\n", - " \"\"\"\n", - "\n", - " def __init__(self, name, surname, age):\n", - " \"\"\"\n", - " Constructs all the necessary attributes for the person object.\n", - "\n", - " Parameters\n", - " ----------\n", - " name : str\n", - " first name of the person\n", - " surname : str\n", - " family name of the person\n", - " age : int\n", - " age of the person\n", - " \"\"\"\n", - "\n", - " self.name = name\n", - " self.surname = surname\n", - " self.age = age\n", - "\n", - " def info(self, additional=\"\"):\n", - " \"\"\"\n", - " Prints the person's name and age.\n", - "\n", - " If the argument 'additional' is passed, then it is appended after the main info.\n", - "\n", - " Parameters\n", - " ----------\n", - " additional : str, optional\n", - " More info to be displayed (default is None)\n", - "\n", - " Returns\n", - " -------\n", - " None\n", - " \"\"\"\n", - "\n", - " print(f'My name is {self.name} {self.surname}. I am {self.age} years old.' + additional)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Here, we can use the following code to access only the docstrings of the **`Person`** class:" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T08:12:00.449245Z", - "start_time": "2021-06-13T08:12:00.436551Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - " A class to represent a person.\n", - "\n", - " ...\n", - "\n", - " Attributes\n", - " ----------\n", - " name : str\n", - " first name of the person\n", - " surname : str\n", - " family name of the person\n", - " age : int\n", - " age of the person\n", - "\n", - " Methods\n", - " -------\n", - " info(additional=\"\"):\n", - " Prints the person's name and age.\n", - " \n" - ] - } - ], - "source": [ - "print(Person.__doc__)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Using the `help()` Function for Docstrings\n", - "\n", - "We can also use the **`help()`** function to read the docstrings associated with various objects." - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-13T08:12:02.355969Z", - "start_time": "2021-06-13T08:12:02.348159Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Help on class Person in module __main__:\n", - "\n", - "class Person(builtins.object)\n", - " | Person(name, surname, age)\n", - " | \n", - " | A class to represent a person.\n", - " | \n", - " | ...\n", - " | \n", - " | Attributes\n", - " | ----------\n", - " | name : str\n", - " | first name of the person\n", - " | surname : str\n", - " | family name of the person\n", - " | age : int\n", - " | age of the person\n", - " | \n", - " | Methods\n", - " | -------\n", - " | info(additional=\"\"):\n", - " | Prints the person's name and age.\n", - " | \n", - " | Methods defined here:\n", - " | \n", - " | __init__(self, name, surname, age)\n", - " | Constructs all the necessary attributes for the person object.\n", - " | \n", - " | Parameters\n", - " | ----------\n", - " | name : str\n", - " | first name of the person\n", - " | surname : str\n", - " | family name of the person\n", - " | age : int\n", - " | age of the person\n", - " | \n", - " | info(self, additional='')\n", - " | Prints the person's name and age.\n", - " | \n", - " | If the argument 'additional' is passed, then it is appended after the main info.\n", - " | \n", - " | Parameters\n", - " | ----------\n", - " | additional : str, optional\n", - " | More info to be displayed (default is None)\n", - " | \n", - " | Returns\n", - " | -------\n", - " | None\n", - " | \n", - " | ----------------------------------------------------------------------\n", - " | Data descriptors defined here:\n", - " | \n", - " | __dict__\n", - " | dictionary for instance variables (if defined)\n", - " | \n", - " | __weakref__\n", - " | list of weak references to the object (if defined)\n", - "\n" - ] - } - ], - "source": [ - "# Example 1: Read Docstrings with the `help()` function\n", - "\n", - "# We can use the help() function on the class Person in Example as:\n", - "\n", - "help(Person)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Here, we can see that the **`help()`** function retrieves the docstrings of the **`Person`** class along with the methods associated with that class." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 4. Docstrings for Python Scripts\n", - "\n", - "* The docstrings for Python script should document the script's functions and command-line syntax as a usable message.\n", - "* It should serve as a quick reference to all the functions and arguments." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 5. Docstrings for Python Packages\n", - "\n", - "The docstrings for a Python package is written in the package's **`__init__.py`** file.\n", - "\n", - "* It should contain all the available modules and sub-packages exported by the package." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Docstring Formats\n", - "\n", - "We can write docstring in many formats like the reStructured text (reST) format, Google format or the NumPy documentation format. To learn more, visit **[Popular Docstring Formats](https://stackoverflow.com/questions/3898572/what-is-the-standard-python-docstring-format)**\n", - "\n", - "We can also generate documentation from docstrings using tools like Sphinx. To learn more, visit **[Official Sphinx Documentation](https://www.sphinx-doc.org/en/master/)**" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "hide_input": false, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.8" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false - }, - "varInspector": { - "cols": { - "lenName": 16, - "lenType": 16, - "lenVar": 40 - }, - "kernels_config": { - "python": { - "delete_cmd_postfix": "", - "delete_cmd_prefix": "del ", - "library": "var_list.py", - "varRefreshCmd": "print(var_dic_list())" - }, - "r": { - "delete_cmd_postfix": ") ", - "delete_cmd_prefix": "rm(", - "library": "var_list.r", - "varRefreshCmd": "cat(var_dic_list()) " - } - }, - "types_to_exclude": [ - "module", - "function", - "builtin_function_or_method", - "instance", - "_Feature" - ], - "window_display": false - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From 0558972b504a3f57204bd20eddcedfd9a0881f56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Wed, 13 Oct 2021 19:32:52 +0530 Subject: [PATCH 35/49] Delete Python_User_defined_Functions.ipynb --- Python_User_defined_Functions.ipynb | 168 ---------------------------- 1 file changed, 168 deletions(-) delete mode 100644 Python_User_defined_Functions.ipynb diff --git a/Python_User_defined_Functions.ipynb b/Python_User_defined_Functions.ipynb deleted file mode 100644 index e871f52..0000000 --- a/Python_User_defined_Functions.ipynb +++ /dev/null @@ -1,168 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "All the IPython Notebooks in this lecture series by Dr. Milan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Python User-defined Functions\n", - "\n", - "In this class, you will find the advantages of using user-defined functions and best practices to follow." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## What are user-defined functions in Python?\n", - "\n", - "Functions that we define ourselves to do certain specific task are referred as user-defined functions. The way in which we define and call **[functions in Python](https://github.com/milaan9/04_Python_Functions/blob/main/001_Python_Functions.ipynb)** are already discussed.\n", - "\n", - "Functions that readily come with Python are called built-in functions. If we use functions written by others in the form of library, it can be termed as library functions.\n", - "\n", - "All the other functions that we write on our own fall under user-defined functions. So, our user-defined function could be a library function to someone else." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Advantages of user-defined functions\n", - "\n", - "1. User-defined functions help to decompose a large program into small segments which makes program easy to understand, maintain and debug.\n", - "2. If repeated code occurs in a program. Function can be used to include those codes and execute when needed by calling that function.\n", - "3. Programmars working on large project can divide the workload by making different functions." - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "ExecuteTime": { - "end_time": "2021-06-25T05:28:47.996956Z", - "start_time": "2021-06-25T05:28:39.880301Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Enter first number: 9.3\n", - "Enter second number: 6.9\n", - "The sum is 16.200000000000003\n" - ] - } - ], - "source": [ - "# Example 1: illustrate the use of user-defined functions\n", - "\n", - "num1 = input('Enter first number: ')\n", - "num2 = input('Enter second number: ')\n", - "\n", - "def my_addition(num1,num2):\n", - " sum = float(num1) + float(num2)\n", - " return sum\n", - "\n", - "#num1 = 9.3\n", - "#num2 = 6.9\n", - "\n", - "print(\"The sum is\", my_addition(num1, num2))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**Explanation:**\n", - "\n", - "Here, we have defined the function **`my_addition()`** which adds two numbers and returns the result.\n", - "\n", - "This is our user-defined function. We could have multiplied the two numbers inside our function (it's all up to us). But this operation would not be consistent with the name of the function. It would create ambiguity.\n", - "\n", - "It is always a good idea to name functions according to the task they perform.\n", - "\n", - "In the above example, **[print()](https://github.com/milaan9/04_Python_Functions/blob/main/002_Python_Functions_Built_in/051_Python_print%28%29.ipynb)** is a **[built-in function in Python](https://github.com/milaan9/04_Python_Functions/tree/main/002_Python_Functions_Built_in)**. " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "hide_input": false, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.8" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false - }, - "varInspector": { - "cols": { - "lenName": 16, - "lenType": 16, - "lenVar": 40 - }, - "kernels_config": { - "python": { - "delete_cmd_postfix": "", - "delete_cmd_prefix": "del ", - "library": "var_list.py", - "varRefreshCmd": "print(var_dic_list())" - }, - "r": { - "delete_cmd_postfix": ") ", - "delete_cmd_prefix": "rm(", - "library": "var_list.r", - "varRefreshCmd": "cat(var_dic_list()) " - } - }, - "types_to_exclude": [ - "module", - "function", - "builtin_function_or_method", - "instance", - "_Feature" - ], - "window_display": false - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From 4c8302948be74b5ce709fb9aa6598ac1a7077243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Wed, 13 Oct 2021 19:33:37 +0530 Subject: [PATCH 36/49] Updated with more examples and exercises --- 001_Python_Functions.ipynb | 1580 ++++++++++++++ ...ython_Function_Global_Local_Nonlocal.ipynb | 707 +++++++ 003_Python_Function_global_Keywords.ipynb | 472 +++++ 004_Python_Function_Arguments.ipynb | 1046 +++++++++ 005_Python_Function_Recursion.ipynb | 258 +++ 006_Python_Function_Anonymous.ipynb | 455 ++++ 007_Python_Function_Module.ipynb | 1866 +++++++++++++++++ 008_Python_Function_random_Module.ipynb | 170 ++ 009_Python_Function_math_Module.ipynb.ipynb | 204 ++ 010_Python_Function_Package.ipynb | 165 ++ Python_Docstrings.ipynb | 866 ++++++++ Python_User_defined_Functions.ipynb | 168 ++ 12 files changed, 7957 insertions(+) create mode 100644 001_Python_Functions.ipynb create mode 100644 002_Python_Function_Global_Local_Nonlocal.ipynb create mode 100644 003_Python_Function_global_Keywords.ipynb create mode 100644 004_Python_Function_Arguments.ipynb create mode 100644 005_Python_Function_Recursion.ipynb create mode 100644 006_Python_Function_Anonymous.ipynb create mode 100644 007_Python_Function_Module.ipynb create mode 100644 008_Python_Function_random_Module.ipynb create mode 100644 009_Python_Function_math_Module.ipynb.ipynb create mode 100644 010_Python_Function_Package.ipynb create mode 100644 Python_Docstrings.ipynb create mode 100644 Python_User_defined_Functions.ipynb diff --git a/001_Python_Functions.ipynb b/001_Python_Functions.ipynb new file mode 100644 index 0000000..8c5a6f4 --- /dev/null +++ b/001_Python_Functions.ipynb @@ -0,0 +1,1580 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "All the IPython Notebooks in **Python Functions** lecture series by Dr. Milaan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Python Functions\n", + "\n", + "In this class, you'll learn about functions, what a function is, the syntax, components, and types of functions. Also, you'll learn to create a function in Python." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# What is a function in Python?\n", + "\n", + "In Python, a **function is a block of organized, reusable (DRY- Donโ€™t Repeat Yourself) code with a name** that is used to perform a single, specific task. It can take arguments and returns the value.\n", + "\n", + "Functions help break our program into smaller and modular chunks. As our program grows larger and larger, functions make it more organized and manageable.\n", + "\n", + "Furthermore, it improves efficiency and reduces errors because of the reusability of a code." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Types of Functions\n", + "\n", + "Python support two types of functions\n", + "\n", + "1. **[Built-in](https://github.com/milaan9/04_Python_Functions/tree/main/002_Python_Functions_Built_in)** function\n", + "2. **[User-defined](https://github.com/milaan9/04_Python_Functions/blob/main/Python_User_defined_Functions.ipynb)** function\n", + "\n", + "1.**Built-in function**\n", + "\n", + "The functions which are come along with Python itself are called a built-in function or predefined function. Some of them are:\n", + "**`range()`**, **`print()`**, **`input()`**, **`type()`**, **`id()`**, **`eval()`** etc.\n", + "\n", + "**Example:** Python **`range()`** function generates the immutable sequence of numbers starting from the given start integer to the stop integer.\n", + "\n", + "```python\n", + ">>> for i in range(1, 10):\n", + ">>> print(i, end=' ')\n", + "\n", + "1 2 3 4 5 6 7 8 9\n", + "```\n", + "\n", + "2. **User-defined function**\n", + "\n", + "Functions which are created by programmer explicitly according to the requirement are called a user-defined function." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Syntax:**\n", + "\n", + "```python\n", + "def function_name(parameter1, parameter2):\n", + " \"\"\"docstring\"\"\"\n", + " # function body \n", + " # write some action\n", + "return value\n", + "```\n", + "\n", + "
\n", + "\n", + "
" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Defining a Function\n", + "\n", + "1. **`def`** is a keyword that marks the start of the function header.\n", + "\n", + "2. **`function_name`** to uniquely identify the function. Function naming follows the same **[rules of writing identifiers in Python](https://github.com/milaan9/01_Python_Introduction/blob/main/005_Python_Keywords_and_Identifiers.ipynb)**.\n", + "\n", + "2. **`parameter`** is the value passed to the function. They are optional.\n", + "\n", + "3. **`:`** (colon) to mark the end of the function header.\n", + "\n", + "4. **`function body`** is a block of code that performs some task and all the statements in **`function body`** must have the same **indentation** level (usually 4 spaces). \n", + "\n", + "5. **\"\"\"docstring\"\"\"** documentation string is used to describe what the function does.\n", + "\n", + "6. **`return`** is a keyword to return a value from the function.. A return statement with no arguments is the same as return **`None`**.\n", + "\n", + ">**Note:** While defining a function, we use two keywords, **`def`** (mandatory) and **`return`** (optional).\n", + "\n", + "**Example:**\n", + "\n", + "```python\n", + ">>> def add(num1,num2): # Function name: 'add', Parameters: 'num1', 'num2'\n", + ">>> print(\"Number 1: \", num1) # Function body\n", + ">>> print(\"Number 2: \", num2) # Function body\n", + ">>> addition = num1 + num2 # Function body\n", + ">>> return addition # return value\n", + "\n", + "\n", + ">>> res = add(2, 4) # Function call\n", + ">>> print(\"Result: \", res)\n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Defining a function without any parameters\n", + "\n", + "Function can be declared without parameters." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:57.838353Z", + "start_time": "2021-10-08T17:47:57.814918Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Welcome to Python for Data Science\n" + ] + } + ], + "source": [ + "# Example 1: \n", + " \n", + "def greet():\n", + " print(\"Welcome to Python for Data Science\")\n", + "\n", + "# call function using its name\n", + "greet()" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:57.946753Z", + "start_time": "2021-10-08T17:47:57.840309Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "9\n" + ] + } + ], + "source": [ + "# Example 2: \n", + "\n", + "def add_two_numbers ():\n", + " num_one = 3\n", + " num_two = 6\n", + " total = num_one + num_two\n", + " print(total)\n", + "add_two_numbers() # calling a function" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:58.053200Z", + "start_time": "2021-10-08T17:47:57.950659Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Milaan Parmar\n" + ] + } + ], + "source": [ + "# Example 3: \n", + "\n", + "def generate_full_name ():\n", + " first_name = 'Milaan'\n", + " last_name = 'Parmar'\n", + " space = ' '\n", + " full_name = first_name + space + last_name\n", + " print(full_name)\n", + "generate_full_name () # calling a function" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Defining a function without parameters and `return` value\n", + "\n", + "Function can also return values, if a function does not have a **`return`** statement, the value of the function is None. Let us rewrite the above functions using **`return`**. From now on, we get a value from a function when we call the function and print it." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:58.176733Z", + "start_time": "2021-10-08T17:47:58.057106Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "9\n" + ] + } + ], + "source": [ + "# Example 1: \n", + "\n", + "def add_two_numbers ():\n", + " num_one = 3\n", + " num_two = 6\n", + " total = num_one + num_two\n", + " return total\n", + "print(add_two_numbers())" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:58.298319Z", + "start_time": "2021-10-08T17:47:58.185523Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Milaan Parmar\n" + ] + } + ], + "source": [ + "# Example 2: \n", + "\n", + "def generate_full_name ():\n", + " first_name = 'Milaan'\n", + " last_name = 'Parmar'\n", + " space = ' '\n", + " full_name = first_name + space + last_name\n", + " return full_name\n", + "print(generate_full_name())" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Defining a function with parameters\n", + "\n", + "In a function we can pass different data types(number, string, boolean, list, tuple, dictionary or set) as a parameter." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Single Parameter: \n", + "\n", + "If our function takes a parameter we should call our function with an argument" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:58.422343Z", + "start_time": "2021-10-08T17:47:58.301246Z" + } + }, + "outputs": [], + "source": [ + "# Example 1: Gereeting\n", + "\n", + "def greet(name):\n", + " \"\"\"\n", + " This function greets to the person passed in as a parameter\n", + " \"\"\"\n", + " print(\"Hello, \" + name + \". Good morning!\") # No output!" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:58.545876Z", + "start_time": "2021-10-08T17:47:58.430154Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "55\n", + "None\n", + "5050\n", + "None\n" + ] + } + ], + "source": [ + "# Example 2: \n", + "\n", + "def sum_of_numbers(n):\n", + " total = 0\n", + " for i in range(n+1):\n", + " total+=i\n", + " print(total)\n", + "print(sum_of_numbers(10)) # 55\n", + "print(sum_of_numbers(100)) # 5050" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Two Parameter: \n", + "\n", + "A function may or may not have a parameter or parameters. A function may also have two or more parameters. If our function takes parameters we should call it with arguments." + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:58.652810Z", + "start_time": "2021-10-08T17:47:58.552712Z" + }, + "scrolled": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello Arthur Welcome to Python for Data Science\n", + "Your course name is Python\n" + ] + } + ], + "source": [ + "# Example 1: \n", + "\n", + "def course(name, course_name):\n", + " print(\"Hello\", name, \"Welcome to Python for Data Science\")\n", + " print(\"Your course name is\", course_name)\n", + "\n", + "course('Arthur', 'Python') # call function" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Defining a function with parameters and `return` value" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:58.761206Z", + "start_time": "2021-10-08T17:47:58.657692Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Milaan, welcome to Python for Data Science\n" + ] + } + ], + "source": [ + "# Example 1: \n", + "\n", + "def greetings (name): # single parameter\n", + " message = name + ', welcome to Python for Data Science'\n", + " return message\n", + "\n", + "print(greetings('Milaan'))" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:58.853005Z", + "start_time": "2021-10-08T17:47:58.764137Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "100\n" + ] + } + ], + "source": [ + "# Example 2: \n", + "\n", + "def add_ten(num): # single parameter\n", + " ten = 10\n", + " return num + ten\n", + "print(add_ten(90))" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:58.976051Z", + "start_time": "2021-10-08T17:47:58.855934Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "9\n" + ] + } + ], + "source": [ + "# Example 3: \n", + "\n", + "def square_number(x): # single parameter\n", + " return x * x\n", + "print(square_number(3))" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:59.084452Z", + "start_time": "2021-10-08T17:47:58.978980Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "314.0\n" + ] + } + ], + "source": [ + "# Example 4: \n", + "\n", + "def area_of_circle (r): # single parameter\n", + " PI = 3.14\n", + " area = PI * r ** 2\n", + " return area\n", + "print(area_of_circle(10))" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:59.192846Z", + "start_time": "2021-10-08T17:47:59.087380Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Addition : 36\n" + ] + } + ], + "source": [ + "# Example 5: \n", + "\n", + "def calculator(a, b): # two parameter\n", + " add = a + b \n", + " return add # return the addition\n", + "\n", + "result = calculator(30, 6) # call function & take return value in variable\n", + "print(\"Addition :\", result) # Output Addition : 36" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:59.299295Z", + "start_time": "2021-10-08T17:47:59.199687Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Full Name: Milaan Parmar\n" + ] + } + ], + "source": [ + "# Example 6: \n", + "\n", + "def generate_full_name (first_name, last_name): # two parameter\n", + " space = ' '\n", + " full_name = first_name + space + last_name\n", + " return full_name\n", + "print('Full Name: ', generate_full_name('Milaan','Parmar'))" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:59.422342Z", + "start_time": "2021-10-08T17:47:59.302224Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sum of two numbers: 10\n" + ] + } + ], + "source": [ + "# Example 7: \n", + "\n", + "def sum_two_numbers (num_one, num_two): # two parameter\n", + " sum = num_one + num_two\n", + " return sum\n", + "print('Sum of two numbers: ', sum_two_numbers(1, 9))" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:59.530738Z", + "start_time": "2021-10-08T17:47:59.425271Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Age: 202\n" + ] + } + ], + "source": [ + "# Example 8: \n", + "\n", + "def calculate_age (current_year, birth_year): # two parameter\n", + " age = current_year - birth_year\n", + " return age;\n", + "\n", + "print('Age: ', calculate_age(2021, 1819))" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:59.623513Z", + "start_time": "2021-10-08T17:47:59.533669Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Weight of an object in Newtons: 981.0 N\n" + ] + } + ], + "source": [ + "# Example 9: \n", + "\n", + "def weight_of_object (mass, gravity): # two parameter\n", + " weight = str(mass * gravity)+ ' N' # the value has to be changed to a string first\n", + " return weight\n", + "print('Weight of an object in Newtons: ', weight_of_object(100, 9.81))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Function `return` Statement\n", + "\n", + "In Python, to return value from the function, a **`return`** statement is used. It returns the value of the expression following the returns keyword.\n", + "\n", + "**Syntax:**\n", + "\n", + "```python\n", + "def fun():\n", + " statement-1\n", + " statement-2\n", + " statement-3\n", + " . \n", + " . \n", + " return [expression]\n", + "```\n", + "\n", + "The **`return`** value is nothing but a outcome of function.\n", + "\n", + "* The **`return`** statement ends the function execution.\n", + "* For a function, it is not mandatory to return a value.\n", + "* If a **`return`** statement is used without any expression, then the **`None`** is returned.\n", + "* The **`return`** statement should be inside of the function block." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Return Single Value" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:59.718728Z", + "start_time": "2021-10-08T17:47:59.626442Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello, Cory. Good morning!\n", + "None\n" + ] + } + ], + "source": [ + "print(greet(\"Cory\"))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here, **`None`** is the returned value since **`greet()`** directly prints the name and no **`return`** statement is used." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Passing Arguments with Key and Value\n", + "\n", + "If we pass the arguments with key and value, the order of the arguments does not matter." + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:59.854957Z", + "start_time": "2021-10-08T17:47:59.727520Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Milaan Parmar\n", + "None\n" + ] + } + ], + "source": [ + "# Example 1: \n", + "\n", + "def print_fullname(firstname, lastname):\n", + " space = ' '\n", + " full_name = firstname + space + lastname\n", + " print(full_name)\n", + "print(print_fullname(firstname = 'Milaan', lastname = 'Parmar'))" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:59.978006Z", + "start_time": "2021-10-08T17:47:59.860817Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "5\n", + "None\n" + ] + } + ], + "source": [ + "# Example 2:\n", + "\n", + "def add_two_numbers (num1, num2):\n", + " total = num1 + num2\n", + " print(total)\n", + "print(add_two_numbers(num2 = 3, num1 = 2)) # Order does not matter" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If we do not **`return`** a value with a function, then our function is returning **`None`** by default. To return a value with a function we use the keyword **`return`** followed by the variable we are returning. We can return any kind of data types from a function." + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:00.178202Z", + "start_time": "2021-10-08T17:47:59.981912Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Milaan Parmar\n" + ] + } + ], + "source": [ + "# Example 1: with return statement\n", + "\n", + "def print_fullname(firstname, lastname):\n", + " space = ' '\n", + " full_name = firstname + space + lastname\n", + " return full_name\n", + "print(print_fullname(firstname = 'Milaan', lastname = 'Parmar'))" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:00.286600Z", + "start_time": "2021-10-08T17:48:00.182107Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "5\n" + ] + } + ], + "source": [ + "# Example 2: with return statement\n", + "\n", + "def add_two_numbers (num1, num2):\n", + " total = num1 + num2\n", + " return total\n", + "print(add_two_numbers(num2 = 3, num1 = 2)) # Order does not matter" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:00.394507Z", + "start_time": "2021-10-08T17:48:00.300275Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2\n", + "4\n" + ] + } + ], + "source": [ + "# Example 3:\n", + "\n", + "def absolute_value(num):\n", + " \"\"\"This function returns the absolute\n", + " value of the entered number\"\"\"\n", + "\n", + " if num >= 0:\n", + " return num\n", + " else:\n", + " return -num\n", + "\n", + "print(absolute_value(2))\n", + "print(absolute_value(-4))" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:00.529768Z", + "start_time": "2021-10-08T17:48:00.400370Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Adding the two values\n", + "Printing within Function\n", + "30\n", + "total : 30\n", + "Hello\n", + "Rest of code\n" + ] + } + ], + "source": [ + "# Example 4:\n", + "\n", + "def sum(a,b): # Function 1\n", + " print(\"Adding the two values\")\n", + " print(\"Printing within Function\")\n", + " print(a+b)\n", + " return a+b\n", + "\n", + "def msg(): # Function 2\n", + " print(\"Hello\")\n", + " return\n", + "\n", + "total=sum(10,20)\n", + "print('total : ',total)\n", + "msg()\n", + "print(\"Rest of code\")" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:00.672343Z", + "start_time": "2021-10-08T17:48:00.537579Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Even numbers are: [2, 46, 72, 90]\n" + ] + } + ], + "source": [ + "# Example 5:\n", + "\n", + "def is_even(list1):\n", + " even_num = []\n", + " for n in list1:\n", + " if n % 2 == 0:\n", + " even_num.append(n)\n", + " # return a list\n", + " return even_num\n", + "\n", + "# Pass list to the function\n", + "even_num = is_even([2, 3, 46, 63, 72, 83, 90, 19])\n", + "print(\"Even numbers are:\", even_num)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Return Multiple Values\n", + "\n", + "You can also return multiple values from a function. Use the return statement by separating each expression by a comma." + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:00.795876Z", + "start_time": "2021-10-08T17:48:00.677226Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Addition: 12\n", + "Subtraction: 8\n", + "Multiplication: 20\n", + "Division: 5.0\n" + ] + } + ], + "source": [ + "# Example 1:\n", + "\n", + "def arithmetic(num1, num2):\n", + " add = num1 + num2\n", + " sub = num1 - num2\n", + " multiply = num1 * num2\n", + " division = num1 / num2\n", + " # return four values\n", + " return add, sub, multiply, division\n", + "\n", + "a, b, c, d = arithmetic(10, 2) # read four return values in four variables\n", + "\n", + "print(\"Addition: \", a)\n", + "print(\"Subtraction: \", b)\n", + "print(\"Multiplication: \", c)\n", + "print(\"Division: \", d)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Return Boolean Values" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:00.903786Z", + "start_time": "2021-10-08T17:48:00.803691Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "even\n", + "True\n", + "False\n" + ] + } + ], + "source": [ + "# Example 1:\n", + "\n", + "def is_even (n):\n", + " if n % 2 == 0:\n", + " print('even')\n", + " return True # return stops further execution of the function, similar to break \n", + " return False\n", + "print(is_even(10)) # True\n", + "print(is_even(7)) # False" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Return a List" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:01.028789Z", + "start_time": "2021-10-08T17:48:00.906718Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[0, 2, 4, 6, 8, 10]\n" + ] + } + ], + "source": [ + "# Example 1:\n", + "\n", + "def find_even_numbers(n):\n", + " evens = []\n", + " for i in range(n + 1):\n", + " if i % 2 == 0:\n", + " evens.append(i)\n", + " return evens\n", + "print(find_even_numbers(10))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## How to call a function in python?\n", + "\n", + "Once we have defined a function, we can call it from another function, program or even the Python prompt. To call a function we simply type the function name with appropriate parameters.\n", + "\n", + "
\n", + "\n", + "
" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:01.135232Z", + "start_time": "2021-10-08T17:48:01.031717Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello, Alan. Good morning!\n" + ] + } + ], + "source": [ + "greet('Alan')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ">**Note:** Try running the above code in the Python program with the function definition to see the output." + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:01.243633Z", + "start_time": "2021-10-08T17:48:01.140118Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Happy birthday, Bill. Hope you have a wonderful day!\n" + ] + } + ], + "source": [ + "# Example 1: \n", + "\n", + "def wish(name):\n", + " \"\"\"\n", + " This function wishes to the person passed in as a parameter\n", + " \"\"\"\n", + " print(\"Happy birthday, \" + name + \". Hope you have a wonderful day!\")\n", + "\n", + "wish('Bill')" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:01.446289Z", + "start_time": "2021-10-08T17:48:01.251445Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Clark, welcome to Python for Data Science\n", + "Milaan, welcome to Python for Data Science\n" + ] + } + ], + "source": [ + "# Example 2: \n", + "\n", + "def greetings (name = 'Clark'):\n", + " message = name + ', welcome to Python for Data Science'\n", + " return message\n", + "print(greetings())\n", + "print(greetings('Milaan'))" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:01.699688Z", + "start_time": "2021-10-08T17:48:01.454570Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Milaan Parmar\n", + "Ethan Hunt\n" + ] + } + ], + "source": [ + "# Example 3: \n", + "\n", + "def generate_full_name (first_name = 'Milaan', last_name = 'Parmar'):\n", + " space = ' '\n", + " full_name = first_name + space + last_name\n", + " return full_name\n", + "print(generate_full_name())\n", + "print(generate_full_name('Ethan','Hunt'))" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:01.793476Z", + "start_time": "2021-10-08T17:48:01.702617Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Age: 200\n" + ] + } + ], + "source": [ + "# Example 4: \n", + "\n", + "def calculate_age (birth_year,current_year = 2021):\n", + " age = current_year - birth_year\n", + " return age;\n", + "print('Age: ', calculate_age(1821))" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:01.900373Z", + "start_time": "2021-10-08T17:48:01.797831Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "value of x is: 9\n", + "value of y is: 6\n" + ] + } + ], + "source": [ + "# Example 5: \n", + "\n", + "def swap(x, y):\n", + " \"\"\"\n", + " This function swaps the value of two variables\n", + " \"\"\"\n", + " temp = x; # value of x will go inside temp\n", + " x = y; # value of y will go inside x\n", + " y = temp; # value of temp will go inside y\n", + " print(\"value of x is:\", x)\n", + " print(\"value of y is:\", y)\n", + " return # \"return\" is optional\n", + "\n", + "x = 6\n", + "y = 9\n", + "swap(x, y) #call function" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:02.023908Z", + "start_time": "2021-10-08T17:48:01.903301Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "9 is a Odd Number\n" + ] + } + ], + "source": [ + "# Example 6: \n", + "\n", + "def even_odd(n): \n", + " if n % 2 == 0: # check number is even or odd\n", + " print(n, 'is a Even number')\n", + " else:\n", + " print(n, 'is a Odd Number')\n", + "\n", + "even_odd(9) # calling function by its name" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:02.147933Z", + "start_time": "2021-10-08T17:48:02.026837Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Weight of an object in Newtons: 981.0 N\n", + "Weight of an object in Newtons: 162.0 N\n" + ] + } + ], + "source": [ + "# Example 7: \n", + "\n", + "def weight_of_object (mass, gravity = 9.81):\n", + " weight = str(mass * gravity)+ ' N' # the value has to be changed to string first\n", + " return weight\n", + "print('Weight of an object in Newtons: ', weight_of_object(100)) # 9.81 - average gravity on Earth's surface\n", + "print('Weight of an object in Newtons: ', weight_of_object(100, 1.62)) # gravity on the surface of the Moon" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "## Docstrings\n", + "\n", + "The first string after the function header is called the **docstring** and is short for documentation string. It is a descriptive text (like a comment) written by a programmer to let others know what block of code does.\n", + "\n", + "Although **optional**, documentation is a good programming practice. Unless you can remember what you had for dinner last week, always document your code.\n", + "\n", + "It is being declared using triple single quotes **`''' '''`** or triple-double quote **`\"\"\" \"\"\"`** so that docstring can extend up to multiple lines.\n", + "\n", + "We can access docstring using doc attribute **`__doc__`** for any object like list, tuple, dict, and user-defined function, etc.\n", + "\n", + "In the above example, we have a docstring immediately below the function header." + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:02.284654Z", + "start_time": "2021-10-08T17:48:02.154767Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " This function greets to the person passed in as a parameter\n", + " \n" + ] + } + ], + "source": [ + "print(greet.__doc__)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To learn more about docstrings in Python, visit **[Python Docstrings](https://github.com/milaan9/04_Python_Functions/blob/main/Python_Docstrings.ipynb)**." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Function `pass` Statement\n", + "\n", + "In Python, the **`pass`** is the keyword, which wonโ€™t do anything. Sometimes there is a situation where we need to define a syntactically empty block. We can define that block using the **`pass`** keyword.\n", + "\n", + "When the interpreter finds a **`pass`** statement in the program, it returns no operation." + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:02.420395Z", + "start_time": "2021-10-08T17:48:02.294414Z" + } + }, + "outputs": [], + "source": [ + "# Example 1:\n", + "\n", + "def addition(num1, num2):\n", + " # Implementation of addition function in comming release\n", + " # Pass statement \n", + " pass\n", + "\n", + "addition(10, 2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## ๐Ÿ’ป Exercises โžž Functions\n", + "\n", + "### Exercises โžž Level 1\n", + "\n", + "2. Area of a circle is calculated as follows: **area = ฯ€ x r x r** and **perimeter = 2 x ฯ€ x r**. Write a function that calculates **`area_of_circle`** and **`perimeter_of_circle`**.\n", + "3. Write a function called **`add_all_nums`** which takes arbitrary number of arguments and sums all the arguments. Check if all the list items are number types. If not do give a reasonable feedback.\n", + "4. Temperature in **ยฐC** can be converted to **ยฐF** using this formula: **ยฐF = (ยฐC x 9/5) + 32**. Write a function which converts **ยฐC to ยฐF**, **`convert_celsius_2_fahrenheit`**.\n", + "5. Write a function called **`check_season`**, it takes a month parameter and returns the season: Autumn, Winter, Spring or Summer.\n", + "6. Write a function called **`calculate_slope`** which return the slope of a linear equation\n", + "7. Quadratic equation is calculated as follows: **axยฒ + bx + c = 0**. Write a function which calculates solution set of a quadratic equation, **`solve_quadratic_eqn`**.\n", + "8. Declare a function named **`print_list`**. It takes a list as a parameter and it prints out each element of the list.\n", + "9. Declare a function named **`reverse_list`**. It takes an array as a parameter and it returns the reverse of the array (use loops).\n", + "\n", + " - ```py\n", + "print(reverse_list([1, 2, 3, 4, 5]))\n", + "#[5, 4, 3, 2, 1]\n", + "print(reverse_list1([\"A\", \"B\", \"C\"]))\n", + "#[\"C\", \"B\", \"A\"]\n", + " ```\n", + "\n", + "10. Declare a function named **`capitalize_list_items`**. It takes a list as a parameter and it returns a capitalized list of items\n", + "11. Declare a function named **`add_item`**. It takes a list and an item parameters. It returns a list with the item added at the end.\n", + "\n", + " - ```py\n", + "food_staff = ['Potato', 'Tomato', 'Mango', 'Milk']\n", + "print(add_item(food_staff, 'Fungi')) #['Potato', 'Tomato', 'Mango', 'Milk', 'Fungi']\n", + "numbers = [2, 3, 7, 9]\n", + "print(add_item(numbers, 5)) #[2, 3, 7, 9, 5]\n", + " ```\n", + "\n", + "12. Declare a function named **`remove_item`**. It takes a list and an item parameters. It returns a list with the item removed from it.\n", + "\n", + " - ```py\n", + "food_staff = ['Potato', 'Tomato', 'Mango', 'Milk']\n", + "print(remove_item(food_staff, 'Mango')) # ['Potato', 'Tomato', 'Milk']\n", + "numbers = [2, 3, 7, 9]\n", + "print(remove_item(numbers, 3)) # [2, 7, 9]\n", + " ```\n", + "\n", + "13. Declare a function named **`sum_of_numbers`**. It takes a number parameter and it adds all the numbers in that range.\n", + "\n", + " - ```py\n", + "print(sum_of_numbers(5)) # 15\n", + "print(sum_all_numbers(10)) # 55\n", + "print(sum_all_numbers(100)) # 5050\n", + " ```\n", + "\n", + "14. Declare a function named **`sum_of_odds`**. It takes a number parameter and it adds all the odd numbers in that range.\n", + "15. Declare a function named **`sum_of_even`**. It takes a number parameter and it adds all the even numbers in that - range.\n", + "\n", + "### Exercises โžž Level 2\n", + "\n", + "1. Declare a function named **`evens_and_odds`**. It takes a positive integer as parameter and it counts number of evens and odds in the number.\n", + "\n", + " - ```py\n", + " print(evens_and_odds(100))\n", + " #The number of odds are 50.\n", + " #The number of evens are 51.\n", + " ```\n", + "\n", + "1. Call your function **`factorial`**, it takes a whole number as a parameter and it return a factorial of the number\n", + "1. Call your function **`is_empty`**, it takes a parameter and it checks if it is empty or not\n", + "1. Write different functions which take lists. They should **`calculate_mean`**, **`calculate_median`**, **`calculate_mode`**, **`calculate_range`**, **`calculate_variance`**, **`calculate_std`** (standard deviation).\n", + "\n", + "### Exercises โžž Level 3\n", + "\n", + "1. Write a function called **`is_prime`**, which checks if a number is prime.\n", + "1. Write a functions which checks if all items are unique in the list.\n", + "1. Write a function which checks if all the items of the list are of the same data type.\n", + "1. Write a function which check if provided variable is a valid python variable\n", + "1. Go to the data folder and access the **[countries-data.py](https://github.com/milaan9/03_Python_Flow_Control/blob/main/countries_details_data.py)** file.\n", + "\n", + "- Create a function called the **`most_spoken_languages`** in the world. It should return 10 or 20 most spoken languages in the world in descending order\n", + "- Create a function called the **`most_populated_countries`**. It should return 10 or 20 most populated countries in descending order." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "gist": { + "data": { + "description": "01_Learn_Python4Data/04_Python_Functions/001_Python_Functions.ipynb", + "public": true + }, + "id": "" + }, + "hide_input": false, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.8" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": false, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": {}, + "toc_section_display": true, + "toc_window_display": false + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/002_Python_Function_Global_Local_Nonlocal.ipynb b/002_Python_Function_Global_Local_Nonlocal.ipynb new file mode 100644 index 0000000..39bdbfe --- /dev/null +++ b/002_Python_Function_Global_Local_Nonlocal.ipynb @@ -0,0 +1,707 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "All the IPython Notebooks in **Python Functions** lecture series by Dr. Milaan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Python Global, Local and Nonlocal variables\n", + "\n", + "In this class, youโ€™ll learn about Python Global variables, Local variables, Nonlocal variables and where to use them.\n", + "\n", + "When we define a function with variables, then those variables scope is limited to that function. In Python, the scope of a variable is the portion of a program where the variable is declared. Parameters and variables defined inside a function are not visible from outside the function. Hence, it is called the variableโ€™s local scope.\n", + "\n", + ">**Note:** The inner function does have access to the outer functionโ€™s local scope.\n", + "\n", + "When we are executing a function, the life of the variables is up to running time. Once we return from the function, those variables get destroyed. So function does no need to remember the value of a variable from its previous call." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Global Variables\n", + "\n", + "In Python, a variable declared outside of the function or in global scope is known as a global variable. This means that a global variable can be accessed inside or outside of the function.\n", + "\n", + "For example:" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T14:51:35.962970Z", + "start_time": "2021-06-13T14:51:35.939538Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Value in 1st function: 999\n", + "Value in 2nd function: 999\n" + ] + } + ], + "source": [ + "# Example 1: Create a Global Variable\n", + "\n", + "global_var = 999\n", + "\n", + "def fun1():\n", + " print(\"Value in 1st function:\", global_var)\n", + "\n", + "def fun2():\n", + " print(\"Value in 2nd function:\", global_var)\n", + "\n", + "fun1()\n", + "fun2()" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T14:51:36.916090Z", + "start_time": "2021-06-13T14:51:36.897539Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x inside: global\n", + "x outside: global\n" + ] + } + ], + "source": [ + "# Example 2: \n", + "\n", + "x = \"global\"\n", + "\n", + "def fun():\n", + " print(\"x inside:\", x)\n", + "\n", + "fun()\n", + "print(\"x outside:\", x)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the above code, we created **`x`** as a global variable and defined a **`fun()`** to print the global variable **`x`**. Finally, we call the **`fun()`** which will print the value of **`x`**.\n", + "\n", + "What if you want to change the value of **`x`** inside a function?" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T14:51:38.791564Z", + "start_time": "2021-06-13T14:51:38.442450Z" + }, + "scrolled": true + }, + "outputs": [ + { + "ename": "UnboundLocalError", + "evalue": "local variable 'x' referenced before assignment", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mUnboundLocalError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mx\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 9\u001b[1;33m \u001b[0mfun\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;32m\u001b[0m in \u001b[0;36mfun\u001b[1;34m()\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mfun\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 6\u001b[1;33m \u001b[0mx\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mx\u001b[0m \u001b[1;33m*\u001b[0m \u001b[1;36m2\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 7\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mx\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;31mUnboundLocalError\u001b[0m: local variable 'x' referenced before assignment" + ] + } + ], + "source": [ + "# Example 3: \n", + "\n", + "x = \"global\"\n", + "\n", + "def fun():\n", + " x = x * 2\n", + " print(x)\n", + "\n", + "fun()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Explanation:**\n", + "\n", + "The output shows an error because Python treats **`x`** as a local variable and **`x`** is also not defined inside **`fun()`**.\n", + "\n", + "To make this work, we use the **`global`** keyword. Visit **[Python Global Keyword](https://github.com/milaan9/04_Python_Functions/blob/main/003_Python_Function_global_Keywords.ipynb)** to learn more." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T14:51:40.101612Z", + "start_time": "2021-06-13T14:51:40.073298Z" + }, + "scrolled": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Python\n", + "DataScience\n" + ] + }, + { + "ename": "NameError", + "evalue": "name 'local_lang' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 12\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mglobal_lang\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m# Output 'DataScience'\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 13\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 14\u001b[1;33m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mlocal_lang\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m# NameError: name 'local_lang' is not defined\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;31mNameError\u001b[0m: name 'local_lang' is not defined" + ] + } + ], + "source": [ + "# Example 4: \n", + "\n", + "global_lang = 'DataScience'\n", + "\n", + "def var_scope_test():\n", + " local_lang = 'Python'\n", + " print(local_lang)\n", + "\n", + "var_scope_test() # Output 'Python'\n", + "\n", + "# outside of function\n", + "print(global_lang) # Output 'DataScience'\n", + "\n", + "print(local_lang) # NameError: name 'local_lang' is not defined" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T14:51:41.071823Z", + "start_time": "2021-06-13T14:51:41.049365Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a,b):( 6 , 30 )\n", + "Global a : 90\n" + ] + }, + { + "ename": "NameError", + "evalue": "name 'b' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 10\u001b[0m \u001b[0mprint_data\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m#(a,b):( 5 , 10 )\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 11\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Global a :\"\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m#Global x : 50\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 12\u001b[1;33m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Local b : \"\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mb\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m#b is local veriable - throw NameError\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;31mNameError\u001b[0m: name 'b' is not defined" + ] + } + ], + "source": [ + "# Example 5: \n", + "\n", + "a=90 # 'a' is a variable defined outside of function, i.e., Global variable\n", + "\n", + "def print_data():\n", + " a=6 # 'a' is a variable defined inside of function, i.e., local variable\n", + " b=30\n", + " print(\"(a,b):(\",a,\",\",b,\")\")\n", + "\n", + "print_data() #(a,b):( 5 , 10 )\n", + "print(\"Global a :\",a) #Global x : 50\n", + "print(\"Local b : \",b) #b is local veriable - throw NameError" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Local Variables\n", + "\n", + "A variable declared inside the function's body or in the local scope is known as a local variable.\n", + "\n", + "If we try to access the local variable from the outside of the function, we will get the error as **`NameError`**." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T14:51:45.055679Z", + "start_time": "2021-06-13T14:51:45.042009Z" + }, + "scrolled": true + }, + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'y' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[0mfun\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 7\u001b[1;33m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0my\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;31mNameError\u001b[0m: name 'y' is not defined" + ] + } + ], + "source": [ + "# Example 1: Accessing local variable outside the scope\n", + "\n", + "def fun():\n", + " y = \"local\"\n", + " \n", + "fun()\n", + "print(y)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The output shows an error because we are trying to access a local variable **`y`** in a global scope whereas the local variable only works inside **`fun()`** or local scope." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T14:51:46.227056Z", + "start_time": "2021-06-13T14:51:46.209482Z" + }, + "scrolled": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "local\n" + ] + } + ], + "source": [ + "# Example 2: Create a Local Variable\n", + "\n", + "# Normally, we declare a variable inside the function to create a local variable.\n", + "\n", + "def fun():\n", + " y = \"local\"\n", + " print(y)\n", + "\n", + "fun()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let's take a look at the cell **In [2]: # Example 3:** where **`x`** was a global variable and we wanted to modify **`x`** inside **`fun()`**." + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T14:51:47.257321Z", + "start_time": "2021-06-13T14:51:47.225098Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Value is : 999\n" + ] + }, + { + "ename": "NameError", + "evalue": "name 'loc_var' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 9\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 10\u001b[0m \u001b[0mfun1\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 11\u001b[1;33m \u001b[0mfun2\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;32m\u001b[0m in \u001b[0;36mfun2\u001b[1;34m()\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mfun2\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 8\u001b[1;33m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Value is :\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mloc_var\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 9\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 10\u001b[0m \u001b[0mfun1\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;31mNameError\u001b[0m: name 'loc_var' is not defined" + ] + } + ], + "source": [ + "# Exercise 3: \n", + "\n", + "def fun1():\n", + " loc_var = 999 # local variable\n", + " print(\"Value is :\", loc_var)\n", + "\n", + "def fun2():\n", + " print(\"Value is :\", loc_var)\n", + "\n", + "fun1()\n", + "fun2()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Global and local variables\n", + "\n", + "Here, we will show how to use global variables and local variables in the same code." + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T14:51:48.270008Z", + "start_time": "2021-06-13T14:51:48.249505Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "globalglobal\n", + "local\n" + ] + } + ], + "source": [ + "# Example 1: Using Global and Local variables in the same code\n", + "\n", + "x = \"global\"\n", + "\n", + "def fun():\n", + " global x\n", + " y = \"local\"\n", + " x = x * 2\n", + " print(x)\n", + " print(y)\n", + "\n", + "fun()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Explanation**:\n", + "\n", + "In the above code, we declare **`x`** as a global and **`y`** as a local variable in the **`fun()`**. Then, we use multiplication operator **`*`** to modify the global variable **`x`** and we print both **`x`** and **`y`**.\n", + "\n", + "After calling the **`fun()`**, the value of **`x`** becomes **`global global`** because we used the **`x * 2`** to print two times **`global`**. After that, we print the value of local variable **`y`** i.e **`local`**." + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T14:51:49.331526Z", + "start_time": "2021-06-13T14:51:49.324692Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "local x: 19\n", + "global x: 9\n" + ] + } + ], + "source": [ + "# Example 2: Global variable and Local variable with same name\n", + "\n", + "x = 9\n", + "\n", + "def fun():\n", + " x = 19\n", + " print(\"local x:\", x)\n", + "\n", + "\n", + "fun()\n", + "print(\"global x:\", x)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Explanation**:\n", + "\n", + "In the above code, we used the same name **`x`** for both global variable and local variable. We get a different result when we print the same variable because the variable is declared in both scopes, i.e. the local scope inside **`fun()`** and global scope outside **`fun()`**.\n", + "\n", + "When we print the variable inside **`fun()`** it outputs **`local x: 19`**. This is called the local scope of the variable.\n", + "\n", + "Similarly, when we print the variable outside the **`fun()`**, it outputs **`global x: 9`**. This is called the global scope of the variable." + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T14:51:50.517064Z", + "start_time": "2021-06-13T14:51:50.505346Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Value inside the body of function: 10\n", + "Value outside of function: 20\n" + ] + } + ], + "source": [ + "# Exercise 3: \n", + "\n", + "def my_func(): # for this Function I am not writing any argument in parenthesis '()'\n", + " x = 10\n", + " print(\"Value inside the body of function:\",x)\n", + "\n", + "x = 20 # first, this line to execute\n", + "my_func() # second, the body of function will execute\n", + "print(\"Value outside of function:\",x) # finally, this line will execute" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Explanation:**\n", + "\n", + "Here, we can see that the value of **`x`** is 20 initially. Even though the function **`my_func()`** changed the value of **`x`** to 10, it did not affect the value outside the function.\n", + "\n", + "This is because the variable **`x`** inside the function is different (local to the function) from the one outside. Although they have the same names, they are two different variables with different scopes.\n", + "\n", + "On the other hand, variables outside of the function are visible from inside. They have a global scope.\n", + "\n", + "We can read these values from inside the function but cannot change (write) them. In order to modify the value of variables outside the function, they must be declared as global variables using the keyword global." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Nonlocal Variables\n", + "\n", + "Nonlocal variables are used in nested functions whose local scope is not defined. This means that the variable can be neither in the local nor the global scope.\n", + "\n", + "Let's see an example of how a global variable is created in Python.\n", + "\n", + "We use **`nonlocal`** keywords to create nonlocal variables." + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T14:51:52.225056Z", + "start_time": "2021-06-13T14:51:52.202598Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "variable type for Outer function: local\n", + "variable type for Inner function: nonlocal\n", + "Variable type of x1: global\n" + ] + } + ], + "source": [ + "# Example 1: Create a nonlocal variable\n", + "\n", + "x1 = \"global\" # Global variable\n", + "\n", + "def outer_fun(): # main function\n", + " x1 = \"local\" # 'x' is local variable for main function and it is nested variable for nested function\n", + " print(\"variable type for Outer function:\", x1)\n", + " \n", + " def inner_fun(): # nested fucntion\n", + " nonlocal x1 # using local variable 'x' in nested function as nonloval variable\n", + " x1 = \"nonlocal\" # changing the value of my 'x'\n", + " print(\"variable type for Inner function:\", x1) # print 'nonlocal'\n", + "\n", + " inner_fun() #print(\"outer:\", x1) # print 'nonlocal'\n", + " \n", + "outer_fun()\n", + "print(\"Variable type of x1:\", x1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the above code, there is a nested **`inner()`** function. We use nonlocal keywords to create a **`nonlocal`** variable. The **`inner()`** function is defined in the scope of another function **`outer()`**.\n", + "\n", + "> **Note**: If we change the value of a nonlocal variable, the changes appear in the local variable." + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T14:51:53.794872Z", + "start_time": "2021-06-13T14:51:53.777294Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "value of x inside inner function is: 900\n", + "value of x inside outer function is: 900\n" + ] + } + ], + "source": [ + "# Exercise 2: \n", + "\n", + "def outer_fun():\n", + " x = 999\n", + "\n", + " def inner_fun():\n", + " # local variable now acts as global variable\n", + " nonlocal x\n", + " x = 900\n", + " print(\"value of x inside inner function is:\", x)\n", + "\n", + " inner_fun()\n", + " print(\"value of x inside outer function is:\", x)\n", + "\n", + "outer_fun()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "hide_input": false, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.8" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": false, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": {}, + "toc_section_display": true, + "toc_window_display": false + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/003_Python_Function_global_Keywords.ipynb b/003_Python_Function_global_Keywords.ipynb new file mode 100644 index 0000000..6db76ab --- /dev/null +++ b/003_Python_Function_global_Keywords.ipynb @@ -0,0 +1,472 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "All the IPython Notebooks in **Python Functions** lecture series by Dr. Milaan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Python `global` Keyword\n", + "\n", + "In this class, youโ€™ll learn about the **`global`** keyword, global variable and when to use **`global`** keyword.\n", + "\n", + "Before reading this article, make sure you have got some basics of **[Python Global, Local and Nonlocal Variables](https://github.com/milaan9/04_Python_Functions/blob/main/002_Python_Function_Global_Local_Nonlocal.ipynb)**." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# What is `global` keyword?\n", + "\n", + "In Python, **`global`** keyword allows you to modify the variable outside of the current scope. It is used to create a global variable and make changes to the variable in a local context." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Rules of `global` Keyword\n", + "\n", + "The basic rules for **`global`** keyword in Python are:\n", + "\n", + "1. When we create a variable inside a function, it is local by default.\n", + "2. When we define a variable outside of a function, it is global by default. You don't have to use **`global`** keyword.\n", + "3. We use **`global`** keyword to read and write a global variable inside a function.\n", + "4. Use of **`global`** keyword outside a function has no effect." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Use of `global` Keyword" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T14:27:02.042929Z", + "start_time": "2021-06-13T14:27:02.025355Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1\n" + ] + } + ], + "source": [ + "# Example 1: Accessing global Variable From Inside a Function\n", + "\n", + "a = 1 # global variable\n", + "\n", + "def add():\n", + " print(a)\n", + "\n", + "add()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "However, we may have some scenarios where we need to modify the global variable from inside a function." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T14:27:05.239195Z", + "start_time": "2021-06-13T14:27:04.904238Z" + } + }, + "outputs": [ + { + "ename": "UnboundLocalError", + "evalue": "local variable 'a' referenced before assignment", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mUnboundLocalError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 9\u001b[1;33m \u001b[0madd\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;32m\u001b[0m in \u001b[0;36madd\u001b[1;34m()\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0madd\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 6\u001b[1;33m \u001b[0ma\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0ma\u001b[0m \u001b[1;33m+\u001b[0m \u001b[1;36m3\u001b[0m \u001b[1;31m# increment a by 3 (modifying my global variable)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 7\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;31mUnboundLocalError\u001b[0m: local variable 'a' referenced before assignment" + ] + } + ], + "source": [ + "# Example 2: Modifying Global Variable From Inside the Function\n", + "\n", + "a = 1 # global variable\n", + " \n", + "def add():\n", + " a = a + 3 # increment a by 3 (modifying my global variable)\n", + " print(a)\n", + "\n", + "add()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This is because we can only access the global variable but cannot modify it from inside the function.\n", + "\n", + "The solution for this is to use the **`global`** keyword." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T14:27:06.885175Z", + "start_time": "2021-06-13T14:27:06.863695Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Inside add(): 3\n", + "In main: 3\n" + ] + } + ], + "source": [ + "# Example 2: Changing Global Variable From Inside a Function using global\n", + "\n", + "a = 0 # global variable\n", + "\n", + "def add():\n", + " global a # using global variable inside my function\n", + " a = a + 3 # increment by 3\n", + " print(\"Inside add():\", a)\n", + "\n", + "add()\n", + "print(\"In main:\", a)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Explanation:**\n", + "\n", + "In the above program, we define **`a`** as a global keyword inside the **`add()`** function.\n", + "\n", + "Then, we increment the variable **`a`** by 1, i.e **`a = a + 3`**. After that, we call the **`add()`** function. Finally, we print the global variable **`a`**.\n", + "\n", + "As we can see, change also occurred on the global variable outside the function, **`a = 3`**." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Letโ€™s see another example where we donโ€™t use **`global`** keyword to access the global variable in the function." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T14:27:09.262597Z", + "start_time": "2021-06-13T14:27:09.239165Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Value in 1st function: 9\n", + "Value in 2nd function: 999\n", + "Value in 3rd function: 9\n" + ] + } + ], + "source": [ + "# Exercise 3: without `global` keyword.\n", + "\n", + "global_var = 9 # Global variable\n", + "\n", + "def fun1():\n", + " print(\"Value in 1st function:\", global_var)\n", + "\n", + "def fun2():\n", + " # Modify global variable\n", + " # function will treat it as a local variable\n", + " global_var = 999\n", + " print(\"Value in 2nd function:\", global_var)\n", + "\n", + "def fun3():\n", + " print(\"Value in 3rd function:\", global_var)\n", + "\n", + "fun1()\n", + "fun2()\n", + "fun3()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Explanation:**\n", + "\n", + "As you can see, **`fun2()`** treated **`global_var`** as a new variable (local variable). To solve such issues or access/modify global variables inside a function, we use the **`global`** keyword." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T14:27:11.122937Z", + "start_time": "2021-06-13T14:27:11.113174Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Value in 1st function: 9\n", + "Value in 2nd function: 999\n", + "Value in 3rd function: 999\n" + ] + } + ], + "source": [ + "# Exercise 3: use the `global` keyword.\n", + "\n", + "\n", + "x = 9 # Global variable\n", + "\n", + "# defining 1st function\n", + "def fun1():\n", + " print(\"Value in 1st function:\", x)\n", + "\n", + "# defining 2nd function\n", + "def fun2():\n", + " # Modify global variable using global keyword\n", + " global x\n", + " x = 999\n", + " print(\"Value in 2nd function:\", x)\n", + "\n", + "# defining 3rd function\n", + "def fun3():\n", + " print(\"Value in 3rd function:\", x)\n", + "\n", + "fun1()\n", + "fun2()\n", + "fun3()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Global Variables Across Python Modules\n", + "\n", + "In Python, we create a single module **config.py** to hold global variables and share information across Python modules within the same program.\n", + "\n", + "Here is how we can share global variables across the python modules." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Example : Share a global Variable Across Python Modules\n", + "\n", + "Create a **config.py** file, to store global variables\n", + "\n", + "```python\n", + ">>> a = 0\n", + ">>> b = \"empty\"\n", + "```\n", + "\n", + "Create a **update.py** file, to change global variables\n", + "\n", + "```python\n", + ">>> import config # import config.py here\n", + "\n", + ">>> config.a = 10 # change the value of 'a' from 0 to 10\n", + ">>> config.b = \"alphabet\" # change the value of 'b' from \"empty\" to \"alphabet\"\n", + "```\n", + "\n", + "Create a **main1.py** file, to test changes in value\n", + "\n", + "```python\n", + ">>> import config # import config.py here\n", + ">>> import update # import update.py here\n", + "\n", + ">>> print(config.a) # print the updated value of 'a'\n", + ">>> print(config.b) # print the updated value of 'b'\n", + "```\n", + "\n", + "When we run the **main.py** file, the output will be\n", + "\n", + "`\n", + "10\n", + "alphabet\n", + "`\n", + "\n", + "In the above, we have created three files: **config.py**, **update.py**, and **main.py**.\n", + "\n", + "The module **config.py** stores global variables of **`a`** and **`b`**. In the **update.py** file, we import the **config.py** module and modify the values of **`a`** and **`b`**. Similarly, in the **main.py** file, we import both **config.py** and **update.py** module. Finally, we print and test the values of global variables whether they are changed or not." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Global in Nested Functions\n", + "\n", + "Here is how you can use a global variable in nested function." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T14:27:16.594081Z", + "start_time": "2021-06-13T14:27:16.570649Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Before calling bar function: 30\n", + "Calling bar function now\n", + "After calling bar function: 30\n", + "x in main function: 66\n" + ] + } + ], + "source": [ + "# Example 1: Using a Global Variable in Nested Function\n", + "\n", + "def fun(): # main function\n", + " x = 30\n", + "\n", + " def day(): # nested fucntion\n", + " global x\n", + " x = 66\n", + " \n", + " print(\"Before calling bar function:\", x) # check indentation\n", + " print(\"Calling bar function now\")\n", + " day()\n", + " print(\"After calling bar function:\", x)\n", + "\n", + "fun()\n", + "print(\"x in main function:\", x)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Explanation:**\n", + "\n", + "In the above program, we declared a global variable inside the nested function **`day()`**. Inside **`fun()`** function, **`x`** has no effect of the global keyword.\n", + "\n", + "Before and after calling **`day()`**, the variable **`x`** takes the value of local variable i.e **`x = 30`**. Outside of the **`fun()`** function, the variable **`x`** will take value defined in the **`day()`** function i.e **`x = 66`**. This is because we have used global keyword in **`x`** to create global variable inside the **`day()`** function (local scope).\n", + "\n", + "If we make any changes inside the **`day()`** function, the changes appear outside the local scope, i.e. **`fun()`**." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "hide_input": false, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.8" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": false, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": {}, + "toc_section_display": true, + "toc_window_display": false + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/004_Python_Function_Arguments.ipynb b/004_Python_Function_Arguments.ipynb new file mode 100644 index 0000000..e4de16f --- /dev/null +++ b/004_Python_Function_Arguments.ipynb @@ -0,0 +1,1046 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "All the IPython Notebooks in **Python Functions** lecture series by Dr. Milaan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Function Argument and Parameter\n", + "\n", + "The argument is a value, a variable, or an object that we pass to a function or method call. \n", + "\n", + "There can be two types of data passed in the function.\n", + "\n", + "* The First type of data is the data passed in the function call. This data is called **arguments**.\n", + "\n", + "* The second type of data is the data received in the function definition. This data is called **parameters**.\n", + "\n", + " - Arguments can be literals, variables and expressions. \n", + " - Parameters must be variable to hold incoming values.\n", + "\n", + "Alternatively, arguments can be called as **actual parameters** or **actual arguments** and parameters can be called as **formal parameters** or **formal arguments**." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Python Function Arguments\n", + "\n", + "In Python, you can define a function that takes variable number of arguments. In this article, you will learn to define such functions using default, keyword and arbitrary arguments.\n", + "\n", + "In Python, there are 2 types of arguments allowed.\n", + "\n", + "1. Positional Arguments (Basic)\n", + "2. Variable Function Arguments\n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Positional Arguments (Basic)\n", + "\n", + "In the **[User-defined function](https://github.com/milaan9/04_Python_Functions/blob/main/Python_User_defined_Functions.ipynb)** topic, we learned about defining a function and calling it. Otherwise, the function call will result in an error. For example:" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:53:46.249389Z", + "start_time": "2021-10-08T17:53:46.233763Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello Arthur, Good morning!\n" + ] + } + ], + "source": [ + "# Example 1:\n", + "\n", + "def greet(name, msg):\n", + " \"\"\"This function greets to the person with the provided message\"\"\"\n", + " print(\"Hello\", name + ', ' + msg)\n", + "\n", + "greet(\"Arthur\", \"Good morning!\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Explanation:**\n", + "\n", + "Here, the function **`greet()`** has two parameters.\n", + "\n", + "Since we have called this function with two arguments, it runs smoothly and we do not get any error.\n", + "\n", + "If we call it with a different number of arguments, the interpreter will show an error message. Below is a call to this function with one and no arguments along with their respective error messages." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:53:46.738157Z", + "start_time": "2021-10-08T17:53:46.252318Z" + } + }, + "outputs": [ + { + "ename": "TypeError", + "evalue": "greet() missing 1 required positional argument: 'msg'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mgreet\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Arthur\"\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m# only one argument\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m: greet() missing 1 required positional argument: 'msg'" + ] + } + ], + "source": [ + "greet(\"Arthur\") # only one argument" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:53:58.135141Z", + "start_time": "2021-10-08T17:53:58.121470Z" + } + }, + "outputs": [ + { + "ename": "TypeError", + "evalue": "greet() missing 2 required positional arguments: 'name' and 'msg'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mgreet\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m# no arguments\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m: greet() missing 2 required positional arguments: 'name' and 'msg'" + ] + } + ], + "source": [ + "greet() # no arguments" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:54:01.795787Z", + "start_time": "2021-10-08T17:54:01.785048Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "60\n", + "30\n" + ] + } + ], + "source": [ + "# Example 2:\n", + "\n", + "def add(a, b):\n", + " print(a - b)\n", + "\n", + "add(90, 30) # Output 60\n", + "add(60, 30) # Output -30" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:54:02.180554Z", + "start_time": "2021-10-08T17:54:02.002333Z" + } + }, + "outputs": [ + { + "ename": "TypeError", + "evalue": "add() takes 2 positional arguments but 3 were given", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0madd\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mb\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ma\u001b[0m \u001b[1;33m-\u001b[0m \u001b[0mb\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 5\u001b[1;33m \u001b[0madd\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m109\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m633\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m9\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m: add() takes 2 positional arguments but 3 were given" + ] + } + ], + "source": [ + "# Example 2: If you try to use pass more parameters you will get an error.\n", + "\n", + "def add(a, b):\n", + " print(a - b)\n", + "add(109, 633, 9)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ">**Note:** In the **Positional argument** number and position of arguments must be matched. If we change the order, then the result may change. Also, If we change the number of arguments, then we will get an error." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:54:02.567760Z", + "start_time": "2021-10-08T17:54:02.553115Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "even\n", + "odd\n" + ] + } + ], + "source": [ + "# Example 3:\n", + "\n", + "def evenodd(x): # x is parameters or formal parameters or formal arguments.\n", + " if (x % 2 == 0):\n", + " print(\"even\")\n", + " else:\n", + " print(\"odd\")\n", + "\n", + "# Driver code\n", + "evenodd(6) # here 2 is argument or actual perameter\n", + "evenodd(9) # here 3 is argument or actual perameter" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:54:02.829482Z", + "start_time": "2021-10-08T17:54:02.808974Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "8\n" + ] + } + ], + "source": [ + "# Example 4:\n", + "\n", + "def cube(x):\n", + " \"This x a passed num value into this function, return cube of x\"\n", + " y=x*x*x;\n", + " return y\n", + "\n", + "# Now you can call cube function\n", + "z=cube(2) #required to pass argument\n", + "print(z)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Variable Function Arguments\n", + "\n", + "Up until now, functions had a fixed number of arguments. In Python, there are other ways to define a function that can take variable number of arguments.\n", + "\n", + "Three different forms of this type are described below:\n", + "\n", + "1. Default Arguments\n", + "2. Keyword Arguments\n", + "3. Arbitrary/Variable-length Arguments\n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Python Default Arguments\n", + "\n", + "Default arguments are arguments that take the default value during the function call. If we do not pass any argument to the function, then the default argument will take place. We can assign default values using the **`=`** assignment operator. For example:" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:54:03.695692Z", + "start_time": "2021-10-08T17:54:03.679093Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello Alan, Good morning!\n", + "Hello Bruce, How do you do?\n", + "Hello Carson, Good night!\n" + ] + } + ], + "source": [ + "# Example 1:\n", + "\n", + "def greet(name, msg=\"Good morning!\"): # two arguments: `name` is fixed arg and 'msg' is variable arg\n", + "\n", + " print(\"Hello\", name + ', ' + msg)\n", + "\n", + "\n", + "greet(\"Alan\")\n", + "greet(\"Bruce\", \"How do you do?\")\n", + "greet(\"Carson\",\"Good night!\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Explanation:**\n", + "\n", + "In this function, the parameter **`name`** does not have a default value and is required (mandatory) during a call.\n", + "\n", + "On the other hand, the parameter **`msg`** has a default value of **`\"Good morning!\"`**. So, it is optional during a call. If a value is provided, it will overwrite the default value.\n", + "\n", + "Any number of arguments in a function can have a default value. But once we have a default argument, all the arguments to its right must also have default values.\n", + "\n", + "This means to say, non-default arguments cannot follow default arguments. For example, if we had defined the function header above as:\n", + "\n", + "```python\n", + ">>> def greet(msg = \"Good morning!\", name):\n", + "```\n", + "\n", + "We would get an error as:\n", + "```python\n", + "SyntaxError: non-default argument follows default argument\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:54:04.298283Z", + "start_time": "2021-10-08T17:54:04.279681Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello David\n", + "Hello Everyone\n" + ] + } + ], + "source": [ + "# Example 2: function with default argument\n", + "\n", + "def message(name=\"Everyone\"):\n", + " print(\"Hello\", name)\n", + "\n", + "# calling function with argument\n", + "message(\"David\")\n", + "\n", + "# calling function without argument\n", + "message()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Explanation:** \n", + "\n", + "When we call a function with an argument, it will be considered that value.\n", + "\n", + "Like in the above example, we passed **`name=\"David\"`** we pass to the function, then the function will consider that value. If we do not pass any argument, it will be considered **`\"name=Everyone\"`** as a default value." + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:54:05.968643Z", + "start_time": "2021-10-08T17:54:05.951068Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Details of: Bill\n", + "Empoyee Id : 101\n", + "Age : 21\n", + "Company : Samsung.com\n", + "-----------------------\n", + "Details of: Cory\n", + "Empoyee Id : 102\n", + "Age : 22\n", + "Company : Baidu.com\n" + ] + } + ], + "source": [ + "# Example 3: it prints default age if it is not passed\n", + "\n", + "def emp_data(name, emp_id, age, company=\"Baidu.com\"): # total 4 arguments (3 is fixed and 1 is variable)\n", + " print(\"Details of: \",name)\n", + " print(\"Empoyee Id : \",emp_id)\n", + " print(\"Age : \",age)\n", + " print(\"Company : \",company)\n", + "\n", + "#call emp_data fun\n", + "emp_data(\"Bill\",101,21,\"Samsung.com\")\n", + "print(\"-----------------------\")\n", + "emp_data(\"Cory\",102,22)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Python Keyword Arguments\n", + "\n", + "Keyword arguments are related to the function calls. A keyword argument is an argument value, passed to function preceded by the variable name and an equals sign.\n", + "\n", + "This allows you to skip arguments or place them out of order because the Python interpreter is able to use the keywords provided to match the values with parameters." + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:54:06.818254Z", + "start_time": "2021-10-08T17:54:06.799703Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello Eric, How do you do?\n", + "Hello Eric, How do you do?\n", + "Hello Eric, How do you do?\n", + "Hello Eric, How do you do?\n" + ] + } + ], + "source": [ + "# Example 1:\n", + "\n", + "greet(\"Eric\", \"How do you do?\")\n", + "\n", + "# 2 keyword arguments\n", + "greet(name = \"Eric\",msg = \"How do you do?\")\n", + "\n", + "# 2 keyword arguments (out of order)\n", + "greet(msg = \"How do you do?\",name = \"Eric\") \n", + "\n", + "# 1 positional, 1 keyword argument\n", + "greet(\"Eric\", msg = \"How do you do?\") " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "As we can see, we can mix positional arguments with keyword arguments during a function call. But we must keep in mind that keyword arguments must follow positional arguments.\n", + "\n", + "Having a positional argument after keyword arguments will result in errors. For example, the function call as follows:" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:54:07.312883Z", + "start_time": "2021-10-08T17:54:07.298727Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello Eric, How do you do?\n" + ] + } + ], + "source": [ + "greet(\"Eric\",\"How do you do?\")" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:54:07.575577Z", + "start_time": "2021-10-08T17:54:07.569232Z" + }, + "scrolled": true + }, + "outputs": [ + { + "ename": "SyntaxError", + "evalue": "positional argument follows keyword argument (, line 1)", + "output_type": "error", + "traceback": [ + "\u001b[1;36m File \u001b[1;32m\"\"\u001b[1;36m, line \u001b[1;32m1\u001b[0m\n\u001b[1;33m greet(name=\"Eric\",\"How do you do?\") # Will result in an error\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m positional argument follows keyword argument\n" + ] + } + ], + "source": [ + "greet(name=\"Eric\",\"How do you do?\") # Will result in an error" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:54:07.837788Z", + "start_time": "2021-10-08T17:54:07.826073Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Milaan Parmar\n" + ] + } + ], + "source": [ + "# Example 2:\n", + "\n", + "def print_fullname(firstname, lastname):\n", + " space = ' '\n", + " full_name = firstname + space + lastname\n", + " return full_name\n", + "print(print_fullname(firstname = 'Milaan', lastname = 'Parmar'))" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:54:08.116107Z", + "start_time": "2021-10-08T17:54:08.109271Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "5\n" + ] + } + ], + "source": [ + "# Example 3:\n", + "\n", + "def add_two_numbers (num1, num2):\n", + " total = num1 + num2\n", + " return total\n", + "print(add_two_numbers(num2 = 3, num1 = 2)) # Order does not matter" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:54:08.454973Z", + "start_time": "2021-10-08T17:54:08.439351Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Age: 200\n" + ] + } + ], + "source": [ + "# Example 4:\n", + "\n", + "def calculate_age (current_year, birth_year):\n", + " age = current_year - birth_year\n", + " return age;\n", + "print('Age: ', calculate_age(2019, 1819))" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:54:08.733298Z", + "start_time": "2021-10-08T17:54:08.724510Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "remainder of 10/3 : 1\n" + ] + } + ], + "source": [ + "# Example 5:\n", + "\n", + "def remainder(dividend,divisor):\n", + " x=dividend%divisor\n", + " return x\n", + "\n", + "#rem = remainder(10,3)\n", + "rem = remainder(divisor = 3, dividend = 10) # keyword argument\n", + "print(\"remainder of 10/3 : \",rem)" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:54:09.011615Z", + "start_time": "2021-10-08T17:54:08.992087Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello Frank Harper\n", + "Hello Gretta Clayton\n" + ] + } + ], + "source": [ + "# Example 6:\n", + "\n", + "def message(name, surname):\n", + " print(\"Hello\", name, surname)\n", + "\n", + "message(name=\"Frank\", surname=\"Harper\")\n", + "message(surname=\"Clayton\", name=\"Gretta\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In keyword arguments order of argument is not matter, but the number of arguments must match. Otherwise, we will get an error." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "While using keyword and positional argument simultaneously, we need to pass 1st arguments as positional arguments and then keyword arguments. Otherwise, we will get **`SyntaxError`**. See the following example." + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:54:09.751364Z", + "start_time": "2021-10-08T17:54:09.743554Z" + } + }, + "outputs": [ + { + "ename": "SyntaxError", + "evalue": "positional argument follows keyword argument (, line 10)", + "output_type": "error", + "traceback": [ + "\u001b[1;36m File \u001b[1;32m\"\"\u001b[1;36m, line \u001b[1;32m10\u001b[0m\n\u001b[1;33m message(first_nm=\"Frank\", \"Harper\") # SyntaxError: positional argument follows keyword argument\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m positional argument follows keyword argument\n" + ] + } + ], + "source": [ + "# Example 7:\n", + "\n", + "def message(first_nm, last_nm):\n", + " print(\"Hello..!\", first_nm, last_nm)\n", + "\n", + "# correct use\n", + "message(\"Frank\", \"Harper\")\n", + "message(\"Frank\", last_nm=\"Harper\")\n", + "\n", + "message(first_nm=\"Frank\", \"Harper\") # SyntaxError: positional argument follows keyword argument" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Python Arbitrary/Variable-length Arguments\n", + "\n", + "Sometimes, we do not know in advance the number of arguments that will be passed into a function. Python allows us to handle this kind of situation through function calls with an arbitrary number of arguments.\n", + "\n", + "We can pass any number of arguments to this function. Internally all these values are represented in the form of a **tuple**.\n", + "\n", + "In the function definition, we use an asterisk **`*`** before the parameter name to denote this kind of argument. For example:" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:54:10.415429Z", + "start_time": "2021-10-08T17:54:10.407618Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello Gary\n", + "Hello Hank\n", + "Hello Ivan\n", + "Hello John\n" + ] + } + ], + "source": [ + "# Example 1: \n", + "\n", + "def greet(*names):\n", + " \"\"\"This function greets all the person in the names tuple.\"\"\"\n", + " # names is a tuple with arguments\n", + " for name in names:\n", + " print(\"Hello\", name)\n", + "\n", + "greet(\"Gary\", \"Hank\", \"Ivan\", \"John\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here, we have called the function with multiple arguments. These arguments get wrapped up into a tuple before being passed into the function. Inside the function, we use a **`for`** loop to retrieve all the arguments back." + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:54:11.604882Z", + "start_time": "2021-10-08T17:54:11.592189Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sum is: 0\n", + "Sum is: 33\n", + "Sum is: 176.6\n" + ] + } + ], + "source": [ + "# Example 2: \n", + "\n", + "def addition(*numbers):\n", + " total = 0\n", + " for no in numbers:\n", + " total = total + no\n", + " print(\"Sum is:\", total)\n", + "\n", + "addition() # 0 arguments\n", + "addition(10, 5, 3, 6, 9) # 5 arguments\n", + "addition(96, 77, 3.6) # 3 arguments" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:54:12.315821Z", + "start_time": "2021-10-08T17:54:12.304103Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10\n" + ] + } + ], + "source": [ + "# Example 3: \n", + "\n", + "def sum_all_nums(*nums):\n", + " total = 0\n", + " for num in nums:\n", + " total += num # same as total = total + num \n", + " return total\n", + "print(sum_all_nums(2, 3, 5)) # 10" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Default and Arbitrary Number of Parameters in Functions" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:54:13.377345Z", + "start_time": "2021-10-08T17:54:13.359769Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Output is: \n", + "10\n", + "Output is: \n", + "70\n", + "40\n", + "20\n", + "Output is: \n", + "30\n", + "60\n", + "90\n", + "120\n" + ] + } + ], + "source": [ + "# Example 1: \n", + "\n", + "def printinfo( arg1, *vartuple ):\n", + " \"This prints a variable passed arguments\"\n", + " print (\"Output is: \")\n", + " print (arg1)\n", + " for var in vartuple:\n", + " print (var)\n", + " return\n", + "\n", + " # Now you can call printinfo function\n", + "printinfo( 10 ) # We have given only one value for the argument\n", + "printinfo( 70, 40, 20 )\n", + "printinfo( 30, 60, 90, 120 )" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:54:14.148826Z", + "start_time": "2021-10-08T17:54:14.127348Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Team-1\n", + "Milaan\n", + "Arthur\n", + "Clark\n", + "Ethan\n", + "None\n" + ] + } + ], + "source": [ + "# Example 2: \n", + "\n", + "def generate_groups (team,*args):\n", + " print(team)\n", + " for i in args:\n", + " print(i)\n", + "print(generate_groups('Team-1','Milaan','Arthur','Clark','Ethan'))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Function as a Parameter of Another Function" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:54:15.540920Z", + "start_time": "2021-10-08T17:54:15.520416Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "9\n" + ] + } + ], + "source": [ + "# Example 1: You can pass functions around as parameters\n", + "\n", + "def square_number (n):\n", + " return n * n\n", + "def do_something(f, x):\n", + " return f(x)\n", + "print(do_something(square_number, 3)) # 27" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "hide_input": false, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.8" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": false, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": {}, + "toc_section_display": true, + "toc_window_display": false + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/005_Python_Function_Recursion.ipynb b/005_Python_Function_Recursion.ipynb new file mode 100644 index 0000000..f301911 --- /dev/null +++ b/005_Python_Function_Recursion.ipynb @@ -0,0 +1,258 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "All the IPython Notebooks in **Python Functions** lecture series by Dr. Milaan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Python Recursion\n", + "\n", + "In this class, you will learn to create a recursive function (a function that calls itself again and again)." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# What is recursion?\n", + "\n", + "Recursion is the process of defining something in terms of itself.\n", + "\n", + "A physical world example would be to **place two parallel mirrors facing each other**. Any object in between them would be reflected recursively." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Python Recursive Function\n", + "\n", + "In Python, we know that a **[function](https://github.com/milaan9/04_Python_Functions/blob/main/001_Python_Functions.ipynb)** can call other functions. It is even possible for the function to call itself. These types of construct are termed as recursive functions.\n", + "\n", + "The following image shows the working of a recursive function called **`recurse`**.\n", + "\n", + "
\n", + "\n", + "
\n", + "\n", + "Following is an example of a recursive function to find the factorial of an integer.\n", + "\n", + "Factorial of a number is the product of all the integers from 1 to that number. For example, the factorial of 6 (denoted as 6!) is \n", + "\n", + "```python\n", + "1*2*3*4*5*6 = 720.\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T16:03:47.995819Z", + "start_time": "2021-06-13T16:03:47.984100Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The factorial of 3 is 6\n" + ] + } + ], + "source": [ + "# Example 1:\n", + "\n", + "def factorial(n):\n", + " \"\"\"This is a recursive function to find the factorial of an integer\"\"\"\n", + "\n", + " if n == 1:\n", + " return 1\n", + " else:\n", + " return (n * factorial(n-1)) # 3 * 2 * 1 = 6\n", + "\n", + "\n", + "num = 3\n", + "print(\"The factorial of\", num, \"is\", factorial(num))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the above example, **`factorial()`** is a recursive function as it calls itself." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "When we call this function with a positive integer, it will recursively call itself by decreasing the number.\n", + "\n", + "Each function multiplies the number with the factorial of the number below it until it is equal to one. This recursive call can be explained in the following steps.\n", + "\n", + "```python\n", + "factorial(3) # 1st call with 3\n", + "3 * factorial(2) # 2nd call with 2\n", + "3 * 2 * factorial(1) # 3rd call with 1\n", + "3 * 2 * 1 # return from 3rd call as number=1\n", + "3 * 2 # return from 2nd call\n", + "6 # return from 1st call\n", + "```\n", + "\n", + "Let's look at an image that shows a step-by-step process of what is going on:\n", + "\n", + "
\n", + "\n", + "
" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Our recursion ends when the number reduces to 1. This is called the base condition.\n", + "\n", + "Every recursive function must have a base condition that stops the recursion or else the function calls itself infinitely.\n", + "\n", + "The Python interpreter limits the depths of recursion to help avoid infinite recursions, resulting in stack overflows.\n", + "\n", + "By default, the maximum depth of recursion is **`1000`**. If the limit is crossed, it results in **`RecursionError`**. Let's look at one such condition." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T16:04:11.723151Z", + "start_time": "2021-06-13T16:04:05.119692Z" + } + }, + "outputs": [ + { + "ename": "RecursionError", + "evalue": "maximum recursion depth exceeded", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mRecursionError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mrecursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 2\u001b[0m \u001b[0mrecursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 3\u001b[1;33m \u001b[0mrecursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;32m\u001b[0m in \u001b[0;36mrecursor\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mrecursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mrecursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 3\u001b[0m \u001b[0mrecursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "... last 1 frames repeated, from the frame below ...\n", + "\u001b[1;32m\u001b[0m in \u001b[0;36mrecursor\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mrecursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mrecursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 3\u001b[0m \u001b[0mrecursor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;31mRecursionError\u001b[0m: maximum recursion depth exceeded" + ] + } + ], + "source": [ + "def recursor():\n", + " recursor()\n", + "recursor()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Advantages of Recursion\n", + "\n", + "1. Recursive functions make the code look clean and elegant.\n", + "2. A complex task can be broken down into simpler sub-problems using recursion.\n", + "3. Sequence generation is easier with recursion than using some nested iteration." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Disadvantages of Recursion\n", + "\n", + "1. Sometimes the logic behind recursion is hard to follow through.\n", + "2. Recursive calls are expensive (inefficient) as they take up a lot of memory and time.\n", + "3. Recursive functions are hard to debug." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "hide_input": false, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.8" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": false, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": {}, + "toc_section_display": true, + "toc_window_display": false + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/006_Python_Function_Anonymous.ipynb b/006_Python_Function_Anonymous.ipynb new file mode 100644 index 0000000..b30f520 --- /dev/null +++ b/006_Python_Function_Anonymous.ipynb @@ -0,0 +1,455 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "All the IPython Notebooks in **Python Functions** lecture series by Dr. Milaan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Python Anonymous/**`lambda`** Function\n", + "\n", + "In this class, you'll learn about the anonymous function, also known as **`lambda`** functions. You'll learn what they are, their syntax and how to use them (with examples)." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## What are **`lambda`** functions in Python?\n", + "\n", + "In Python, an anonymous function is a **[function](https://github.com/milaan9/04_Python_Functions/blob/main/001_Python_Functions.ipynb)** that is defined without a name.\n", + "\n", + "While normal functions are defined using the **`def`** keyword in Python, anonymous functions are defined using the **`lambda`** keyword.\n", + "\n", + "In opposite to a normal function, a Python **`lambda`** function is a single expression. But, in a lambda body, we can expand with expressions over multiple lines using parentheses **`()`** or a multiline string **`\"\"\" \"\"\"`**.\n", + "\n", + "For example: **`lambda n:n+n`**\n", + "\n", + "The reason behind the using anonymous function is for instant use, that is, one-time usage and the code is very concise so that there is more readability in the code.\n", + "\n", + "Hence, anonymous functions are also called **`lambda`** functions.\n", + "\n", + "* Lambda forms can take any number of arguments but return just one value in the form of an expression. They cannot contain commands or multiple expressions.\n", + "\n", + "* An anonymous function cannot be a direct call to print because **lambda** requires an expression. \n", + "\n", + "* **`lambda`** functions have their own local namespace and cannot access variables other than those in their parameter list and those in the global namespace. \n", + "\n", + "* Although it appears that lambdas are a one-line version of a function, they are not equivalent to inline statements in C or C++, whose purpose is to stack allocation by passing function, during invocation for performance reasons.\n", + "\n", + "**Syntax:** \n", + "\n", + "```python\n", + "lambda argument_list: expression\n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Letโ€™s see an example to print even numbers without a **`lambda`** function and with a **`lambda`** function. See the difference in line of code as well as readability of code." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T16:39:39.033426Z", + "start_time": "2021-06-13T16:39:39.014872Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Even numbers are: [10, 16, 78, 2]\n" + ] + } + ], + "source": [ + "# Example 1: Program for even numbers without lambda function\n", + "\n", + "def even_numbers(nums):\n", + " even_list = []\n", + " for n in nums:\n", + " if n % 2 == 0:\n", + " even_list.append(n)\n", + " return even_list\n", + "\n", + "num_list = [10, 9, 16, 78, 2, 3, 7, 1]\n", + "ans = even_numbers(num_list)\n", + "print(\"Even numbers are:\", ans)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T16:39:39.494358Z", + "start_time": "2021-06-13T16:39:39.474831Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Even numbers are: [10, 16, 78, 2]\n" + ] + } + ], + "source": [ + "# Example 1: Program for even number with a lambda function\n", + "\n", + "l = [10, 9, 16, 78, 2, 3, 7, 1]\n", + "even_nos = list(filter(lambda x: x % 2 == 0, l))\n", + "print(\"Even numbers are: \", even_nos)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T16:39:39.879120Z", + "start_time": "2021-06-13T16:39:39.860569Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "12\n" + ] + } + ], + "source": [ + "# Example 2: Program to show the use of lambda functions\n", + "\n", + "double = lambda x: x * 2\n", + "\n", + "print(double(6))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Explanation:**\n", + "\n", + "In the above program, lambda **`x: x * 2`** is the lambda function. Here **`x`** is the argument and **`x * 2`** is the expression that gets evaluated and returned.\n", + "\n", + "This function has no name. It returns a function object which is assigned to the identifier **`double`**. We can now call it as a normal function. The statement\n", + "\n", + "```python\n", + ">>> double = lambda x: x * 2\n", + "```\n", + "\n", + "is nearly the same as:\n", + "\n", + "```python\n", + ">>> def double(x):\n", + ">>> return x * 2\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T16:39:40.863492Z", + "start_time": "2021-06-13T16:39:40.847866Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Square of number is 100\n", + "Square of number is 4\n" + ] + } + ], + "source": [ + "# Example 3: Normal Function definition is here\n", + "\n", + "def square(x):\n", + " return x*x\n", + "\n", + "# anonymous function\n", + "sqr = lambda x: x*x\n", + "\n", + "#Calling square function\n", + "print(\"Square of number is\",square(10)) #call normal function\n", + "print(\"Square of number is\",sqr(2)) #call anonymous function" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Use of **`lambda`** Function in python\n", + "\n", + "We use **`lambda`** function when we require a nameless function for a short period of time.\n", + "\n", + "In Python, we generally use it as an argument to a higher-order function (a function that takes in other functions as **[arguments](https://github.com/milaan9/04_Python_Functions/blob/main/004_Python_Function_Arguments.ipynb)**). **`lambda`** function are used along with built-in functions like **`filter()`**, **`map()`**, **`reduce()`** etc." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### `lambda` function use with `filter()`\n", + "\n", + "The **`filter()`** function in Python takes in a function and a list as arguments.\n", + "\n", + "The function is called with all the items in the list and a new list is returned which contains items for which the function evaluates to **`True`**.\n", + "\n", + "Here is an example use of **`filter()`** function to filter out only even numbers from a list." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T16:39:42.617383Z", + "start_time": "2021-06-13T16:39:42.602735Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Even numbers are: [4, 6, 8, 12]\n" + ] + } + ], + "source": [ + "# Example 1: Program to filter out only the even items from a list\n", + "\n", + "my_list = [1, 5, 4, 6, 8, 11, 3, 12] # total 8 elements\n", + "\n", + "new_list = list(filter(lambda x: (x%2 == 0), my_list)) # returns the output in form of a list\n", + "\n", + "print(\"Even numbers are: \", new_list)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T16:39:43.496282Z", + "start_time": "2021-06-13T16:39:43.478704Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Positive numbers are: [5, 12, 6, 9]\n" + ] + } + ], + "source": [ + "# Example 2: \n", + "\n", + "l = [-10, 5, 12, -78, 6, -1, -7, 9]\n", + "positive_nos = list(filter(lambda x: x > 0, l))\n", + "print(\"Positive numbers are: \", positive_nos)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### `lambda` function with `map()`\n", + "\n", + "The **`map()`** function in Python takes in a function and a list.\n", + "\n", + "The function is called with all the items in the list and a new list is returned which contains items returned by that function for each item.\n", + "\n", + "Here is an example use of **`map()`** function to double all the items in a list." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T16:39:45.093927Z", + "start_time": "2021-06-13T16:39:45.078304Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Double values are: [2, 10, 8, 12, 16, 22, 6, 24]\n" + ] + } + ], + "source": [ + "# Example 1: Program to double each item in a list using map()\n", + "\n", + "my_list = [1, 5, 4, 6, 8, 11, 3, 12] # total 8 elements\n", + "new_list = list(map(lambda x: x * 2, my_list)) # returns the output in form of a list\n", + "print(\"Double values are: \", new_list)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T16:39:45.524588Z", + "start_time": "2021-06-13T16:39:45.512870Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Cube values are: [8, 27, 64, 512, 729]\n" + ] + } + ], + "source": [ + "# Example 2:\n", + "\n", + "list1 = [2, 3, 4, 8, 9]\n", + "list2 = list(map(lambda x: x*x*x, list1))\n", + "print(\"Cube values are:\", list2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### `lambda` function with `reduce()`\n", + "\n", + "The **`reduce()`** function is used to minimize sequence elements into a single value by applying the specified condition.\n", + "\n", + "The **`reduce()`** function is present in the **`functools`** module; hence, we need to import it using the import statement before using it." + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T16:39:46.968912Z", + "start_time": "2021-06-13T16:39:46.960127Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Addition of all list elements is : 54\n" + ] + } + ], + "source": [ + "# Example 1:\n", + "\n", + "from functools import reduce\n", + "list1 = [20, 13, 4, 8, 9]\n", + "add = reduce(lambda x, y: x+y, list1)\n", + "print(\"Addition of all list elements is : \", add)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "hide_input": false, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.8" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": false, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": {}, + "toc_section_display": true, + "toc_window_display": false + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/007_Python_Function_Module.ipynb b/007_Python_Function_Module.ipynb new file mode 100644 index 0000000..b0d7b46 --- /dev/null +++ b/007_Python_Function_Module.ipynb @@ -0,0 +1,1866 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "All the IPython Notebooks in **Python Functions** lecture series by Dr. Milaan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Python Modules\n", + "\n", + "In this class, you will learn to create and import custom modules in Python. Also, you will find different techniques to import and use custom and built-in modules in Python." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## What are modules in Python?\n", + "\n", + "Module containing a set of codes or a set of functions which can be included to an application. Modules refer to the Python file, which contains Python code like Python statements, classes, functions, variables, etc. A file with Python code is defined with extension**`.py`**\n", + "\n", + "For example: In **`main.py`**, where the **`main`** is the module name.\n", + "\n", + "In Python, large code is divided into small modules. The benefit of modules is, it provides a way to share reusable functions." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Advantage\n", + "\n", + "* **Reusability**: Module can be used in some other python code. Hence it provides the facility of code reusability.\n", + "* **Categorization**: Similar type of attributes can be placed in one module." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Creating a module in Python\n", + "\n", + "A file containing Python code, for example: **`example.py`**, is called a module, and its module name would be **`example`**.\n", + "\n", + "We use modules to break down large programs into small manageable and organized files. Furthermore, modules provide reusability of code.\n", + "\n", + "We can define our most used functions in a module and import it, instead of copying their definitions into different programs.\n", + "\n", + "The module contains Python code like classes, functions, methods, but it also has variables. A variable can list, tuple, dict, etc.\n", + "\n", + "Let us create a module. Type the following and save it as **`example.py`**.\n", + "\n", + "```python\n", + "# Python Module example\n", + "\n", + ">>> def add(a, b):\n", + ">>> \"\"\"This program adds two numbers and return the result\"\"\"\n", + ">>> result = a + b\n", + ">>> return result\n", + "```\n", + "\n", + "Here, we have defined a **[function](https://github.com/milaan9/04_Python_Functions/blob/main/001_Python_Functions.ipynb)** **`add()`** inside a module named **`example`**. The function takes in two numbers and returns their sum." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## How to import modules in Python?\n", + "\n", + "We can import the definitions inside a module to another module or the interactive interpreter in Python.\n", + "\n", + "We use the **`import`** keyword to do this. To import our previously defined module example, we type the following in the Python prompt." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "```python\n", + ">>> import example\n", + "```\n", + "This does not import the names of the functions defined in **`example`** directly in the current symbol table. It only imports the module name **`example`** there.\n", + "\n", + "Using the module name we can access the function using the dot **`.`** operator. For example:\n", + "\n", + "**# Example 1:**" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:26.910409Z", + "start_time": "2021-10-12T14:02:26.835984Z" + }, + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "9.6" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import example\n", + "example.add(3,6.6)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Python has tons of standard modules. You can check out the full list of **[Python standard modules](https://docs.python.org/3/py-modindex.html)** and their use cases. These files are in the Lib directory inside the location where you installed Python.\n", + "\n", + "Standard modules can be imported the same way as we import our user-defined modules.\n", + "\n", + "There are various ways to import modules. They are listed below:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**# Example 2:**\n", + "\n", + "The Python code for a module named a name normally resides in a file **main.py**. But first create a function in **test.py**. Here is an example of a simple module,\n", + "\n", + "**test.py** - \n", + "\n", + "```python\n", + ">>> def fun():\n", + ">>> print(\"something here inside fun()\")\n", + "```\n", + "**main.py** โˆ’\n", + "\n", + "```python\n", + ">>> import test\n", + ">>> from test import fun\n", + ">>> fun()\n", + "```\n", + "\n", + "Output of above example: Run **main.py**\n", + "\n", + "`something here inside fun()`\n", + "\n", + "----------------------------------------------------------------\n", + "For **test.ipynb** or **test1.ipynb** and **main.ipynb**\n", + "\n", + "Open anaconda prompt and type **`pip install import-ipynb`**\n", + "\n", + "see:\n", + "Downloading import-ipynb-0.1.3.tar.gz (4.0 kB)\n", + "\n", + "**test.py** or **test1.ipynb** - \n", + "\n", + "```python\n", + ">>> def fun():\n", + ">>> print(\"something here inside fun()\")\n", + "```\n", + "**main.ipynb** โˆ’\n", + "\n", + "```python\n", + ">>> import import_ipynb\n", + "\n", + ">>> import test1\n", + ">>> from test1 import fun\n", + ">>> fun()\n", + "```\n", + "\n", + "Output of above example: Run **main.ipynb**\n", + "\n", + "`something here inside fun()`" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**# Example 3:**\n", + "\n", + "**fibo.py** - \n", + "\n", + "```python\n", + "# Fibonacci numbers module\n", + ">>> def fib(n): # return Fibonacci series up to n\n", + ">>> result = []\n", + ">>> a, b = 0, 1\n", + ">>> while b < n:\n", + ">>> result.append(b)\n", + ">>> a, b = b, a + b\n", + ">>> return result\n", + "```\n", + "**main.py** โˆ’\n", + "\n", + "```python\n", + ">>> import fibo\n", + ">>> from fibo import fib\n", + ">>> print(fib(100))\n", + "```\n", + "\n", + "Output of above example: Run **main.py**\n", + "\n", + "`[1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]`\n", + "\n", + "----------------------------------------------------------------\n", + "For **test.ipynb** or **test1.ipynb** and **main.ipynb**\n", + "\n", + "Open anaconda prompt and type **`pip install import-ipynb`**\n", + "\n", + "see:\n", + "Downloading import-ipynb-0.1.3.tar.gz (4.0 kB)\n", + "\n", + "**fibo1.ipynb** or **fibo.py** - \n", + "\n", + "```python\n", + "# Fibonacci numbers module\n", + ">>> def fib(n): # return Fibonacci series up to n\n", + ">>> result = []\n", + ">>> a, b = 0, 1\n", + ">>> while b < n:\n", + ">>> result.append(b)\n", + ">>> a, b = b, a + b\n", + ">>> return result\n", + "```\n", + "**main.ipynb** โˆ’\n", + "\n", + "```python\n", + ">>> import import_ipynb\n", + "\n", + ">>> import fibo1\n", + ">>> from fibo1 import fib\n", + ">>> print(fib(100))\n", + "```\n", + "\n", + "Output of above example: Run **main.ipynb**\n", + "\n", + "`[1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]`" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**# Example 4:**\n", + "\n", + "**equal.py** - \n", + "\n", + "```python\n", + "#function definition\n", + ">>> def equal(a, b):\n", + ">>> if(a == b):\n", + ">>> return True\n", + "```\n", + "**main.py** โˆ’\n", + "\n", + "```python\n", + ">>> from equal import *\n", + ">>> a, b = 10, 10\n", + ">>> print(equal(a, b))\n", + "```\n", + "\n", + "Output of above example: Run **main.py**\n", + "\n", + "`True`\n", + "\n", + "----------------------------------------------------------------\n", + "For **equal.ipynb** or **equal1.ipynb** and **main.ipynb**\n", + "\n", + "Open anaconda prompt and type **`pip install import-ipynb`**\n", + "\n", + "see:\n", + "Downloading import-ipynb-0.1.3.tar.gz (4.0 kB)\n", + "\n", + "**equal.ipynb** or **equal1.ipynb** - \n", + "\n", + "```python\n", + "#function definition\n", + ">>> def equal(a, b):\n", + ">>> if(a == b):\n", + ">>> return True\n", + "```\n", + "**main.ipynb** โˆ’\n", + "\n", + "```python\n", + ">>> import import_ipynb\n", + "\n", + ">>> from equal1 import *\n", + ">>> a, b = 10, 10\n", + ">>> print(equal(a, b))\n", + "```\n", + "\n", + "Output of above example: Run **main.ipynb**\n", + "\n", + "`True`" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In Python, each and every built-in module has a large number of predefined functions to perform specific tasks. For instance, Python has a built-in module named **`operator`**, inside which the function called **`eq()`** is defined. This function returns the boolean value of **`True`** if the given two input values are equal. Else, returns **`False`**.\n", + "\n", + "So now, we can make use of this operator module in our **`main()`** program to check if two numbers are equal. This means we would no longer need that **`equal.py`** module." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:27.045065Z", + "start_time": "2021-10-12T14:02:26.913837Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "True\n" + ] + } + ], + "source": [ + "# Example 5: \n", + "\n", + "#main function\n", + "from operator import *\n", + "a, b = 10, 10\n", + "print(eq(a, b))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Python `import` statement\n", + "\n", + "We can import a module using the **`import`** statement and access the definitions inside it using the dot operator **`.`** as described above. Here is an example." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:27.248271Z", + "start_time": "2021-10-12T14:02:27.048983Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The value of pi is 3.141592653589793\n" + ] + } + ], + "source": [ + "# Example 1: \n", + "\n", + "# import statement example to import standard module math\n", + "import math\n", + "print(\"The value of pi is\", math.pi)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:27.381949Z", + "start_time": "2021-10-12T14:02:27.261984Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2.449489742783178\n" + ] + } + ], + "source": [ + "# Example 2:\n", + "\n", + "import math\n", + "\n", + "# use math module functions\n", + "print(math.sqrt(6)) # Output 2.449489742783178" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### `import` multiple modules\n", + "\n", + "If we want to use more than one module, then we can import multiple modules. This is the simplest form of **`import`** a keyword that we already use in the above example." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:27.501912Z", + "start_time": "2021-10-12T14:02:27.389783Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "720\n", + "28\n" + ] + } + ], + "source": [ + "# Example 1: Import two modules\n", + "\n", + "import math, random\n", + "\n", + "print(math.factorial(6))\n", + "print(random.randint(10, 30))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Python `from-import` statement\n", + "\n", + "To import particular classes or functions, we can use the **`from-import`** statement. It is an alternate way to **`import`**. By using this form, we can import individual attributes and methods directly into the program.We can import specific names from a module without importing the module as a whole." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:27.623348Z", + "start_time": "2021-10-12T14:02:27.505830Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "720\n" + ] + } + ], + "source": [ + "# Example 1: import only factorial function from math module\n", + "from math import factorial\n", + "\n", + "print(factorial(6))" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:27.772693Z", + "start_time": "2021-10-12T14:02:27.627264Z" + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "2.718281828459045" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Example 2: \n", + "\n", + "from math import pi, e\n", + "e" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:27.892167Z", + "start_time": "2021-10-12T14:02:27.779549Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The value of pi is 3.141592653589793\n" + ] + } + ], + "source": [ + "# Example 3: \n", + "\n", + "# import only pi from math module\n", + "from math import pi\n", + "print(\"The value of pi is\", pi)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here, we imported only the **`pi`** attribute from the **`math`** module.\n", + "\n", + "In such cases, we don't use the dot operator. We can also import multiple attributes as follows:" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:28.069912Z", + "start_time": "2021-10-12T14:02:27.898045Z" + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "3.141592653589793" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Example 4: \n", + "\n", + "from math import pi, e\n", + "pi" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### `import` with renaming\n", + "\n", + "We can import a module by renaming it as follows:" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:28.190856Z", + "start_time": "2021-10-12T14:02:28.072848Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The value of pi is 3.141592653589793\n" + ] + } + ], + "source": [ + "# Example 1: \n", + "\n", + "# import module by renaming it\n", + "import math as m\n", + "print(\"The value of pi is\", m.pi)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We have renamed the **`math`** module as **`m`**. This can save us typing time in some cases.\n", + "\n", + ">**Note:** that the name **`math`** is not recognized in our scope. Hence, **`math.pi`** is invalid, and **`m.pi`** is the correct implementation." + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:28.360765Z", + "start_time": "2021-10-12T14:02:28.195755Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "12\n" + ] + } + ], + "source": [ + "# Example 2: Import a module by renaming it\n", + "\n", + "import random as rand\n", + "\n", + "print(rand.randrange(10, 20, 2))" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:28.435682Z", + "start_time": "2021-10-12T14:02:28.363705Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "49\n" + ] + } + ], + "source": [ + "# Example 3: import a method by renaming it\n", + "\n", + "# rename randint as random_number\n", + "from random import randint as random_number\n", + "\n", + "# Gives any random number from range(10, 50)\n", + "print(random_number(30, 60))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### `import` all names\n", + "\n", + "We can **`import`** all functions and attributes of a specific module, then instead of writing all function names and attribute names, we can import all using an **asterisk** **`*`**." + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:28.557118Z", + "start_time": "2021-10-12T14:02:28.438621Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The value of pi is 3.141592653589793\n" + ] + } + ], + "source": [ + "# Example 1: \n", + "\n", + "# import all names from the standard module math\n", + "\n", + "from math import *\n", + "print(\"The value of pi is\", pi)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here, we have imported all the definitions from the **`math`** module. This includes all names visible in our scope except those beginning with an underscore(private definitions).\n", + "\n", + "Importing everything with the asterisk **`*`** symbol is not a good programming practice. This can lead to duplicate definitions for an identifier. It also hampers the readability of our code." + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:28.666311Z", + "start_time": "2021-10-12T14:02:28.562015Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "216.0\n", + "720\n", + "9.42477796076938\n", + "10.0\n" + ] + } + ], + "source": [ + "# Example 2: \n", + "\n", + "from math import *\n", + "print(pow(6,3))\n", + "print(factorial(6))\n", + "\n", + "print(pi*3)\n", + "print(sqrt(100))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Python Module Search Path\n", + "\n", + "While importing a module, Python looks at several places. Interpreter first looks for a built-in module. Then(if built-in module not found), Python looks into a list of directories defined in **`sys.path`**. The search is in this order.\n", + "\n", + "1. The current directory.\n", + "2. **`PYTHONPATH`** (an environment variable with a list of directories).\n", + "3. The installation-dependent default directory." + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:28.804883Z", + "start_time": "2021-10-12T14:02:28.670228Z" + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "['C:\\\\Users\\\\Deepak\\\\01_Learn_Python4Data\\\\04_Python_Functions',\n", + " 'C:\\\\ProgramData\\\\Anaconda3\\\\python38.zip',\n", + " 'C:\\\\ProgramData\\\\Anaconda3\\\\DLLs',\n", + " 'C:\\\\ProgramData\\\\Anaconda3\\\\lib',\n", + " 'C:\\\\ProgramData\\\\Anaconda3',\n", + " '',\n", + " 'C:\\\\Users\\\\Deepak\\\\AppData\\\\Roaming\\\\Python\\\\Python38\\\\site-packages',\n", + " 'C:\\\\ProgramData\\\\Anaconda3\\\\lib\\\\site-packages',\n", + " 'C:\\\\ProgramData\\\\Anaconda3\\\\lib\\\\site-packages\\\\locket-0.2.1-py3.8.egg',\n", + " 'C:\\\\ProgramData\\\\Anaconda3\\\\lib\\\\site-packages\\\\win32',\n", + " 'C:\\\\ProgramData\\\\Anaconda3\\\\lib\\\\site-packages\\\\win32\\\\lib',\n", + " 'C:\\\\ProgramData\\\\Anaconda3\\\\lib\\\\site-packages\\\\Pythonwin',\n", + " 'C:\\\\ProgramData\\\\Anaconda3\\\\lib\\\\site-packages\\\\IPython\\\\extensions',\n", + " 'C:\\\\Users\\\\Deepak\\\\.ipython']" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import sys\n", + "sys.path" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can add and modify this list to add our own path." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Reloading a module\n", + "\n", + "The Python interpreter imports a module only once during a session. This makes things more efficient. Foe example:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**# Example 1:**\n", + "\n", + "Suppose we have the following code in a module named **`my_module`**.\n", + "\n", + "```python\n", + "# This module shows the effect of\n", + "# multiple imports and reload\n", + "\n", + "print(\"This code got executed\")\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:28.929252Z", + "start_time": "2021-10-12T14:02:28.807820Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "This code got executed\n" + ] + } + ], + "source": [ + "import my_module" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can see that our code got executed only once. This goes to say that our module was imported only once.\n", + "\n", + "Now if our module changed during the course of the program, we would have to reload it.One way to do this is to restart the interpreter. But this does not help much.\n", + "\n", + "Python provides a more efficient way of doing this. We can use the **`reload()`** function inside the **`imp`** module to reload a module. We can do it in the following ways:" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:29.020820Z", + "start_time": "2021-10-12T14:02:28.932192Z" + } + }, + "outputs": [], + "source": [ + "import imp\n", + "import my_module" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:29.114344Z", + "start_time": "2021-10-12T14:02:29.023756Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "This code got executed\n" + ] + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import my_module\n", + "imp.reload(my_module)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**# Example 2:**\n", + "\n", + "First, create a Python module with the name **`greet_module.pynb`**\n", + "and write the below code in that file.\n", + "\n", + "```python\n", + ">>> print(\"Welcome to Dr Parmar's Python4DataScience class\")\n", + "```\n", + "\n", + "Now, create a Python file with the name, **main.py** and write the below code in it and import the module test_module.py. See the following code.\n", + "\n", + "```python\n", + ">>> import import_ipynb\n", + ">>> import time\n", + ">>> from importlib import reload\n", + "\n", + ">>> # load 1st time\n", + ">>> import test_module\n", + ">>> time.sleep(25)\n", + ">>> # reload \n", + ">>> reload(test_module)\n", + ">>> time.sleep(25) \n", + "\n", + ">>> # reload again \n", + ">>> reload(test_module)\n", + ">>> print(\"This is test file..\")\n", + "```\n", + "\n", + "Output of above example: Run **main.py** \n", + "\n", + "```python\n", + "Welcome to Dr Parmar's Python4DataScience class\n", + "Welcome to Dr Parmar's Python4DataScience class\n", + "Welcome to Dr Parmar's Python4DataScience class\n", + "This is test file..\n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## The `dir()` built-in function\n", + "\n", + "We can use the **`dir()`** function to find out names that are defined inside a module. When we use this function with any object (an object can be sequence like list, tuple, set, dict or can be class, function, module, etc. ), it returns properties, attributes, and method.\n", + "\n", + "For example, we have defined a function **`add()`** in the module example that we had in the beginning.\n", + "\n", + "We can use dir in example module in the following way:" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:29.223046Z", + "start_time": "2021-10-12T14:02:29.117282Z" + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "['__builtins__',\n", + " '__cached__',\n", + " '__doc__',\n", + " '__file__',\n", + " '__loader__',\n", + " '__name__',\n", + " '__package__',\n", + " '__spec__',\n", + " 'add']" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Example 1:\n", + "\n", + "dir(example)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here, we can see a sorted list of names (along with **`add`**). All other names that begin with an underscore are default Python attributes associated with the module (not user-defined).\n", + "\n", + "For example, the **`__name__`** attribute contains the name of the module." + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:29.332241Z", + "start_time": "2021-10-12T14:02:29.227944Z" + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "'example'" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Example 2:\n", + "\n", + "import example\n", + "example.__name__" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "All the names defined in our current namespace can be found out using the **`dir()`** function without any arguments." + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:29.473261Z", + "start_time": "2021-10-12T14:02:29.335177Z" + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "['__builtins__', '__doc__', '__name__', 'a', 'b', 'math', 'pyscripter']" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Example 3:\n", + "\n", + "a = 1\n", + "b = \"hello\"\n", + "import math\n", + "dir()\n", + "['__builtins__', '__doc__', '__name__', 'a', 'b', 'math', 'pyscripter']" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:29.566785Z", + "start_time": "2021-10-12T14:02:29.476197Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['__doc__', '__loader__', '__name__', '__package__', '__spec__', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'comb', 'copysign', 'cos', 'cosh', 'degrees', 'dist', 'e', 'erf', 'erfc', 'exp', 'expm1', 'fabs', 'factorial', 'floor', 'fmod', 'frexp', 'fsum', 'gamma', 'gcd', 'hypot', 'inf', 'isclose', 'isfinite', 'isinf', 'isnan', 'isqrt', 'ldexp', 'lgamma', 'log', 'log10', 'log1p', 'log2', 'modf', 'nan', 'perm', 'pi', 'pow', 'prod', 'radians', 'remainder', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'tau', 'trunc']\n" + ] + } + ], + "source": [ + "# Example 4:\n", + "\n", + "import math\n", + "\n", + "print(dir(math))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Python Modules List\n", + "\n", + "Using Python built-in function **`help()`**, we can obtain the list of built-in modules available in Python. On executing the line help ('modules') in Python IDE, you can see all the Python built-in modules. Some of the frequently used ones are discussed below.\n", + "\n", + "| Module | Description |\n", + "|:----| :--- |\n", + "| **`Operator`** | This module provides a set of pre-defined functions corresponding to operators in Python. | \n", + "| **`decimal`** | This module is used to print the complete decimal value when one number is divided by another number. | \n", + "| **[random](https://github.com/milaan9/04_Python_Functions/blob/main/008_Python_Function_random_Module.ipynb)** | random module is used to generate random numbers. Some of the pre-defined functions of this module are **`randint()`**, **`choice()`**, **`uniform`**, etc. | \n", + "| **`string`** | string module provides a set of functions that are used to perform certain operations on characters. This module has pre-defined functions like capwords, ascii_letters, etc. | \n", + "| **[math](https://github.com/milaan9/04_Python_Functions/blob/main/009_Python_Function_math_Module.ipynb.ipynb)** | math module is used to perform mathematical operations. This module provides some pre-defined mathematical functions like sqrt, factorial, etc. | " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Python Built-In Modules Examples\n", + "\n", + "There are many **built-in** modules in Python. Some of the common built-in modules: **`os`**, **[sys](https://docs.python.org/3/library/sys.html)**, **`operator`**, **`string`**, **`decimal`**, **[random](https://github.com/milaan9/04_Python_Functions/blob/main/008_Python_Function_random_Module.ipynb)** , **[math](https://github.com/milaan9/04_Python_Functions/blob/main/009_Python_Function_math_Module.ipynb.ipynb)**, **`statistics`**, **`datetime`**, **`time`**, **`collections`**, **`threading`**, **`mailbox`**, **`tkinter`**, **`json`**, **`re`**, etc." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Example Using `os` Module\n", + "\n", + "Using python **`os`** module it is possible to automatically perform many operating system tasks. The **`os`** module in Python provides functions for creating, changing current working directory, and removing a directory (folder), fetching its contents, changing and identifying the current directory." + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:30.283151Z", + "start_time": "2021-10-12T14:02:29.576580Z" + }, + "scrolled": true + }, + "outputs": [ + { + "ename": "FileExistsError", + "evalue": "[WinError 183] Cannot create a file when that file already exists: 'directory_name'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mFileExistsError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mos\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;31m# Creating a directory\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 6\u001b[1;33m \u001b[0mos\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mmkdir\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'directory_name'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 7\u001b[0m \u001b[1;31m# Changing the current directory\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[0mos\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mchdir\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'path'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;31mFileExistsError\u001b[0m: [WinError 183] Cannot create a file when that file already exists: 'directory_name'" + ] + } + ], + "source": [ + "# Example 1:\n", + "\n", + "# import the module\n", + "import os\n", + "# Creating a directory\n", + "os.mkdir('directory_name')\n", + "# Changing the current directory\n", + "os.chdir('path')\n", + "# Getting current working directory\n", + "os.getcwd()\n", + "# Removing directory\n", + "os.rmdir()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Example Using `sys` Module\n", + "\n", + "The **[sys](https://docs.python.org/3/library/sys.html)** module provides functions and variables used to manipulate different parts of the Python runtime environment." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**`sys.argv`** function returns a list of command line arguments passed to a Python script. The item at index 0 in this list is always the name of the script, at index 1 is the argument passed from the command line." + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:39.796140Z", + "start_time": "2021-10-12T14:02:39.781456Z" + }, + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "['C:\\\\Users\\\\Deepak\\\\01_Learn_Python4Data\\\\04_Python_Functions',\n", + " 'C:\\\\ProgramData\\\\Anaconda3\\\\python38.zip',\n", + " 'C:\\\\ProgramData\\\\Anaconda3\\\\DLLs',\n", + " 'C:\\\\ProgramData\\\\Anaconda3\\\\lib',\n", + " 'C:\\\\ProgramData\\\\Anaconda3',\n", + " '',\n", + " 'C:\\\\Users\\\\Deepak\\\\AppData\\\\Roaming\\\\Python\\\\Python38\\\\site-packages',\n", + " 'C:\\\\ProgramData\\\\Anaconda3\\\\lib\\\\site-packages',\n", + " 'C:\\\\ProgramData\\\\Anaconda3\\\\lib\\\\site-packages\\\\locket-0.2.1-py3.8.egg',\n", + " 'C:\\\\ProgramData\\\\Anaconda3\\\\lib\\\\site-packages\\\\win32',\n", + " 'C:\\\\ProgramData\\\\Anaconda3\\\\lib\\\\site-packages\\\\win32\\\\lib',\n", + " 'C:\\\\ProgramData\\\\Anaconda3\\\\lib\\\\site-packages\\\\Pythonwin',\n", + " 'C:\\\\ProgramData\\\\Anaconda3\\\\lib\\\\site-packages\\\\IPython\\\\extensions',\n", + " 'C:\\\\Users\\\\Deepak\\\\.ipython']" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import sys\n", + "sys.path" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**First**, create a Python module with the name **`script.py`** and write the below code in that file.\n", + "\n", + "```py\n", + ">>> import sys\n", + ">>> # print(sys.argv[0], argv[1],sys.argv[2]) # this line would print out: filename argument1 argument2\n", + ">>> print('Welcome {}. Enjoy {} for Data Science ^_^'.format(sys.argv[1], sys.argv[2]))\n", + "```\n", + "**Second**, open **`Anaconda Prompt (Anaconda3)`**\n", + "\n", + "**Third**, type system path after **`cd`**\n", + "\n", + "```sy\n", + "cd C:\\\\Users\\\\Deepak\\\\01_Learn_Python4Data\\\\04_Python_Functions\n", + "```\n", + "\n", + "**Forth**, type\n", + "\n", + "```sy\n", + "python script.py Milaan Python\n", + "```\n", + "\n", + "**Output:**\n", + "\n", + "```sy\n", + "Welcome Milaan. Enjoy Python for Data Science ^_^\n", + "```\n", + "\n", + "
\n", + "\n", + "
" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Some useful **`sys`** commands to type in:\n", + "\n", + "```py\n", + "# to exit sys\n", + "sys.exit()\n", + "# To know the largest integer variable it takes\n", + "sys.maxsize\n", + "# To know environment path\n", + "sys.path\n", + "# To know the version of python you are using\n", + "sys.version\n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Example Using `operator` Module" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:42.304149Z", + "start_time": "2021-10-12T14:02:42.287505Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n", + "False\n", + "10\n", + "Hello World\n" + ] + } + ], + "source": [ + "# Example 1:\n", + "\n", + "from operator import *\n", + "a, b = 10, 20\n", + "#prints the product of the values 'a' and 'b'\n", + "print(mul(a, b))\n", + "#prints True if the value of 'a' is greater than 'b'. Else, False\n", + "print(gt(a, b))\n", + "#prints the remainder value, when the value of 'a' is divided by 'b'\n", + "print(mod(a, b))\n", + "#concatenates and prints the given two strings\n", + "print(concat(\"Hello \", \"World\"))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Example Using `string` Module\n", + "\n", + "A **[string](https://github.com/milaan9/02_Python_Datatypes/blob/main/002_Python_String.ipynb)** module is a useful module for many purposes. The example below shows some use of the string module." + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:43.381879Z", + "start_time": "2021-10-12T14:02:43.369152Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello World\n", + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n" + ] + } + ], + "source": [ + "# Example 1:\n", + "\n", + "from string import *\n", + "print(capwords(\"hello world\")) #capitalizes the first letter of each words\n", + "print(ascii_letters) #prints all lowercase and uppercase letters" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:43.805435Z", + "start_time": "2021-10-12T14:02:43.793679Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n", + "0123456789\n", + "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\n" + ] + } + ], + "source": [ + "# Example 2:\n", + "\n", + "import string\n", + "print(string.ascii_letters) # abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n", + "print(string.digits) # 0123456789\n", + "print(string.punctuation) # !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Example Using `decimal` Module" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:45.249910Z", + "start_time": "2021-10-12T14:02:45.199966Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3.3333333333333335\n", + "3.333333333333333481363069950020872056484222412109375\n" + ] + } + ], + "source": [ + "# Example 1:\n", + "\n", + "from decimal import *\n", + "a, b = 10, 3\n", + "c = a / b\n", + "print(c)\n", + "print(Decimal(c)) #prints the complete decimal value of c" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Example Using `random` Module\n", + "\n", + "The **[random](https://github.com/milaan9/04_Python_Functions/blob/main/008_Python_Function_random_Module.ipynb)** module is used to generate the random numbers. It provides the following two built in functions:\n", + "\n", + "#### Comparision operators in Python\n", + "\n", + "| Function | Description |\n", + "|:----| :--- |\n", + "| **`random()`** | It returns a random number between 0.0 and 1.0 where 1.0 is exclusive. | \n", + "| **`randint(x,y)`** | It returns a random number between x and y where both the numbers are inclusive. | " + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:46.106312Z", + "start_time": "2021-10-12T14:02:46.097503Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10\n", + "16\n", + "13.03505598723366\n" + ] + } + ], + "source": [ + "# Example 1:\n", + "\n", + "from random import *\n", + "print(randint(10, 20)) #prints a random number between the given range\n", + "\n", + "list1 = [30, 23, 45, 16, 89, 56]\n", + "print(choice(list1)) #prints a random element from the given iterator\n", + "\n", + "print(uniform(10, 20)) #prints a random float number between two given values" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:46.586662Z", + "start_time": "2021-10-12T14:02:46.570998Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.2946014910624595\n", + "8\n" + ] + } + ], + "source": [ + "# Example 2:\n", + "\n", + "import random\n", + "\n", + "print(random.random())\n", + "print(random.randint(2,8))" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:46.953905Z", + "start_time": "2021-10-12T14:02:46.897105Z" + } + }, + "outputs": [ + { + "ename": "TypeError", + "evalue": "'module' object is not callable", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mrandom\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mrandint\u001b[0m \u001b[1;31m# import randint function\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 5\u001b[1;33m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mrandom\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m# it doesn't take any arguments; it returns a value between 0 and 0.9999\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 6\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;31m# call randint function to get random number\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;31mTypeError\u001b[0m: 'module' object is not callable" + ] + } + ], + "source": [ + "# Example 3:\n", + "\n", + "from random import randint # import randint function\n", + "\n", + "print(random()) # it doesn't take any arguments; it returns a value between 0 and 0.9999\n", + "\n", + "# call randint function to get random number\n", + "print(randint(10, 30)) # it returns a random integer number between [10, 30] inclusive" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Example Using `math` Module\n", + "\n", + "Using **[math](https://github.com/milaan9/04_Python_Functions/blob/main/009_Python_Function_math_Module.ipynb.ipynb)** module, you can use different built in mathematical functions.\n", + "\n", + "#### math module Functions:\n", + "\n", + "| Function | Description |\n", + "|:----| :--- |\n", + "| **`ceil(n)`** | It returns the next integer number of the given number. | \n", + "| **`sqrt(n)`** | It returns the Square root of the given number. | \n", + "| **`exp(n)`** | It returns the natural logarithm e raised to the given number. | \n", + "| **`floor(n)`** | It returns the previous integer number of the given number. | \n", + "| **`log(n,baseto)`** | It returns the previous integer number of the given number. | \n", + "| **`pow(baseto, exp)`** | It returns baseto raised to the exp power. | \n", + "| **`sin(n)`** | It returns sine of the given radian. | \n", + "| **`cos(n)`** | It returns cosine of the given radian. | \n", + "| **`tan(n)`** | It returns tangent of the given radian. | " + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:48.223575Z", + "start_time": "2021-10-12T14:02:48.206931Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "4.0\n", + "120\n" + ] + } + ], + "source": [ + "# Example 1:\n", + "\n", + "from math import *\n", + "print(sqrt(16)) # prints the square root of the value 16 in the form of a floating-point value\n", + "print(factorial(5)) # prints the factorial of the value 5" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:49.064312Z", + "start_time": "2021-10-12T14:02:49.042770Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "5\n", + "4\n", + "3.0\n", + "20.085536923187668\n", + "0.6931471805599453\n", + "8.0\n", + "0.0\n", + "1.0\n", + "1.6197751905438615\n", + "2.0\n" + ] + } + ], + "source": [ + "# Example 2:\n", + "\n", + "import math\n", + "\n", + "a=4.6\n", + "print(math.ceil(a)) # 5, rounding to the highest\n", + "print(math.floor(a)) # 4, rounding to the lowest\n", + "b=9\n", + "print(math.sqrt(b)) # 3.0, square root\n", + "print(math.exp(3.0)) # 20.085536923187668\n", + "print(math.log(2.0)) # 0.6931471805599453\n", + "print(math.pow(2.0,3.0)) # 8.0, exponential function\n", + "print(math.sin(0)) # 0.0\n", + "print(math.cos(0)) # 1.0\n", + "print (math.tan(45)) # 1.6197751905438615\n", + "print(math.log10(100)) # 2.0, logarithm with 10 as base " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Constants - \n", + "\n", + "The math module provides two constants for mathematical Operations:\n", + "\n", + "* **`math.pi`** : Returns constant Pi = 3.14159...\n", + "* **`math.e`** : Returns constant e= 2.71828..." + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:50.965636Z", + "start_time": "2021-10-12T14:02:50.945076Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "math.pi : 3.141592653589793\n", + "math.e : 2.718281828459045\n" + ] + } + ], + "source": [ + "# Example 3:\n", + "\n", + "import math \n", + "\n", + "print(\"math.pi : \",math.pi) # 3.141592653589793, pi constant\n", + "print(\"math.e : \",math.e) # 2.718281828459045, e constant" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Example Using `statistics` Module\n", + "\n", + "The statistics module provides functions for mathematical statistics of numeric data. The popular statistical functions which are defined in this module: **`mean`**, **`median`**, **`mode`**, **`stdev`** etc." + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-12T14:02:52.744549Z", + "start_time": "2021-10-12T14:02:52.645153Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "21.09090909090909\n", + "22\n", + "20\n", + "6.106628291529549\n" + ] + } + ], + "source": [ + "# Example 1:\n", + "\n", + "from statistics import * # importing all the statistics modules\n", + "ages = [20, 20, 4, 24, 25, 22, 26, 20, 23, 22, 26]\n", + "print(mean(ages)) # ~22.9\n", + "print(median(ages)) # 23\n", + "print(mode(ages)) # 20\n", + "print(stdev(ages)) # ~2.3" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Wrap up\n", + "\n", + "Since Python provides a lot of built-in modules, it is advisable to use built-in modules rather than user-created modules to perform basic operations." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## ๐Ÿ’ป Exercises โžž Module\n", + "\n", + "### Exercises โžž Level 1\n", + "\n", + "1. Writ a function which generates a six digit/character **`random_user_id`**.\n", + " - ```py\n", + " print(random_user_id());\n", + " '1ee33d'\n", + " ```\n", + "2. Modify the previous task. Declare a function named **`user_id_gen_by_user`**. It doesnโ€™t take any parameters but it takes two inputs using **`input()`**. One of the inputs is the number of characters and the second input is the number of IDs which are supposed to be generated.\n", + " \n", + " - ```py\n", + "print(user_id_gen_by_user()) # user input: 5 5\n", + "#output:\n", + "#kcsy2\n", + "#SMFYb\n", + "#bWmeq\n", + "#ZXOYh\n", + "#2Rgxf\n", + " ``` \n", + " \n", + " - ```py\n", + "print(user_id_gen_by_user()) # 16 5\n", + "#1GCSgPLMaBAVQZ26\n", + "#YD7eFwNQKNs7qXaT\n", + "#ycArC5yrRupyG00S\n", + "#UbGxOFI7UXSWAyKN\n", + "#dIV0SSUTgAdKwStr\n", + " ```\n", + "\n", + "3. Write a function named **`rgb_color_gen`**. It will generate rgb colors (3 values ranging from 0 to 255 each).\n", + " \n", + " - ```py\n", + "print(rgb_color_gen()) \n", + "#rgb(125,244,255) - the output should be in this form\n", + " ```\n", + " \n", + "### Exercises โžž Level 2\n", + "\n", + "1. Write a function **`list_of_hexa_colors`** which returns any number of hexadecimal colors in an array (six hexadecimal numbers written after **`#`**. Hexadecimal numeral system is made out of 16 symbols, 0-9 and first 6 letters of the alphabet, a-f. Check the task 6 for output examples).\n", + "2. Write a function **`list_of_rgb_colors`** which returns any number of RGB colors in an array.\n", + "3. Write a function **`generate_colors`** which can generate any number of hexa or rgb colors.\n", + "\n", + " - ```py\n", + " generate_colors('hexa', 3) # ['#a3e12f','#03ed55','#eb3d2b'] \n", + " generate_colors('hexa', 1) # ['#b334ef']\n", + " generate_colors('rgb', 3) # ['rgb(5, 55, 175','rgb(50, 105, 100','rgb(15, 26, 80'] \n", + " generate_colors('rgb', 1) # ['rgb(33,79, 176)']\n", + " ```\n", + " \n", + "### Exercises โžž Level 3\n", + "\n", + "1. Call your function **`shuffle_list`**, it takes a list as a parameter and it returns a shuffled list\n", + "2. Write a function which returns an array of seven random numbers in a range of 0-9. All the numbers must be unique." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "hide_input": false, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.8" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": false, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": { + "height": "calc(100% - 180px)", + "left": "10px", + "top": "150px", + "width": "204.797px" + }, + "toc_section_display": true, + "toc_window_display": false + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/008_Python_Function_random_Module.ipynb b/008_Python_Function_random_Module.ipynb new file mode 100644 index 0000000..807ed21 --- /dev/null +++ b/008_Python_Function_random_Module.ipynb @@ -0,0 +1,170 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "All the IPython Notebooks in **Python Functions** lecture series by Dr. Milaan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Python Random Module\n", + "\n", + "You can generate random numbers in Python by using random module.\n", + "\n", + "Python offers **`random`** module that can generate random numbers.\n", + "\n", + "These are pseudo-random number as the sequence of number generated depends on the seed.\n", + "\n", + "If the seeding value is same, the sequence will be the same. For example, if you use 2 as the seeding value, you will always see the following sequence." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T16:48:05.271252Z", + "start_time": "2021-06-13T16:48:05.255627Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.9560342718892494\n", + "0.9478274870593494\n", + "0.05655136772680869\n" + ] + } + ], + "source": [ + "import random\n", + "random.seed(2)\n", + "\n", + "print(random.random())\n", + "print(random.random())\n", + "print(random.random())" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Not so random eh?** Since this generator is completely deterministic, it must not be used for encryption purpose.\n", + "\n", + "Here is the list of all the functions defined in random module with a brief explanation of what they do.\n", + "\n", + "**List of Functions in Python Random Module**\n", + "\n", + "| Function | Description |\n", + "|:----| :--- |\n", + "| **`seed(a=None, version=2)`** | Initialize the random number generator | \n", + "| **`getstate()`** | Returns an object capturing the current internal state of the generator | \n", + "| **`setstate(state)`** | Restores the internal state of the generator | \n", + "| **`getrandbits(k)`** | Returns a Python integer with k random bits | \n", + "| **`randrange(start, stop[, step])`** | Returns a random integer from the range | \n", + "| **`randint(a, b)`** | Returns a random integer between a and b inclusive | \n", + "| **`choice(seq)`** | Return a random element from the non-empty sequence | \n", + "| **`shuffle(seq)`** | Shuffle the sequence | \n", + "| **`sample(population, k)`** | Return a k length list of unique elements chosen from the population sequence | \n", + "| **`random()`** | Return the next random floating point number in the range [0.0, 1.0] | \n", + "| **`uniform(a, b)`** | Return a random floating point number between a and b inclusive | \n", + "| **`triangular(low, high, mode)`** | Return a random floating point number between low and high, with the specified mode between those bounds | \n", + "| **`betavariate(alpha, beta)`** | Beta distribution | \n", + "| **`expovariate(lambd)`** | Exponential distribution | \n", + "| **`gammavariate(alpha, beta)`** | Gamma distribution | \n", + "| **`gauss(mu, sigma)`** | Gaussian distribution | \n", + "| **`lognormvariate(mu, sigma)`** | Log normal distribution | \n", + "| **`normalvariate(mu, sigma)`** | Normal distribution | \n", + "| **`vonmisesvariate(mu, kappa)`** | Vonmises distribution | \n", + "| **`paretovariate(alpha)`** | Pareto distribution | \n", + "| **`weibullvariate(alpha, beta)`** | Weibull distribution | " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Visit this page to learn more on **[how you can generate pseudo-random numbers in Python](https://docs.python.org/3/library/random.html)**." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "hide_input": false, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.8" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": false, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": {}, + "toc_section_display": true, + "toc_window_display": false + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/009_Python_Function_math_Module.ipynb.ipynb b/009_Python_Function_math_Module.ipynb.ipynb new file mode 100644 index 0000000..42ea443 --- /dev/null +++ b/009_Python_Function_math_Module.ipynb.ipynb @@ -0,0 +1,204 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "All the IPython Notebooks in **Python Functions** lecture series by Dr. Milaan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Python Mathematical Functions\n", + "\n", + "Learn about all the mathematical functions available in Python and how you can use them in your program." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## What is `math` module in Python?\n", + "\n", + "The **`math`** **[module](https://github.com/milaan9/04_Python_Functions/blob/main/007_Python_Function_Module.ipynb)** is a standard module in Python and is always available. To use mathematical functions under this module, you have to import the module using **`import math`**.\n", + "\n", + "It gives access to the underlying C library functions. For example:" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T16:56:20.316916Z", + "start_time": "2021-06-13T16:56:20.289575Z" + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "2.0" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Square root calculation\n", + "\n", + "import math\n", + "math.sqrt(4)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This module does not support complex datatypes. The **[cmath module](https://docs.python.org/3.0/library/cmath.html)** is the **`complex`** counterpart." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Functions in Python Math Module\n", + "\n", + "Here is the list of all the functions and attributes defined in **`math`** module with a brief explanation of what they do.\n", + "\n", + "**List of Functions in Python Math Module**\n", + "\n", + "| Function | Description |\n", + "|:----| :--- |\n", + "| **`ceil(x)`** | Returns the smallest integer greater than or equal to x. | \n", + "| **`copysign(x, y)`** | Returns x with the sign of y | \n", + "| **`fabs(x)`** | Returns the absolute value of x | \n", + "| **`factorial(x)`** | Returns the factorial of x | \n", + "| **`floor(x)`** | Returns the largest integer less than or equal to x | \n", + "| **`fmod(x, y)`** | Returns the remainder when x is divided by y | \n", + "| **`frexp(x)`** | Returns the mantissa and exponent of x as the pair (m, e) | \n", + "| **`fsum(iterable)`** | Returns an accurate floating point sum of values in the iterable | \n", + "| **`isfinite(x)`** | Returns True if x is neither an infinity nor a NaN (Not a Number) | \n", + "| **`isinf(x)`** | Returns True if x is a positive or negative infinity | \n", + "| **`isnan(x)`** | Returns True if x is a NaN | \n", + "| **`ldexp(x, i)`** | Returns x * (2**i) | \n", + "| **`modf(x)`** | Returns the fractional and integer parts of x | \n", + "| **`trunc(x)`** | Returns the truncated integer value of x | \n", + "| **`exp(x)`** | Returns e**x | \n", + "| **`expm1(x)`** | Returns e**x - 1 | \n", + "| **`log(x[, b])`** | Returns the logarithm of **`x`** to the base **`b`** (defaults to e) | \n", + "| **`log1p(x)`** | Returns the natural logarithm of 1+x | \n", + "| **`log2(x)`** | Returns the base-2 logarithm of x | \n", + "| **`log10(x)`** | Returns the base-10 logarithm of x | \n", + "| **`pow(x, y)`** | Returns x raised to the power y | \n", + "| **`sqrt(x)`** | Returns the square root of x | \n", + "| **`acos(x)`** | Returns the arc cosine of x | \n", + "| **`asin(x)`** | Returns the arc sine of x | \n", + "| **`atan(x)`** | Returns the arc tangent of x | \n", + "| **`atan2(y, x)`** | Returns atan(y / x) | \n", + "| **`cos(x)`** | Returns the cosine of x | \n", + "| **`hypot(x, y)`** | Returns the Euclidean norm, sqrt(x*x + y*y) | \n", + "| **`sin(x)`** | Returns the sine of x | \n", + "| **`tan(x)`** | Returns the tangent of x | \n", + "| **`degrees(x)`** | Converts angle x from radians to degrees | \n", + "| **`radians(x)`** | Converts angle x from degrees to radians | \n", + "| **`acosh(x)`** | Returns the inverse hyperbolic cosine of x | \n", + "| **`asinh(x)`** | Returns the inverse hyperbolic sine of x | \n", + "| **`atanh(x)`** | Returns the inverse hyperbolic tangent of x | \n", + "| **`cosh(x)`** | Returns the hyperbolic cosine of x | \n", + "| **`sinh(x)`** | Returns the hyperbolic cosine of x | \n", + "| **`tanh(x)`** | Returns the hyperbolic tangent of x | \n", + "| **`erf(x)`** | Returns the error function at x | \n", + "| **`erfc(x)`** | Returns the complementary error function at x | \n", + "| **`gamma(x)`** | Returns the Gamma function at x | \n", + "| **`lgamma(x)`** | Returns the natural logarithm of the absolute value of the Gamma function at x | \n", + "| **`pi`** | Mathematical constant, the ratio of circumference of a circle to it's diameter (3.14159...) | \n", + "| **`e`** | mathematical constant e (2.71828...) | " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Visit this page to learn about all the **[mathematical functions defined in Python 3](https://docs.python.org/3/library/math.html)**." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "hide_input": false, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.8" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": false, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": {}, + "toc_section_display": true, + "toc_window_display": false + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/010_Python_Function_Package.ipynb b/010_Python_Function_Package.ipynb new file mode 100644 index 0000000..b8ea88b --- /dev/null +++ b/010_Python_Function_Package.ipynb @@ -0,0 +1,165 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "All the IPython Notebooks in **Python Functions** lecture series by Dr. Milaan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Python Package\n", + "\n", + "In this class, you'll learn to divide your code base into clean, efficient modules using Python packages. Also, you'll learn to import and use your own or third party packagesin your Python program." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## What are packages?\n", + "\n", + "We don't usually store all of our files on our computer in the same location. We use a well-organized hierarchy of directories for easier access.\n", + "\n", + "Similar files are kept in the same directory, for example, we may keep all the songs in the \"**music**\" directory. Analogous to this, Python has packages for directories and **[modules](https://github.com/milaan9/04_Python_Functions/blob/main/007_Python_Function_Module.ipynb)** for files.\n", + "\n", + "As our application program grows larger in size with a lot of modules, we place similar modules in one package and different modules in different packages. This makes a project (program) easy to manage and conceptually clear.\n", + "\n", + "Similarly, as a directory can contain subdirectories and files, a Python package can have sub-packages and modules.\n", + "\n", + "A directory must contain a file named **`__init__.py`** in order for Python to consider it as a package. This file can be left empty but we generally place the initialization code for that package in this file.\n", + "\n", + "Here is an example. Suppose we are developing a game. One possible organization of packages and modules could be as shown in the figure below.\n", + "\n", + "| | \n", + "|:--:| \n", + "| **Package Module Structure in Python Programming** |" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Importing module from a package\n", + "\n", + "We can import modules from packages using the dot **`.`** operator.\n", + "\n", + "For example, if we want to import the **`start`** module in the above example, it can be done as follows:\n", + "\n", + "```python\n", + ">>>import Game.Level.start\n", + "```\n", + "\n", + "Now, if this module contains a **[function](https://github.com/milaan9/04_Python_Functions/blob/main/001_Python_Functions.ipynb)** named **`select_difficulty()`**, we must use the full name to reference it.\n", + "\n", + "```python\n", + ">>>Game.Level.start.select_difficulty(2)\n", + "```\n", + "\n", + "If this construct seems lengthy, we can import the module without the package prefix as follows:\n", + "\n", + "```python\n", + ">>>from Game.Level import start\n", + "```\n", + "\n", + "We can now call the function simply as follows:\n", + "\n", + "```python\n", + ">>>start.select_difficulty(2)\n", + "```\n", + "\n", + "Another way of importing just the required function (or class or variable) from a module within a package would be as follows:\n", + "\n", + "```python\n", + ">>>from Game.Level.start import select_difficulty\n", + "```\n", + "\n", + "Now we can directly call this function.\n", + "\n", + "```python\n", + ">>>select_difficulty(2)\n", + "```\n", + "\n", + "Although easier, this method is not recommended. Using the full **[namespace](https://github.com/milaan9/01_Python_Introduction/blob/main/013_Python_Namespace_and_Scope.ipynb)** avoids confusion and prevents two same identifier names from colliding.\n", + "\n", + "While importing packages, Python looks in the list of directories defined in **`sys.path`**, similar as for **[module search path](https://github.com/milaan9/04_Python_Functions/blob/main/007_Python_Function_Module.ipynb)**." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "hide_input": false, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.8" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": false, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": {}, + "toc_section_display": true, + "toc_window_display": false + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/Python_Docstrings.ipynb b/Python_Docstrings.ipynb new file mode 100644 index 0000000..acfd122 --- /dev/null +++ b/Python_Docstrings.ipynb @@ -0,0 +1,866 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "All the IPython Notebooks in **Python Functions** lecture series by Dr. Milaan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Python Docstrings\n", + "\n", + "In this class, we will learn about Python docstrings. More specifically, we will learn how and why docstrings are used with the help of examples.\n", + "\n", + "Python docstrings are the string literals that appear right after the definition of a function, method, class, or module. For example:" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T08:11:06.380353Z", + "start_time": "2021-06-13T08:11:06.362780Z" + } + }, + "outputs": [], + "source": [ + "# Example 1: Docstrings\n", + "\n", + "def square(n):\n", + " '''Takes in a number n, returns the square of n'''\n", + " return n**2" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here, the string literal:\n", + "```python\n", + " '''Takes in a number n, returns the square of n'''\n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "inside the triple quotation marks is the **docstring** of the function **`square()`** as it appears right after its definition.\n", + "\n", + ">**Note:** We can also use triple **`'''`** quotations to create docstrings." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Python Comments vs Docstrings\n", + "\n", + "### Python Comments\n", + "\n", + "Comments are descriptions that help programmers better understand the intent and functionality of the program. They are completely ignored by the Python interpreter.\n", + "\n", + "In Python, we use the hash symbol **`#`** to write a single-line comment. For example, " + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T08:11:09.750448Z", + "start_time": "2021-06-13T08:11:09.730916Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello World\n" + ] + } + ], + "source": [ + "# Example 1: Program to print \"Hello World\"\n", + "\n", + "print(\"Hello World\") " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Python Comments Using Strings\n", + "\n", + "If we do not assign strings to any variable, they act as comments. For example," + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T08:11:10.920358Z", + "start_time": "2021-06-13T08:11:10.906691Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello World\n" + ] + } + ], + "source": [ + "# Example 1:\n", + "\n", + "\"I am a single-line comment\"\n", + "\n", + "'''\n", + "I am a\n", + "multi-line comment!\n", + "'''\n", + "\n", + "print(\"Hello World\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ">**Note:** We use triple quotation marks for multi-line strings." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Python docstrings\n", + "\n", + "As mentioned above, Python docstrings are strings used right after the definition of a function, method, class, or module (like in Example \n", + "\n", + "**1. They are used to document our code**.\n", + "\n", + "We can access these docstrings using the **`__doc__`** attribute." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Python `__doc__` attribute\n", + "\n", + "Whenever string literals are present just after the definition of a function, module, class or a method, they are associated with the object as their **`__doc__`** attribute. We can later use this attribute to retrieve this docstring." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T08:11:13.090263Z", + "start_time": "2021-06-13T08:11:13.082453Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Takes in a number n, returns the square of n\n" + ] + } + ], + "source": [ + "# Example 1: Printing docstring\n", + "\n", + "def square(n):\n", + " '''Takes in a number n, returns the square of n'''\n", + " return n**2\n", + "\n", + "print(square.__doc__)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here, the documentation of our **`square()`** function can be accessed using the **`__doc__`** attribute." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now, let's look at docstrings for the built-in function **`print()`**:" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T08:11:15.210361Z", + "start_time": "2021-06-13T08:11:15.202551Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "print(value, ..., sep=' ', end='\\n', file=sys.stdout, flush=False)\n", + "\n", + "Prints the values to a stream, or to sys.stdout by default.\n", + "Optional keyword arguments:\n", + "file: a file-like object (stream); defaults to the current sys.stdout.\n", + "sep: string inserted between values, default a space.\n", + "end: string appended after the last value, default a newline.\n", + "flush: whether to forcibly flush the stream.\n" + ] + } + ], + "source": [ + "# Example 2: Docstrings for the built-in `print()` function\n", + "\n", + "print(print.__doc__)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here, we can see that the documentation of the **`print()`** function is present as the **`__doc__`** attribute of this function." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Single-line docstrings in Python\n", + "\n", + "Single line docstrings are the documents that fit in one line.\n", + "\n", + "**Standard conventions to write single-line docstrings:**\n", + "\n", + "* Even though they are single-lined, we still use the triple quotes around these docstrings as they can be expanded easily later.\n", + "* The closing quotes are on the same line as the opening quotes.\n", + "* There's no blank line either before or after the docstring.\n", + "* They should not be descriptive, rather they must follow \"Do this, return that\" structure ending with a period.\n", + "\n", + "Let's take an example." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T08:11:17.116597Z", + "start_time": "2021-06-13T08:11:17.107811Z" + } + }, + "outputs": [], + "source": [ + "# Example 1: Write single-line docstrings for a function\n", + " \n", + "def multiplier(a, b):\n", + " \"\"\"Takes in two numbers, returns their product.\"\"\"\n", + " return a*b" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T08:11:18.790898Z", + "start_time": "2021-06-13T08:11:18.770883Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "This function returns the factorial of a given number.\n" + ] + } + ], + "source": [ + "# Example 2:\n", + "\n", + "def factorial(x):\n", + " \"\"\"This function returns the factorial of a given number.\"\"\"\n", + " return x\n", + "\n", + "# access doc string\n", + "print(factorial.__doc__)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T08:11:43.163257Z", + "start_time": "2021-06-13T08:11:43.148615Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Help on function factorial in module __main__:\n", + "\n", + "factorial(x)\n", + " This function returns the factorial of a given number.\n", + "\n", + "None\n" + ] + } + ], + "source": [ + "# Example 3:\n", + "\n", + "# pass function name to help() function\n", + "print(help(factorial))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Multi-line Docstrings in Python\n", + "\n", + "Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description.\n", + "\n", + "The PEP 257 document provides the standard conventions to write multi-line docstrings for various objects.\n", + "\n", + "Some have been listed below:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 1. Docstrings for Python Modules\n", + "\n", + "* The docstrings for Python Modules should list all the available classes, functions, objects and exceptions that are imported when the module is imported.\n", + "* They should also have a one-line summary for each item.\n", + "\n", + "They are written at the beginning of the Python file.\n", + "\n", + "Let's look at the docstrings for the builtin module in Python called pickle." + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T08:11:46.512840Z", + "start_time": "2021-06-13T08:11:46.499173Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Create portable serialized representations of Python objects.\n", + "\n", + "See module copyreg for a mechanism for registering custom picklers.\n", + "See module pickletools source for extensive comments.\n", + "\n", + "Classes:\n", + "\n", + " Pickler\n", + " Unpickler\n", + "\n", + "Functions:\n", + "\n", + " dump(object, file)\n", + " dumps(object) -> string\n", + " load(file) -> object\n", + " loads(string) -> object\n", + "\n", + "Misc variables:\n", + "\n", + " __version__\n", + " format_version\n", + " compatible_formats\n", + "\n", + "\n" + ] + } + ], + "source": [ + "# Example 1: Docstrings of Python module\n", + "\n", + "import pickle\n", + "print(pickle.__doc__)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here, we can see that the docstring written at the beginning of the **pickle.py** module file can be accessed as its docstring." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 2. Docstrings for Python Functions\n", + "\n", + "* The docstring for a function or method should summarize its behavior and document its arguments and return values.\n", + "* It should also list all the exceptions that can be raised and other optional arguments." + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T08:11:50.215445Z", + "start_time": "2021-06-13T08:11:50.203731Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Returns the sum of two decimal numbers in binary digits.\n", + "\n", + " Parameters:\n", + " a (int): A decimal integer\n", + " b (int): Another decimal integer\n", + "\n", + " Returns:\n", + " binary_sum (str): Binary string of the sum of a and b\n", + " \n" + ] + } + ], + "source": [ + "# Example 1: Docstrings for Python functions\n", + "\n", + "def add_binary(a, b):\n", + " '''\n", + " Returns the sum of two decimal numbers in binary digits.\n", + "\n", + " Parameters:\n", + " a (int): A decimal integer\n", + " b (int): Another decimal integer\n", + "\n", + " Returns:\n", + " binary_sum (str): Binary string of the sum of a and b\n", + " '''\n", + " binary_sum = bin(a+b)[2:]\n", + " return binary_sum\n", + "\n", + "\n", + "print(add_binary.__doc__)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "As you can see, we have included a short description of what the function does, the parameter it takes in and the value it returns. The string literal is embedded to the function **`add_binary`** as its **`__doc__`** attribute." + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T08:11:55.625557Z", + "start_time": "2021-06-13T08:11:55.613350Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " \n", + " Description of function\n", + " \n", + " Arguments: \n", + " parameter1(int):Description of parameter1\n", + " \n", + " Returns: \n", + " int value \n", + " \n" + ] + } + ], + "source": [ + "# Example 2:\n", + "\n", + "def any_fun(parameter1):\n", + " \"\"\" \n", + " Description of function\n", + " \n", + " Arguments: \n", + " parameter1(int):Description of parameter1\n", + " \n", + " Returns: \n", + " int value \n", + " \"\"\" \n", + "\n", + "print(any_fun.__doc__)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 3. Docstrings for Python Classes\n", + "\n", + "The docstrings for classes should summarize its behavior and list the public methods and instance variables.\n", + "The subclasses, constructors, and methods should each have their own docstrings." + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T08:11:58.791059Z", + "start_time": "2021-06-13T08:11:58.782272Z" + } + }, + "outputs": [], + "source": [ + "# Example 1: Docstrings for Python class\n", + "\n", + "# Suppose we have a Person.py file with the following code:\n", + "\n", + "class Person:\n", + " \"\"\"\n", + " A class to represent a person.\n", + "\n", + " ...\n", + "\n", + " Attributes\n", + " ----------\n", + " name : str\n", + " first name of the person\n", + " surname : str\n", + " family name of the person\n", + " age : int\n", + " age of the person\n", + "\n", + " Methods\n", + " -------\n", + " info(additional=\"\"):\n", + " Prints the person's name and age.\n", + " \"\"\"\n", + "\n", + " def __init__(self, name, surname, age):\n", + " \"\"\"\n", + " Constructs all the necessary attributes for the person object.\n", + "\n", + " Parameters\n", + " ----------\n", + " name : str\n", + " first name of the person\n", + " surname : str\n", + " family name of the person\n", + " age : int\n", + " age of the person\n", + " \"\"\"\n", + "\n", + " self.name = name\n", + " self.surname = surname\n", + " self.age = age\n", + "\n", + " def info(self, additional=\"\"):\n", + " \"\"\"\n", + " Prints the person's name and age.\n", + "\n", + " If the argument 'additional' is passed, then it is appended after the main info.\n", + "\n", + " Parameters\n", + " ----------\n", + " additional : str, optional\n", + " More info to be displayed (default is None)\n", + "\n", + " Returns\n", + " -------\n", + " None\n", + " \"\"\"\n", + "\n", + " print(f'My name is {self.name} {self.surname}. I am {self.age} years old.' + additional)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here, we can use the following code to access only the docstrings of the **`Person`** class:" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T08:12:00.449245Z", + "start_time": "2021-06-13T08:12:00.436551Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " A class to represent a person.\n", + "\n", + " ...\n", + "\n", + " Attributes\n", + " ----------\n", + " name : str\n", + " first name of the person\n", + " surname : str\n", + " family name of the person\n", + " age : int\n", + " age of the person\n", + "\n", + " Methods\n", + " -------\n", + " info(additional=\"\"):\n", + " Prints the person's name and age.\n", + " \n" + ] + } + ], + "source": [ + "print(Person.__doc__)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Using the `help()` Function for Docstrings\n", + "\n", + "We can also use the **`help()`** function to read the docstrings associated with various objects." + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-13T08:12:02.355969Z", + "start_time": "2021-06-13T08:12:02.348159Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Help on class Person in module __main__:\n", + "\n", + "class Person(builtins.object)\n", + " | Person(name, surname, age)\n", + " | \n", + " | A class to represent a person.\n", + " | \n", + " | ...\n", + " | \n", + " | Attributes\n", + " | ----------\n", + " | name : str\n", + " | first name of the person\n", + " | surname : str\n", + " | family name of the person\n", + " | age : int\n", + " | age of the person\n", + " | \n", + " | Methods\n", + " | -------\n", + " | info(additional=\"\"):\n", + " | Prints the person's name and age.\n", + " | \n", + " | Methods defined here:\n", + " | \n", + " | __init__(self, name, surname, age)\n", + " | Constructs all the necessary attributes for the person object.\n", + " | \n", + " | Parameters\n", + " | ----------\n", + " | name : str\n", + " | first name of the person\n", + " | surname : str\n", + " | family name of the person\n", + " | age : int\n", + " | age of the person\n", + " | \n", + " | info(self, additional='')\n", + " | Prints the person's name and age.\n", + " | \n", + " | If the argument 'additional' is passed, then it is appended after the main info.\n", + " | \n", + " | Parameters\n", + " | ----------\n", + " | additional : str, optional\n", + " | More info to be displayed (default is None)\n", + " | \n", + " | Returns\n", + " | -------\n", + " | None\n", + " | \n", + " | ----------------------------------------------------------------------\n", + " | Data descriptors defined here:\n", + " | \n", + " | __dict__\n", + " | dictionary for instance variables (if defined)\n", + " | \n", + " | __weakref__\n", + " | list of weak references to the object (if defined)\n", + "\n" + ] + } + ], + "source": [ + "# Example 1: Read Docstrings with the `help()` function\n", + "\n", + "# We can use the help() function on the class Person in Example as:\n", + "\n", + "help(Person)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here, we can see that the **`help()`** function retrieves the docstrings of the **`Person`** class along with the methods associated with that class." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 4. Docstrings for Python Scripts\n", + "\n", + "* The docstrings for Python script should document the script's functions and command-line syntax as a usable message.\n", + "* It should serve as a quick reference to all the functions and arguments." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 5. Docstrings for Python Packages\n", + "\n", + "The docstrings for a Python package is written in the package's **`__init__.py`** file.\n", + "\n", + "* It should contain all the available modules and sub-packages exported by the package." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Docstring Formats\n", + "\n", + "We can write docstring in many formats like the reStructured text (reST) format, Google format or the NumPy documentation format. To learn more, visit **[Popular Docstring Formats](https://stackoverflow.com/questions/3898572/what-is-the-standard-python-docstring-format)**\n", + "\n", + "We can also generate documentation from docstrings using tools like Sphinx. To learn more, visit **[Official Sphinx Documentation](https://www.sphinx-doc.org/en/master/)**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "hide_input": false, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.8" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": false, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": {}, + "toc_section_display": true, + "toc_window_display": false + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/Python_User_defined_Functions.ipynb b/Python_User_defined_Functions.ipynb new file mode 100644 index 0000000..c59922b --- /dev/null +++ b/Python_User_defined_Functions.ipynb @@ -0,0 +1,168 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "All the IPython Notebooks in **Python Functions** lecture series by Dr. Milaan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Python User-defined Functions\n", + "\n", + "In this class, you will find the advantages of using user-defined functions and best practices to follow." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## What are user-defined functions in Python?\n", + "\n", + "Functions that we define ourselves to do certain specific task are referred as user-defined functions. The way in which we define and call **[functions in Python](https://github.com/milaan9/04_Python_Functions/blob/main/001_Python_Functions.ipynb)** are already discussed.\n", + "\n", + "Functions that readily come with Python are called built-in functions. If we use functions written by others in the form of library, it can be termed as library functions.\n", + "\n", + "All the other functions that we write on our own fall under user-defined functions. So, our user-defined function could be a library function to someone else." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Advantages of user-defined functions\n", + "\n", + "1. User-defined functions help to decompose a large program into small segments which makes program easy to understand, maintain and debug.\n", + "2. If repeated code occurs in a program. Function can be used to include those codes and execute when needed by calling that function.\n", + "3. Programmars working on large project can divide the workload by making different functions." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "ExecuteTime": { + "end_time": "2021-06-25T05:28:47.996956Z", + "start_time": "2021-06-25T05:28:39.880301Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Enter first number: 9.3\n", + "Enter second number: 6.9\n", + "The sum is 16.200000000000003\n" + ] + } + ], + "source": [ + "# Example 1: illustrate the use of user-defined functions\n", + "\n", + "num1 = input('Enter first number: ')\n", + "num2 = input('Enter second number: ')\n", + "\n", + "def my_addition(num1,num2):\n", + " sum = float(num1) + float(num2)\n", + " return sum\n", + "\n", + "#num1 = 9.3\n", + "#num2 = 6.9\n", + "\n", + "print(\"The sum is\", my_addition(num1, num2))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Explanation:**\n", + "\n", + "Here, we have defined the function **`my_addition()`** which adds two numbers and returns the result.\n", + "\n", + "This is our user-defined function. We could have multiplied the two numbers inside our function (it's all up to us). But this operation would not be consistent with the name of the function. It would create ambiguity.\n", + "\n", + "It is always a good idea to name functions according to the task they perform.\n", + "\n", + "In the above example, **[print()](https://github.com/milaan9/04_Python_Functions/blob/main/002_Python_Functions_Built_in/051_Python_print%28%29.ipynb)** is a **[built-in function in Python](https://github.com/milaan9/04_Python_Functions/tree/main/002_Python_Functions_Built_in)**. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "hide_input": false, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.8" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": false, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": {}, + "toc_section_display": true, + "toc_window_display": false + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 4a484d4fafcf89e460407cc0944ade19c29fc33f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Wed, 13 Oct 2021 19:34:14 +0530 Subject: [PATCH 37/49] Updated with more examples and exercises From e6b6da3390a39d73cd7bb1eb523bb23920f0e515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Wed, 13 Oct 2021 19:34:45 +0530 Subject: [PATCH 38/49] Updated with more examples and exercises From e47ea74e27b546c2e927c7af496d00e8a936927d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Wed, 13 Oct 2021 19:35:11 +0530 Subject: [PATCH 39/49] Updated with more examples and exercises From 29f75511ba45e6d8548a77fc6d801800da016b6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Wed, 13 Oct 2021 19:35:26 +0530 Subject: [PATCH 40/49] Updated with more examples and exercises From 15a64e437253afca448175a39ea0678b712c72c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Thu, 14 Oct 2021 22:28:11 +0530 Subject: [PATCH 41/49] Update 001_Python_Functions.ipynb --- 001_Python_Functions.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/001_Python_Functions.ipynb b/001_Python_Functions.ipynb index 8c5a6f4..4c7ec79 100644 --- a/001_Python_Functions.ipynb +++ b/001_Python_Functions.ipynb @@ -1489,7 +1489,7 @@ "### Exercises โžž Level 3\n", "\n", "1. Write a function called **`is_prime`**, which checks if a number is prime.\n", - "1. Write a functions which checks if all items are unique in the list.\n", + "1. Write a functions which checks if all the items are unique in the list.\n", "1. Write a function which checks if all the items of the list are of the same data type.\n", "1. Write a function which check if provided variable is a valid python variable\n", "1. Go to the data folder and access the **[countries-data.py](https://github.com/milaan9/03_Python_Flow_Control/blob/main/countries_details_data.py)** file.\n", From 6a4d55d10170c24b71fd8ba5a627df174dde12df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Mon, 18 Oct 2021 17:27:09 +0530 Subject: [PATCH 42/49] Delete 001_Python_Functions.ipynb --- 001_Python_Functions.ipynb | 1580 ------------------------------------ 1 file changed, 1580 deletions(-) delete mode 100644 001_Python_Functions.ipynb diff --git a/001_Python_Functions.ipynb b/001_Python_Functions.ipynb deleted file mode 100644 index 4c7ec79..0000000 --- a/001_Python_Functions.ipynb +++ /dev/null @@ -1,1580 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "All the IPython Notebooks in **Python Functions** lecture series by Dr. Milaan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Python Functions\n", - "\n", - "In this class, you'll learn about functions, what a function is, the syntax, components, and types of functions. Also, you'll learn to create a function in Python." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# What is a function in Python?\n", - "\n", - "In Python, a **function is a block of organized, reusable (DRY- Donโ€™t Repeat Yourself) code with a name** that is used to perform a single, specific task. It can take arguments and returns the value.\n", - "\n", - "Functions help break our program into smaller and modular chunks. As our program grows larger and larger, functions make it more organized and manageable.\n", - "\n", - "Furthermore, it improves efficiency and reduces errors because of the reusability of a code." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Types of Functions\n", - "\n", - "Python support two types of functions\n", - "\n", - "1. **[Built-in](https://github.com/milaan9/04_Python_Functions/tree/main/002_Python_Functions_Built_in)** function\n", - "2. **[User-defined](https://github.com/milaan9/04_Python_Functions/blob/main/Python_User_defined_Functions.ipynb)** function\n", - "\n", - "1.**Built-in function**\n", - "\n", - "The functions which are come along with Python itself are called a built-in function or predefined function. Some of them are:\n", - "**`range()`**, **`print()`**, **`input()`**, **`type()`**, **`id()`**, **`eval()`** etc.\n", - "\n", - "**Example:** Python **`range()`** function generates the immutable sequence of numbers starting from the given start integer to the stop integer.\n", - "\n", - "```python\n", - ">>> for i in range(1, 10):\n", - ">>> print(i, end=' ')\n", - "\n", - "1 2 3 4 5 6 7 8 9\n", - "```\n", - "\n", - "2. **User-defined function**\n", - "\n", - "Functions which are created by programmer explicitly according to the requirement are called a user-defined function." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**Syntax:**\n", - "\n", - "```python\n", - "def function_name(parameter1, parameter2):\n", - " \"\"\"docstring\"\"\"\n", - " # function body \n", - " # write some action\n", - "return value\n", - "```\n", - "\n", - "
\n", - "\n", - "
" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Defining a Function\n", - "\n", - "1. **`def`** is a keyword that marks the start of the function header.\n", - "\n", - "2. **`function_name`** to uniquely identify the function. Function naming follows the same **[rules of writing identifiers in Python](https://github.com/milaan9/01_Python_Introduction/blob/main/005_Python_Keywords_and_Identifiers.ipynb)**.\n", - "\n", - "2. **`parameter`** is the value passed to the function. They are optional.\n", - "\n", - "3. **`:`** (colon) to mark the end of the function header.\n", - "\n", - "4. **`function body`** is a block of code that performs some task and all the statements in **`function body`** must have the same **indentation** level (usually 4 spaces). \n", - "\n", - "5. **\"\"\"docstring\"\"\"** documentation string is used to describe what the function does.\n", - "\n", - "6. **`return`** is a keyword to return a value from the function.. A return statement with no arguments is the same as return **`None`**.\n", - "\n", - ">**Note:** While defining a function, we use two keywords, **`def`** (mandatory) and **`return`** (optional).\n", - "\n", - "**Example:**\n", - "\n", - "```python\n", - ">>> def add(num1,num2): # Function name: 'add', Parameters: 'num1', 'num2'\n", - ">>> print(\"Number 1: \", num1) # Function body\n", - ">>> print(\"Number 2: \", num2) # Function body\n", - ">>> addition = num1 + num2 # Function body\n", - ">>> return addition # return value\n", - "\n", - "\n", - ">>> res = add(2, 4) # Function call\n", - ">>> print(\"Result: \", res)\n", - "```" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Defining a function without any parameters\n", - "\n", - "Function can be declared without parameters." - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:47:57.838353Z", - "start_time": "2021-10-08T17:47:57.814918Z" - }, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Welcome to Python for Data Science\n" - ] - } - ], - "source": [ - "# Example 1: \n", - " \n", - "def greet():\n", - " print(\"Welcome to Python for Data Science\")\n", - "\n", - "# call function using its name\n", - "greet()" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:47:57.946753Z", - "start_time": "2021-10-08T17:47:57.840309Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "9\n" - ] - } - ], - "source": [ - "# Example 2: \n", - "\n", - "def add_two_numbers ():\n", - " num_one = 3\n", - " num_two = 6\n", - " total = num_one + num_two\n", - " print(total)\n", - "add_two_numbers() # calling a function" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:47:58.053200Z", - "start_time": "2021-10-08T17:47:57.950659Z" - }, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Milaan Parmar\n" - ] - } - ], - "source": [ - "# Example 3: \n", - "\n", - "def generate_full_name ():\n", - " first_name = 'Milaan'\n", - " last_name = 'Parmar'\n", - " space = ' '\n", - " full_name = first_name + space + last_name\n", - " print(full_name)\n", - "generate_full_name () # calling a function" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Defining a function without parameters and `return` value\n", - "\n", - "Function can also return values, if a function does not have a **`return`** statement, the value of the function is None. Let us rewrite the above functions using **`return`**. From now on, we get a value from a function when we call the function and print it." - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:47:58.176733Z", - "start_time": "2021-10-08T17:47:58.057106Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "9\n" - ] - } - ], - "source": [ - "# Example 1: \n", - "\n", - "def add_two_numbers ():\n", - " num_one = 3\n", - " num_two = 6\n", - " total = num_one + num_two\n", - " return total\n", - "print(add_two_numbers())" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:47:58.298319Z", - "start_time": "2021-10-08T17:47:58.185523Z" - }, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Milaan Parmar\n" - ] - } - ], - "source": [ - "# Example 2: \n", - "\n", - "def generate_full_name ():\n", - " first_name = 'Milaan'\n", - " last_name = 'Parmar'\n", - " space = ' '\n", - " full_name = first_name + space + last_name\n", - " return full_name\n", - "print(generate_full_name())" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Defining a function with parameters\n", - "\n", - "In a function we can pass different data types(number, string, boolean, list, tuple, dictionary or set) as a parameter." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Single Parameter: \n", - "\n", - "If our function takes a parameter we should call our function with an argument" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:47:58.422343Z", - "start_time": "2021-10-08T17:47:58.301246Z" - } - }, - "outputs": [], - "source": [ - "# Example 1: Gereeting\n", - "\n", - "def greet(name):\n", - " \"\"\"\n", - " This function greets to the person passed in as a parameter\n", - " \"\"\"\n", - " print(\"Hello, \" + name + \". Good morning!\") # No output!" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:47:58.545876Z", - "start_time": "2021-10-08T17:47:58.430154Z" - }, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "55\n", - "None\n", - "5050\n", - "None\n" - ] - } - ], - "source": [ - "# Example 2: \n", - "\n", - "def sum_of_numbers(n):\n", - " total = 0\n", - " for i in range(n+1):\n", - " total+=i\n", - " print(total)\n", - "print(sum_of_numbers(10)) # 55\n", - "print(sum_of_numbers(100)) # 5050" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Two Parameter: \n", - "\n", - "A function may or may not have a parameter or parameters. A function may also have two or more parameters. If our function takes parameters we should call it with arguments." - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:47:58.652810Z", - "start_time": "2021-10-08T17:47:58.552712Z" - }, - "scrolled": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Hello Arthur Welcome to Python for Data Science\n", - "Your course name is Python\n" - ] - } - ], - "source": [ - "# Example 1: \n", - "\n", - "def course(name, course_name):\n", - " print(\"Hello\", name, \"Welcome to Python for Data Science\")\n", - " print(\"Your course name is\", course_name)\n", - "\n", - "course('Arthur', 'Python') # call function" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Defining a function with parameters and `return` value" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:47:58.761206Z", - "start_time": "2021-10-08T17:47:58.657692Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Milaan, welcome to Python for Data Science\n" - ] - } - ], - "source": [ - "# Example 1: \n", - "\n", - "def greetings (name): # single parameter\n", - " message = name + ', welcome to Python for Data Science'\n", - " return message\n", - "\n", - "print(greetings('Milaan'))" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:47:58.853005Z", - "start_time": "2021-10-08T17:47:58.764137Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "100\n" - ] - } - ], - "source": [ - "# Example 2: \n", - "\n", - "def add_ten(num): # single parameter\n", - " ten = 10\n", - " return num + ten\n", - "print(add_ten(90))" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:47:58.976051Z", - "start_time": "2021-10-08T17:47:58.855934Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "9\n" - ] - } - ], - "source": [ - "# Example 3: \n", - "\n", - "def square_number(x): # single parameter\n", - " return x * x\n", - "print(square_number(3))" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:47:59.084452Z", - "start_time": "2021-10-08T17:47:58.978980Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "314.0\n" - ] - } - ], - "source": [ - "# Example 4: \n", - "\n", - "def area_of_circle (r): # single parameter\n", - " PI = 3.14\n", - " area = PI * r ** 2\n", - " return area\n", - "print(area_of_circle(10))" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:47:59.192846Z", - "start_time": "2021-10-08T17:47:59.087380Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Addition : 36\n" - ] - } - ], - "source": [ - "# Example 5: \n", - "\n", - "def calculator(a, b): # two parameter\n", - " add = a + b \n", - " return add # return the addition\n", - "\n", - "result = calculator(30, 6) # call function & take return value in variable\n", - "print(\"Addition :\", result) # Output Addition : 36" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:47:59.299295Z", - "start_time": "2021-10-08T17:47:59.199687Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Full Name: Milaan Parmar\n" - ] - } - ], - "source": [ - "# Example 6: \n", - "\n", - "def generate_full_name (first_name, last_name): # two parameter\n", - " space = ' '\n", - " full_name = first_name + space + last_name\n", - " return full_name\n", - "print('Full Name: ', generate_full_name('Milaan','Parmar'))" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:47:59.422342Z", - "start_time": "2021-10-08T17:47:59.302224Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Sum of two numbers: 10\n" - ] - } - ], - "source": [ - "# Example 7: \n", - "\n", - "def sum_two_numbers (num_one, num_two): # two parameter\n", - " sum = num_one + num_two\n", - " return sum\n", - "print('Sum of two numbers: ', sum_two_numbers(1, 9))" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:47:59.530738Z", - "start_time": "2021-10-08T17:47:59.425271Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Age: 202\n" - ] - } - ], - "source": [ - "# Example 8: \n", - "\n", - "def calculate_age (current_year, birth_year): # two parameter\n", - " age = current_year - birth_year\n", - " return age;\n", - "\n", - "print('Age: ', calculate_age(2021, 1819))" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:47:59.623513Z", - "start_time": "2021-10-08T17:47:59.533669Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Weight of an object in Newtons: 981.0 N\n" - ] - } - ], - "source": [ - "# Example 9: \n", - "\n", - "def weight_of_object (mass, gravity): # two parameter\n", - " weight = str(mass * gravity)+ ' N' # the value has to be changed to a string first\n", - " return weight\n", - "print('Weight of an object in Newtons: ', weight_of_object(100, 9.81))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Function `return` Statement\n", - "\n", - "In Python, to return value from the function, a **`return`** statement is used. It returns the value of the expression following the returns keyword.\n", - "\n", - "**Syntax:**\n", - "\n", - "```python\n", - "def fun():\n", - " statement-1\n", - " statement-2\n", - " statement-3\n", - " . \n", - " . \n", - " return [expression]\n", - "```\n", - "\n", - "The **`return`** value is nothing but a outcome of function.\n", - "\n", - "* The **`return`** statement ends the function execution.\n", - "* For a function, it is not mandatory to return a value.\n", - "* If a **`return`** statement is used without any expression, then the **`None`** is returned.\n", - "* The **`return`** statement should be inside of the function block." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Return Single Value" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:47:59.718728Z", - "start_time": "2021-10-08T17:47:59.626442Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Hello, Cory. Good morning!\n", - "None\n" - ] - } - ], - "source": [ - "print(greet(\"Cory\"))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Here, **`None`** is the returned value since **`greet()`** directly prints the name and no **`return`** statement is used." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Passing Arguments with Key and Value\n", - "\n", - "If we pass the arguments with key and value, the order of the arguments does not matter." - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:47:59.854957Z", - "start_time": "2021-10-08T17:47:59.727520Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Milaan Parmar\n", - "None\n" - ] - } - ], - "source": [ - "# Example 1: \n", - "\n", - "def print_fullname(firstname, lastname):\n", - " space = ' '\n", - " full_name = firstname + space + lastname\n", - " print(full_name)\n", - "print(print_fullname(firstname = 'Milaan', lastname = 'Parmar'))" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:47:59.978006Z", - "start_time": "2021-10-08T17:47:59.860817Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "5\n", - "None\n" - ] - } - ], - "source": [ - "# Example 2:\n", - "\n", - "def add_two_numbers (num1, num2):\n", - " total = num1 + num2\n", - " print(total)\n", - "print(add_two_numbers(num2 = 3, num1 = 2)) # Order does not matter" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "If we do not **`return`** a value with a function, then our function is returning **`None`** by default. To return a value with a function we use the keyword **`return`** followed by the variable we are returning. We can return any kind of data types from a function." - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:48:00.178202Z", - "start_time": "2021-10-08T17:47:59.981912Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Milaan Parmar\n" - ] - } - ], - "source": [ - "# Example 1: with return statement\n", - "\n", - "def print_fullname(firstname, lastname):\n", - " space = ' '\n", - " full_name = firstname + space + lastname\n", - " return full_name\n", - "print(print_fullname(firstname = 'Milaan', lastname = 'Parmar'))" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:48:00.286600Z", - "start_time": "2021-10-08T17:48:00.182107Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "5\n" - ] - } - ], - "source": [ - "# Example 2: with return statement\n", - "\n", - "def add_two_numbers (num1, num2):\n", - " total = num1 + num2\n", - " return total\n", - "print(add_two_numbers(num2 = 3, num1 = 2)) # Order does not matter" - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:48:00.394507Z", - "start_time": "2021-10-08T17:48:00.300275Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "2\n", - "4\n" - ] - } - ], - "source": [ - "# Example 3:\n", - "\n", - "def absolute_value(num):\n", - " \"\"\"This function returns the absolute\n", - " value of the entered number\"\"\"\n", - "\n", - " if num >= 0:\n", - " return num\n", - " else:\n", - " return -num\n", - "\n", - "print(absolute_value(2))\n", - "print(absolute_value(-4))" - ] - }, - { - "cell_type": "code", - "execution_count": 24, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:48:00.529768Z", - "start_time": "2021-10-08T17:48:00.400370Z" - }, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Adding the two values\n", - "Printing within Function\n", - "30\n", - "total : 30\n", - "Hello\n", - "Rest of code\n" - ] - } - ], - "source": [ - "# Example 4:\n", - "\n", - "def sum(a,b): # Function 1\n", - " print(\"Adding the two values\")\n", - " print(\"Printing within Function\")\n", - " print(a+b)\n", - " return a+b\n", - "\n", - "def msg(): # Function 2\n", - " print(\"Hello\")\n", - " return\n", - "\n", - "total=sum(10,20)\n", - "print('total : ',total)\n", - "msg()\n", - "print(\"Rest of code\")" - ] - }, - { - "cell_type": "code", - "execution_count": 25, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:48:00.672343Z", - "start_time": "2021-10-08T17:48:00.537579Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Even numbers are: [2, 46, 72, 90]\n" - ] - } - ], - "source": [ - "# Example 5:\n", - "\n", - "def is_even(list1):\n", - " even_num = []\n", - " for n in list1:\n", - " if n % 2 == 0:\n", - " even_num.append(n)\n", - " # return a list\n", - " return even_num\n", - "\n", - "# Pass list to the function\n", - "even_num = is_even([2, 3, 46, 63, 72, 83, 90, 19])\n", - "print(\"Even numbers are:\", even_num)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Return Multiple Values\n", - "\n", - "You can also return multiple values from a function. Use the return statement by separating each expression by a comma." - ] - }, - { - "cell_type": "code", - "execution_count": 26, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:48:00.795876Z", - "start_time": "2021-10-08T17:48:00.677226Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Addition: 12\n", - "Subtraction: 8\n", - "Multiplication: 20\n", - "Division: 5.0\n" - ] - } - ], - "source": [ - "# Example 1:\n", - "\n", - "def arithmetic(num1, num2):\n", - " add = num1 + num2\n", - " sub = num1 - num2\n", - " multiply = num1 * num2\n", - " division = num1 / num2\n", - " # return four values\n", - " return add, sub, multiply, division\n", - "\n", - "a, b, c, d = arithmetic(10, 2) # read four return values in four variables\n", - "\n", - "print(\"Addition: \", a)\n", - "print(\"Subtraction: \", b)\n", - "print(\"Multiplication: \", c)\n", - "print(\"Division: \", d)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Return Boolean Values" - ] - }, - { - "cell_type": "code", - "execution_count": 27, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:48:00.903786Z", - "start_time": "2021-10-08T17:48:00.803691Z" - }, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "even\n", - "True\n", - "False\n" - ] - } - ], - "source": [ - "# Example 1:\n", - "\n", - "def is_even (n):\n", - " if n % 2 == 0:\n", - " print('even')\n", - " return True # return stops further execution of the function, similar to break \n", - " return False\n", - "print(is_even(10)) # True\n", - "print(is_even(7)) # False" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Return a List" - ] - }, - { - "cell_type": "code", - "execution_count": 28, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:48:01.028789Z", - "start_time": "2021-10-08T17:48:00.906718Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[0, 2, 4, 6, 8, 10]\n" - ] - } - ], - "source": [ - "# Example 1:\n", - "\n", - "def find_even_numbers(n):\n", - " evens = []\n", - " for i in range(n + 1):\n", - " if i % 2 == 0:\n", - " evens.append(i)\n", - " return evens\n", - "print(find_even_numbers(10))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## How to call a function in python?\n", - "\n", - "Once we have defined a function, we can call it from another function, program or even the Python prompt. To call a function we simply type the function name with appropriate parameters.\n", - "\n", - "
\n", - "\n", - "
" - ] - }, - { - "cell_type": "code", - "execution_count": 29, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:48:01.135232Z", - "start_time": "2021-10-08T17:48:01.031717Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Hello, Alan. Good morning!\n" - ] - } - ], - "source": [ - "greet('Alan')" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - ">**Note:** Try running the above code in the Python program with the function definition to see the output." - ] - }, - { - "cell_type": "code", - "execution_count": 30, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:48:01.243633Z", - "start_time": "2021-10-08T17:48:01.140118Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Happy birthday, Bill. Hope you have a wonderful day!\n" - ] - } - ], - "source": [ - "# Example 1: \n", - "\n", - "def wish(name):\n", - " \"\"\"\n", - " This function wishes to the person passed in as a parameter\n", - " \"\"\"\n", - " print(\"Happy birthday, \" + name + \". Hope you have a wonderful day!\")\n", - "\n", - "wish('Bill')" - ] - }, - { - "cell_type": "code", - "execution_count": 31, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:48:01.446289Z", - "start_time": "2021-10-08T17:48:01.251445Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Clark, welcome to Python for Data Science\n", - "Milaan, welcome to Python for Data Science\n" - ] - } - ], - "source": [ - "# Example 2: \n", - "\n", - "def greetings (name = 'Clark'):\n", - " message = name + ', welcome to Python for Data Science'\n", - " return message\n", - "print(greetings())\n", - "print(greetings('Milaan'))" - ] - }, - { - "cell_type": "code", - "execution_count": 32, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:48:01.699688Z", - "start_time": "2021-10-08T17:48:01.454570Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Milaan Parmar\n", - "Ethan Hunt\n" - ] - } - ], - "source": [ - "# Example 3: \n", - "\n", - "def generate_full_name (first_name = 'Milaan', last_name = 'Parmar'):\n", - " space = ' '\n", - " full_name = first_name + space + last_name\n", - " return full_name\n", - "print(generate_full_name())\n", - "print(generate_full_name('Ethan','Hunt'))" - ] - }, - { - "cell_type": "code", - "execution_count": 33, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:48:01.793476Z", - "start_time": "2021-10-08T17:48:01.702617Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Age: 200\n" - ] - } - ], - "source": [ - "# Example 4: \n", - "\n", - "def calculate_age (birth_year,current_year = 2021):\n", - " age = current_year - birth_year\n", - " return age;\n", - "print('Age: ', calculate_age(1821))" - ] - }, - { - "cell_type": "code", - "execution_count": 34, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:48:01.900373Z", - "start_time": "2021-10-08T17:48:01.797831Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "value of x is: 9\n", - "value of y is: 6\n" - ] - } - ], - "source": [ - "# Example 5: \n", - "\n", - "def swap(x, y):\n", - " \"\"\"\n", - " This function swaps the value of two variables\n", - " \"\"\"\n", - " temp = x; # value of x will go inside temp\n", - " x = y; # value of y will go inside x\n", - " y = temp; # value of temp will go inside y\n", - " print(\"value of x is:\", x)\n", - " print(\"value of y is:\", y)\n", - " return # \"return\" is optional\n", - "\n", - "x = 6\n", - "y = 9\n", - "swap(x, y) #call function" - ] - }, - { - "cell_type": "code", - "execution_count": 35, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:48:02.023908Z", - "start_time": "2021-10-08T17:48:01.903301Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "9 is a Odd Number\n" - ] - } - ], - "source": [ - "# Example 6: \n", - "\n", - "def even_odd(n): \n", - " if n % 2 == 0: # check number is even or odd\n", - " print(n, 'is a Even number')\n", - " else:\n", - " print(n, 'is a Odd Number')\n", - "\n", - "even_odd(9) # calling function by its name" - ] - }, - { - "cell_type": "code", - "execution_count": 36, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:48:02.147933Z", - "start_time": "2021-10-08T17:48:02.026837Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Weight of an object in Newtons: 981.0 N\n", - "Weight of an object in Newtons: 162.0 N\n" - ] - } - ], - "source": [ - "# Example 7: \n", - "\n", - "def weight_of_object (mass, gravity = 9.81):\n", - " weight = str(mass * gravity)+ ' N' # the value has to be changed to string first\n", - " return weight\n", - "print('Weight of an object in Newtons: ', weight_of_object(100)) # 9.81 - average gravity on Earth's surface\n", - "print('Weight of an object in Newtons: ', weight_of_object(100, 1.62)) # gravity on the surface of the Moon" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "## Docstrings\n", - "\n", - "The first string after the function header is called the **docstring** and is short for documentation string. It is a descriptive text (like a comment) written by a programmer to let others know what block of code does.\n", - "\n", - "Although **optional**, documentation is a good programming practice. Unless you can remember what you had for dinner last week, always document your code.\n", - "\n", - "It is being declared using triple single quotes **`''' '''`** or triple-double quote **`\"\"\" \"\"\"`** so that docstring can extend up to multiple lines.\n", - "\n", - "We can access docstring using doc attribute **`__doc__`** for any object like list, tuple, dict, and user-defined function, etc.\n", - "\n", - "In the above example, we have a docstring immediately below the function header." - ] - }, - { - "cell_type": "code", - "execution_count": 37, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:48:02.284654Z", - "start_time": "2021-10-08T17:48:02.154767Z" - }, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - " This function greets to the person passed in as a parameter\n", - " \n" - ] - } - ], - "source": [ - "print(greet.__doc__)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "To learn more about docstrings in Python, visit **[Python Docstrings](https://github.com/milaan9/04_Python_Functions/blob/main/Python_Docstrings.ipynb)**." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Function `pass` Statement\n", - "\n", - "In Python, the **`pass`** is the keyword, which wonโ€™t do anything. Sometimes there is a situation where we need to define a syntactically empty block. We can define that block using the **`pass`** keyword.\n", - "\n", - "When the interpreter finds a **`pass`** statement in the program, it returns no operation." - ] - }, - { - "cell_type": "code", - "execution_count": 38, - "metadata": { - "ExecuteTime": { - "end_time": "2021-10-08T17:48:02.420395Z", - "start_time": "2021-10-08T17:48:02.294414Z" - } - }, - "outputs": [], - "source": [ - "# Example 1:\n", - "\n", - "def addition(num1, num2):\n", - " # Implementation of addition function in comming release\n", - " # Pass statement \n", - " pass\n", - "\n", - "addition(10, 2)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## ๐Ÿ’ป Exercises โžž Functions\n", - "\n", - "### Exercises โžž Level 1\n", - "\n", - "2. Area of a circle is calculated as follows: **area = ฯ€ x r x r** and **perimeter = 2 x ฯ€ x r**. Write a function that calculates **`area_of_circle`** and **`perimeter_of_circle`**.\n", - "3. Write a function called **`add_all_nums`** which takes arbitrary number of arguments and sums all the arguments. Check if all the list items are number types. If not do give a reasonable feedback.\n", - "4. Temperature in **ยฐC** can be converted to **ยฐF** using this formula: **ยฐF = (ยฐC x 9/5) + 32**. Write a function which converts **ยฐC to ยฐF**, **`convert_celsius_2_fahrenheit`**.\n", - "5. Write a function called **`check_season`**, it takes a month parameter and returns the season: Autumn, Winter, Spring or Summer.\n", - "6. Write a function called **`calculate_slope`** which return the slope of a linear equation\n", - "7. Quadratic equation is calculated as follows: **axยฒ + bx + c = 0**. Write a function which calculates solution set of a quadratic equation, **`solve_quadratic_eqn`**.\n", - "8. Declare a function named **`print_list`**. It takes a list as a parameter and it prints out each element of the list.\n", - "9. Declare a function named **`reverse_list`**. It takes an array as a parameter and it returns the reverse of the array (use loops).\n", - "\n", - " - ```py\n", - "print(reverse_list([1, 2, 3, 4, 5]))\n", - "#[5, 4, 3, 2, 1]\n", - "print(reverse_list1([\"A\", \"B\", \"C\"]))\n", - "#[\"C\", \"B\", \"A\"]\n", - " ```\n", - "\n", - "10. Declare a function named **`capitalize_list_items`**. It takes a list as a parameter and it returns a capitalized list of items\n", - "11. Declare a function named **`add_item`**. It takes a list and an item parameters. It returns a list with the item added at the end.\n", - "\n", - " - ```py\n", - "food_staff = ['Potato', 'Tomato', 'Mango', 'Milk']\n", - "print(add_item(food_staff, 'Fungi')) #['Potato', 'Tomato', 'Mango', 'Milk', 'Fungi']\n", - "numbers = [2, 3, 7, 9]\n", - "print(add_item(numbers, 5)) #[2, 3, 7, 9, 5]\n", - " ```\n", - "\n", - "12. Declare a function named **`remove_item`**. It takes a list and an item parameters. It returns a list with the item removed from it.\n", - "\n", - " - ```py\n", - "food_staff = ['Potato', 'Tomato', 'Mango', 'Milk']\n", - "print(remove_item(food_staff, 'Mango')) # ['Potato', 'Tomato', 'Milk']\n", - "numbers = [2, 3, 7, 9]\n", - "print(remove_item(numbers, 3)) # [2, 7, 9]\n", - " ```\n", - "\n", - "13. Declare a function named **`sum_of_numbers`**. It takes a number parameter and it adds all the numbers in that range.\n", - "\n", - " - ```py\n", - "print(sum_of_numbers(5)) # 15\n", - "print(sum_all_numbers(10)) # 55\n", - "print(sum_all_numbers(100)) # 5050\n", - " ```\n", - "\n", - "14. Declare a function named **`sum_of_odds`**. It takes a number parameter and it adds all the odd numbers in that range.\n", - "15. Declare a function named **`sum_of_even`**. It takes a number parameter and it adds all the even numbers in that - range.\n", - "\n", - "### Exercises โžž Level 2\n", - "\n", - "1. Declare a function named **`evens_and_odds`**. It takes a positive integer as parameter and it counts number of evens and odds in the number.\n", - "\n", - " - ```py\n", - " print(evens_and_odds(100))\n", - " #The number of odds are 50.\n", - " #The number of evens are 51.\n", - " ```\n", - "\n", - "1. Call your function **`factorial`**, it takes a whole number as a parameter and it return a factorial of the number\n", - "1. Call your function **`is_empty`**, it takes a parameter and it checks if it is empty or not\n", - "1. Write different functions which take lists. They should **`calculate_mean`**, **`calculate_median`**, **`calculate_mode`**, **`calculate_range`**, **`calculate_variance`**, **`calculate_std`** (standard deviation).\n", - "\n", - "### Exercises โžž Level 3\n", - "\n", - "1. Write a function called **`is_prime`**, which checks if a number is prime.\n", - "1. Write a functions which checks if all the items are unique in the list.\n", - "1. Write a function which checks if all the items of the list are of the same data type.\n", - "1. Write a function which check if provided variable is a valid python variable\n", - "1. Go to the data folder and access the **[countries-data.py](https://github.com/milaan9/03_Python_Flow_Control/blob/main/countries_details_data.py)** file.\n", - "\n", - "- Create a function called the **`most_spoken_languages`** in the world. It should return 10 or 20 most spoken languages in the world in descending order\n", - "- Create a function called the **`most_populated_countries`**. It should return 10 or 20 most populated countries in descending order." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "gist": { - "data": { - "description": "01_Learn_Python4Data/04_Python_Functions/001_Python_Functions.ipynb", - "public": true - }, - "id": "" - }, - "hide_input": false, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.8" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false - }, - "varInspector": { - "cols": { - "lenName": 16, - "lenType": 16, - "lenVar": 40 - }, - "kernels_config": { - "python": { - "delete_cmd_postfix": "", - "delete_cmd_prefix": "del ", - "library": "var_list.py", - "varRefreshCmd": "print(var_dic_list())" - }, - "r": { - "delete_cmd_postfix": ") ", - "delete_cmd_prefix": "rm(", - "library": "var_list.r", - "varRefreshCmd": "cat(var_dic_list()) " - } - }, - "types_to_exclude": [ - "module", - "function", - "builtin_function_or_method", - "instance", - "_Feature" - ], - "window_display": false - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From 9bff59bd5822ea92a026d238eeb0163003d97a59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Mon, 18 Oct 2021 17:27:20 +0530 Subject: [PATCH 43/49] Add files via upload --- 001_Python_Functions.ipynb | 1580 ++++++++++++++++++++++++++++++++++++ 1 file changed, 1580 insertions(+) create mode 100644 001_Python_Functions.ipynb diff --git a/001_Python_Functions.ipynb b/001_Python_Functions.ipynb new file mode 100644 index 0000000..c0d783c --- /dev/null +++ b/001_Python_Functions.ipynb @@ -0,0 +1,1580 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "All the IPython Notebooks in **Python Functions** lecture series by Dr. Milaan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions)**\n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Python Functions\n", + "\n", + "In this class, you'll learn about functions, what a function is, the syntax, components, and types of functions. Also, you'll learn to create a function in Python." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# What is a function in Python?\n", + "\n", + "In Python, a **function is a block of organized, reusable (DRY- Donโ€™t Repeat Yourself) code with a name** that is used to perform a single, specific task. It can take arguments and returns the value.\n", + "\n", + "Functions help break our program into smaller and modular chunks. As our program grows larger and larger, functions make it more organized and manageable.\n", + "\n", + "Furthermore, it improves efficiency and reduces errors because of the reusability of a code." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Types of Functions\n", + "\n", + "Python support two types of functions\n", + "\n", + "1. **[Built-in](https://github.com/milaan9/04_Python_Functions/tree/main/002_Python_Functions_Built_in)** function\n", + "2. **[User-defined](https://github.com/milaan9/04_Python_Functions/blob/main/Python_User_defined_Functions.ipynb)** function\n", + "\n", + "1.**Built-in function**\n", + "\n", + "The functions which are come along with Python itself are called a built-in function or predefined function. Some of them are:\n", + "**`range()`**, **`print()`**, **`input()`**, **`type()`**, **`id()`**, **`eval()`** etc.\n", + "\n", + "**Example:** Python **`range()`** function generates the immutable sequence of numbers starting from the given start integer to the stop integer.\n", + "\n", + "```python\n", + ">>> for i in range(1, 10):\n", + ">>> print(i, end=' ')\n", + "\n", + "1 2 3 4 5 6 7 8 9\n", + "```\n", + "\n", + "2. **User-defined function**\n", + "\n", + "Functions which are created by programmer explicitly according to the requirement are called a user-defined function." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Syntax:**\n", + "\n", + "```python\n", + "def function_name(parameter1, parameter2):\n", + " \"\"\"docstring\"\"\"\n", + " # function body \n", + " # write some action\n", + "return value\n", + "```\n", + "\n", + "
\n", + "\n", + "
" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Defining a Function\n", + "\n", + "1. **`def`** is a keyword that marks the start of the function header.\n", + "\n", + "2. **`function_name`** to uniquely identify the function. Function naming follows the same **[rules of writing identifiers in Python](https://github.com/milaan9/01_Python_Introduction/blob/main/005_Python_Keywords_and_Identifiers.ipynb)**.\n", + "\n", + "2. **`parameter`** is the value passed to the function. They are optional.\n", + "\n", + "3. **`:`** (colon) to mark the end of the function header.\n", + "\n", + "4. **`function body`** is a block of code that performs some task and all the statements in **`function body`** must have the same **indentation** level (usually 4 spaces). \n", + "\n", + "5. **\"\"\"docstring\"\"\"** documentation string is used to describe what the function does.\n", + "\n", + "6. **`return`** is a keyword to return a value from the function.. A return statement with no arguments is the same as return **`None`**.\n", + "\n", + ">**Note:** While defining a function, we use two keywords, **`def`** (mandatory) and **`return`** (optional).\n", + "\n", + "**Example:**\n", + "\n", + "```python\n", + ">>> def add(num1,num2): # Function name: 'add', Parameters: 'num1', 'num2'\n", + ">>> print(\"Number 1: \", num1) # Function body\n", + ">>> print(\"Number 2: \", num2) # Function body\n", + ">>> addition = num1 + num2 # Function body\n", + ">>> return addition # return value\n", + "\n", + "\n", + ">>> res = add(2, 4) # Function call\n", + ">>> print(\"Result: \", res)\n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Defining a function without any parameters\n", + "\n", + "Function can be declared without parameters." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:57.838353Z", + "start_time": "2021-10-08T17:47:57.814918Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Welcome to Python for Data Science\n" + ] + } + ], + "source": [ + "# Example 1: \n", + " \n", + "def greet():\n", + " print(\"Welcome to Python for Data Science\")\n", + "\n", + "# call function using its name\n", + "greet()" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:57.946753Z", + "start_time": "2021-10-08T17:47:57.840309Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "9\n" + ] + } + ], + "source": [ + "# Example 2: \n", + "\n", + "def add_two_numbers ():\n", + " num_one = 3\n", + " num_two = 6\n", + " total = num_one + num_two\n", + " print(total)\n", + "add_two_numbers() # calling a function" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:58.053200Z", + "start_time": "2021-10-08T17:47:57.950659Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Milaan Parmar\n" + ] + } + ], + "source": [ + "# Example 3: \n", + "\n", + "def generate_full_name ():\n", + " first_name = 'Milaan'\n", + " last_name = 'Parmar'\n", + " space = ' '\n", + " full_name = first_name + space + last_name\n", + " print(full_name)\n", + "generate_full_name () # calling a function" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Defining a function without parameters and `return` value\n", + "\n", + "Function can also return values, if a function does not have a **`return`** statement, the value of the function is None. Let us rewrite the above functions using **`return`**. From now on, we get a value from a function when we call the function and print it." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:58.176733Z", + "start_time": "2021-10-08T17:47:58.057106Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "9\n" + ] + } + ], + "source": [ + "# Example 1: \n", + "\n", + "def add_two_numbers ():\n", + " num_one = 3\n", + " num_two = 6\n", + " total = num_one + num_two\n", + " return total\n", + "print(add_two_numbers())" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:58.298319Z", + "start_time": "2021-10-08T17:47:58.185523Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Milaan Parmar\n" + ] + } + ], + "source": [ + "# Example 2: \n", + "\n", + "def generate_full_name ():\n", + " first_name = 'Milaan'\n", + " last_name = 'Parmar'\n", + " space = ' '\n", + " full_name = first_name + space + last_name\n", + " return full_name\n", + "print(generate_full_name())" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Defining a function with parameters\n", + "\n", + "In a function we can pass different data types(number, string, boolean, list, tuple, dictionary or set) as a parameter." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Single Parameter: \n", + "\n", + "If our function takes a parameter we should call our function with an argument" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:58.422343Z", + "start_time": "2021-10-08T17:47:58.301246Z" + } + }, + "outputs": [], + "source": [ + "# Example 1: Gereeting\n", + "\n", + "def greet(name):\n", + " \"\"\"\n", + " This function greets to the person passed in as a parameter\n", + " \"\"\"\n", + " print(\"Hello, \" + name + \". Good morning!\") # No output!" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:58.545876Z", + "start_time": "2021-10-08T17:47:58.430154Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "55\n", + "None\n", + "5050\n", + "None\n" + ] + } + ], + "source": [ + "# Example 2: \n", + "\n", + "def sum_of_numbers(n):\n", + " total = 0\n", + " for i in range(n+1):\n", + " total+=i\n", + " print(total)\n", + "print(sum_of_numbers(10)) # 55\n", + "print(sum_of_numbers(100)) # 5050" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Two Parameter: \n", + "\n", + "A function may or may not have a parameter or parameters. A function may also have two or more parameters. If our function takes parameters we should call it with arguments." + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:58.652810Z", + "start_time": "2021-10-08T17:47:58.552712Z" + }, + "scrolled": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello Arthur Welcome to Python for Data Science\n", + "Your course name is Python\n" + ] + } + ], + "source": [ + "# Example 1: \n", + "\n", + "def course(name, course_name):\n", + " print(\"Hello\", name, \"Welcome to Python for Data Science\")\n", + " print(\"Your course name is\", course_name)\n", + "\n", + "course('Arthur', 'Python') # call function" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Defining a function with parameters and `return` value" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:58.761206Z", + "start_time": "2021-10-08T17:47:58.657692Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Milaan, welcome to Python for Data Science\n" + ] + } + ], + "source": [ + "# Example 1: \n", + "\n", + "def greetings (name): # single parameter\n", + " message = name + ', welcome to Python for Data Science'\n", + " return message\n", + "\n", + "print(greetings('Milaan'))" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:58.853005Z", + "start_time": "2021-10-08T17:47:58.764137Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "100\n" + ] + } + ], + "source": [ + "# Example 2: \n", + "\n", + "def add_ten(num): # single parameter\n", + " ten = 10\n", + " return num + ten\n", + "print(add_ten(90))" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:58.976051Z", + "start_time": "2021-10-08T17:47:58.855934Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "9\n" + ] + } + ], + "source": [ + "# Example 3: \n", + "\n", + "def square_number(x): # single parameter\n", + " return x * x\n", + "print(square_number(3))" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:59.084452Z", + "start_time": "2021-10-08T17:47:58.978980Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "314.0\n" + ] + } + ], + "source": [ + "# Example 4: \n", + "\n", + "def area_of_circle (r): # single parameter\n", + " PI = 3.14\n", + " area = PI * r ** 2\n", + " return area\n", + "print(area_of_circle(10))" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:59.192846Z", + "start_time": "2021-10-08T17:47:59.087380Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Addition : 36\n" + ] + } + ], + "source": [ + "# Example 5: \n", + "\n", + "def calculator(a, b): # two parameter\n", + " add = a + b \n", + " return add # return the addition\n", + "\n", + "result = calculator(30, 6) # call function & take return value in variable\n", + "print(\"Addition :\", result) # Output Addition : 36" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:59.299295Z", + "start_time": "2021-10-08T17:47:59.199687Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Full Name: Milaan Parmar\n" + ] + } + ], + "source": [ + "# Example 6: \n", + "\n", + "def generate_full_name (first_name, last_name): # two parameter\n", + " space = ' '\n", + " full_name = first_name + space + last_name\n", + " return full_name\n", + "print('Full Name: ', generate_full_name('Milaan','Parmar'))" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:59.422342Z", + "start_time": "2021-10-08T17:47:59.302224Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sum of two numbers: 10\n" + ] + } + ], + "source": [ + "# Example 7: \n", + "\n", + "def sum_two_numbers (num_one, num_two): # two parameter\n", + " sum = num_one + num_two\n", + " return sum\n", + "print('Sum of two numbers: ', sum_two_numbers(1, 9))" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:59.530738Z", + "start_time": "2021-10-08T17:47:59.425271Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Age: 202\n" + ] + } + ], + "source": [ + "# Example 8: \n", + "\n", + "def calculate_age (current_year, birth_year): # two parameter\n", + " age = current_year - birth_year\n", + " return age;\n", + "\n", + "print('Age: ', calculate_age(2021, 1819))" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:59.623513Z", + "start_time": "2021-10-08T17:47:59.533669Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Weight of an object in Newtons: 981.0 N\n" + ] + } + ], + "source": [ + "# Example 9: \n", + "\n", + "def weight_of_object (mass, gravity): # two parameter\n", + " weight = str(mass * gravity)+ ' N' # the value has to be changed to a string first\n", + " return weight\n", + "print('Weight of an object in Newtons: ', weight_of_object(100, 9.81))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Function `return` Statement\n", + "\n", + "In Python, to return value from the function, a **`return`** statement is used. It returns the value of the expression following the returns keyword.\n", + "\n", + "**Syntax:**\n", + "\n", + "```python\n", + "def fun():\n", + " statement-1\n", + " statement-2\n", + " statement-3\n", + " . \n", + " . \n", + " return [expression]\n", + "```\n", + "\n", + "The **`return`** value is nothing but a outcome of function.\n", + "\n", + "* The **`return`** statement ends the function execution.\n", + "* For a function, it is not mandatory to return a value.\n", + "* If a **`return`** statement is used without any expression, then the **`None`** is returned.\n", + "* The **`return`** statement should be inside of the function block." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Return Single Value" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:59.718728Z", + "start_time": "2021-10-08T17:47:59.626442Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello, Cory. Good morning!\n", + "None\n" + ] + } + ], + "source": [ + "print(greet(\"Cory\"))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here, **`None`** is the returned value since **`greet()`** directly prints the name and no **`return`** statement is used." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Passing Arguments with Key and Value\n", + "\n", + "If we pass the arguments with key and value, the order of the arguments does not matter." + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:59.854957Z", + "start_time": "2021-10-08T17:47:59.727520Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Milaan Parmar\n", + "None\n" + ] + } + ], + "source": [ + "# Example 1: \n", + "\n", + "def print_fullname(firstname, lastname):\n", + " space = ' '\n", + " full_name = firstname + space + lastname\n", + " print(full_name)\n", + "print(print_fullname(firstname = 'Milaan', lastname = 'Parmar'))" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:47:59.978006Z", + "start_time": "2021-10-08T17:47:59.860817Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "5\n", + "None\n" + ] + } + ], + "source": [ + "# Example 2:\n", + "\n", + "def add_two_numbers (num1, num2):\n", + " total = num1 + num2\n", + " print(total)\n", + "print(add_two_numbers(num2 = 3, num1 = 2)) # Order does not matter" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If we do not **`return`** a value with a function, then our function is returning **`None`** by default. To return a value with a function we use the keyword **`return`** followed by the variable we are returning. We can return any kind of data types from a function." + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:00.178202Z", + "start_time": "2021-10-08T17:47:59.981912Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Milaan Parmar\n" + ] + } + ], + "source": [ + "# Example 1: with return statement\n", + "\n", + "def print_fullname(firstname, lastname):\n", + " space = ' '\n", + " full_name = firstname + space + lastname\n", + " return full_name\n", + "print(print_fullname(firstname = 'Milaan', lastname = 'Parmar'))" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:00.286600Z", + "start_time": "2021-10-08T17:48:00.182107Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "5\n" + ] + } + ], + "source": [ + "# Example 2: with return statement\n", + "\n", + "def add_two_numbers (num1, num2):\n", + " total = num1 + num2\n", + " return total\n", + "print(add_two_numbers(num2 = 3, num1 = 2)) # Order does not matter" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:00.394507Z", + "start_time": "2021-10-08T17:48:00.300275Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2\n", + "4\n" + ] + } + ], + "source": [ + "# Example 3:\n", + "\n", + "def absolute_value(num):\n", + " \"\"\"This function returns the absolute\n", + " value of the entered number\"\"\"\n", + "\n", + " if num >= 0:\n", + " return num\n", + " else:\n", + " return -num\n", + "\n", + "print(absolute_value(2))\n", + "print(absolute_value(-4))" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:00.529768Z", + "start_time": "2021-10-08T17:48:00.400370Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Adding the two values\n", + "Printing within Function\n", + "30\n", + "total : 30\n", + "Hello\n", + "Rest of code\n" + ] + } + ], + "source": [ + "# Example 4:\n", + "\n", + "def sum(a,b): # Function 1\n", + " print(\"Adding the two values\")\n", + " print(\"Printing within Function\")\n", + " print(a+b)\n", + " return a+b\n", + "\n", + "def msg(): # Function 2\n", + " print(\"Hello\")\n", + " return\n", + "\n", + "total=sum(10,20)\n", + "print('total : ',total)\n", + "msg()\n", + "print(\"Rest of code\")" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:00.672343Z", + "start_time": "2021-10-08T17:48:00.537579Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Even numbers are: [2, 46, 72, 90]\n" + ] + } + ], + "source": [ + "# Example 5:\n", + "\n", + "def is_even(list1):\n", + " even_num = []\n", + " for n in list1:\n", + " if n % 2 == 0:\n", + " even_num.append(n)\n", + " # return a list\n", + " return even_num\n", + "\n", + "# Pass list to the function\n", + "even_num = is_even([2, 3, 46, 63, 72, 83, 90, 19])\n", + "print(\"Even numbers are:\", even_num)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Return Multiple Values\n", + "\n", + "You can also return multiple values from a function. Use the return statement by separating each expression by a comma." + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:00.795876Z", + "start_time": "2021-10-08T17:48:00.677226Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Addition: 12\n", + "Subtraction: 8\n", + "Multiplication: 20\n", + "Division: 5.0\n" + ] + } + ], + "source": [ + "# Example 1:\n", + "\n", + "def arithmetic(num1, num2):\n", + " add = num1 + num2\n", + " sub = num1 - num2\n", + " multiply = num1 * num2\n", + " division = num1 / num2\n", + " # return four values\n", + " return add, sub, multiply, division\n", + "\n", + "a, b, c, d = arithmetic(10, 2) # read four return values in four variables\n", + "\n", + "print(\"Addition: \", a)\n", + "print(\"Subtraction: \", b)\n", + "print(\"Multiplication: \", c)\n", + "print(\"Division: \", d)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Return Boolean Values" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:00.903786Z", + "start_time": "2021-10-08T17:48:00.803691Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "even\n", + "True\n", + "False\n" + ] + } + ], + "source": [ + "# Example 1:\n", + "\n", + "def is_even (n):\n", + " if n % 2 == 0:\n", + " print('even')\n", + " return True # return stops further execution of the function, similar to break \n", + " return False\n", + "print(is_even(10)) # True\n", + "print(is_even(7)) # False" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Return a List" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:01.028789Z", + "start_time": "2021-10-08T17:48:00.906718Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[0, 2, 4, 6, 8, 10]\n" + ] + } + ], + "source": [ + "# Example 1:\n", + "\n", + "def find_even_numbers(n):\n", + " evens = []\n", + " for i in range(n + 1):\n", + " if i % 2 == 0:\n", + " evens.append(i)\n", + " return evens\n", + "print(find_even_numbers(10))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## How to call a function in python?\n", + "\n", + "Once we have defined a function, we can call it from another function, program or even the Python prompt. To call a function we simply type the function name with appropriate parameters.\n", + "\n", + "
\n", + "\n", + "
" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:01.135232Z", + "start_time": "2021-10-08T17:48:01.031717Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello, Alan. Good morning!\n" + ] + } + ], + "source": [ + "greet('Alan')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ">**Note:** Try running the above code in the Python program with the function definition to see the output." + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:01.243633Z", + "start_time": "2021-10-08T17:48:01.140118Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Happy birthday, Bill. Hope you have a wonderful day!\n" + ] + } + ], + "source": [ + "# Example 1: \n", + "\n", + "def wish(name):\n", + " \"\"\"\n", + " This function wishes to the person passed in as a parameter\n", + " \"\"\"\n", + " print(\"Happy birthday, \" + name + \". Hope you have a wonderful day!\")\n", + "\n", + "wish('Bill')" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:01.446289Z", + "start_time": "2021-10-08T17:48:01.251445Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Clark, welcome to Python for Data Science\n", + "Milaan, welcome to Python for Data Science\n" + ] + } + ], + "source": [ + "# Example 2: \n", + "\n", + "def greetings (name = 'Clark'):\n", + " message = name + ', welcome to Python for Data Science'\n", + " return message\n", + "print(greetings())\n", + "print(greetings('Milaan'))" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:01.699688Z", + "start_time": "2021-10-08T17:48:01.454570Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Milaan Parmar\n", + "Ethan Hunt\n" + ] + } + ], + "source": [ + "# Example 3: \n", + "\n", + "def generate_full_name (first_name = 'Milaan', last_name = 'Parmar'):\n", + " space = ' '\n", + " full_name = first_name + space + last_name\n", + " return full_name\n", + "print(generate_full_name())\n", + "print(generate_full_name('Ethan','Hunt'))" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:01.793476Z", + "start_time": "2021-10-08T17:48:01.702617Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Age: 200\n" + ] + } + ], + "source": [ + "# Example 4: \n", + "\n", + "def calculate_age (birth_year,current_year = 2021):\n", + " age = current_year - birth_year\n", + " return age;\n", + "print('Age: ', calculate_age(1821))" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:01.900373Z", + "start_time": "2021-10-08T17:48:01.797831Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "value of x is: 9\n", + "value of y is: 6\n" + ] + } + ], + "source": [ + "# Example 5: \n", + "\n", + "def swap(x, y):\n", + " \"\"\"\n", + " This function swaps the value of two variables\n", + " \"\"\"\n", + " temp = x; # value of x will go inside temp\n", + " x = y; # value of y will go inside x\n", + " y = temp; # value of temp will go inside y\n", + " print(\"value of x is:\", x)\n", + " print(\"value of y is:\", y)\n", + " return # \"return\" is optional\n", + "\n", + "x = 6\n", + "y = 9\n", + "swap(x, y) #call function" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:02.023908Z", + "start_time": "2021-10-08T17:48:01.903301Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "9 is a Odd Number\n" + ] + } + ], + "source": [ + "# Example 6: \n", + "\n", + "def even_odd(n): \n", + " if n % 2 == 0: # check number is even or odd\n", + " print(n, 'is a Even number')\n", + " else:\n", + " print(n, 'is a Odd Number')\n", + "\n", + "even_odd(9) # calling function by its name" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:02.147933Z", + "start_time": "2021-10-08T17:48:02.026837Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Weight of an object in Newtons: 981.0 N\n", + "Weight of an object in Newtons: 162.0 N\n" + ] + } + ], + "source": [ + "# Example 7: \n", + "\n", + "def weight_of_object (mass, gravity = 9.81):\n", + " weight = str(mass * gravity)+ ' N' # the value has to be changed to string first\n", + " return weight\n", + "print('Weight of an object in Newtons: ', weight_of_object(100)) # 9.81 - average gravity on Earth's surface\n", + "print('Weight of an object in Newtons: ', weight_of_object(100, 1.62)) # gravity on the surface of the Moon" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "## Docstrings\n", + "\n", + "The first string after the function header is called the **docstring** and is short for documentation string. It is a descriptive text (like a comment) written by a programmer to let others know what block of code does.\n", + "\n", + "Although **optional**, documentation is a good programming practice. Unless you can remember what you had for dinner last week, always document your code.\n", + "\n", + "It is being declared using triple single quotes **`''' '''`** or triple-double quote **`\"\"\" \"\"\"`** so that docstring can extend up to multiple lines.\n", + "\n", + "We can access docstring using doc attribute **`__doc__`** for any object like list, tuple, dict, and user-defined function, etc.\n", + "\n", + "In the above example, we have a docstring immediately below the function header." + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:02.284654Z", + "start_time": "2021-10-08T17:48:02.154767Z" + }, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " This function greets to the person passed in as a parameter\n", + " \n" + ] + } + ], + "source": [ + "print(greet.__doc__)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To learn more about docstrings in Python, visit **[Python Docstrings](https://github.com/milaan9/04_Python_Functions/blob/main/Python_Docstrings.ipynb)**." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Function `pass` Statement\n", + "\n", + "In Python, the **`pass`** is the keyword, which wonโ€™t do anything. Sometimes there is a situation where we need to define a syntactically empty block. We can define that block using the **`pass`** keyword.\n", + "\n", + "When the interpreter finds a **`pass`** statement in the program, it returns no operation." + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": { + "ExecuteTime": { + "end_time": "2021-10-08T17:48:02.420395Z", + "start_time": "2021-10-08T17:48:02.294414Z" + } + }, + "outputs": [], + "source": [ + "# Example 1:\n", + "\n", + "def addition(num1, num2):\n", + " # Implementation of addition function in comming release\n", + " # Pass statement \n", + " pass\n", + "\n", + "addition(10, 2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## ๐Ÿ’ป Exercises โžž Functions\n", + "\n", + "### Exercises โžž Level 1\n", + "\n", + "1. Area of a circle is calculated as follows: **area = ฯ€ x r x r** and **perimeter = 2 x ฯ€ x r**. Write a function that calculates **`area_of_circle`** and **`perimeter_of_circle`**.\n", + "2. Write a function called **`add_all_nums`** which takes arbitrary number of arguments and sums all the arguments. Check if all the list items are number types. If not do give a reasonable feedback.\n", + "3. Temperature in **ยฐC** can be converted to **ยฐF** using this formula: **ยฐF = (ยฐC x 9/5) + 32**. Write a function which converts **ยฐC to ยฐF**, **`convert_celsius_2_fahrenheit`**.\n", + "4. Write a function called **`check_season`**, it takes a month parameter and returns the season: Autumn, Winter, Spring or Summer.\n", + "5. Write a function called **`calculate_slope`** which return the slope of a linear equation\n", + "6. Quadratic equation is calculated as follows: **axยฒ + bx + c = 0**. Write a function which calculates solution set of a quadratic equation, **`solve_quadratic_eqn`**.\n", + "7. Declare a function named **`print_list`**. It takes a list as a parameter and it prints out each element of the list.\n", + "8. Declare a function named **`reverse_list`**. It takes an array as a parameter and it returns the reverse of the array (use loops).\n", + "\n", + " - ```py\n", + "print(reverse_list([1, 2, 3, 4, 5]))\n", + "#[5, 4, 3, 2, 1]\n", + "print(reverse_list1([\"A\", \"B\", \"C\"]))\n", + "#[\"C\", \"B\", \"A\"]\n", + " ```\n", + "\n", + "9. Declare a function named **`capitalize_list_items`**. It takes a list as a parameter and it returns a capitalized list of items\n", + "10. Declare a function named **`add_item`**. It takes a list and an item parameters. It returns a list with the item added at the end.\n", + "\n", + " - ```py\n", + "food_staff = ['Potato', 'Tomato', 'Mango', 'Milk']\n", + "print(add_item(food_staff, 'Fungi')) #['Potato', 'Tomato', 'Mango', 'Milk', 'Fungi']\n", + "numbers = [2, 3, 7, 9]\n", + "print(add_item(numbers, 5)) #[2, 3, 7, 9, 5]\n", + " ```\n", + "\n", + "11. Declare a function named **`remove_item`**. It takes a list and an item parameters. It returns a list with the item removed from it.\n", + "\n", + " - ```py\n", + "food_staff = ['Potato', 'Tomato', 'Mango', 'Milk']\n", + "print(remove_item(food_staff, 'Mango')) # ['Potato', 'Tomato', 'Milk']\n", + "numbers = [2, 3, 7, 9]\n", + "print(remove_item(numbers, 3)) # [2, 7, 9]\n", + " ```\n", + "\n", + "12. Declare a function named **`sum_of_numbers`**. It takes a number parameter and it adds all the numbers in that range.\n", + "\n", + " - ```py\n", + "print(sum_of_numbers(5)) # 15\n", + "print(sum_all_numbers(10)) # 55\n", + "print(sum_all_numbers(100)) # 5050\n", + " ```\n", + "\n", + "13. Declare a function named **`sum_of_odds`**. It takes a number parameter and it adds all the odd numbers in that range.\n", + "14. Declare a function named **`sum_of_even`**. It takes a number parameter and it adds all the even numbers in that - range.\n", + "\n", + "### Exercises โžž Level 2\n", + "\n", + "1. Declare a function named **`evens_and_odds`**. It takes a positive integer as parameter and it counts number of evens and odds in the number.\n", + "\n", + " - ```py\n", + " print(evens_and_odds(100))\n", + " #The number of odds are 50.\n", + " #The number of evens are 51.\n", + " ```\n", + "\n", + "2. Call your function **`factorial`**, it takes a whole number as a parameter and it return a factorial of the number\n", + "3. Call your function **`is_empty`**, it takes a parameter and it checks if it is empty or not\n", + "4. Write different functions which take lists. They should **`calculate_mean`**, **`calculate_median`**, **`calculate_mode`**, **`calculate_range`**, **`calculate_variance`**, **`calculate_std`** (standard deviation).\n", + "\n", + "### Exercises โžž Level 3\n", + "\n", + "1. Write a function called **`is_prime`**, which checks if a number is prime.\n", + "2. Write a functions which checks if all items are unique in the list.\n", + "3. Write a function which checks if all the items of the list are of the same data type.\n", + "4. Write a function which check if provided variable is a valid python variable\n", + "5. Go to the data folder and access the **[countries-data.py](https://github.com/milaan9/03_Python_Flow_Control/blob/main/countries_details_data.py)** file.\n", + "\n", + "- Create a function called the **`most_spoken_languages`** in the world. It should return 10 or 20 most spoken languages in the world in descending order\n", + "- Create a function called the **`most_populated_countries`**. It should return 10 or 20 most populated countries in descending order." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "gist": { + "data": { + "description": "01_Learn_Python4Data/04_Python_Functions/001_Python_Functions.ipynb", + "public": true + }, + "id": "" + }, + "hide_input": false, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.8" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": false, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": {}, + "toc_section_display": true, + "toc_window_display": false + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 13acd69541b5e7bc987154989411e6570806eed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Fri, 12 Nov 2021 23:13:38 +0530 Subject: [PATCH 44/49] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 817a87b..1286f0a 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ These are online **read-only** versions. However you can **`Run โ–ถ`** all the You can Star Badge and Fork Badge Starring and Forking is free for you, but it tells me and other people that it was helpful and you like this tutorial. -Go [**`here`**](https://github.com/milaan9/04_Python_Functions) if you aren't here already and click โžž **`โœฐ Star`** and **`โต– Fork`** button in the top right corner. You will be asked to create a GitHub account if you don't already have one. +Go [**`here`**](https://github.com/milaan9/04_Python_Functions) if you aren't here already and click โžž **`โœฐ Star`** and **`โต– Fork`** button in the top right corner. You'll be asked to create a GitHub account if you don't already have one. --- From 0e207eff7980af6cdc025e6272ac18a5fc5713b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Tue, 16 Nov 2021 20:54:27 +0800 Subject: [PATCH 45/49] Delete 067_Python___import__().ipynb --- .../067_Python___import__().ipynb | 164 ------------------ 1 file changed, 164 deletions(-) delete mode 100644 002_Python_Functions_Built_in/067_Python___import__().ipynb diff --git a/002_Python_Functions_Built_in/067_Python___import__().ipynb b/002_Python_Functions_Built_in/067_Python___import__().ipynb deleted file mode 100644 index b8189ca..0000000 --- a/002_Python_Functions_Built_in/067_Python___import__().ipynb +++ /dev/null @@ -1,164 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "All the IPython Notebooks in this lecture series by Dr. Milan Parmar are available @ **[GitHub](https://github.com/milaan9/04_Python_Functions/tree/main/002_Python_Functions_Built_in)**\n", - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Python `__import__()`\n", - "\n", - "The **`__import__()`** is a function that is called by the import statement.\n", - "\n", - "**Syntax**:\n", - "\n", - "```python\n", - "__import__(name, globals=None, locals=None, fromlist=(), level=0)\n", - "```" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## `__import__()` Parameter\n", - "\n", - "* **name** - the name of the module you want to import\n", - "* **globals** and **locals** - determines how to interpret **`name`**\n", - "* **fromlist** - objects or submodules that should be imported by name\n", - "* **level** - specifies whether to use absolute or relative imports" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Use of `__import__()` is Discouraged\n", - "\n", - "This **`__import__()`** function is not necessary for everyday Python program. It is rarely used and often discouraged.\n", - "\n", - "This function can be used to change the semantics of the **[import statement](https://github.com/milaan9/04_Python_Functions/blob/main/007_Python_Function_Module.ipynb)** as the statement calls this function. Instead, it is better to use import hooks.\n", - "\n", - "And, if you want to import a module by name, use **[importlib.import_module()](https://docs.python.org/3/library/importlib.html#importlib.import_module)**." - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "scrolled": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "2.5\n" - ] - } - ], - "source": [ - "# Example: How __import()__ works?\n", - "\n", - "mathematics = __import__('math', globals(), locals(), [], 0)\n", - "print(mathematics.fabs(-2.5))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The **`fabs()`** method is defined in the **`math`** module. You can call this function using the following syntax:\n", - "\n", - "```python\n", - "import math\n", - "math.fabs(x)\n", - "```\n", - "\n", - "However, in the above program, we changed the way **`fabs()`** works. Now, we can also access **`fabs()`** using the following syntax:\n", - "\n", - "```python\n", - "mathematics.fabs(x)\n", - "```" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "hide_input": false, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.8" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false - }, - "varInspector": { - "cols": { - "lenName": 16, - "lenType": 16, - "lenVar": 40 - }, - "kernels_config": { - "python": { - "delete_cmd_postfix": "", - "delete_cmd_prefix": "del ", - "library": "var_list.py", - "varRefreshCmd": "print(var_dic_list())" - }, - "r": { - "delete_cmd_postfix": ") ", - "delete_cmd_prefix": "rm(", - "library": "var_list.r", - "varRefreshCmd": "cat(var_dic_list()) " - } - }, - "types_to_exclude": [ - "module", - "function", - "builtin_function_or_method", - "instance", - "_Feature" - ], - "window_display": false - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From 0e776b98dd6349efe2789ded1d54ccb453325414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Tue, 16 Nov 2021 20:54:39 +0800 Subject: [PATCH 46/49] Add files via upload --- .../002_Seaborn_Controlling_Aesthetics.ipynb | 581 ++++++++++++++++++ 1 file changed, 581 insertions(+) create mode 100644 002_Python_Functions_Built_in/002_Seaborn_Controlling_Aesthetics.ipynb diff --git a/002_Python_Functions_Built_in/002_Seaborn_Controlling_Aesthetics.ipynb b/002_Python_Functions_Built_in/002_Seaborn_Controlling_Aesthetics.ipynb new file mode 100644 index 0000000..a678980 --- /dev/null +++ b/002_Python_Functions_Built_in/002_Seaborn_Controlling_Aesthetics.ipynb @@ -0,0 +1,581 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "All the IPython Notebooks in **[Python Seaborn Module](https://github.com/milaan9/12_Python_Seaborn_Module)** lecture series by **[Dr. Milaan Parmar](https://www.linkedin.com/in/milaanparmar/)** are available @ **[GitHub](https://github.com/milaan9)**\n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\"Open" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Controlling Aesthetics of Seaborn Plots" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "One of the biggest advantages of Seaborn over Matplotlib is that its default aesthetics are visually far more appealing. Undoubtedly Matplotlib is highly customizable, but sometimes it may get difficult to know exact settings to tweak in order to achieve an attractive plot. Whereas, Seaborn comes with a number of customized themes and a high-level interface for controlling the look of same matplotlib figures.\n", + "\n", + "Seaborn splits Matplotlib parameters into two independent groups: *First* group sets the aesthetic style of the plot; and *second* scales various elements of the figure to get easily incorporated into different contexts." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Seaborn doesnโ€™t take away any of Matplotlib credits, but rather adds some nice default aesthetics and built-in plots that complement and sometimes replace the complicated Matplotlib code professionals needed to write. *Facet plots* and *Regression plots* are an example of that. In this lecture I shall show how easy it is to build a *Regression plot* using Seaborn and then let us compare it by building something similar in Matplotlib." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ">**Note** (for non-native English speakers): The term *Aesthetics* just refers to the appearance of the figure/plot." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "ExecuteTime": { + "end_time": "2021-07-16T14:23:04.768850Z", + "start_time": "2021-07-16T14:23:02.634110Z" + } + }, + "outputs": [], + "source": [ + "# Importing intrinsic libraries:\n", + "import numpy as np\n", + "import pandas as pd\n", + "import matplotlib.pyplot as plt\n", + "import seaborn as sns" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now, once we have imported necessary libraries, let us begin talking about aesthetics with those 2 special lines of code we had added in our previous lecture. Our first line of code was:" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "ExecuteTime": { + "end_time": "2021-07-16T14:23:11.678443Z", + "start_time": "2021-07-16T14:23:11.656963Z" + } + }, + "outputs": [], + "source": [ + "%matplotlib inline" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**`%matplotlib`** is one of the *magic function* of Jupyter Notebook that along with **`inline`** **[sets the backend of matplotlib](http://ipython.readthedocs.io/en/stable/interactive/plotting.html)** to the *inline* backend within Jupyter notebook. If we look into relevant documentation, it says:\n", + "\n", + "IPython has a set of predefined **โ€˜magic functionsโ€™** that you can call with a command line style syntax. There are two kinds of magics: line-oriented and cell-oriented. \n", + "\n", + "1. Line magics are prefixed with the **`%`** character and work much like OS command-line calls: they get as an argument the rest of the line, where arguments are passed without parentheses or quotes. Lines magics can return results and can be used in the right hand side of an assignment. \n", + "\n", + "2. Cell magics are prefixed with a double **`%%`**, and they are functions that get as an argument not only the rest of the line, but also the lines below it in a separate argument.\n", + "\n", + "With this backend, the output of plotting commands is displayed inline within frontends like the Jupyter notebook, directly below the code cell that produced it. The resulting plots will then also be stored in the notebook document.\n", + "\n", + "Furthermore, if we want interactivity as well, we can use **`nbagg`** backend with **`%matplotlib`** notebook (in IPython 3.x). Though we won't be getting into that extremely advanced level of Matplotlib specific presentation here, but if that interest you, please check **[here](https://matplotlib.org/users/whats_new.html#the-nbagg-backend)**.\n", + "\n", + "Let us now move on to our second line of code:" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "ExecuteTime": { + "end_time": "2021-07-16T14:25:25.755122Z", + "start_time": "2021-07-16T14:25:25.737547Z" + } + }, + "outputs": [], + "source": [ + "sns.set()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Seaborn runs on top of Matplotlib and with that as a default comes a *White* background for each of our plot, that looks pretty dull. With this line of code, we switch our plot to Seaborn default using **`.set()`** function. Let us look into what it yields, using one of the built-in dataset:" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "ExecuteTime": { + "end_time": "2021-07-16T14:25:37.203243Z", + "start_time": "2021-07-16T14:25:36.597297Z" + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEJCAYAAACdePCvAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAUxElEQVR4nO3df3AU9eHG8eeSI0HkV8AEUTMMSKbQdkRQSKJAACUEJIAkTYNMGGlVaBG+YqcQEUox8qOUymClk2KZWoVOTSggZCQDNMBI4+BApmHsVKo1IWakISIJBMJx5O77B/U0LTmO5HY3yef9+ueyXPb24cNxz+3u7edcfr/fLwCAcSKcDgAAcAYFAACGogAAwFAUAAAYigIAAENRAABgKAoAAAzldjrArTp//pJ8Pi5dAIBQRES4FBNz+w3v63AF4PP5KQAACAMOAQGAoSgAADAUBQAAhqIAAMBQFAAAGIoCAABDUQAA0AplZce1atWLKis77nSUVutw1wEAQHtQWPhHVVR8qitXGjVixINOx2kV9gAAoBUaG680u+2IKAAAMBQFAACGogAAwFAUAAAYigIADNEZPraI8OJjoIAhOsPHFhFe7AEAhugMH1tEeFEAAGAoCgAADEUBAIChKAAAMBQFAACGogAAwFAUAAAYigIAAENxJTCADqd3jyh16RrtaIbISFfgNja2h2M5vFc8qrt4tVXrUgAAOpwuXaP17py5jma4/O+awK2TWaa8+XuplQXAISAAMBQFAACGogDQrjGFMWAdzgGgXWMKY8A67AGgXWMKY8A6FAAAGIoCAABDWXoO4LXXXtO+ffskSSkpKVqyZIlKS0u1du1aeTweTZ48WYsXL7YyAtBu9OwVreioKMe2314uXJIkz9WrulDvcTQDLCyA0tJSHT16VLt27ZLL5dJTTz2loqIibdiwQW+99Zb69++vefPm6ciRI0pJSbEqBtBuREdF6cnf/59j26+5UBu4dTKHJL0xd5MkCsBplh0Cio2NVW5urqKiotSlSxfde++9qqys1IABAxQfHy+326309HQVFxdbFQEAEIRlBZCQkKD7779fklRZWal9+/bJ5XIpNjY28DtxcXGqqamxKgIAIAjLrwP4+OOPNW/ePC1ZskSRkZGqrKwM3Of3++VyuW7p8fr27R7mhGjP2tNxa4QX/57h09qxtLQATpw4oUWLFmnZsmV67LHH9MEHH6i2tjZwf21treLi4m7pMc+da5DP5w93VLRTTU3+wG1t7UWH07QNL3jNteXfk7FsLthYRkS4WnzjbNkhoDNnzmjBggXasGGDHnvsMUnSsGHDVFFRodOnT6upqUlFRUUaO3asVREcwdQFADoKy/YAtm7dKo/Ho3Xr1gX+LDs7W+vWrdPChQvl8XiUkpKitLQ0qyI4gqkLAHQUlhXA8uXLtXz58hvet2fPHqs26zimLgDM0CXCJTX957aD4kpgAGiFh3v2VnxUtB7u2dvpKK3GbKAA0AqDut6mQV1vczpGm7AHAACGogAAwFAUAAAYigIAAENRAABgKAoAMISrS0SzW4BnAmCIXvf1U3S/29Xrvn5OR0E7wXUAgCFuu6eHbruHSdTwN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rwWL16sBQsWqFu3burevbtGjhypqqqqwHozZ85UXl5eu/5GKJiN2UABC/h8Pr300ku666679MwzzzgdB7ghDgEBYdbQ0KDExESdOXNGc+bMcToO0CL2AADAUOwBAIChKAAAMBQFAACGogAAwFAUAAAYigIAAEP9P+2R72VC+UXwAAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "tips = sns.load_dataset(\"tips\")\n", + "\n", + "sns.barplot(x = \"day\", y = \"total_bill\", data = tips)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ">**Note:** **`sns.set()`** needs to be explicitly called ONLY in Seaborn v0.8 and above." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "With both the lines of code explained, let us now look into what else can we do to vary appearance of our plot. Earlier we spoke about Seaborn segregating Matplotlib parameters into 2 independent groups: *Styling* and *Scaling* of figures.\n", + "\n", + "Let us begin by delving into *Styling* aspect, that is controlled by using **`sns.axes_style()`** and **`sns.set_style()`** functions." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "ExecuteTime": { + "end_time": "2021-07-16T14:26:06.035458Z", + "start_time": "2021-07-16T14:26:05.676092Z" + }, + "scrolled": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEJCAYAAACdePCvAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAb8klEQVR4nO3dfXAU9eHH8c+RI0EEJRkTQYlMorQ+MChlANMBAuHBA40gQTxniiO1KSgNM6iVQH2oor9EamWgYhkZq606jZACYgavBgJUxIcxKExQRAxJoGiIzQNJkCO53O+PmCup5AjJbvbu9v36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5s2BWV+l1gepzJw5U+vXr9e7776rY8eOaefOnXK5XKqoqNBXX30lSdqwYYPuuOMORUdHW/lrAD9CAQDn8cEHH2jKlCnq16+fnE6nMjIyJEm//e1vFRcXp3Xr1un3v/+9Tpw4oVOnTik6Olp33nmnNmzYIJ/Pp02bNmnOnDkW/xbAjzEXENAJZ8+YEhUVJUl68MEH5fP5NG3aNE2YMEHffPNN4Ofcbrdmz56t0aNHa+jQoUpMTLQkNxAMRwDAeYwfP14ej0cnT55US0tL4HkFu3fv1sKFCzV9+nRJ0r59+wKzag4aNEg33XST/u///k933323ZdmBYDgCAM4jNTVVX375pTIyMnTJJZfo2muvVU1NjRYvXqyFCxeqb9++6tevn0aNGqWKiorA+2bNmqXly5eH9BOhYG/MBgqYoKWlRU899ZSuuOIK/frXv7Y6DnBOnAICDNbQ0KAxY8bom2++0T333GN1HKBDHAEAgE1xBAAANkUBAIBNUQAAYFMUAADYFAUAADZFAQCATf0/iiDqr74iWgIAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "sns.set_style(\"whitegrid\")\n", + "sns.boxplot(x = \"day\", y = \"total_bill\", data = tips)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Few common background options include: **`whitegrid`** (as shown above), **`dark`** (for solid grey color), **`white`** (this is default) and **`ticks`**. Let us explore an example with **`ticks`** as background and then try to remove top and right axes spines:" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "ExecuteTime": { + "end_time": "2021-07-16T14:26:35.532704Z", + "start_time": "2021-07-16T14:26:35.216303Z" + }, + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEJCAYAAACdePCvAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zL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FwaOTIkfrggw8ktfy/+uyzz6p///5yOp1Wxg8rHW3LBQsW6Cc/+YmWL1+uoqIijRw50uKkXcdUEABgU5wCAgCbogAAwKYoAACwKQoAAGyKAgAAm6IAgAvkdruDc78AkYwCAACbogCATli1apXGjx+vGTNmqLS0VJJ09OhRzZkzRzNnztTYsWN13333yefzadu2bXK5XMFlv/jiC40cOVJnzpyxKj7QLgoAOI8dO3bozTff1NatW4OzvkotD1KZNm2aNm7cqDfffFNVVVXavXu3nE6nKisr9emnn0qSNm3apOzsbPXu3dvKXwM4BwUAnMc777yjCRMm6JJLLlFsbKxycnIkSb/5zW+UkJCg559/Xr/73e904sQJnT59Wr1799bPfvYzbdq0SX6/X1u2bNHMmTMt/i2AczEXENAJZ8+YEhMTI0l68MEH5ff7NWnSJI0ZM0Zffvll8PtcLpdmzJih4cOHa8iQIUpNTbUkNxAKRwDAeYwePVput1v19fVqbm4OPq9g7969WrBggSZPnixJ+vDDD4Ozag4cOFA//vGP9X//93+66667LMsOhMIRAHAeGRkZ+uSTT5STk6O4uDhde+21qq2t1aJFi7RgwQL169dPl1xyiYYNG6bKysrgctOnT9fy5cvD+olQsDdmAwVM0NzcrCeeeEJXXHGFfvWrX1kdB2gXp4AAg506dUojRozQl19+qbvvvtvqOECHOAIAAJviCAAAbIoCAACbogAAwKYoAACwKQoAAGyKAgAAm/p/tkbYc3GJ1zAAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "sns.set_style(\"ticks\")\n", + "sns.boxplot(x=\"day\", y=\"total_bill\", data=tips)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the above plot we observe 2 changes:\n", + "\n", + "- There are no horizontal line/grid in the background, that we had in previous figure.\n", + "- There are **`ticks`** on X and Y axes, representing the axis interval.\n", + "\n", + "We still have top and right axes spine so let's get rid of that now:" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "ExecuteTime": { + "end_time": "2021-07-16T14:26:43.971574Z", + "start_time": "2021-07-16T14:26:43.688376Z" + } + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEJCAYAAACdePCvAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAbmElEQVR4nO3df3AU9eHG8eeSE5BKJBkTgyYyRJmq7WipBUwHCIQfHmCEEIrnpEipUlAMM1grgYpW0W8itTLQQBkda6k6jWABMYNXQwJURGWUqQwoVg1JSPVCbBIiYo78uO8fMVciyRGS3ezd7fs145i73N4+2dF7bvez+1mH3+/3CwBgO1FWBwAAWIMCAACbogAAwKYoAACwKQoAAGwqbAqgublZVVVVam5utjoKAESEsCkAr9eriRMnyuv1Wh0FACJC2BQAAMBYFAAA2BQFAAA2RQEAgE1RAABgUxQAYBO1tbXKzc1VXV2d1VEQIigAwCYKCwv14YcfqrCw0OooCBEUAGADtbW1Kikpkd/v165du9gLgCTJaeabz507V7W1tXI621bz2GOP6euvv1ZeXp58Pp+mTp2qpUuXmhkBgNq+/be2tkqSWltbVVhYqHvuucfiVLCaaQXg9/tVXl6u3bt3BwqgsbFRLpdLL7zwgoYMGaKFCxdq7969SktLMysGAEl79uwJTKPS3Nys3bt3UwAw7xBQWVmZJOmXv/ylbrvtNr344os6dOiQhg4dquTkZDmdTmVkZMjj8ZgVAcC3xo8fH/gi5nQ6NWHCBIsTIRSYtgfQ0NCg1NRUrVy5Uk1NTbrzzjt19913Kz4+PvCahIQEVVdXd7psQ0NDh+eYAwjoObfbrZKSEklSVFSU3G63xYkQCkwrgBEjRmjEiBGBx7Nnz9a6det00003BZ7z+/1yOBznLLtp0yYVFBSYFQ2wnbi4OE2cOFEej0eTJk1SbGys1ZEQAkwrgPfee09NTU1KTU2V1PZhf+WVV6qmpibwmpqaGiUkJJyz7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vroI/Xr108Oh0OLFi3S6NGjVVxcHLjJUnR0dOBn/E9X2/K6665TbGysPv30U0lt8+yHK/YATPLTn/5Uf//73+VyuTRs2DDddNNNVkeCDdx888267777tGjRosBe59ixY7V+/Xrl5uZq6tSpcjgcGjNmjN5//31Jbf+tPv300xo0aJBcLpeV8UNKV9ty8eLF+vGPf6xVq1apoKBAY8aMsThpzzEVBADYFIeAAMCmKAAAsCkKAABsigIAAJuiAADApigA4AJ5PJ7A3C9AOKMAAMCmKACgG9auXatJkyZp9uzZKi4uliQdO3ZM8+fP15w5czRhwgTdc8898vl82rFjh9xud2DZzz//XGPGjNGZM2esig90igIAzmPXrl164403tH379sCsr1LbjVRmzpypzZs364033lBVVZX27Nkjl8ulyspKffLJJ5KkLVu2KDMzU/369bPyzwDOQQEA5/H2229r8uTJuuSSS+R0OpWVlSVJ+s1vfqO4uDg9++yz+t3vfqcTJ07o9OnT6tevn372s59py5Ytamlp0bZt2zRnzhyL/wrgXMwFBHTD2TOmREdHS5Luv/9+tbS0aOrUqRo/fry++OKLwOvcbrdmz56tUaNGafjw4UpOTrYkNxAMewDAeYwbN04ej0cNDQ1qbW0N3K9g3759Wrx4saZNmyZJ+uCDDwKzag4ZMkQ/+tGP9H//93+64447LMsOBMMeAHAeaWlp+vjjj5WVlaWYmBhde+21qqur09KlS7V48WINHDhQl1xyiUaOHKnKysrAcrNmzdKqVatC+o5QsDdmAwVM0Nraqscee0xXXHGFfvWrX1kdB+gUh4AAg506dUqjR4/WF198oTvvvNPqOECX2AMAAJtiDwAAbIoCAACbogAAwKYoAACwKQoAAGyKAgAAm/p//s27qV0IugAAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "sns.set_style(\"ticks\")\n", + "sns.boxplot(x=\"day\", y=\"total_bill\", data=tips)\n", + "sns.despine()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If we also want to despine left axis, we just need to alter our last line of code by adding a parameter: **`(left=True)`**, and it shall fetch:" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "ExecuteTime": { + "end_time": "2021-07-16T14:26:53.458287Z", + "start_time": "2021-07-16T14:26:53.175091Z" + } + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEJCAYAAACdePCvAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAbVUlEQVR4nO3df3AU9f3H8dclZ/hROcmNRNDEDFGmajta6gCmAwTCDw8wQgjFc1qkVCkohBmslUBFq+g3kVoZKFhGx9pUnaZgATGDVwMBKqIyylQGFKuGJFAhxF7CiciRH/f9I+YKTXLEZDd7d/t8zDBk925v39mBe+1nP5/9rCMUCoUEALCdBKsLAABYgwAAAJsiAADApggAALApAgAAbIoAAACbIgAAwKYIAACwKQIAAGyKAAAAmyIAAMCmCAAAsCkCALAJv9+vgoIC1dXVWV0KogQBANhESUmJPvzwQ5WUlFhdCqIEAQDYgN/v144dOxQKhbR9+3ZaAZAkOc388FmzZsnv98vpbNnNY489pq+++kqFhYUKBoOaNGmSFi9ebGYJANRy9t/c3CxJam5uVklJie69916Lq4LVTAuAUCikyspK7dy5MxwAZ8+elcfj0YsvvqhBgwZp3rx52r17t7KysswqA4CkXbt2qbGxUZLU2NionTt3EgAw7xJQRUWFJOnnP/+5br/9dr300ks6cOCA0tPTlZaWJqfTqZycHPl8PrNKAPCNMWPGhE/EnE6nxo4da3FFiAamtQACgYAyMzO1fPlyNTQ06K677tI999yjAQMGhN+TkpKimpqadrcNBAJt1rtcLrlcLrNKBuKW1+vVjh07JEkJCQnyer0WV4RoYFoADB06VEOHDg0vz5gxQ2vWrNHNN98cXhcKheRwONpsW1xcrLVr17ZZv3DhQuXn55tTMBDH3G63xo0bJ5/Pp/Hjxys5Odn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9SH/729/k8Xg0ePBg3XzzzVaXBBu45ZZbtHDhQs2fPz/c6hw1apTWrVungoICTZo0SQ6HQyNHjtT7778vqeXf6tNPP61+/frJ4/FYWX5U6ehYLliwQD/84Q+1YsUKrV27ViNHjrS40q5jKggAsCkuAQGATREAAGBTBAAA2BQBAAA2RQAAgE0RAMC35PP5wnO/ALGMAAAAmyIAgE5YvXq1xo8frxkzZqisrEySdOTIEc2ZM0czZ87U2LFjde+99yoYDGrr1q3yer3hbT///HONHDlS586ds6p8oF0EAHAR27dv1xtvvKEtW7aEZ32VWh6kMm3aNG3YsEFvvPGGjh07pl27dsnj8ai6ulqffPKJJGnjxo3Kzc1VUlKSlb8G0AYBAFzE22+/rQkTJujSSy+V0+lUXl6eJOlXv/qV3G63nnvuOf3mN7/RyZMndebMGSUlJenHP/6xNm7cqKamJm3evFkzZ860+LcA2mIuIKATzp8xJTExUZJ0//33q6mpSZMmTdKYMWN0/Pjx8Pu8Xq9mzJih4cOHa8iQIUpLS7OkbiASWgDARYwePVo+n0+BQEDNzc3h5xXs2bNHCxYs0OTJkyVJH3zwQXhWzUGDBukHP/iB/u///k933nmnZbUDkdACAC4iKytLH3/8sfLy8uRyuXTdddeprq5Oixcv1oIFC9S3b19deumlGjZsmKqrq8PbTZ8+XStWrIjqJ0LB3pgNFDBBc3OzHnvsMV155ZX6xS9+YXU5QLu4BAQY7PTp0xoxYoSOHz+uu+66y+pygA7RAgAAm6IFAAA2RQAAgE0RAABgUwQAANgUAQAANkUAAIBN/T/1kZNXZ0NAOQAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "sns.set_style(\"ticks\")\n", + "sns.boxplot(x=\"day\", y=\"total_bill\", data=tips)\n", + "sns.despine(left=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now let us try to temporarily visualize two types of background in a single plot. For this, we shall use **`.axes_style()`** as follows:" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "ExecuteTime": { + "end_time": "2021-07-16T14:27:02.062201Z", + "start_time": "2021-07-16T14:27:01.492871Z" + } + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXMAAAD7CAYAAACYLnSTAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAADfH0lEQVR4nOyddZhV5dqH790x3Z1MMMQwQ3d3C4iigt3HPrYeP/XY7bETFUWQEEFCumtgmmG6u2v33uv7YwSFqT0jNbrv6+K6mJn1rve3117rWW88IRIEQcCGDRs2bPRoxJdbgA0bNmzY+OvYjLkNGzZs/A2wGXMbNmzY+BtgM+Y2bNiw8TfAZsxt2LBh42+AzZjbsGHDxt8AmzG3YcOGjb8B0svVcW1tMxZL113c3dzsqa5uugiKLg49SW9P0go9S29P0go9S29P0grd1ysWi3BxsWv375fNmFssQreM+Zm2PYmepLcnaYWepbcnaYWepbcnaYWLo/eyGfMrifIaDVUNOsxmAbPZgrODgiAvB8Ri0eWWZuMKwGS2UF2vo6xGQ7POiLuTCi9XNY5qGSKR7R6xAc06IzklDZgtAhKxCJlETJC3AyrFpTOx/1hjXljRxNFT5cRnVlJarWn1dzullN5BLgyO9GRIlCdi20P7j0IQBFLzatgRV0Rqbg3mNkZSDmoZY6J9mTjQD1dH5WVQaeNyUt+kZ3d8MSm5NeSWNnB+YhSpRERUkCux4e4M6+N10Q37P86YN2gMrNubzf7EUsRiEZGBzkwc6E+Apz0SiQiJWER5jZbUvBpO5dVwIr2SLUfzuWZiOFFBLpdbvo1LwIn0Stbvz6GkqhlHOzmTB/vj72GPl6saO6WUyjod5bUaTufXsuVoPluPFjC4twfXTAzHxUFxueXbuMjojWZ+O1bA5qMFGIxmQn0dmTMymKggF+QyCWaLgE5vIjWvhviMKr7dls6GA7ksnhDG8L5eF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1+IiIhg+/bt99usJomLi+P333/n6NGjnDx5ErFYzMaNG++3Wc3SFu+13NxcnnvuOR577DG6dOlyv81pktOnT5Odnc1jjz12z4/dZpy5jY3NDflcqJeBvPnV5UHj0qVLPP/887z11ls88sgj99ucZtmzZw+nT59mzJgxrFu3jiNHjrBs2bL7bVajWFhY0K1bN8zMzNDR0WHgwIEP7BsawKlTp+jWrRvm5ubIZDIeffRRQkND77dZzdLW7rXk5GSefPJJHnnkEV577bX7bU6z7Nq1i8TERMaMGcP8+fOJioq6d2+W9yz6/i9zfQO0sLBQqKqqEkaPHi2Eh4ffb7MaJSsrS+jSpYtw5syZ+21Kq/n9998f6A3QsLAwYciQIUJpaamgUCiEqVOnCr/++uv9NqtJTp48KYwePVqorKwUVCqV8N577wnr1q2732Y1Sr9+/YSMjAyhpqZG6N27t3D16lVBoVAIkydPFvbs2XO/zbuF67aWl5cLffr0EbZv336/TWqW6/bezLlz5+7pBmibiZlbW1szc+ZMnn32WeRyOY8//jhBQUH326xG2bhxI7W1taxYseLG/3vyySeZMGHCfbTq4SA4OJgXX3yRp556CrlcTo8ePf6VV9Z7Rc+ePYmJieHRRx9FKpUSGBjIlClT7rdZzaKtrc2KFSuYNm0atbW19OnTh6FDh95vsxpl27ZtFBQUsGnTJjZt2gRA//79mT59+n227L9HU86vQYMGDQ8BbSZmrkGDBg0amkbjzDVo0KDhIUDjzDVo0KDhIUDjzDVo0KDhIUDjzDVo0KDhIUDjzDVo0KDhIUDjzDVo0KDhIUDjzDVo0KDhIeB/TwQkXwtl6ccAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "# This function shall help us plot some offset sine waves:\n", + "def sinplot(flip=1):\n", + " x = np.linspace(0, 14, 100)\n", + " for i in range(1, 7):\n", + " plt.plot(x, np.sin(x + i * .5) * (7 - i) * flip)\n", + "\n", + "with sns.axes_style(\"darkgrid\"):\n", + " plt.subplot(211)\n", + " sinplot()\n", + "plt.subplot(212)\n", + "sinplot(-1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let us now look into other independent group of Matplotlib parameters created by Seaborn, i.e. *Scaling* of plot elements; that is controlled using **`.plotting_context()`** and **`.set_context()`** functions.\n", + "\n", + "The four preset contexts, in order of relative size, are **`paper`**, **`notebook`**, **`talk`**, and **`poster`**. The **`notebook`** style is default, and was used in the plots above. At first letโ€™s reset the default parameters by calling **`sns.set()`** & then play around with other contexts for scaling, starting with **`paper`**:" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "ExecuteTime": { + "end_time": "2021-07-16T14:27:30.496950Z", + "start_time": "2021-07-16T14:27:30.488161Z" + } + }, + "outputs": [], + "source": [ + "sns.set()" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "ExecuteTime": { + "end_time": "2021-07-16T14:27:32.324076Z", + "start_time": "2021-07-16T14:27:31.793812Z" + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEGCAYAAABmXi5tAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAaAElEQVR4nO3df3BU1d3H8c9ugGSzqzShITNigz+gFcxYHhW0jEEwkEGEyQQdWQxphwJPGyqVWAahOnbsCFHGqR21lmJAHDREwYGpTgdFE0cbOwRDQ21JSxyoER+ZZJIYs7sEzO4+f6SJUpNl2b2be3fv+/WPJnf33u8cks+enHPuuY5wOBwWACDlOc0uAAAwMgh8ALAJAh8AbILABwCbIPABwCYIfACwiVFmFzCcxsZGs0sAgKR0ww03DPl9ywa+NHzRAIChReosM6QDADZB4AOATRD4AGATBD4A2ASBD6Sozs5ObdiwQV1dXWaXAos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GFhYXy+Xxau3atsrOz9dprr2nMmDE6deqUgsGg2WUmhaHa8tixY1q5cqWk83/HJ02aJKn/r4J4HzY/UhjSuUhO5/lNlp6ero6ODkn9PyzDvQ7RcTgcZpeQdOrr6/X8889L6n/w+WWXXaatW7eqvLxcjz76qMaMGaNwOCyHwyG2zopsqLa85JJL1NHRob6+Pp08eXLwtcn4s0oqxenaa69VR0eHysrK1NraanY5sKHS0lJ98cUXWrx4scrKyjRu3Dg9+OCDWrNmjZYtW6aMjAy1t7frmmuu0W9/+1u1t7ebXbJlDdWWlZWV2rx5s1avXq3x48ebXWJc2C0TAGyCHj4A2ASBDwA2QeADgE0Q+ABgEwQ+ANgEgQ9cwKlTp1RWVmZ2GUDcCHwAsAnW4QND8Pv9uv/+++X3+5Wbm6u2tjbNnj1b7777rnp7ezV16lQ99NBDuuOOO7Rv3z65XC5t3rxZBQUFKigoMLt8YEj08IEh7Nu3T9OmTdOLL76o22+/XcFgUOfOndMLL7yg3bt36/3339fZs2c1b9481dbWKhgM6oMPPtDMmTPNLh0YFpunAUNoaWnR3LlzJUnXX3+9XnjhBYVCIa1bt04ul0uBQEB9fX1avHixHn/8cXk8Hs2cOVNpaWkmVw4Mj8AHhnDFFVfoyJEjKigo0D/+8Q/985//VF9fn3bv3q3Ozk698cYbCofDuvLKK+X3+7Vnzx5VVFSYXTYQEWP4wBC+/PJLrV+/Xm1tbZo4caKOHz+ujIwM9fb2yuVyye/3a8uWLZo0aZL27NmjPXv26JVXXjG7bCAiAh+I0+7du+V0OrVkyRKzSwEiYkgHiENlZaU++ugjPfvss2aXAlwQPXwAsAmWZQKATRD4AGATBD4A2ASBDwA2QeADgE0Q+ABgE/8PghWadxE+PacAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "sns.set_context(\"paper\")\n", + "sns.set_style(\"whitegrid\")\n", + "\n", + "sns.boxplot(x = \"day\", y = \"total_bill\", data = tips)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "I am pretty sure you must be thinking that this figure/plot in no ways is scaled as it looks similar to our previous plot outputs. So, I shall clarify that right away:\n", + "\n", + "Jupyter Notebook scales down large images in the notebook cell output. This is generally done because past a certain size, we get automatic figure scaling. For exploratory analysis, we prefer iterating quickly over a number of different analyses and it's more useful to have **[facets](https://dictionary.cambridge.org/dictionary/english/facet)** that are of similar size; than to have overall figures that are same size in a particular context.\n", + "\n", + "When we're in a situation where we need to have something that's exactly a certain size overall; ideally we:\n", + "- know precisely what you want and\n", + "- can afford to take off some time and work through the calculations.\n", + "\n", + "With all that being said, if we plot the same figure in an Editor like *Anaconda Spyder* or *JetBrains' PyCharm* or *IntelliJ*, we shall be able to visualize them in their original size. Hence what needs to be our take-away from scaling segment, is that an addition of a line of code can fetch the size of image as per our requirement and we may experiment accordingly." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In practical world, we also add a dictionary of parameters using **`rc`** to have a finer control over the aesthetics. Let me show you an example with the same **`_sinplot_`** function we defined earlier:" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "ExecuteTime": { + "end_time": "2021-07-16T14:28:00.840869Z", + "start_time": "2021-07-16T14:28:00.567438Z" + } + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAasAAAEpCAYAAAAtaQ2+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAC/QElEQVR4nOx9Z2Ac1bn2M7N9V2XVe+/NkiW5yr0DBtsUG9NJQiAEvuQScnNzk5CEm9zc9AQCJITejI0B9457tyVLsmX13vuutL3MfD+ELM2es6uVq4T3+QM+O7M6Wu2ctz3v8zI8z/PwwAMPPPDAgwkM9lZvwAMPPPDAAw/GgsdYeeCBBx54MOHhMVYeeOCBBx5MeHiMl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tJSNDU1obW1FVKpFP7+/khISEBycjL1pIYIBStCCCFuj+asCCGEuD0KVoQQQtweBStCCCFuj4IVIYQQt0fBihBCiNujYEUIIcTtUbAihBDi9ihYEUIIcXsUrAghhLg9ClaEEELcHgUrQgghbo+CFSGEELdHwYoQQojbo2BFCCHE7VGwIoQQ4vb+DxtbTuZWMwH4AAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "sns.set(style='whitegrid', rc={\"grid.linewidth\": 1.5})\n", + "sns.set_context(\"poster\", font_scale=2.5, rc={\"lines.linewidth\": 5.0})\n", + "sinplot()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Though our Notebook didn't display enlarged (scaled) plot, we may notice how in the backend (in memory) it has created the figure as per our instructions. We have *thick lines* now in our plot because I set **`linewidth`** to **`5`**, *font size* on axes have thickened because of **`font_scale`**. Generally we don't use anything more than that during data analysis although exceptional scenarios may demand few more parameters as per requirement. " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ">**Note:** **`%matplotlib inline`** just needs to be called once in a kernel unless we refresh/restart the kernel. This is a function that works only in Jupyter Notebook. In other IDE, you will have to explicitly mention either **`sns.plt.show()`** or just **`plt.show()`** at the end of your code for plot/figure to be displayed.\n", + "Also, style and context once set remains defined unless we explicitly call for a change. If never called in a kernel, Seaborn will work with it's defaults: Matplotlib 'white' background without grids, and 'notebook' scale size." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the next lecture, we shall see the difference in coding between **[Matplotlib and Seaborn](https://github.com/milaan9/12_Python_Seaborn_Module/blob/main/003_Matplotlib_vs_Seaborn.ipynb)** to achieve a certain goal (Regression plot illustration)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "hide_input": false, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.8" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": false, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": {}, + "toc_section_display": true, + "toc_window_display": false + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 1a70930661da1e9c20216d949a976d55f6364385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Sun, 15 May 2022 15:15:24 +0800 Subject: [PATCH 47/49] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1286f0a..ff30c20 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@

Last Commit +Created Last Commit From 7b935b424ebcfed20342e5b37deabdfb34d444bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=BC=D0=B0=D1=80=20/=20=5F=E7=B1=B3?= =?UTF-8?q?=E5=85=B0=20=E5=B8=95=E5=B0=94=E9=A9=AC?= Date: Sun, 12 Jun 2022 23:56:54 +0800 Subject: [PATCH 48/49] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ff30c20..3e3f85b 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ Go [**`here`**](https://github.com/milaan9/04_Python_Functions) if you aren't he --- -### How can I read this tutorial without an Internet connection? GIF +### How can I read this tutorial without an Internet connection? GIF 1. Go [**`here`**](https://github.com/milaan9/04_Python_Functions) and click the big green โžž **`Code`** button in the top right of the page, then click โžž [**`Download ZIP`**](https://github.com/milaan9/04_Python_Functions/archive/refs/heads/main.zip). From f8ba60be0ef0ea297d946684d412720d443a9b21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milaan=20Parmar=20/=20=20=D0=9C=D0=B8=D0=BB=D0=B0=D0=BD=20?= =?UTF-8?q?=20/=20=E7=B1=B3=E5=85=B0?= Date: Fri, 9 Dec 2022 15:03:24 -0600 Subject: [PATCH 49/49] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3e3f85b..e1c5cef 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

Last Commit -Created -Last Commit + + Stars Badge