From 213b8edf0197e4b599507f58c02bd6f6c327a0cc Mon Sep 17 00:00:00 2001 From: Goga Patarkatsishvili Date: Fri, 11 Aug 2017 03:14:38 +0400 Subject: [PATCH 01/39] Create .gitattributes --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..0fd914b --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +site/* linguist-vendored From 3d73f265a3a99d01a30f5e4cf0dc94dff3cb31c9 Mon Sep 17 00:00:00 2001 From: Goga Patarkatsishvili Date: Fri, 11 Aug 2017 15:38:52 +0400 Subject: [PATCH 02/39] Update README.md --- README.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 68971f7..b2de6ae 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,15 @@ -# Python-Synopsis -python study guide +Welcome to Python Synopsis! +=================== + +### Python Study Guide + + +In this repository I want to share resources, that helped me understand python programing language deeply. +It was not easy to find appropriate **books, articles, answers from Stackoverflow, online courses, videos from py conferences** and etc. + +So, after all I decided to share **top resources** for everyone about each topic, that you need to know about python, if you want to be senior python **Software Engineer**. + +Of course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than **30-40** chapters. + +So, You can start study from here: + [Python Synopsis - https://ent1c3d.github.io/Python-Synopsis/site/ ](https://ent1c3d.github.io/Python-Synopsis/site/) From 609f2a7ee3bb1bfc02c2d1bb618b2c3a793a8adc Mon Sep 17 00:00:00 2001 From: Goga Patarkatsishvili Date: Fri, 11 Aug 2017 15:40:47 +0400 Subject: [PATCH 03/39] Update index.md --- docs/index.md | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/docs/index.md b/docs/index.md index ad81313..aefeb99 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,31 +1,13 @@ -# Welcome to MkDocs +Welcome to Python Synopsis! +=================== -For full documentation visit [mkdocs.org](http://mkdocs.org). +### Python Study Guide -## Commands -* `mkdocs new [dir-name]` - Create a new project. -* `mkdocs serve` - Start the live-reloading docs server. -* `mkdocs build` - Build the documentation site. -* `mkdocs help` - Print this help message. +In this repository I want to share resources, that helped me understand python programing language deeply. +It was not easy to find appropriate **books, articles, answers from Stackoverflow, online courses, videos from py conferences** and etc. -#### Commands +So, after all I decided to share **top resources** for everyone about each topic, that you need to know about python, if you want to be senior python **Software Engineer**. -* `mkdocs new [dir-name]` - Create a new project. -* `mkdocs serve` - Start the live-reloading docs server. -* `mkdocs build` - Build the documentation site. -* `mkdocs help` - Print this help message. +Of course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than **30-40** chapters. -# Commands - -* `mkdocs new [dir-name]` - Create a new project. -* `mkdocs serve` - Start the live-reloading docs server. -* `mkdocs build` - Build the documentation site. -* `mkdocs help` - Print this help message. - -## Project layout - - mkdocs.yml # The configuration file. - docs/ - index.md # The documentation homepage. - ... # Other markdown pages, images and other files. From 91ab18882af921f05c8121dddca1ae6bff9be0be Mon Sep 17 00:00:00 2001 From: ent1c3d Date: Sun, 13 Aug 2017 13:53:26 +0400 Subject: [PATCH 04/39] .. --- README.md | 3 + docs/about.md | 63 +- ...rt1.md => 1-Python_Programming_Lanuage.md} | 521 +- docs/index.md | 2 + mkdocs.yml | 35 +- site/404.html | 492 +- site/About/index.html | 609 +- site/{img => assets/images}/favicon.ico | Bin .../images/icons/bitbucket-670608a71a.svg | 1 + .../assets/images/icons/github-1da075986e.svg | 1 + .../assets/images/icons/gitlab-5ad3f9f9e5.svg | 1 + .../javascripts/application-6940329b9f.js | 1 + site/assets/javascripts/lunr/lunr.da.js | 1 + site/assets/javascripts/lunr/lunr.de.js | 1 + site/assets/javascripts/lunr/lunr.du.js | 1 + site/assets/javascripts/lunr/lunr.es.js | 1 + site/assets/javascripts/lunr/lunr.fi.js | 1 + site/assets/javascripts/lunr/lunr.fr.js | 1 + site/assets/javascripts/lunr/lunr.hu.js | 1 + site/assets/javascripts/lunr/lunr.it.js | 1 + site/assets/javascripts/lunr/lunr.jp.js | 1 + site/assets/javascripts/lunr/lunr.multi.js | 1 + site/assets/javascripts/lunr/lunr.no.js | 1 + site/assets/javascripts/lunr/lunr.pt.js | 1 + site/assets/javascripts/lunr/lunr.ro.js | 1 + site/assets/javascripts/lunr/lunr.ru.js | 1 + .../javascripts/lunr/lunr.stemmer.support.js | 1 + site/assets/javascripts/lunr/lunr.sv.js | 1 + site/assets/javascripts/lunr/lunr.tr.js | 1 + site/assets/javascripts/lunr/tinyseg.js | 1 + .../javascripts/modernizr-1df76c4e58.js | 1 + .../application-02c2a4388f.palette.css | 1 + .../stylesheets/application-bfecc7305d.css | 1 + .../index.html | 1265 ++-- site/css/base.css | 168 - site/css/bootstrap-custom.css | 5249 ----------------- site/css/bootstrap-custom.min.css | 1 - site/css/cinder.css | 82 - site/css/font-awesome-4.0.3.css | 1338 ----- site/css/highlight.css | 125 - site/fonts/fontawesome-webfont.eot | Bin 38205 -> 0 bytes site/fonts/fontawesome-webfont.svg | 414 -- site/fonts/fontawesome-webfont.ttf | Bin 80652 -> 0 bytes site/fonts/fontawesome-webfont.woff | Bin 44432 -> 0 bytes site/img/grid1.png | Bin 251 -> 0 bytes site/img/grid10.png | Bin 495 -> 0 bytes site/img/grid11.png | Bin 253 -> 0 bytes site/img/grid12.png | Bin 260 -> 0 bytes site/img/grid13.png | Bin 266 -> 0 bytes site/img/grid14.png | Bin 240 -> 0 bytes site/img/grid15.png | Bin 442 -> 0 bytes site/img/grid16.png | Bin 442 -> 0 bytes site/img/grid17.png | Bin 442 -> 0 bytes site/img/grid18.png | Bin 457 -> 0 bytes site/img/grid19.png | Bin 427 -> 0 bytes site/img/grid2.png | Bin 271 -> 0 bytes site/img/grid20.png | Bin 493 -> 0 bytes site/img/grid3.png | Bin 266 -> 0 bytes site/img/grid4.png | Bin 244 -> 0 bytes site/img/grid5.png | Bin 442 -> 0 bytes site/img/grid6.png | Bin 460 -> 0 bytes site/img/grid7.png | Bin 442 -> 0 bytes site/img/grid8.png | Bin 457 -> 0 bytes site/img/grid9.png | Bin 456 -> 0 bytes site/index.html | 642 +- site/js/base.js | 20 - site/js/bootstrap-3.0.3.min.js | 7 - site/js/highlight.pack.js | 2 - site/js/jquery-1.10.2.min.js | 6 - site/mkdocs/js/lunr.min.js | 14 +- site/mkdocs/js/require.js | 72 +- .../js/search-results-template.mustache | 8 +- site/mkdocs/js/search.js | 176 +- site/mkdocs/js/text.js | 780 +-- site/mkdocs/search_index.json | 221 +- site/sitemap.xml | 58 +- 76 files changed, 2878 insertions(+), 9520 deletions(-) rename docs/beginner/{part1.md => 1-Python_Programming_Lanuage.md} (97%) rename site/{img => assets/images}/favicon.ico (100%) create mode 100644 site/assets/images/icons/bitbucket-670608a71a.svg create mode 100644 site/assets/images/icons/github-1da075986e.svg create mode 100644 site/assets/images/icons/gitlab-5ad3f9f9e5.svg create mode 100644 site/assets/javascripts/application-6940329b9f.js create mode 100644 site/assets/javascripts/lunr/lunr.da.js create mode 100644 site/assets/javascripts/lunr/lunr.de.js create mode 100644 site/assets/javascripts/lunr/lunr.du.js create mode 100644 site/assets/javascripts/lunr/lunr.es.js create mode 100644 site/assets/javascripts/lunr/lunr.fi.js create mode 100644 site/assets/javascripts/lunr/lunr.fr.js create mode 100644 site/assets/javascripts/lunr/lunr.hu.js create mode 100644 site/assets/javascripts/lunr/lunr.it.js create mode 100644 site/assets/javascripts/lunr/lunr.jp.js create mode 100644 site/assets/javascripts/lunr/lunr.multi.js create mode 100644 site/assets/javascripts/lunr/lunr.no.js create mode 100644 site/assets/javascripts/lunr/lunr.pt.js create mode 100644 site/assets/javascripts/lunr/lunr.ro.js create mode 100644 site/assets/javascripts/lunr/lunr.ru.js create mode 100644 site/assets/javascripts/lunr/lunr.stemmer.support.js create mode 100644 site/assets/javascripts/lunr/lunr.sv.js create mode 100644 site/assets/javascripts/lunr/lunr.tr.js create mode 100644 site/assets/javascripts/lunr/tinyseg.js create mode 100644 site/assets/javascripts/modernizr-1df76c4e58.js create mode 100644 site/assets/stylesheets/application-02c2a4388f.palette.css create mode 100644 site/assets/stylesheets/application-bfecc7305d.css rename site/beginner/{part1 => 1-Python_Programming_Lanuage}/index.html (57%) delete mode 100644 site/css/base.css delete mode 100644 site/css/bootstrap-custom.css delete mode 100644 site/css/bootstrap-custom.min.css delete mode 100644 site/css/cinder.css delete mode 100644 site/css/font-awesome-4.0.3.css delete mode 100644 site/css/highlight.css delete mode 100644 site/fonts/fontawesome-webfont.eot delete mode 100644 site/fonts/fontawesome-webfont.svg delete mode 100644 site/fonts/fontawesome-webfont.ttf delete mode 100644 site/fonts/fontawesome-webfont.woff delete mode 100644 site/img/grid1.png delete mode 100644 site/img/grid10.png delete mode 100644 site/img/grid11.png delete mode 100644 site/img/grid12.png delete mode 100644 site/img/grid13.png delete mode 100644 site/img/grid14.png delete mode 100644 site/img/grid15.png delete mode 100644 site/img/grid16.png delete mode 100644 site/img/grid17.png delete mode 100644 site/img/grid18.png delete mode 100644 site/img/grid19.png delete mode 100644 site/img/grid2.png delete mode 100644 site/img/grid20.png delete mode 100644 site/img/grid3.png delete mode 100644 site/img/grid4.png delete mode 100644 site/img/grid5.png delete mode 100644 site/img/grid6.png delete mode 100644 site/img/grid7.png delete mode 100644 site/img/grid8.png delete mode 100644 site/img/grid9.png delete mode 100644 site/js/base.js delete mode 100644 site/js/bootstrap-3.0.3.min.js delete mode 100644 site/js/highlight.pack.js delete mode 100644 site/js/jquery-1.10.2.min.js diff --git a/README.md b/README.md index b2de6ae..af2cbe8 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,6 @@ Of course, it needs plenty of time to organize best resources based on the topic So, You can start study from here: [Python Synopsis - https://ent1c3d.github.io/Python-Synopsis/site/ ](https://ent1c3d.github.io/Python-Synopsis/site/) + +- Beginner + - [The Python Programming Language, Implementation and Adventages](https://ent1c3d.github.io/Python-Synopsis/site/beginner/1-Python_Programming_Lanuage) diff --git a/docs/about.md b/docs/about.md index 0701d51..fcea2a5 100644 --- a/docs/about.md +++ b/docs/about.md @@ -1,62 +1 @@ -# Sit qua me lacrimis beatum pontum natorum - -## Quos Minoide sepulcrales pomi - -Lorem markdownum magnae prosternite omnes alveus vimine **transcribere** timuere -**penetrale**; ambrosia marinas abruptaque corpora telum. Non admotum foret; -domo, nova veniam pondere; incipit. - -- Tu hic -- Cruores nec sororis heros amor fronti inplevere -- Concitat dolens -- Candentia genitore fiant -- Linguam viderat coniuge rebar abire - -Toto una miser spondet mutataeque obsedit hederae *murmure Penthea gerebat* -solebat tradidit! Perque sua caput genis terram vidit: di arces vidit inopes -caelo defendere harundo causa. Rota possit herbis bello peregit auctor rursus -habebimus nubibus maxima. Et et dicere, cultor, tamen arva [Periclymeni -caelum](http://poenae.io/feminaaegida) saepe sunt emicat vidit. - -## Repperit est quoque visus at tamen in - -Esse patior virga sit feruntur arva palustres prohibebar -[vultusque](http://patuit.com/erampecori.html) audiri turbantur visum, gelidos? -Luctus et fabricata esse temptant molliri admonitorque dare currunt, -[dedit](http://www.exue.io/quamquerellae.aspx)? Amoris mihi properabat petit, -salve supremo haec rumoribus fine. Esse et futuri oculos duos Pandion? - -> Quis Vidi: ferox sub incenduntque Lycopen estque pennae iactat! Hanc corpus -> neve Hecate Herculeis vacuum! Res illa fortunata iuvencae summa! - -Venilia oscula; ora felicior metus hospita. Visendae -[molitur](http://www.oenopiam-tua.com/quae-volucrum.html). Iuvat non umerique -nostraque accipitris Somnia retentis ceciderunt adero mutatus? Est deum occiduo -odoro adnuit et omnibus ponunt, natalibus tecta, amanti. Ipse in perdere -Cyllenide **opibus Aiaci** calculus est *exegi*, in ergo altis monitis ore -quattuor enim. - -## Nostra terris Veneri et et exiguus omnia - -Timore et genitor virum Apolline relicta e in nemus erant, ulla hunc pro, -quaeque caducifer supra et. Amicas tigno toris: incustoditae mora est, -requiritur nostra. Pronusque caret tegumenque Iovis, Tartara hos viri ignis, -aconiton praebuit Pithecusas sumo. Omne illo; contigit de quod [est cara -suo](http://lapsa-et.net/), Ceres spatio et vetus haeserat, de. - - volume_rootkit_tag += pcb_bar(packet_wildcard, document); - if (token_dos / repeater * opacity_bar / - ddrProgressiveStreaming.clipboardTimeInternal(dllCameraCable)) { - peripheral_index += 1; - } - newbie += favorites_integrated - operatingDacProcess + 4 + - hypermedia_link_output + fiosGnuCut; - data(tweetFormatData.sync_software(packetDirectDrive, duplex.openglDrive( - cable, compression_clean, 3), chip_trojan(1, type, - minisite_printer)), -1, dvi_leaf * maximizeDriveCaps); - -Achivam undas filum parte sustulit, tellure aderam Mavortis carens! Pro in si -illa amor neget iurasse morsus. Temeraria potuit. Nec stipite, terris sed invito -est nimia nam, in sis tum naufragus **ipse vota** gramina auferat dixit: dies. -Sit ulciscitur navis, navita duplex voveas, tui potest *versa*, aequora ut -numine fidelius pudet. \ No newline at end of file +# I'll write later diff --git a/docs/beginner/part1.md b/docs/beginner/1-Python_Programming_Lanuage.md similarity index 97% rename from docs/beginner/part1.md rename to docs/beginner/1-Python_Programming_Lanuage.md index 901a209..f87813e 100644 --- a/docs/beginner/part1.md +++ b/docs/beginner/1-Python_Programming_Lanuage.md @@ -1,262 +1,259 @@ -Welcome to Python Synopsis by Ent! -=================== - ----------- - - -The Python Programming Language -------------- -The programming language you will learn is Python. Python is an example of a highlevel -language; other high-level languages you might have heard of are **C, C++, Perl,** -and **Java**. -There are also low-level languages, sometimes referred to as **“machine languages”** or -**“assembly languages.”** Loosely speaking, computers can only run programs written in -low-level languages. So programs written in a high-level language have to be processed -before they can run. This extra processing takes some time, which is a small disadvantage -of high-level languages. - -The advantages are enormous. First, it is much easier to program in a high-level lan -guage. Programs written in a high-level language take less time to write, they are shorter -and easier to read, and they are more likely to be correct. Second, high-level languages -are portable, meaning that they can run on different kinds of computers with few or no -modifications. Low-level programs can run on only one kind of computer and have to -be rewritten to run on another. - -Due to these advantages, almost all programs are written in high-level languages. Lowlevel -languages are used only for a few specialized applications. - -Two kinds of programs process high-level languages into low-level languages: -interpreters and compilers. An interpreter reads a high-level program and executes it, -meaning that it does what the program says. It processes the program a little at a time, -alternately reading lines and performing computations. Figure 1-1 shows the structure -of an interpreter. - -![Figure 1-1. An interpreter processes the program a little at a time, alternately reading lines -and performing computations.](../images/interpreter.png ) - -A compiler reads the program and translates it completely before the program starts -running. In this context, the high-level program is called the source code, and the -translated program is called the object code or the executable. Once a program is com -piled, you can execute it repeatedly without further translation. Figure 1-2 shows the -structure of a compiler. - -![Figure 1-2. A compiler translates source code into object code, which is run by a hardware -executor.](../images/compiler.png) - - -Python is considered an interpreted language because Python programs are executed -by an interpreter. There are two ways to use the interpreter: **interactive** mode and **script mode**. In interactive mode, you type Python programs and the interpreter displays the -result: -\>>> 1 + 1 -2 -The chevron, >>>, is the prompt the interpreter uses to indicate that it is ready. If you -type 1 + 1, the interpreter replies 2. - -Alternatively, you can store code in a file and use the interpreter to execute the contents -of the file, which is called a script. By convention, Python scripts have names that end -with .py. -To execute the script, you have to tell the interpreter the name of the file. If you have a -script named dinsdale.py and you are working in a UNIX command window, you type -python dinsdale.py. In other development environments, the details of executing -scripts are different. You can find instructions for your environment at the Python web -site http://python.org. -Working in interactive mode is convenient for testing small pieces of code because you -can type and execute them immediately. But for anything more than a few lines, you -should save your code as a script so you can modify and execute it in the future. - - -> **Source:** -> :fa-book: **Think Python** by Allen B. Downey - 2012 - - - -## Python’s View - -The brief description in the prior section is fairly standard for scripting languages, and -it’s usually all that most Python programmers need to know. You type code into text -files, and you run those files through the interpreter. Under the hood, though, a bit -more happens when you tell Python to “go.” Although knowledge of Python internals -is not strictly required for Python programming, a basic understanding of the runtime -structure of Python can help you grasp the bigger picture of program execution. -When you instruct Python to run your script, there are a few steps that Python carries -out before your code actually starts crunching away. Specifically, it’s first compiled to -something called “byte code” and then routed to something called a “virtual machine.” - -#### Byte code compilation - -Internally, and almost completely hidden from you, when you execute a program -Python first compiles your source code (the statements in your file) into a format known -as byte code. Compilation is simply a translation step, and byte code is a lower-level, -platform-independent representation of your source code. Roughly, Python translates -each of your source statements into a group of byte code instructions by decomposing -them into individual steps. This byte code translation is performed to speed -execution—byte code can be run much more quickly than the original source code -statements in your text file. -You’ll notice that the prior paragraph said that this is almost completely hidden from -you. If the Python process has write access on your machine, it will store the byte code -of your programs in files that end with a .pyc extension (“.pyc” means compiled “.py” -source). You will see these files show up on your computer after you’ve run a few -programs alongside the corresponding source code files (that is, in the same -directories). -Python saves byte code like this as a startup speed optimization. The next time you run -your program, Python will load the .pyc files and skip the compilation step, as long as -you haven’t changed your source code since the byte code was last saved. Python automatically -checks the timestamps of source and byte code files to know when it must -recompile—if you resave your source code, byte code is automatically re-created the -next time your program is run. -If Python cannot write the byte code files to your machine, your program still works— -the byte code is generated in memory and simply discarded on program exit.* However, -because .pyc files speed startup time, you’ll want to make sure they are written for larger -programs. Byte code files are also one way to ship Python programs—Python is happy -to run a program if all it can find are .pyc files, even if the original .py source files are -absent. - -#### The Python Virtual Machine (PVM) -Once your program has been compiled to byte code (or the byte code has been loaded -from existing .pyc files), it is shipped off for execution to something generally known -as the Python Virtual Machine (PVM, for the more acronym-inclined among you). The -PVM sounds more impressive than it is; really, it’s not a separate program, and it need -not be installed by itself. In fact, the PVM is just a big loop that iterates through your -byte code instructions, one by one, to carry out their operations. The PVM is the runtime -engine of Python; it’s always present as part of the Python system, and it’s the -component that truly runs your scripts. Technically, it’s just the last step of what is -called the “Python interpreter.” - -![Figure 1-3. Python’s traditional runtime execution model: source code you type is translated to byte -code, which is then run by the Python Virtual Machine. Your code is automatically compiled, but then -it is interpreted.](../images/py_execution_model.png) - -Figure illustrates the runtime structure described here. Keep in mind that all of this -complexity is deliberately hidden from Python programmers. Byte code compilation is -automatic, and the PVM is just part of the Python system that you have installed on -your machine. Again, programmers simply code and run files of statements. - - -#### Performance implications -Readers with a background in fully compiled languages such as C and C++ might notice -a few differences in the Python model. For one thing, there is usually no build or “make” -step in Python work: code runs immediately after it is written. For another, Python byte -code is not binary machine code (e.g., instructions for an Intel chip). Byte code is a -Python-specific representation. - -This is why some Python code may not run as fast as C or C++ code, as described in -Chapter 1—the PVM loop, not the CPU chip, still must interpret the byte code, and -byte code instructions require more work than CPU instructions. On the other hand, -unlike in classic interpreters, there is still an internal compile step—Python does not -need to reanalyze and reparse each source statement repeatedly. The net effect is that -pure Python code runs at speeds somewhere between those of a traditional compiled -language and a traditional interpreted language. See Chapter 1 for more on Python -performance tradeoffs. - -> **Source:** -> :fa-book: **Learning Python, Fourth Edition** by Mark Lutz - 2009 - -## Python Implementation Alternatives - -Really, as this book is being written, there are three primary implementations of the -Python language—CPython, Jython, and IronPython—along with a handful of secondary -implementations such as Stackless Python. In brief, CPython is the standard implementation; -all the others have very specific purposes and roles. All implement the -same Python language but execute programs in different ways. - -#### CPython -The original, and standard, implementation of Python is usually called CPython, when -you want to contrast it with the other two. Its name comes from the fact that it is coded -in portable ANSI C language code. This is the Python that you fetch from http://www -.python.org, get with the ActivePython distribution, and have automatically on most -Linux and Mac OS X machines. If you’ve found a preinstalled version of Python on -your machine, it’s probably CPython, unless your company is using Python in very -specialized ways. -Unless you want to script Java or .NET applications with Python, you probably want -to use the standard CPython system. Because it is the reference implementation of the -language, it tends to run the fastest, be the most complete, and be more robust than -the alternative systems. Figure 1-3 reflects CPython’s runtime architecture. - -#### Jython -The Jython system (originally known as JPython) is an alternative implementation of -the Python language, targeted for integration with the Java programming language. -Jython consists of Java classes that compile Python source code to Java byte code and -then route the resulting byte code to the Java Virtual Machine (JVM). Programmers -still code Python statements in .py text files as usual; the Jython system essentially just -replaces the rightmost two bubbles in Figure 1-3 with Java-based equivalents. -Jython’s goal is to allow Python code to script Java applications, much as CPython -allows Python to script C and C++ components. Its integration with Java is remarkably -seamless. Because Python code is translated to Java byte code, it looks and feels like a -true Java program at runtime. Jython scripts can serve as web applets and servlets, build -Java-based GUIs, and so on. Moreover, Jython includes integration support that allows -Python code to import and use Java classes as though they were coded in Python. -Because Jython is slower and less robust than CPython, though, it is usually seen as a -tool of interest primarily to Java developers looking for a scripting language to be a -frontend to Java code. - -#### IronPython -A third implementation of Python, and newer than both CPython and Jython, -IronPython is designed to allow Python programs to integrate with applications coded -to work with Microsoft’s .NET Framework for Windows, as well as the Mono open -source equivalent for Linux. .NET and its C# programming language runtime system -are designed to be a language-neutral object communication layer, in the spirit of Microsoft’s -earlier COM model. IronPython allows Python programs to act as both client -and server components, accessible from other .NET languages. -By implementation, IronPython is very much like Jython (and, in fact, was developed -by the same creator)—it replaces the last two bubbles in Figure 1-3 with equivalents -for execution in the .NET environment. Also, like Jython, IronPython has a special -focus—it is primarily of interest to developers integrating Python with .NET components. -Because it is being developed by Microsoft, though, IronPython might also be -able to leverage some important optimization tools for better performance. -IronPython’s scope is still evolving as I write this; for more details, consult the Python -online resources or search the Web. - -> **Source:** -> :fa-book: **Learning Python, Fourth Edition** by Mark Lutz - 2009 - - - -## Python Programming Language Advantages - - -Python is a dynamic, strongly typed, object oriented, multipurpose programming language, designed to be quick (to learn, to use, and to understand), and to enforce a clean and uniform syntax. - - 1. Python is dynamically typed: it means that you don't declare a type (e.g. 'integer') for a variable name, and then assign something of that type (and only that type). Instead, you have variable names, and you bind them to entities whose type stays with the entity itself. a = 5 makes the variable name a to refer to the integer 5. Later, a = "hello" makes the variable name a to refer to a string containing "hello". Static typed languages would have you declare int a and then a = 5, but assigning a = "hello" would have been a compile time error. On one hand, this makes everything more unpredictable (you don't know what a refers to). On the other hand, it makes very easy to achieve some results a static typed languages makes very difficult. - 2. Python is strongly typed. It means that if a = "5" (the string whose value is '5') will remain a string, and never coerced to a number if the context requires so. Every type conversion in python must be done explicitly. This is different from, for example, Perl or Javascript, where you have weak typing, and can write things like "hello" + 5 to get "hello5". - 3. Python is object oriented, with class-based inheritance. Everything is an object (including classes, functions, modules, etc), in the sense that they can be passed around as arguments, have methods and attributes, and so on. - 4. Python is multipurpose: it is not specialised to a specific target of users (like R for statistics, or PHP for web programming). It is extended through modules and libraries, that hook very easily into the C programming language. - 5. Python enforces correct indentation of the code by making the indentation part of the syntax. There are no control braces in Python. Blocks of code are identified by the level of indentation. Although a big turn off for many programmers not used to this, it is precious as it gives a very uniform style and results in code that is visually pleasant to read. - 6. The code is compiled into byte code and then executed in a virtual machine. This means that precompiled code is portable between platforms. - -Python can be used for any programming task, from GUI programming to web programming with everything else in between. It's quite efficient, as much of its activity is done at the C level. Python is just a layer on top of C. There are libraries for everything you can think of: game programming and openGL, GUI interfaces, web frameworks, semantic web, scientific computing... - -> **Source:** -> :fa-link: https://stackoverflow.com/questions/1909512/what-is-python-used-for - -#### Adventages again -- **Easy Syntax** -Python's syntax is easy to learn, so both non-programmers and programmers can start programming right away. -- **Readability** -Python's syntax is very clear, so it is easy to understand program code. (Python is often referred to as "executable pseudo-code" because its syntax mostly follows the conventions used by programmers to outline their ideas without the formal verbosity of code in most programming languages; in other words syntax of Python is almost identical to the simplified "pseudo-code" used by many programmers to prototype and describe their solution to other programmers. Thus Python can be used to prototype and test code which is later to be implemented in other programming languages).[citation needed] -- **High-Level Language** -Python looks more like a readable, human language than like a low-level language. This gives you the ability to program at a faster rate than a low-level language will allow you. -- **Object oriented programming** -Object-oriented programming allows you to create data structures that can be re-used, which reduces the amount of repetitive work that you'll need to do. Programming languages usually define objects with namespaces, like class or def, and objects can edit themselves by using keyword, like this or self. Most modern programming languages are object-oriented (such as Java, C++, and C#) or have support for OOP features (such as Perl version 5 and later). Additionally object-oriented techniques can be used in the design of almost any non-trivial software and implemented in almost any programming or scripting language. (For example a number of Linux kernel features are "objects" which implement their own encapsulation of behavior and data structive via pointers, specifically pointers to functions, in the C programming language).[citation needed] Python's support for object-oriented programming is one of its greatest benefits to new programmers because they will be encountering the same concepts and terminology in their work environment. If you ever decide to switch languages, or use any other for that fact, you'll have a significant chance that you'll be working with object-oriented programming.[1] -- **It's Free** -Python is both free and open-source. The Python Software Foundation distributes pre-made binaries that are freely available for use on all major operating systems called CPython. You can get CPython's source-code, too. Plus, you can modify the source code and distribute as allowed by CPython's license. [2] (Luckily, CPython has a permissive free software license attitude.) -- **Cross-platform** -Python runs on all major operating systems like Microsoft Windows, Linux, and Mac OS X. -- **Widely Supported** -Python has an active support community with many web sites, mailing lists, and USENET "netnews" groups that attract a large number of knowledgeable and helpful contributes. -- **It's Safe** -Python doesn't have pointers like other C-based languages, making it much more reliable. Along with that, errors never pass silently unless they're explicitly silenced. This allows you to see and read why the program crashed and where to correct your error. -- **Batteries Included** -Python is famous for being the "batteries are included" language.[3] There are over 300 standard library modules which contain modules and classes for a wide variety of programming tasks.[citation needed] For example the standard library contains modules for safely creating temporary files (named or anonymous), mapping files into memory (including use of shared and anonymous memory mappings), spawning and controlling sub-processes, compressing and decompressing files (compatible with gzip or PK-zip) and archives files (such as Unix/Linux "tar"), accessing indexed "DBM" (database) files, interfacing to various graphical user interfaces (such as the TK toolkit and the popular WxWindows multi-platform windowing system), parsing and maintaining CSV (comma-separated values) and ".cfg" or ".ini" configuration files (similar in syntax to the venerable WIN.INI files from MS-DOS and MS-Windows), for sending e-mail, fetching and parsing web pages, etc. It's possible, for example, to create a custom web server in Python using less than a dozen lines of code, and one of the standard libraries, of course. -- **Extensible** -In addition to the standard libraries there are extensive collections of freely available add-on modules, libraries, frameworks, and tool-kits. These generally conform to similar standards and conventions; for example almost all of the database adapters (to talk to almost any client-server RDBMS engine such as MySQL, Postgres, Oracle, etc) conform to the Python DBAPI and thus can mostly be accessed using the same code. So it's usually easy to modify a Python program to support any database engine. - -> **Source:** -> :fa-link: https://en.wikiversity.org/wiki/Python_Concepts/Why_learn_Python - -## Who Uses Python Today ? - -Here are links to just a few of the organizations that use python: -- :fa-link: https://wiki.python.org/moin/OrganizationsUsingPython - -Python Success Stories : -- :fa-link: https://www.python.org/about/success +The Python Programming Language +=================== + +---------- + +The programming language you will learn is Python. Python is an example of a highlevel +language; other high-level languages you might have heard of are **C, C++, Perl,** +and **Java**. +There are also low-level languages, sometimes referred to as **“machine languages”** or +**“assembly languages.”** Loosely speaking, computers can only run programs written in +low-level languages. So programs written in a high-level language have to be processed +before they can run. This extra processing takes some time, which is a small disadvantage +of high-level languages. + +The advantages are enormous. First, it is much easier to program in a high-level lan +guage. Programs written in a high-level language take less time to write, they are shorter +and easier to read, and they are more likely to be correct. Second, high-level languages +are portable, meaning that they can run on different kinds of computers with few or no +modifications. Low-level programs can run on only one kind of computer and have to +be rewritten to run on another. + +Due to these advantages, almost all programs are written in high-level languages. Lowlevel +languages are used only for a few specialized applications. + +Two kinds of programs process high-level languages into low-level languages: +interpreters and compilers. An interpreter reads a high-level program and executes it, +meaning that it does what the program says. It processes the program a little at a time, +alternately reading lines and performing computations. Figure 1-1 shows the structure +of an interpreter. + +![Figure 1-1. An interpreter processes the program a little at a time, alternately reading lines +and performing computations.](../images/interpreter.PNG ) + +A compiler reads the program and translates it completely before the program starts +running. In this context, the high-level program is called the source code, and the +translated program is called the object code or the executable. Once a program is com +piled, you can execute it repeatedly without further translation. Figure 1-2 shows the +structure of a compiler. + +![Figure 1-2. A compiler translates source code into object code, which is run by a hardware +executor.](../images/compiler.PNG) + + +Python is considered an interpreted language because Python programs are executed +by an interpreter. There are two ways to use the interpreter: **interactive** mode and **script mode**. In interactive mode, you type Python programs and the interpreter displays the +result: +\>>> 1 + 1 +2 +The chevron, >>>, is the prompt the interpreter uses to indicate that it is ready. If you +type 1 + 1, the interpreter replies 2. + +Alternatively, you can store code in a file and use the interpreter to execute the contents +of the file, which is called a script. By convention, Python scripts have names that end +with .py. +To execute the script, you have to tell the interpreter the name of the file. If you have a +script named dinsdale.py and you are working in a UNIX command window, you type +python dinsdale.py. In other development environments, the details of executing +scripts are different. You can find instructions for your environment at the Python web +site http://python.org. +Working in interactive mode is convenient for testing small pieces of code because you +can type and execute them immediately. But for anything more than a few lines, you +should save your code as a script so you can modify and execute it in the future. + + +> **Source:** +> :fa-book: **Think Python** by Allen B. Downey - 2012 + + + +## Python’s View + +The brief description in the prior section is fairly standard for scripting languages, and +it’s usually all that most Python programmers need to know. You type code into text +files, and you run those files through the interpreter. Under the hood, though, a bit +more happens when you tell Python to “go.” Although knowledge of Python internals +is not strictly required for Python programming, a basic understanding of the runtime +structure of Python can help you grasp the bigger picture of program execution. +When you instruct Python to run your script, there are a few steps that Python carries +out before your code actually starts crunching away. Specifically, it’s first compiled to +something called “byte code” and then routed to something called a “virtual machine.” + +#### Byte code compilation + +Internally, and almost completely hidden from you, when you execute a program +Python first compiles your source code (the statements in your file) into a format known +as byte code. Compilation is simply a translation step, and byte code is a lower-level, +platform-independent representation of your source code. Roughly, Python translates +each of your source statements into a group of byte code instructions by decomposing +them into individual steps. This byte code translation is performed to speed +execution—byte code can be run much more quickly than the original source code +statements in your text file. +You’ll notice that the prior paragraph said that this is almost completely hidden from +you. If the Python process has write access on your machine, it will store the byte code +of your programs in files that end with a .pyc extension (“.pyc” means compiled “.py” +source). You will see these files show up on your computer after you’ve run a few +programs alongside the corresponding source code files (that is, in the same +directories). +Python saves byte code like this as a startup speed optimization. The next time you run +your program, Python will load the .pyc files and skip the compilation step, as long as +you haven’t changed your source code since the byte code was last saved. Python automatically +checks the timestamps of source and byte code files to know when it must +recompile—if you resave your source code, byte code is automatically re-created the +next time your program is run. +If Python cannot write the byte code files to your machine, your program still works— +the byte code is generated in memory and simply discarded on program exit.* However, +because .pyc files speed startup time, you’ll want to make sure they are written for larger +programs. Byte code files are also one way to ship Python programs—Python is happy +to run a program if all it can find are .pyc files, even if the original .py source files are +absent. + +#### The Python Virtual Machine (PVM) +Once your program has been compiled to byte code (or the byte code has been loaded +from existing .pyc files), it is shipped off for execution to something generally known +as the Python Virtual Machine (PVM, for the more acronym-inclined among you). The +PVM sounds more impressive than it is; really, it’s not a separate program, and it need +not be installed by itself. In fact, the PVM is just a big loop that iterates through your +byte code instructions, one by one, to carry out their operations. The PVM is the runtime +engine of Python; it’s always present as part of the Python system, and it’s the +component that truly runs your scripts. Technically, it’s just the last step of what is +called the “Python interpreter.” + +![Figure 1-3. Python’s traditional runtime execution model: source code you type is translated to byte +code, which is then run by the Python Virtual Machine. Your code is automatically compiled, but then +it is interpreted.](../images/py_execution_model.PNG) + +Figure illustrates the runtime structure described here. Keep in mind that all of this +complexity is deliberately hidden from Python programmers. Byte code compilation is +automatic, and the PVM is just part of the Python system that you have installed on +your machine. Again, programmers simply code and run files of statements. + + +#### Performance implications +Readers with a background in fully compiled languages such as C and C++ might notice +a few differences in the Python model. For one thing, there is usually no build or “make” +step in Python work: code runs immediately after it is written. For another, Python byte +code is not binary machine code (e.g., instructions for an Intel chip). Byte code is a +Python-specific representation. + +This is why some Python code may not run as fast as C or C++ code, as described in +Chapter 1—the PVM loop, not the CPU chip, still must interpret the byte code, and +byte code instructions require more work than CPU instructions. On the other hand, +unlike in classic interpreters, there is still an internal compile step—Python does not +need to reanalyze and reparse each source statement repeatedly. The net effect is that +pure Python code runs at speeds somewhere between those of a traditional compiled +language and a traditional interpreted language. See Chapter 1 for more on Python +performance tradeoffs. + +> **Source:** +> :fa-book: **Learning Python, Fourth Edition** by Mark Lutz - 2009 + +## Python Implementation Alternatives + +Really, as this book is being written, there are three primary implementations of the +Python language—CPython, Jython, and IronPython—along with a handful of secondary +implementations such as Stackless Python. In brief, CPython is the standard implementation; +all the others have very specific purposes and roles. All implement the +same Python language but execute programs in different ways. + +#### CPython +The original, and standard, implementation of Python is usually called CPython, when +you want to contrast it with the other two. Its name comes from the fact that it is coded +in portable ANSI C language code. This is the Python that you fetch from http://www +.python.org, get with the ActivePython distribution, and have automatically on most +Linux and Mac OS X machines. If you’ve found a preinstalled version of Python on +your machine, it’s probably CPython, unless your company is using Python in very +specialized ways. +Unless you want to script Java or .NET applications with Python, you probably want +to use the standard CPython system. Because it is the reference implementation of the +language, it tends to run the fastest, be the most complete, and be more robust than +the alternative systems. Figure 1-3 reflects CPython’s runtime architecture. + +#### Jython +The Jython system (originally known as JPython) is an alternative implementation of +the Python language, targeted for integration with the Java programming language. +Jython consists of Java classes that compile Python source code to Java byte code and +then route the resulting byte code to the Java Virtual Machine (JVM). Programmers +still code Python statements in .py text files as usual; the Jython system essentially just +replaces the rightmost two bubbles in Figure 1-3 with Java-based equivalents. +Jython’s goal is to allow Python code to script Java applications, much as CPython +allows Python to script C and C++ components. Its integration with Java is remarkably +seamless. Because Python code is translated to Java byte code, it looks and feels like a +true Java program at runtime. Jython scripts can serve as web applets and servlets, build +Java-based GUIs, and so on. Moreover, Jython includes integration support that allows +Python code to import and use Java classes as though they were coded in Python. +Because Jython is slower and less robust than CPython, though, it is usually seen as a +tool of interest primarily to Java developers looking for a scripting language to be a +frontend to Java code. + +#### IronPython +A third implementation of Python, and newer than both CPython and Jython, +IronPython is designed to allow Python programs to integrate with applications coded +to work with Microsoft’s .NET Framework for Windows, as well as the Mono open +source equivalent for Linux. .NET and its C# programming language runtime system +are designed to be a language-neutral object communication layer, in the spirit of Microsoft’s +earlier COM model. IronPython allows Python programs to act as both client +and server components, accessible from other .NET languages. +By implementation, IronPython is very much like Jython (and, in fact, was developed +by the same creator)—it replaces the last two bubbles in Figure 1-3 with equivalents +for execution in the .NET environment. Also, like Jython, IronPython has a special +focus—it is primarily of interest to developers integrating Python with .NET components. +Because it is being developed by Microsoft, though, IronPython might also be +able to leverage some important optimization tools for better performance. +IronPython’s scope is still evolving as I write this; for more details, consult the Python +online resources or search the Web. + +> **Source:** +> :fa-book: **Learning Python, Fourth Edition** by Mark Lutz - 2009 + + + +## Python Programming Language Advantages + + +Python is a dynamic, strongly typed, object oriented, multipurpose programming language, designed to be quick (to learn, to use, and to understand), and to enforce a clean and uniform syntax. + + 1. Python is dynamically typed: it means that you don't declare a type (e.g. 'integer') for a variable name, and then assign something of that type (and only that type). Instead, you have variable names, and you bind them to entities whose type stays with the entity itself. a = 5 makes the variable name a to refer to the integer 5. Later, a = "hello" makes the variable name a to refer to a string containing "hello". Static typed languages would have you declare int a and then a = 5, but assigning a = "hello" would have been a compile time error. On one hand, this makes everything more unpredictable (you don't know what a refers to). On the other hand, it makes very easy to achieve some results a static typed languages makes very difficult. + 2. Python is strongly typed. It means that if a = "5" (the string whose value is '5') will remain a string, and never coerced to a number if the context requires so. Every type conversion in python must be done explicitly. This is different from, for example, Perl or Javascript, where you have weak typing, and can write things like "hello" + 5 to get "hello5". + 3. Python is object oriented, with class-based inheritance. Everything is an object (including classes, functions, modules, etc), in the sense that they can be passed around as arguments, have methods and attributes, and so on. + 4. Python is multipurpose: it is not specialised to a specific target of users (like R for statistics, or PHP for web programming). It is extended through modules and libraries, that hook very easily into the C programming language. + 5. Python enforces correct indentation of the code by making the indentation part of the syntax. There are no control braces in Python. Blocks of code are identified by the level of indentation. Although a big turn off for many programmers not used to this, it is precious as it gives a very uniform style and results in code that is visually pleasant to read. + 6. The code is compiled into byte code and then executed in a virtual machine. This means that precompiled code is portable between platforms. + +Python can be used for any programming task, from GUI programming to web programming with everything else in between. It's quite efficient, as much of its activity is done at the C level. Python is just a layer on top of C. There are libraries for everything you can think of: game programming and openGL, GUI interfaces, web frameworks, semantic web, scientific computing... + +> **Source:** +> :fa-link: https://stackoverflow.com/questions/1909512/what-is-python-used-for + +#### Adventages again +- **Easy Syntax** +Python's syntax is easy to learn, so both non-programmers and programmers can start programming right away. +- **Readability** +Python's syntax is very clear, so it is easy to understand program code. (Python is often referred to as "executable pseudo-code" because its syntax mostly follows the conventions used by programmers to outline their ideas without the formal verbosity of code in most programming languages; in other words syntax of Python is almost identical to the simplified "pseudo-code" used by many programmers to prototype and describe their solution to other programmers. Thus Python can be used to prototype and test code which is later to be implemented in other programming languages).[citation needed] +- **High-Level Language** +Python looks more like a readable, human language than like a low-level language. This gives you the ability to program at a faster rate than a low-level language will allow you. +- **Object oriented programming** +Object-oriented programming allows you to create data structures that can be re-used, which reduces the amount of repetitive work that you'll need to do. Programming languages usually define objects with namespaces, like class or def, and objects can edit themselves by using keyword, like this or self. Most modern programming languages are object-oriented (such as Java, C++, and C#) or have support for OOP features (such as Perl version 5 and later). Additionally object-oriented techniques can be used in the design of almost any non-trivial software and implemented in almost any programming or scripting language. (For example a number of Linux kernel features are "objects" which implement their own encapsulation of behavior and data structive via pointers, specifically pointers to functions, in the C programming language).[citation needed] Python's support for object-oriented programming is one of its greatest benefits to new programmers because they will be encountering the same concepts and terminology in their work environment. If you ever decide to switch languages, or use any other for that fact, you'll have a significant chance that you'll be working with object-oriented programming.[1] +- **It's Free** +Python is both free and open-source. The Python Software Foundation distributes pre-made binaries that are freely available for use on all major operating systems called CPython. You can get CPython's source-code, too. Plus, you can modify the source code and distribute as allowed by CPython's license. [2] (Luckily, CPython has a permissive free software license attitude.) +- **Cross-platform** +Python runs on all major operating systems like Microsoft Windows, Linux, and Mac OS X. +- **Widely Supported** +Python has an active support community with many web sites, mailing lists, and USENET "netnews" groups that attract a large number of knowledgeable and helpful contributes. +- **It's Safe** +Python doesn't have pointers like other C-based languages, making it much more reliable. Along with that, errors never pass silently unless they're explicitly silenced. This allows you to see and read why the program crashed and where to correct your error. +- **Batteries Included** +Python is famous for being the "batteries are included" language.[3] There are over 300 standard library modules which contain modules and classes for a wide variety of programming tasks.[citation needed] For example the standard library contains modules for safely creating temporary files (named or anonymous), mapping files into memory (including use of shared and anonymous memory mappings), spawning and controlling sub-processes, compressing and decompressing files (compatible with gzip or PK-zip) and archives files (such as Unix/Linux "tar"), accessing indexed "DBM" (database) files, interfacing to various graphical user interfaces (such as the TK toolkit and the popular WxWindows multi-platform windowing system), parsing and maintaining CSV (comma-separated values) and ".cfg" or ".ini" configuration files (similar in syntax to the venerable WIN.INI files from MS-DOS and MS-Windows), for sending e-mail, fetching and parsing web pages, etc. It's possible, for example, to create a custom web server in Python using less than a dozen lines of code, and one of the standard libraries, of course. +- **Extensible** +In addition to the standard libraries there are extensive collections of freely available add-on modules, libraries, frameworks, and tool-kits. These generally conform to similar standards and conventions; for example almost all of the database adapters (to talk to almost any client-server RDBMS engine such as MySQL, Postgres, Oracle, etc) conform to the Python DBAPI and thus can mostly be accessed using the same code. So it's usually easy to modify a Python program to support any database engine. + +> **Source:** +> :fa-link: https://en.wikiversity.org/wiki/Python_Concepts/Why_learn_Python + +## Who Uses Python Today ? + +Here are links to just a few of the organizations that use python: +- :fa-link: https://wiki.python.org/moin/OrganizationsUsingPython + +Python Success Stories : +- :fa-link: https://www.python.org/about/success diff --git a/docs/index.md b/docs/index.md index aefeb99..f693eb7 100644 --- a/docs/index.md +++ b/docs/index.md @@ -11,3 +11,5 @@ So, after all I decided to share **top resources** for everyone about each topic Of course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than **30-40** chapters. +- Beginner + - [The Python Programming Language, Implementation and Adventages](https://ent1c3d.github.io/Python-Synopsis/site/beginner/1-Python_Programming_Lanuage) \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 1eb7085..5d7b507 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,12 +1,37 @@ +# Project information site_name: Python Synopsis -site_description: +site_description: Python Study Guide site_author: Goga Patarkatsishvili -copyright: Ent1c3d + +# Repository +repo_name: ent1c3d/Python-Synopsis +repo_url: https://ent1c3d.github.io/Python-Synopsis/site/ + +copyright: Copyright © 2017 Goga Patarkatsishvili + +# Pages pages: - Home : index.md - Beginner: - - The Python Programming Language, Implementation and Adventages : beginner/part1.md + - The Python Programming Language, Implementation and Adventages : beginner/1-Python_Programming_Lanuage.md - About: About.md -theme: cinder + +# Documentation and theme +theme: material markdown_extensions: - - fontawesome_markdown \ No newline at end of file + - fontawesome_markdown + +# Options +extra: +# logo: 'images/logo.svg' + palette: + primary: 'blue grey' + accent: 'light blue' +# font: +# text: 'Roboto' +# code: 'Roboto Mono' + social: + - type: 'github' + link: 'https://github.com/ent1c3d' + - type: 'linkedin' + link: 'https://www.linkedin.com/in/ent1c3d/' \ No newline at end of file diff --git a/site/404.html b/site/404.html index a17eb5a..592ebc7 100644 --- a/site/404.html +++ b/site/404.html @@ -1,182 +1,310 @@ - - - - - - - - - - - Python Synopsis - - - - - - - - - - - - - - - - - - - - - - - -
- - -
-
-

404

-

Page not found

-

Home

-
-
- - -
- -
-
-

- Ent1c3d
- - Documentation built with MkDocs.

-
- - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + Python Synopsis + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + +
+
+ + +
+
+
+ +
+
+
+ + + +
+
+ +

404 - Not found

+ + + + +
+
+
+
+ + +
+ + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/site/About/index.html b/site/About/index.html index b6ce462..92a6b60 100644 --- a/site/About/index.html +++ b/site/About/index.html @@ -1,247 +1,362 @@ - - - - - - - - - - - About - Python Synopsis - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -

Sit qua me lacrimis beatum pontum natorum

-

Quos Minoide sepulcrales pomi

-

Lorem markdownum magnae prosternite omnes alveus vimine transcribere timuere -penetrale; ambrosia marinas abruptaque corpora telum. Non admotum foret; -domo, nova veniam pondere; incipit.

-
    -
  • Tu hic
  • -
  • Cruores nec sororis heros amor fronti inplevere
  • -
  • Concitat dolens
  • -
  • Candentia genitore fiant
  • -
  • Linguam viderat coniuge rebar abire
  • -
-

Toto una miser spondet mutataeque obsedit hederae murmure Penthea gerebat -solebat tradidit! Perque sua caput genis terram vidit: di arces vidit inopes -caelo defendere harundo causa. Rota possit herbis bello peregit auctor rursus -habebimus nubibus maxima. Et et dicere, cultor, tamen arva Periclymeni -caelum saepe sunt emicat vidit.

-

Repperit est quoque visus at tamen in

-

Esse patior virga sit feruntur arva palustres prohibebar -vultusque audiri turbantur visum, gelidos? -Luctus et fabricata esse temptant molliri admonitorque dare currunt, -dedit? Amoris mihi properabat petit, -salve supremo haec rumoribus fine. Esse et futuri oculos duos Pandion?

-
-

Quis Vidi: ferox sub incenduntque Lycopen estque pennae iactat! Hanc corpus -neve Hecate Herculeis vacuum! Res illa fortunata iuvencae summa!

-
-

Venilia oscula; ora felicior metus hospita. Visendae -molitur. Iuvat non umerique -nostraque accipitris Somnia retentis ceciderunt adero mutatus? Est deum occiduo -odoro adnuit et omnibus ponunt, natalibus tecta, amanti. Ipse in perdere -Cyllenide opibus Aiaci calculus est exegi, in ergo altis monitis ore -quattuor enim.

-

Nostra terris Veneri et et exiguus omnia

-

Timore et genitor virum Apolline relicta e in nemus erant, ulla hunc pro, -quaeque caducifer supra et. Amicas tigno toris: incustoditae mora est, -requiritur nostra. Pronusque caret tegumenque Iovis, Tartara hos viri ignis, -aconiton praebuit Pithecusas sumo. Omne illo; contigit de quod est cara -suo, Ceres spatio et vetus haeserat, de.

-
volume_rootkit_tag += pcb_bar(packet_wildcard, document);
-if (token_dos / repeater * opacity_bar /
-        ddrProgressiveStreaming.clipboardTimeInternal(dllCameraCable)) {
-    peripheral_index += 1;
-}
-newbie += favorites_integrated - operatingDacProcess + 4 +
-        hypermedia_link_output + fiosGnuCut;
-data(tweetFormatData.sync_software(packetDirectDrive, duplex.openglDrive(
-        cable, compression_clean, 3), chip_trojan(1, type,
-        minisite_printer)), -1, dvi_leaf * maximizeDriveCaps);
-
-

Achivam undas filum parte sustulit, tellure aderam Mavortis carens! Pro in si -illa amor neget iurasse morsus. Temeraria potuit. Nec stipite, terris sed invito -est nimia nam, in sis tum naufragus ipse vota gramina auferat dixit: dies. -Sit ulciscitur navis, navita duplex voveas, tui potest versa, aequora ut -numine fidelius pudet.

- -
- -
-
-

- Ent1c3d
- - Documentation built with MkDocs.

-
- - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + About - Python Synopsis + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + +
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+ + + +

I'll write later

+ + + + + + + +
+
+
+
+ + + + +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/site/img/favicon.ico b/site/assets/images/favicon.ico similarity index 100% rename from site/img/favicon.ico rename to site/assets/images/favicon.ico diff --git a/site/assets/images/icons/bitbucket-670608a71a.svg b/site/assets/images/icons/bitbucket-670608a71a.svg new file mode 100644 index 0000000..7d95cb2 --- /dev/null +++ b/site/assets/images/icons/bitbucket-670608a71a.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/site/assets/images/icons/github-1da075986e.svg b/site/assets/images/icons/github-1da075986e.svg new file mode 100644 index 0000000..3cacb2e --- /dev/null +++ b/site/assets/images/icons/github-1da075986e.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/site/assets/images/icons/gitlab-5ad3f9f9e5.svg b/site/assets/images/icons/gitlab-5ad3f9f9e5.svg new file mode 100644 index 0000000..b036a9b --- /dev/null +++ b/site/assets/images/icons/gitlab-5ad3f9f9e5.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/site/assets/javascripts/application-6940329b9f.js b/site/assets/javascripts/application-6940329b9f.js new file mode 100644 index 0000000..4ce1717 --- /dev/null +++ b/site/assets/javascripts/application-6940329b9f.js @@ -0,0 +1 @@ +window.app=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=35)}([function(e,t,n){"use strict";var r=n(23)("wks"),i=n(14),o=n(1).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t,n){"use strict";var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t,n){"use strict";var r=n(10),i=n(25);e.exports=n(5)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){"use strict";var r=n(11);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){"use strict";var r=n(1),i=n(2),o=n(6),a=n(14)("src"),s=Function.toString,c=(""+s).split("toString");n(7).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var u="function"==typeof n;u&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(u&&(o(n,a)||i(n,a,e[t]?""+e[t]:c.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||s.call(this)})},function(e,t,n){"use strict";e.exports=!n(24)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){"use strict";var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,n){"use strict";var r=e.exports={version:"2.4.0"};"number"==typeof __e&&(__e=r)},function(e,t,n){"use strict";e.exports={}},function(e,t,n){"use strict";var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,n){"use strict";var r=n(3),i=n(38),o=n(39),a=Object.defineProperty;t.f=n(5)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(e){return"object"===(void 0===e?"undefined":r(e))?null!==e:"function"==typeof e}},function(e,t,n){"use strict";var r=n(18);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){"use strict";var r=n(9),i=n(0)("toStringTag"),o="Arguments"==r(function(){return arguments}()),a=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=a(t=Object(e),i))?n:o?r(t):"Object"==(s=r(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t,n){"use strict";var r=0,i=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+i).toString(36))}},function(e,t,n){"use strict";var r=n(11),i=n(1).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,n){"use strict";var r=Math.ceil,i=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?i:r)(e)}},function(e,t,n){"use strict";e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){"use strict";var r=n(47),i=n(17);e.exports=function(e){return r(i(e))}},function(e,t,n){"use strict";var r=n(23)("keys"),i=n(14);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t,n){"use strict";var r=n(10).f,i=n(6),o=n(0)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={createElement:function(e,t){var n=document.createElement(e);t&&Array.prototype.forEach.call(Object.keys(t),function(e){n.setAttribute(e,t[e])});for(var r=arguments.length,i=Array(r>2?r-2:0),o=2;o0?i(r(e),9007199254740991):0}},function(e,t,n){"use strict";e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){"use strict";e.exports=n(1).document&&document.documentElement},function(e,t,n){"use strict";var r,i,o,a=n(12),s=n(63),c=n(31),u=n(15),l=n(1),f=l.process,h=l.setImmediate,d=l.clearImmediate,p=l.MessageChannel,m=0,y={},v=function(){var e=+this;if(y.hasOwnProperty(e)){var t=y[e];delete y[e],t()}},g=function(e){v.call(e.data)};h&&d||(h=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return y[++m]=function(){s("function"==typeof e?e:Function(e),t)},r(m),m},d=function(e){delete y[e]},"process"==n(9)(f)?r=function(e){f.nextTick(a(v,e,1))}:p?(i=new p,o=i.port2,i.port1.onmessage=g,r=a(o.postMessage,o,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(e){l.postMessage(e+"","*")},l.addEventListener("message",g,!1)):r="onreadystatechange"in u("script")?function(e){c.appendChild(u("script")).onreadystatechange=function(){c.removeChild(this),v.call(e)}}:function(e){setTimeout(a(v,e,1),0)}),e.exports={set:h,clear:d}},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;n=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){"use strict";var r=n(16),i=n(17);e.exports=function(e){return function(t,n){var o,a,s=String(i(t)),c=r(n),u=s.length;return c<0||c>=u?e?"":void 0:(o=s.charCodeAt(c),o<55296||o>56319||c+1===u||(a=s.charCodeAt(c+1))<56320||a>57343?e?s.charAt(c):o:e?s.slice(c,c+2):a-56320+(o-55296<<10)+65536)}}},function(e,t,n){"use strict";var r=n(43),i=n(25),o=n(21),a={};n(2)(a,n(0)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){"use strict";var r=n(3),i=n(44),o=n(30),a=n(20)("IE_PROTO"),s=function(){},c=function(){var e,t=n(15)("iframe"),r=o.length;for(t.style.display="none",n(31).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(" - - - - - - - - - -
- - -
- -

Welcome to Python Synopsis by Ent!

-
-

The Python Programming Language

-

The programming language you will learn is Python. Python is an example of a highlevel -language; other high-level languages you might have heard of are C, C++, Perl, -and Java. -There are also low-level languages, sometimes referred to as “machine languages” or -“assembly languages.” Loosely speaking, computers can only run programs written in -low-level languages. So programs written in a high-level language have to be processed -before they can run. This extra processing takes some time, which is a small disadvantage -of high-level languages.

-

The advantages are enormous. First, it is much easier to program in a high-level lan -guage. Programs written in a high-level language take less time to write, they are shorter -and easier to read, and they are more likely to be correct. Second, high-level languages -are portable, meaning that they can run on different kinds of computers with few or no -modifications. Low-level programs can run on only one kind of computer and have to -be rewritten to run on another.

-

Due to these advantages, almost all programs are written in high-level languages. Lowlevel -languages are used only for a few specialized applications.

-

Two kinds of programs process high-level languages into low-level languages: -interpreters and compilers. An interpreter reads a high-level program and executes it, -meaning that it does what the program says. It processes the program a little at a time, -alternately reading lines and performing computations. Figure 1-1 shows the structure -of an interpreter.

-

Figure 1-1.  An interpreter processes the program a little at a time, alternately reading lines
-and performing computations.

-

A compiler reads the program and translates it completely before the program starts -running. In this context, the high-level program is called the source code, and the -translated program is called the object code or the executable. Once a program is com -piled, you can execute it repeatedly without further translation. Figure 1-2 shows the -structure of a compiler.

-

Figure 1-2. A compiler translates source code into object code, which is run by a hardware
-executor.

-

Python is considered an interpreted language because Python programs are executed -by an interpreter. There are two ways to use the interpreter: interactive mode and script mode. In interactive mode, you type Python programs and the interpreter displays the -result: ->>> 1 + 1 -2 -The chevron, >>>, is the prompt the interpreter uses to indicate that it is ready. If you -type 1 + 1, the interpreter replies 2.

-

Alternatively, you can store code in a file and use the interpreter to execute the contents -of the file, which is called a script. By convention, Python scripts have names that end -with .py. -To execute the script, you have to tell the interpreter the name of the file. If you have a -script named dinsdale.py and you are working in a UNIX command window, you type -python dinsdale.py. In other development environments, the details of executing -scripts are different. You can find instructions for your environment at the Python web -site http://python.org. -Working in interactive mode is convenient for testing small pieces of code because you -can type and execute them immediately. But for anything more than a few lines, you -should save your code as a script so you can modify and execute it in the future.

-
-

Source:
- Think Python by Allen B. Downey - 2012

-
-

Python’s View

-

The brief description in the prior section is fairly standard for scripting languages, and -it’s usually all that most Python programmers need to know. You type code into text -files, and you run those files through the interpreter. Under the hood, though, a bit -more happens when you tell Python to “go.” Although knowledge of Python internals -is not strictly required for Python programming, a basic understanding of the runtime -structure of Python can help you grasp the bigger picture of program execution. -When you instruct Python to run your script, there are a few steps that Python carries -out before your code actually starts crunching away. Specifically, it’s first compiled to -something called “byte code” and then routed to something called a “virtual machine.”

-

Byte code compilation

-

Internally, and almost completely hidden from you, when you execute a program -Python first compiles your source code (the statements in your file) into a format known -as byte code. Compilation is simply a translation step, and byte code is a lower-level, -platform-independent representation of your source code. Roughly, Python translates -each of your source statements into a group of byte code instructions by decomposing -them into individual steps. This byte code translation is performed to speed -execution—byte code can be run much more quickly than the original source code -statements in your text file. -You’ll notice that the prior paragraph said that this is almost completely hidden from -you. If the Python process has write access on your machine, it will store the byte code -of your programs in files that end with a .pyc extension (“.pyc” means compiled “.py” -source). You will see these files show up on your computer after you’ve run a few -programs alongside the corresponding source code files (that is, in the same -directories). -Python saves byte code like this as a startup speed optimization. The next time you run -your program, Python will load the .pyc files and skip the compilation step, as long as -you haven’t changed your source code since the byte code was last saved. Python automatically -checks the timestamps of source and byte code files to know when it must -recompile—if you resave your source code, byte code is automatically re-created the -next time your program is run. -If Python cannot write the byte code files to your machine, your program still works— -the byte code is generated in memory and simply discarded on program exit.* However, -because .pyc files speed startup time, you’ll want to make sure they are written for larger -programs. Byte code files are also one way to ship Python programs—Python is happy -to run a program if all it can find are .pyc files, even if the original .py source files are -absent.

-

The Python Virtual Machine (PVM)

-

Once your program has been compiled to byte code (or the byte code has been loaded -from existing .pyc files), it is shipped off for execution to something generally known -as the Python Virtual Machine (PVM, for the more acronym-inclined among you). The -PVM sounds more impressive than it is; really, it’s not a separate program, and it need -not be installed by itself. In fact, the PVM is just a big loop that iterates through your -byte code instructions, one by one, to carry out their operations. The PVM is the runtime -engine of Python; it’s always present as part of the Python system, and it’s the -component that truly runs your scripts. Technically, it’s just the last step of what is -called the “Python interpreter.”

-

Figure 1-3. Python’s traditional runtime execution model: source code you type is translated to byte
-code, which is then run by the Python Virtual Machine. Your code is automatically compiled, but then
-it is interpreted.

-

Figure illustrates the runtime structure described here. Keep in mind that all of this -complexity is deliberately hidden from Python programmers. Byte code compilation is -automatic, and the PVM is just part of the Python system that you have installed on -your machine. Again, programmers simply code and run files of statements.

-

Performance implications

-

Readers with a background in fully compiled languages such as C and C++ might notice -a few differences in the Python model. For one thing, there is usually no build or “make” -step in Python work: code runs immediately after it is written. For another, Python byte -code is not binary machine code (e.g., instructions for an Intel chip). Byte code is a -Python-specific representation.

-

This is why some Python code may not run as fast as C or C++ code, as described in -Chapter 1—the PVM loop, not the CPU chip, still must interpret the byte code, and -byte code instructions require more work than CPU instructions. On the other hand, -unlike in classic interpreters, there is still an internal compile step—Python does not -need to reanalyze and reparse each source statement repeatedly. The net effect is that -pure Python code runs at speeds somewhere between those of a traditional compiled -language and a traditional interpreted language. See Chapter 1 for more on Python -performance tradeoffs.

-
-

Source:
- Learning Python, Fourth Edition by Mark Lutz - 2009

-
-

Python Implementation Alternatives

-

Really, as this book is being written, there are three primary implementations of the -Python language—CPython, Jython, and IronPython—along with a handful of secondary -implementations such as Stackless Python. In brief, CPython is the standard implementation; -all the others have very specific purposes and roles. All implement the -same Python language but execute programs in different ways.

-

CPython

-

The original, and standard, implementation of Python is usually called CPython, when -you want to contrast it with the other two. Its name comes from the fact that it is coded -in portable ANSI C language code. This is the Python that you fetch from http://www -.python.org, get with the ActivePython distribution, and have automatically on most -Linux and Mac OS X machines. If you’ve found a preinstalled version of Python on -your machine, it’s probably CPython, unless your company is using Python in very -specialized ways. -Unless you want to script Java or .NET applications with Python, you probably want -to use the standard CPython system. Because it is the reference implementation of the -language, it tends to run the fastest, be the most complete, and be more robust than -the alternative systems. Figure 1-3 reflects CPython’s runtime architecture.

-

Jython

-

The Jython system (originally known as JPython) is an alternative implementation of -the Python language, targeted for integration with the Java programming language. -Jython consists of Java classes that compile Python source code to Java byte code and -then route the resulting byte code to the Java Virtual Machine (JVM). Programmers -still code Python statements in .py text files as usual; the Jython system essentially just -replaces the rightmost two bubbles in Figure 1-3 with Java-based equivalents. -Jython’s goal is to allow Python code to script Java applications, much as CPython -allows Python to script C and C++ components. Its integration with Java is remarkably -seamless. Because Python code is translated to Java byte code, it looks and feels like a -true Java program at runtime. Jython scripts can serve as web applets and servlets, build -Java-based GUIs, and so on. Moreover, Jython includes integration support that allows -Python code to import and use Java classes as though they were coded in Python. -Because Jython is slower and less robust than CPython, though, it is usually seen as a -tool of interest primarily to Java developers looking for a scripting language to be a -frontend to Java code.

-

IronPython

-

A third implementation of Python, and newer than both CPython and Jython, -IronPython is designed to allow Python programs to integrate with applications coded -to work with Microsoft’s .NET Framework for Windows, as well as the Mono open -source equivalent for Linux. .NET and its C# programming language runtime system -are designed to be a language-neutral object communication layer, in the spirit of Microsoft’s -earlier COM model. IronPython allows Python programs to act as both client -and server components, accessible from other .NET languages. -By implementation, IronPython is very much like Jython (and, in fact, was developed -by the same creator)—it replaces the last two bubbles in Figure 1-3 with equivalents -for execution in the .NET environment. Also, like Jython, IronPython has a special -focus—it is primarily of interest to developers integrating Python with .NET components. -Because it is being developed by Microsoft, though, IronPython might also be -able to leverage some important optimization tools for better performance. -IronPython’s scope is still evolving as I write this; for more details, consult the Python -online resources or search the Web.

-
-

Source:
- Learning Python, Fourth Edition by Mark Lutz - 2009

-
-

Python Programming Language Advantages

-

Python is a dynamic, strongly typed, object oriented, multipurpose programming language, designed to be quick (to learn, to use, and to understand), and to enforce a clean and uniform syntax.

-
    -
  1. Python is dynamically typed: it means that you don't declare a type (e.g. 'integer') for a variable name, and then assign something of that type (and only that type). Instead, you have variable names, and you bind them to entities whose type stays with the entity itself. a = 5 makes the variable name a to refer to the integer 5. Later, a = "hello" makes the variable name a to refer to a string containing "hello". Static typed languages would have you declare int a and then a = 5, but assigning a = "hello" would have been a compile time error. On one hand, this makes everything more unpredictable (you don't know what a refers to). On the other hand, it makes very easy to achieve some results a static typed languages makes very difficult.
  2. -
  3. Python is strongly typed. It means that if a = "5" (the string whose value is '5') will remain a string, and never coerced to a number if the context requires so. Every type conversion in python must be done explicitly. This is different from, for example, Perl or Javascript, where you have weak typing, and can write things like "hello" + 5 to get "hello5".
  4. -
  5. Python is object oriented, with class-based inheritance. Everything is an object (including classes, functions, modules, etc), in the sense that they can be passed around as arguments, have methods and attributes, and so on.
  6. -
  7. Python is multipurpose: it is not specialised to a specific target of users (like R for statistics, or PHP for web programming). It is extended through modules and libraries, that hook very easily into the C programming language.
  8. -
  9. Python enforces correct indentation of the code by making the indentation part of the syntax. There are no control braces in Python. Blocks of code are identified by the level of indentation. Although a big turn off for many programmers not used to this, it is precious as it gives a very uniform style and results in code that is visually pleasant to read.
  10. -
  11. The code is compiled into byte code and then executed in a virtual machine. This means that precompiled code is portable between platforms.
  12. -
-

Python can be used for any programming task, from GUI programming to web programming with everything else in between. It's quite efficient, as much of its activity is done at the C level. Python is just a layer on top of C. There are libraries for everything you can think of: game programming and openGL, GUI interfaces, web frameworks, semantic web, scientific computing...

-
-

Source:
- https://stackoverflow.com/questions/1909512/what-is-python-used-for

-
-

Adventages again

-
    -
  • Easy Syntax -Python's syntax is easy to learn, so both non-programmers and programmers can start programming right away.
  • -
  • Readability -Python's syntax is very clear, so it is easy to understand program code. (Python is often referred to as "executable pseudo-code" because its syntax mostly follows the conventions used by programmers to outline their ideas without the formal verbosity of code in most programming languages; in other words syntax of Python is almost identical to the simplified "pseudo-code" used by many programmers to prototype and describe their solution to other programmers. Thus Python can be used to prototype and test code which is later to be implemented in other programming languages).[citation needed]
  • -
  • High-Level Language -Python looks more like a readable, human language than like a low-level language. This gives you the ability to program at a faster rate than a low-level language will allow you.
  • -
  • Object oriented programming -Object-oriented programming allows you to create data structures that can be re-used, which reduces the amount of repetitive work that you'll need to do. Programming languages usually define objects with namespaces, like class or def, and objects can edit themselves by using keyword, like this or self. Most modern programming languages are object-oriented (such as Java, C++, and C#) or have support for OOP features (such as Perl version 5 and later). Additionally object-oriented techniques can be used in the design of almost any non-trivial software and implemented in almost any programming or scripting language. (For example a number of Linux kernel features are "objects" which implement their own encapsulation of behavior and data structive via pointers, specifically pointers to functions, in the C programming language).[citation needed] Python's support for object-oriented programming is one of its greatest benefits to new programmers because they will be encountering the same concepts and terminology in their work environment. If you ever decide to switch languages, or use any other for that fact, you'll have a significant chance that you'll be working with object-oriented programming.[1]
  • -
  • It's Free -Python is both free and open-source. The Python Software Foundation distributes pre-made binaries that are freely available for use on all major operating systems called CPython. You can get CPython's source-code, too. Plus, you can modify the source code and distribute as allowed by CPython's license. [2] (Luckily, CPython has a permissive free software license attitude.)
  • -
  • Cross-platform -Python runs on all major operating systems like Microsoft Windows, Linux, and Mac OS X.
  • -
  • Widely Supported -Python has an active support community with many web sites, mailing lists, and USENET "netnews" groups that attract a large number of knowledgeable and helpful contributes.
  • -
  • It's Safe -Python doesn't have pointers like other C-based languages, making it much more reliable. Along with that, errors never pass silently unless they're explicitly silenced. This allows you to see and read why the program crashed and where to correct your error.
  • -
  • Batteries Included -Python is famous for being the "batteries are included" language.[3] There are over 300 standard library modules which contain modules and classes for a wide variety of programming tasks.[citation needed] For example the standard library contains modules for safely creating temporary files (named or anonymous), mapping files into memory (including use of shared and anonymous memory mappings), spawning and controlling sub-processes, compressing and decompressing files (compatible with gzip or PK-zip) and archives files (such as Unix/Linux "tar"), accessing indexed "DBM" (database) files, interfacing to various graphical user interfaces (such as the TK toolkit and the popular WxWindows multi-platform windowing system), parsing and maintaining CSV (comma-separated values) and ".cfg" or ".ini" configuration files (similar in syntax to the venerable WIN.INI files from MS-DOS and MS-Windows), for sending e-mail, fetching and parsing web pages, etc. It's possible, for example, to create a custom web server in Python using less than a dozen lines of code, and one of the standard libraries, of course.
  • -
  • Extensible -In addition to the standard libraries there are extensive collections of freely available add-on modules, libraries, frameworks, and tool-kits. These generally conform to similar standards and conventions; for example almost all of the database adapters (to talk to almost any client-server RDBMS engine such as MySQL, Postgres, Oracle, etc) conform to the Python DBAPI and thus can mostly be accessed using the same code. So it's usually easy to modify a Python program to support any database engine.
  • -
-
-

Source:
- https://en.wikiversity.org/wiki/Python_Concepts/Why_learn_Python

-
-

Who Uses Python Today ?

-

Here are links to just a few of the organizations that use python:
-- https://wiki.python.org/moin/OrganizationsUsingPython

-

Python Success Stories :
-- https://www.python.org/about/success

- -
- -
-
-

- Ent1c3d
- - Documentation built with MkDocs.

-
- - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + The Python Programming Language, Implementation and Adventages - Python Synopsis + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + +
+
+ + +
+
+
+ +
+
+
+ + + + + +
+
+ + + +

The Python Programming Language

+
+

The programming language you will learn is Python. Python is an example of a highlevel +language; other high-level languages you might have heard of are C, C++, Perl, +and Java. +There are also low-level languages, sometimes referred to as “machine languages” or +“assembly languages.” Loosely speaking, computers can only run programs written in +low-level languages. So programs written in a high-level language have to be processed +before they can run. This extra processing takes some time, which is a small disadvantage +of high-level languages.

+

The advantages are enormous. First, it is much easier to program in a high-level lan +guage. Programs written in a high-level language take less time to write, they are shorter +and easier to read, and they are more likely to be correct. Second, high-level languages +are portable, meaning that they can run on different kinds of computers with few or no +modifications. Low-level programs can run on only one kind of computer and have to +be rewritten to run on another.

+

Due to these advantages, almost all programs are written in high-level languages. Lowlevel +languages are used only for a few specialized applications.

+

Two kinds of programs process high-level languages into low-level languages: +interpreters and compilers. An interpreter reads a high-level program and executes it, +meaning that it does what the program says. It processes the program a little at a time, +alternately reading lines and performing computations. Figure 1-1 shows the structure +of an interpreter.

+

Figure 1-1.  An interpreter processes the program a little at a time, alternately reading lines
+and performing computations.

+

A compiler reads the program and translates it completely before the program starts +running. In this context, the high-level program is called the source code, and the +translated program is called the object code or the executable. Once a program is com +piled, you can execute it repeatedly without further translation. Figure 1-2 shows the +structure of a compiler.

+

Figure 1-2. A compiler translates source code into object code, which is run by a hardware
+executor.

+

Python is considered an interpreted language because Python programs are executed +by an interpreter. There are two ways to use the interpreter: interactive mode and script mode. In interactive mode, you type Python programs and the interpreter displays the +result: +>>> 1 + 1 +2 +The chevron, >>>, is the prompt the interpreter uses to indicate that it is ready. If you +type 1 + 1, the interpreter replies 2.

+

Alternatively, you can store code in a file and use the interpreter to execute the contents +of the file, which is called a script. By convention, Python scripts have names that end +with .py. +To execute the script, you have to tell the interpreter the name of the file. If you have a +script named dinsdale.py and you are working in a UNIX command window, you type +python dinsdale.py. In other development environments, the details of executing +scripts are different. You can find instructions for your environment at the Python web +site http://python.org. +Working in interactive mode is convenient for testing small pieces of code because you +can type and execute them immediately. But for anything more than a few lines, you +should save your code as a script so you can modify and execute it in the future.

+
+

Source:
+ Think Python by Allen B. Downey - 2012

+
+

Python’s View

+

The brief description in the prior section is fairly standard for scripting languages, and +it’s usually all that most Python programmers need to know. You type code into text +files, and you run those files through the interpreter. Under the hood, though, a bit +more happens when you tell Python to “go.” Although knowledge of Python internals +is not strictly required for Python programming, a basic understanding of the runtime +structure of Python can help you grasp the bigger picture of program execution. +When you instruct Python to run your script, there are a few steps that Python carries +out before your code actually starts crunching away. Specifically, it’s first compiled to +something called “byte code” and then routed to something called a “virtual machine.”

+

Byte code compilation

+

Internally, and almost completely hidden from you, when you execute a program +Python first compiles your source code (the statements in your file) into a format known +as byte code. Compilation is simply a translation step, and byte code is a lower-level, +platform-independent representation of your source code. Roughly, Python translates +each of your source statements into a group of byte code instructions by decomposing +them into individual steps. This byte code translation is performed to speed +execution—byte code can be run much more quickly than the original source code +statements in your text file. +You’ll notice that the prior paragraph said that this is almost completely hidden from +you. If the Python process has write access on your machine, it will store the byte code +of your programs in files that end with a .pyc extension (“.pyc” means compiled “.py” +source). You will see these files show up on your computer after you’ve run a few +programs alongside the corresponding source code files (that is, in the same +directories). +Python saves byte code like this as a startup speed optimization. The next time you run +your program, Python will load the .pyc files and skip the compilation step, as long as +you haven’t changed your source code since the byte code was last saved. Python automatically +checks the timestamps of source and byte code files to know when it must +recompile—if you resave your source code, byte code is automatically re-created the +next time your program is run. +If Python cannot write the byte code files to your machine, your program still works— +the byte code is generated in memory and simply discarded on program exit.* However, +because .pyc files speed startup time, you’ll want to make sure they are written for larger +programs. Byte code files are also one way to ship Python programs—Python is happy +to run a program if all it can find are .pyc files, even if the original .py source files are +absent.

+

The Python Virtual Machine (PVM)

+

Once your program has been compiled to byte code (or the byte code has been loaded +from existing .pyc files), it is shipped off for execution to something generally known +as the Python Virtual Machine (PVM, for the more acronym-inclined among you). The +PVM sounds more impressive than it is; really, it’s not a separate program, and it need +not be installed by itself. In fact, the PVM is just a big loop that iterates through your +byte code instructions, one by one, to carry out their operations. The PVM is the runtime +engine of Python; it’s always present as part of the Python system, and it’s the +component that truly runs your scripts. Technically, it’s just the last step of what is +called the “Python interpreter.”

+

Figure 1-3. Python’s traditional runtime execution model: source code you type is translated to byte
+code, which is then run by the Python Virtual Machine. Your code is automatically compiled, but then
+it is interpreted.

+

Figure illustrates the runtime structure described here. Keep in mind that all of this +complexity is deliberately hidden from Python programmers. Byte code compilation is +automatic, and the PVM is just part of the Python system that you have installed on +your machine. Again, programmers simply code and run files of statements.

+

Performance implications

+

Readers with a background in fully compiled languages such as C and C++ might notice +a few differences in the Python model. For one thing, there is usually no build or “make” +step in Python work: code runs immediately after it is written. For another, Python byte +code is not binary machine code (e.g., instructions for an Intel chip). Byte code is a +Python-specific representation.

+

This is why some Python code may not run as fast as C or C++ code, as described in +Chapter 1—the PVM loop, not the CPU chip, still must interpret the byte code, and +byte code instructions require more work than CPU instructions. On the other hand, +unlike in classic interpreters, there is still an internal compile step—Python does not +need to reanalyze and reparse each source statement repeatedly. The net effect is that +pure Python code runs at speeds somewhere between those of a traditional compiled +language and a traditional interpreted language. See Chapter 1 for more on Python +performance tradeoffs.

+
+

Source:
+ Learning Python, Fourth Edition by Mark Lutz - 2009

+
+

Python Implementation Alternatives

+

Really, as this book is being written, there are three primary implementations of the +Python language—CPython, Jython, and IronPython—along with a handful of secondary +implementations such as Stackless Python. In brief, CPython is the standard implementation; +all the others have very specific purposes and roles. All implement the +same Python language but execute programs in different ways.

+

CPython

+

The original, and standard, implementation of Python is usually called CPython, when +you want to contrast it with the other two. Its name comes from the fact that it is coded +in portable ANSI C language code. This is the Python that you fetch from http://www +.python.org, get with the ActivePython distribution, and have automatically on most +Linux and Mac OS X machines. If you’ve found a preinstalled version of Python on +your machine, it’s probably CPython, unless your company is using Python in very +specialized ways. +Unless you want to script Java or .NET applications with Python, you probably want +to use the standard CPython system. Because it is the reference implementation of the +language, it tends to run the fastest, be the most complete, and be more robust than +the alternative systems. Figure 1-3 reflects CPython’s runtime architecture.

+

Jython

+

The Jython system (originally known as JPython) is an alternative implementation of +the Python language, targeted for integration with the Java programming language. +Jython consists of Java classes that compile Python source code to Java byte code and +then route the resulting byte code to the Java Virtual Machine (JVM). Programmers +still code Python statements in .py text files as usual; the Jython system essentially just +replaces the rightmost two bubbles in Figure 1-3 with Java-based equivalents. +Jython’s goal is to allow Python code to script Java applications, much as CPython +allows Python to script C and C++ components. Its integration with Java is remarkably +seamless. Because Python code is translated to Java byte code, it looks and feels like a +true Java program at runtime. Jython scripts can serve as web applets and servlets, build +Java-based GUIs, and so on. Moreover, Jython includes integration support that allows +Python code to import and use Java classes as though they were coded in Python. +Because Jython is slower and less robust than CPython, though, it is usually seen as a +tool of interest primarily to Java developers looking for a scripting language to be a +frontend to Java code.

+

IronPython

+

A third implementation of Python, and newer than both CPython and Jython, +IronPython is designed to allow Python programs to integrate with applications coded +to work with Microsoft’s .NET Framework for Windows, as well as the Mono open +source equivalent for Linux. .NET and its C# programming language runtime system +are designed to be a language-neutral object communication layer, in the spirit of Microsoft’s +earlier COM model. IronPython allows Python programs to act as both client +and server components, accessible from other .NET languages. +By implementation, IronPython is very much like Jython (and, in fact, was developed +by the same creator)—it replaces the last two bubbles in Figure 1-3 with equivalents +for execution in the .NET environment. Also, like Jython, IronPython has a special +focus—it is primarily of interest to developers integrating Python with .NET components. +Because it is being developed by Microsoft, though, IronPython might also be +able to leverage some important optimization tools for better performance. +IronPython’s scope is still evolving as I write this; for more details, consult the Python +online resources or search the Web.

+
+

Source:
+ Learning Python, Fourth Edition by Mark Lutz - 2009

+
+

Python Programming Language Advantages

+

Python is a dynamic, strongly typed, object oriented, multipurpose programming language, designed to be quick (to learn, to use, and to understand), and to enforce a clean and uniform syntax.

+
    +
  1. Python is dynamically typed: it means that you don't declare a type (e.g. 'integer') for a variable name, and then assign something of that type (and only that type). Instead, you have variable names, and you bind them to entities whose type stays with the entity itself. a = 5 makes the variable name a to refer to the integer 5. Later, a = "hello" makes the variable name a to refer to a string containing "hello". Static typed languages would have you declare int a and then a = 5, but assigning a = "hello" would have been a compile time error. On one hand, this makes everything more unpredictable (you don't know what a refers to). On the other hand, it makes very easy to achieve some results a static typed languages makes very difficult.
  2. +
  3. Python is strongly typed. It means that if a = "5" (the string whose value is '5') will remain a string, and never coerced to a number if the context requires so. Every type conversion in python must be done explicitly. This is different from, for example, Perl or Javascript, where you have weak typing, and can write things like "hello" + 5 to get "hello5".
  4. +
  5. Python is object oriented, with class-based inheritance. Everything is an object (including classes, functions, modules, etc), in the sense that they can be passed around as arguments, have methods and attributes, and so on.
  6. +
  7. Python is multipurpose: it is not specialised to a specific target of users (like R for statistics, or PHP for web programming). It is extended through modules and libraries, that hook very easily into the C programming language.
  8. +
  9. Python enforces correct indentation of the code by making the indentation part of the syntax. There are no control braces in Python. Blocks of code are identified by the level of indentation. Although a big turn off for many programmers not used to this, it is precious as it gives a very uniform style and results in code that is visually pleasant to read.
  10. +
  11. The code is compiled into byte code and then executed in a virtual machine. This means that precompiled code is portable between platforms.
  12. +
+

Python can be used for any programming task, from GUI programming to web programming with everything else in between. It's quite efficient, as much of its activity is done at the C level. Python is just a layer on top of C. There are libraries for everything you can think of: game programming and openGL, GUI interfaces, web frameworks, semantic web, scientific computing...

+
+

Source:
+ https://stackoverflow.com/questions/1909512/what-is-python-used-for

+
+

Adventages again

+
    +
  • Easy Syntax +Python's syntax is easy to learn, so both non-programmers and programmers can start programming right away.
  • +
  • Readability +Python's syntax is very clear, so it is easy to understand program code. (Python is often referred to as "executable pseudo-code" because its syntax mostly follows the conventions used by programmers to outline their ideas without the formal verbosity of code in most programming languages; in other words syntax of Python is almost identical to the simplified "pseudo-code" used by many programmers to prototype and describe their solution to other programmers. Thus Python can be used to prototype and test code which is later to be implemented in other programming languages).[citation needed]
  • +
  • High-Level Language +Python looks more like a readable, human language than like a low-level language. This gives you the ability to program at a faster rate than a low-level language will allow you.
  • +
  • Object oriented programming +Object-oriented programming allows you to create data structures that can be re-used, which reduces the amount of repetitive work that you'll need to do. Programming languages usually define objects with namespaces, like class or def, and objects can edit themselves by using keyword, like this or self. Most modern programming languages are object-oriented (such as Java, C++, and C#) or have support for OOP features (such as Perl version 5 and later). Additionally object-oriented techniques can be used in the design of almost any non-trivial software and implemented in almost any programming or scripting language. (For example a number of Linux kernel features are "objects" which implement their own encapsulation of behavior and data structive via pointers, specifically pointers to functions, in the C programming language).[citation needed] Python's support for object-oriented programming is one of its greatest benefits to new programmers because they will be encountering the same concepts and terminology in their work environment. If you ever decide to switch languages, or use any other for that fact, you'll have a significant chance that you'll be working with object-oriented programming.[1]
  • +
  • It's Free +Python is both free and open-source. The Python Software Foundation distributes pre-made binaries that are freely available for use on all major operating systems called CPython. You can get CPython's source-code, too. Plus, you can modify the source code and distribute as allowed by CPython's license. [2] (Luckily, CPython has a permissive free software license attitude.)
  • +
  • Cross-platform +Python runs on all major operating systems like Microsoft Windows, Linux, and Mac OS X.
  • +
  • Widely Supported +Python has an active support community with many web sites, mailing lists, and USENET "netnews" groups that attract a large number of knowledgeable and helpful contributes.
  • +
  • It's Safe +Python doesn't have pointers like other C-based languages, making it much more reliable. Along with that, errors never pass silently unless they're explicitly silenced. This allows you to see and read why the program crashed and where to correct your error.
  • +
  • Batteries Included +Python is famous for being the "batteries are included" language.[3] There are over 300 standard library modules which contain modules and classes for a wide variety of programming tasks.[citation needed] For example the standard library contains modules for safely creating temporary files (named or anonymous), mapping files into memory (including use of shared and anonymous memory mappings), spawning and controlling sub-processes, compressing and decompressing files (compatible with gzip or PK-zip) and archives files (such as Unix/Linux "tar"), accessing indexed "DBM" (database) files, interfacing to various graphical user interfaces (such as the TK toolkit and the popular WxWindows multi-platform windowing system), parsing and maintaining CSV (comma-separated values) and ".cfg" or ".ini" configuration files (similar in syntax to the venerable WIN.INI files from MS-DOS and MS-Windows), for sending e-mail, fetching and parsing web pages, etc. It's possible, for example, to create a custom web server in Python using less than a dozen lines of code, and one of the standard libraries, of course.
  • +
  • Extensible +In addition to the standard libraries there are extensive collections of freely available add-on modules, libraries, frameworks, and tool-kits. These generally conform to similar standards and conventions; for example almost all of the database adapters (to talk to almost any client-server RDBMS engine such as MySQL, Postgres, Oracle, etc) conform to the Python DBAPI and thus can mostly be accessed using the same code. So it's usually easy to modify a Python program to support any database engine.
  • +
+
+

Source:
+ https://en.wikiversity.org/wiki/Python_Concepts/Why_learn_Python

+
+

Who Uses Python Today ?

+

Here are links to just a few of the organizations that use python:
+- https://wiki.python.org/moin/OrganizationsUsingPython

+

Python Success Stories :
+- https://www.python.org/about/success

+ + + + + + + +
+
+
+
+ + + + +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/site/css/base.css b/site/css/base.css deleted file mode 100644 index cd505a3..0000000 --- a/site/css/base.css +++ /dev/null @@ -1,168 +0,0 @@ -body { - padding-top: 70px; -} - -h1[id]:before, h2[id]:before, h3[id]:before, h4[id]:before, h5[id]:before, h6[id]:before { - content: ""; - display: block; - margin-top: -75px; - height: 75px; -} - -ul.nav li.first-level { - font-weight: bold; -} - -ul.nav li.third-level { - padding-left: 12px; -} - -div.col-md-3 { - padding-left: 0; -} - -div.col-md-9 { - padding-bottom: 100px; -} - -div.source-links { - float: right; -} - -/* - * Side navigation - * - * Scrollspy and affixed enhanced navigation to highlight sections and secondary - * sections of docs content. - */ - -/* By default it's not affixed in mobile views, so undo that */ -.bs-sidebar.affix { - position: static; -} - -.bs-sidebar.well { - padding: 0; -} - -/* First level of nav */ -.bs-sidenav { - margin-top: 30px; - margin-bottom: 30px; - padding-top: 10px; - padding-bottom: 10px; - border-radius: 5px; -} - -/* All levels of nav */ -.bs-sidebar .nav > li > a { - display: block; - padding: 5px 20px; - z-index: 1; -} -.bs-sidebar .nav > li > a:hover, -.bs-sidebar .nav > li > a:focus { - text-decoration: none; - border-right: 1px solid; -} -.bs-sidebar .nav > .active > a, -.bs-sidebar .nav > .active:hover > a, -.bs-sidebar .nav > .active:focus > a { - font-weight: bold; - background-color: transparent; - border-right: 1px solid; -} - -/* Nav: second level (shown on .active) */ -.bs-sidebar .nav .nav { - display: none; /* Hide by default, but at >768px, show it */ - margin-bottom: 8px; -} -.bs-sidebar .nav .nav > li > a { - padding-top: 3px; - padding-bottom: 3px; - padding-left: 30px; - font-size: 90%; -} - -/* Show and affix the side nav when space allows it */ -@media (min-width: 992px) { - .bs-sidebar .nav > .active > ul { - display: block; - } - /* Widen the fixed sidebar */ - .bs-sidebar.affix, - .bs-sidebar.affix-bottom { - width: 213px; - } - .bs-sidebar.affix { - position: fixed; /* Undo the static from mobile first approach */ - top: 80px; - } - .bs-sidebar.affix-bottom { - position: absolute; /* Undo the static from mobile first approach */ - } - .bs-sidebar.affix-bottom .bs-sidenav, - .bs-sidebar.affix .bs-sidenav { - margin-top: 0; - margin-bottom: 0; - } -} -@media (min-width: 1200px) { - /* Widen the fixed sidebar again */ - .bs-sidebar.affix-bottom, - .bs-sidebar.affix { - width: 263px; - } -} - - -/* Added to support >2 level nav in drop down */ - -.dropdown-submenu { - position: relative; -} - -.dropdown-submenu>.dropdown-menu { - top: 0; - left: 100%; - margin-top: 0px; - margin-left: 0px; - -webkit-border-radius: 0 6px 6px 6px; - -moz-border-radius: 0 6px 6px; - border-radius: 0 6px 6px 6px; -} - -.dropdown-submenu:hover>.dropdown-menu { - display: block; -} - -.dropdown-submenu>a:after { - display: block; - content: " "; - float: right; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; - border-width: 5px 0 5px 5px; - border-left-color: #ccc; - margin-top: 5px; - margin-right: -10px; -} - -.dropdown-submenu:hover>a:after { - border-left-color: #fff; -} - -.dropdown-submenu.pull-left { - float: none; -} - -.dropdown-submenu.pull-left>.dropdown-menu { - left: -100%; - margin-left: 00px; - -webkit-border-radius: 6px 0 6px 6px; - -moz-border-radius: 6px 0 6px 6px; - border-radius: 6px 0 6px 6px; -} diff --git a/site/css/bootstrap-custom.css b/site/css/bootstrap-custom.css deleted file mode 100644 index be6e961..0000000 --- a/site/css/bootstrap-custom.css +++ /dev/null @@ -1,5249 +0,0 @@ -/*! normalize.css v2.1.3 | MIT License | git.io/normalize */ -article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { - display: block; -} -audio, canvas, video { - display: inline-block; -} -audio:not([controls]) { - display: none; - height: 0; -} -[hidden], template { - display: none; -} -html { - font-family: sans-serif; - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%} -body { - margin: 0; -} -a { - background: transparent; -} -a:focus { - outline: thin dotted; -} -a:active, a:hover { - outline: 0; -} -h1 { - margin: .67em 0; - font-size: 2em; -} -abbr[title] { - border-bottom: 1px dotted; -} -b, strong { - font-weight: bold; -} -dfn { - font-style: italic; -} -hr { - height: 0; - -moz-box-sizing: content-box; - box-sizing: content-box; -} -mark { - color: #000; - background: #ff0; -} -code, kbd, pre, samp { - font-family: Hack, monospace, serif; - font-size: 1em; -} -pre { - white-space: pre-wrap; -} -q { - quotes: "\201C" "\201D" "\2018" "\2019"} -small { - font-size: 80%} -sub, sup { - position: relative; - font-size: 75%; - line-height: 0; - vertical-align: baseline; -} -sup { - top: -0.5em; -} -sub { - bottom: -0.25em; -} -img { - border: 0; -} -svg:not(:root) { - overflow: hidden; -} -figure { - margin: 0; -} -fieldset { - padding: .35em .625em .75em; - margin: 0 2px; - border: 1px solid #c0c0c0; -} -legend { - padding: 0; - border: 0; -} -button, input, select, textarea { - margin: 0; - font-family: inherit; - font-size: 100%} -button, input { - line-height: normal; -} -button, select { - text-transform: none; -} -button, html input[type="button"], input[type="reset"], input[type="submit"] { - cursor: pointer; - -webkit-appearance: button; -} -button[disabled], html input[disabled] { - cursor: default; -} -input[type="checkbox"], input[type="radio"] { - padding: 0; - box-sizing: border-box; -} -input[type="search"] { - -webkit-box-sizing: content-box; - -moz-box-sizing: content-box; - box-sizing: content-box; - -webkit-appearance: textfield; -} -input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} -button::-moz-focus-inner, input::-moz-focus-inner { - padding: 0; - border: 0; -} -textarea { - overflow: auto; - vertical-align: top; -} -table { - border-collapse: collapse; - border-spacing: 0; -} -@media print { - * { - color: #000!important; - text-shadow: none!important; - background: transparent!important; - box-shadow: none!important; -} -a, a:visited { - text-decoration: underline; -} -a[href]:after { - content: " (" attr(href) ")"} -abbr[title]:after { - content: " (" attr(title) ")"} -a[href^="javascript:"]:after, a[href^="#"]:after { - content: ""} -pre, blockquote { - border: 1px solid #999; - page-break-inside: avoid; -} -thead { - display: table-header-group; -} -tr, img { - page-break-inside: avoid; -} -img { - max-width: 100%!important; -} -@page { - margin: 2cm .5cm; -} -p, h2, h3 { - orphans: 3; - widows: 3; -} -h2, h3 { - page-break-after: avoid; -} -select { - background: #fff!important; -} -.navbar { - display: none; -} -.table td, .table th { - background-color: #fff!important; -} -.btn>.caret, .dropup>.btn>.caret { - border-top-color: #000!important; -} -.label { - border: 1px solid #000; -} -.table { - border-collapse: collapse!important; -} -.table-bordered th, .table-bordered td { - border: 1px solid #ddd!important; -} -}*, *:before, *:after { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -html { - font-size: 62.5%; - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -} -body { - font-family: Merriweather, Georgia, serif; - font-size: 14px; - line-height: 1.428571429; - color: #222; - background-color: #fff; -} -input, button, select, textarea { - font-family: inherit; - font-size: inherit; - line-height: inherit; -} -a { - color: #008cba; - text-decoration: none; -} -a:hover, a:focus { - color: #00526e; - text-decoration: underline; -} -a:focus { - outline: thin dotted; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; -} -img { - vertical-align: middle; -} -.img-responsive { - display: block; - height: auto; - max-width: 100%} -.img-rounded { - border-radius: 0; -} -.img-thumbnail { - display: inline-block; - height: auto; - max-width: 100%; - padding: 4px; - line-height: 1.428571429; - background-color: #fff; - border: 1px solid #ddd; - border-radius: 0; - -webkit-transition: all .2s ease-in-out; - transition: all .2s ease-in-out; -} -.img-circle { - border-radius: 50%} -hr { - margin-top: 21px; - margin-bottom: 21px; - border: 0; - border-top: 1px solid #ddd; -} -.sr-only { - position: absolute; - width: 1px; - height: 1px; - padding: 0; - margin: -1px; - overflow: hidden; - clip: rect(0, 0, 0, 0); - border: 0; -} -h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { - font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; - font-weight: 300; - line-height: 1.1; - color: inherit; -} -h1 small, h2 small, h3 small, h4 small, h5 small, h6 small, .h1 small, .h2 small, .h3 small, .h4 small, .h5 small, .h6 small, h1 .small, h2 .small, h3 .small, h4 .small, h5 .small, h6 .small, .h1 .small, .h2 .small, .h3 .small, .h4 .small, .h5 .small, .h6 .small { - font-weight: normal; - line-height: 1; - color: #999; -} -h1, h2, h3 { - margin-top: 21px; - margin-bottom: 10.5px; -} -h1 small, h2 small, h3 small, h1 .small, h2 .small, h3 .small { - font-size: 65%} -h4, h5, h6 { - margin-top: 10.5px; - margin-bottom: 10.5px; -} -h4 small, h5 small, h6 small, h4 .small, h5 .small, h6 .small { - font-size: 75%} -h1, .h1 { - font-size: 39px; -} -h2, .h2 { - font-size: 32px; -} -h3, .h3 { - font-size: 26px; -} -h4, .h4 { - font-size: 19px; -} -h5, .h5 { - font-size: 15px; -} -h6, .h6 { - font-size: 13px; -} -p { - margin: 0 0 10.5px; -} -.lead { - margin-bottom: 21px; - font-size: 17px; - font-weight: 200; - line-height: 1.4; -} -@media(min-width:768px) { - .lead { - font-size: 22.5px; -} -}small, .small { - font-size: 85%} -cite { - font-style: normal; -} -.text-muted { - color: #999; -} -.text-primary { - color: #008cba; -} -.text-primary:hover { - color: #006687; -} -.text-warning { - color: #e99002; -} -.text-warning:hover { - color: #b67102; -} -.text-danger { - color: #f04124; -} -.text-danger:hover { - color: #d32a0e; -} -.text-success { - color: #43ac6a; -} -.text-success:hover { - color: #358753; -} -.text-info { - color: #5bc0de; -} -.text-info:hover { - color: #31b0d5; -} -.text-left { - text-align: left; -} -.text-right { - text-align: right; -} -.text-center { - text-align: center; -} -.page-header { - padding-bottom: 9.5px; - margin: 42px 0 21px; - border-bottom: 1px solid #ddd; -} -ul, ol { - margin-top: 0; - margin-bottom: 10.5px; -} -ul ul, ol ul, ul ol, ol ol { - margin-bottom: 0; -} -.list-unstyled { - padding-left: 0; - list-style: none; -} -.list-inline { - padding-left: 0; - list-style: none; -} -.list-inline>li { - display: inline-block; - padding-right: 5px; - padding-left: 5px; -} -.list-inline>li:first-child { - padding-left: 0; -} -dl { - margin-top: 0; - margin-bottom: 21px; -} -dt, dd { - line-height: 1.428571429; -} -dt { - font-weight: bold; -} -dd { - margin-left: 0; -} -@media(min-width:768px) { - .dl-horizontal dt { - float: left; - width: 160px; - overflow: hidden; - clear: left; - text-align: right; - text-overflow: ellipsis; - white-space: nowrap; -} -.dl-horizontal dd { - margin-left: 180px; -} -.dl-horizontal dd:before, .dl-horizontal dd:after { - display: table; - content: " "} -.dl-horizontal dd:after { - clear: both; -} -.dl-horizontal dd:before, .dl-horizontal dd:after { - display: table; - content: " "} -.dl-horizontal dd:after { - clear: both; -} -.dl-horizontal dd:before, .dl-horizontal dd:after { - display: table; - content: " "} -.dl-horizontal dd:after { - clear: both; -} -.dl-horizontal dd:before, .dl-horizontal dd:after { - display: table; - content: " "} -.dl-horizontal dd:after { - clear: both; -} -.dl-horizontal dd:before, .dl-horizontal dd:after { - display: table; - content: " "} -.dl-horizontal dd:after { - clear: both; -} -}abbr[title], abbr[data-original-title] { - cursor: help; - border-bottom: 1px dotted #999; -} -.initialism { - font-size: 90%; - text-transform: uppercase; -} -blockquote { - padding: 10.5px 21px; - margin: 0 0 21px; - border-left: 5px solid #ddd; -} -blockquote p { - font-size: 18.75px; - font-weight: 300; - line-height: 1.25; -} -blockquote p:last-child { - margin-bottom: 0; -} -blockquote small, blockquote .small { - display: block; - line-height: 1.428571429; - color: #6f6f6f; -} -blockquote small:before, blockquote .small:before { - content: '\2014 \00A0'} -blockquote.pull-right { - padding-right: 15px; - padding-left: 0; - border-right: 5px solid #ddd; - border-left: 0; -} -blockquote.pull-right p, blockquote.pull-right small, blockquote.pull-right .small { - text-align: right; -} -blockquote.pull-right small:before, blockquote.pull-right .small:before { - content: ''} -blockquote.pull-right small:after, blockquote.pull-right .small:after { - content: '\00A0 \2014'} -blockquote:before, blockquote:after { - content: ""} -address { - margin-bottom: 21px; - font-style: normal; - line-height: 1.428571429; -} -code, kbd, pre, samp { - font-family: Hack, Menlo, Monaco, Consolas, "Courier New", monospace; -} -code { - padding: 2px 4px; - font-size: 90%; - color: #c7254e; - white-space: nowrap; - background-color: #f9f2f4; - border-radius: 0; -} -pre { - display: block; - padding: 10px; - margin: 0 0 10.5px; - font-size: 14px; - line-height: 1.428571429; - color: #333; - word-break: break-all; - word-wrap: break-word; - background-color: #f5f5f5; - border: 1px solid #ccc; - border-radius: 0; -} -pre code { - padding: 0; - font-size: inherit; - color: inherit; - white-space: pre-wrap; - background-color: transparent; - border-radius: 0; -} -.pre-scrollable { - max-height: 340px; - overflow-y: scroll; -} -.container { - padding-right: 15px; - padding-left: 15px; - margin-right: auto; - margin-left: auto; -} -.container:before, .container:after { - display: table; - content: " "} -.container:after { - clear: both; -} -.container:before, .container:after { - display: table; - content: " "} -.container:after { - clear: both; -} -.container:before, .container:after { - display: table; - content: " "} -.container:after { - clear: both; -} -.container:before, .container:after { - display: table; - content: " "} -.container:after { - clear: both; -} -.container:before, .container:after { - display: table; - content: " "} -.container:after { - clear: both; -} -@media(min-width:768px) { - .container { - width: 750px; -} -}@media(min-width:992px) { - .container { - width: 970px; -} -}@media(min-width:1200px) { - .container { - width: 1170px; -} -}.row { - margin-right: -15px; - margin-left: -15px; -} -.row:before, .row:after { - display: table; - content: " "} -.row:after { - clear: both; -} -.row:before, .row:after { - display: table; - content: " "} -.row:after { - clear: both; -} -.row:before, .row:after { - display: table; - content: " "} -.row:after { - clear: both; -} -.row:before, .row:after { - display: table; - content: " "} -.row:after { - clear: both; -} -.row:before, .row:after { - display: table; - content: " "} -.row:after { - clear: both; -} -.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { - position: relative; - min-height: 1px; - padding-right: 15px; - padding-left: 15px; -} -.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { - float: left; -} -.col-xs-12 { - width: 100%} -.col-xs-11 { - width: 91.66666666666666%} -.col-xs-10 { - width: 83.33333333333334%} -.col-xs-9 { - width: 75%} -.col-xs-8 { - width: 66.66666666666666%} -.col-xs-7 { - width: 58.333333333333336%} -.col-xs-6 { - width: 50%} -.col-xs-5 { - width: 41.66666666666667%} -.col-xs-4 { - width: 33.33333333333333%} -.col-xs-3 { - width: 25%} -.col-xs-2 { - width: 16.666666666666664%} -.col-xs-1 { - width: 8.333333333333332%} -.col-xs-pull-12 { - right: 100%} -.col-xs-pull-11 { - right: 91.66666666666666%} -.col-xs-pull-10 { - right: 83.33333333333334%} -.col-xs-pull-9 { - right: 75%} -.col-xs-pull-8 { - right: 66.66666666666666%} -.col-xs-pull-7 { - right: 58.333333333333336%} -.col-xs-pull-6 { - right: 50%} -.col-xs-pull-5 { - right: 41.66666666666667%} -.col-xs-pull-4 { - right: 33.33333333333333%} -.col-xs-pull-3 { - right: 25%} -.col-xs-pull-2 { - right: 16.666666666666664%} -.col-xs-pull-1 { - right: 8.333333333333332%} -.col-xs-pull-0 { - right: 0; -} -.col-xs-push-12 { - left: 100%} -.col-xs-push-11 { - left: 91.66666666666666%} -.col-xs-push-10 { - left: 83.33333333333334%} -.col-xs-push-9 { - left: 75%} -.col-xs-push-8 { - left: 66.66666666666666%} -.col-xs-push-7 { - left: 58.333333333333336%} -.col-xs-push-6 { - left: 50%} -.col-xs-push-5 { - left: 41.66666666666667%} -.col-xs-push-4 { - left: 33.33333333333333%} -.col-xs-push-3 { - left: 25%} -.col-xs-push-2 { - left: 16.666666666666664%} -.col-xs-push-1 { - left: 8.333333333333332%} -.col-xs-push-0 { - left: 0; -} -.col-xs-offset-12 { - margin-left: 100%} -.col-xs-offset-11 { - margin-left: 91.66666666666666%} -.col-xs-offset-10 { - margin-left: 83.33333333333334%} -.col-xs-offset-9 { - margin-left: 75%} -.col-xs-offset-8 { - margin-left: 66.66666666666666%} -.col-xs-offset-7 { - margin-left: 58.333333333333336%} -.col-xs-offset-6 { - margin-left: 50%} -.col-xs-offset-5 { - margin-left: 41.66666666666667%} -.col-xs-offset-4 { - margin-left: 33.33333333333333%} -.col-xs-offset-3 { - margin-left: 25%} -.col-xs-offset-2 { - margin-left: 16.666666666666664%} -.col-xs-offset-1 { - margin-left: 8.333333333333332%} -.col-xs-offset-0 { - margin-left: 0; -} -@media(min-width:768px) { - .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { - float: left; -} -.col-sm-12 { - width: 100%} -.col-sm-11 { - width: 91.66666666666666%} -.col-sm-10 { - width: 83.33333333333334%} -.col-sm-9 { - width: 75%} -.col-sm-8 { - width: 66.66666666666666%} -.col-sm-7 { - width: 58.333333333333336%} -.col-sm-6 { - width: 50%} -.col-sm-5 { - width: 41.66666666666667%} -.col-sm-4 { - width: 33.33333333333333%} -.col-sm-3 { - width: 25%} -.col-sm-2 { - width: 16.666666666666664%} -.col-sm-1 { - width: 8.333333333333332%} -.col-sm-pull-12 { - right: 100%} -.col-sm-pull-11 { - right: 91.66666666666666%} -.col-sm-pull-10 { - right: 83.33333333333334%} -.col-sm-pull-9 { - right: 75%} -.col-sm-pull-8 { - right: 66.66666666666666%} -.col-sm-pull-7 { - right: 58.333333333333336%} -.col-sm-pull-6 { - right: 50%} -.col-sm-pull-5 { - right: 41.66666666666667%} -.col-sm-pull-4 { - right: 33.33333333333333%} -.col-sm-pull-3 { - right: 25%} -.col-sm-pull-2 { - right: 16.666666666666664%} -.col-sm-pull-1 { - right: 8.333333333333332%} -.col-sm-pull-0 { - right: 0; -} -.col-sm-push-12 { - left: 100%} -.col-sm-push-11 { - left: 91.66666666666666%} -.col-sm-push-10 { - left: 83.33333333333334%} -.col-sm-push-9 { - left: 75%} -.col-sm-push-8 { - left: 66.66666666666666%} -.col-sm-push-7 { - left: 58.333333333333336%} -.col-sm-push-6 { - left: 50%} -.col-sm-push-5 { - left: 41.66666666666667%} -.col-sm-push-4 { - left: 33.33333333333333%} -.col-sm-push-3 { - left: 25%} -.col-sm-push-2 { - left: 16.666666666666664%} -.col-sm-push-1 { - left: 8.333333333333332%} -.col-sm-push-0 { - left: 0; -} -.col-sm-offset-12 { - margin-left: 100%} -.col-sm-offset-11 { - margin-left: 91.66666666666666%} -.col-sm-offset-10 { - margin-left: 83.33333333333334%} -.col-sm-offset-9 { - margin-left: 75%} -.col-sm-offset-8 { - margin-left: 66.66666666666666%} -.col-sm-offset-7 { - margin-left: 58.333333333333336%} -.col-sm-offset-6 { - margin-left: 50%} -.col-sm-offset-5 { - margin-left: 41.66666666666667%} -.col-sm-offset-4 { - margin-left: 33.33333333333333%} -.col-sm-offset-3 { - margin-left: 25%} -.col-sm-offset-2 { - margin-left: 16.666666666666664%} -.col-sm-offset-1 { - margin-left: 8.333333333333332%} -.col-sm-offset-0 { - margin-left: 0; -} -}@media(min-width:992px) { - .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { - float: left; -} -.col-md-12 { - width: 100%} -.col-md-11 { - width: 91.66666666666666%} -.col-md-10 { - width: 83.33333333333334%} -.col-md-9 { - width: 75%} -.col-md-8 { - width: 66.66666666666666%} -.col-md-7 { - width: 58.333333333333336%} -.col-md-6 { - width: 50%} -.col-md-5 { - width: 41.66666666666667%} -.col-md-4 { - width: 33.33333333333333%} -.col-md-3 { - width: 25%} -.col-md-2 { - width: 16.666666666666664%} -.col-md-1 { - width: 8.333333333333332%} -.col-md-pull-12 { - right: 100%} -.col-md-pull-11 { - right: 91.66666666666666%} -.col-md-pull-10 { - right: 83.33333333333334%} -.col-md-pull-9 { - right: 75%} -.col-md-pull-8 { - right: 66.66666666666666%} -.col-md-pull-7 { - right: 58.333333333333336%} -.col-md-pull-6 { - right: 50%} -.col-md-pull-5 { - right: 41.66666666666667%} -.col-md-pull-4 { - right: 33.33333333333333%} -.col-md-pull-3 { - right: 25%} -.col-md-pull-2 { - right: 16.666666666666664%} -.col-md-pull-1 { - right: 8.333333333333332%} -.col-md-pull-0 { - right: 0; -} -.col-md-push-12 { - left: 100%} -.col-md-push-11 { - left: 91.66666666666666%} -.col-md-push-10 { - left: 83.33333333333334%} -.col-md-push-9 { - left: 75%} -.col-md-push-8 { - left: 66.66666666666666%} -.col-md-push-7 { - left: 58.333333333333336%} -.col-md-push-6 { - left: 50%} -.col-md-push-5 { - left: 41.66666666666667%} -.col-md-push-4 { - left: 33.33333333333333%} -.col-md-push-3 { - left: 25%} -.col-md-push-2 { - left: 16.666666666666664%} -.col-md-push-1 { - left: 8.333333333333332%} -.col-md-push-0 { - left: 0; -} -.col-md-offset-12 { - margin-left: 100%} -.col-md-offset-11 { - margin-left: 91.66666666666666%} -.col-md-offset-10 { - margin-left: 83.33333333333334%} -.col-md-offset-9 { - margin-left: 75%} -.col-md-offset-8 { - margin-left: 66.66666666666666%} -.col-md-offset-7 { - margin-left: 58.333333333333336%} -.col-md-offset-6 { - margin-left: 50%} -.col-md-offset-5 { - margin-left: 41.66666666666667%} -.col-md-offset-4 { - margin-left: 33.33333333333333%} -.col-md-offset-3 { - margin-left: 25%} -.col-md-offset-2 { - margin-left: 16.666666666666664%} -.col-md-offset-1 { - margin-left: 8.333333333333332%} -.col-md-offset-0 { - margin-left: 0; -} -}@media(min-width:1200px) { - .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { - float: left; -} -.col-lg-12 { - width: 100%} -.col-lg-11 { - width: 91.66666666666666%} -.col-lg-10 { - width: 83.33333333333334%} -.col-lg-9 { - width: 75%} -.col-lg-8 { - width: 66.66666666666666%} -.col-lg-7 { - width: 58.333333333333336%} -.col-lg-6 { - width: 50%} -.col-lg-5 { - width: 41.66666666666667%} -.col-lg-4 { - width: 33.33333333333333%} -.col-lg-3 { - width: 25%} -.col-lg-2 { - width: 16.666666666666664%} -.col-lg-1 { - width: 8.333333333333332%} -.col-lg-pull-12 { - right: 100%} -.col-lg-pull-11 { - right: 91.66666666666666%} -.col-lg-pull-10 { - right: 83.33333333333334%} -.col-lg-pull-9 { - right: 75%} -.col-lg-pull-8 { - right: 66.66666666666666%} -.col-lg-pull-7 { - right: 58.333333333333336%} -.col-lg-pull-6 { - right: 50%} -.col-lg-pull-5 { - right: 41.66666666666667%} -.col-lg-pull-4 { - right: 33.33333333333333%} -.col-lg-pull-3 { - right: 25%} -.col-lg-pull-2 { - right: 16.666666666666664%} -.col-lg-pull-1 { - right: 8.333333333333332%} -.col-lg-pull-0 { - right: 0; -} -.col-lg-push-12 { - left: 100%} -.col-lg-push-11 { - left: 91.66666666666666%} -.col-lg-push-10 { - left: 83.33333333333334%} -.col-lg-push-9 { - left: 75%} -.col-lg-push-8 { - left: 66.66666666666666%} -.col-lg-push-7 { - left: 58.333333333333336%} -.col-lg-push-6 { - left: 50%} -.col-lg-push-5 { - left: 41.66666666666667%} -.col-lg-push-4 { - left: 33.33333333333333%} -.col-lg-push-3 { - left: 25%} -.col-lg-push-2 { - left: 16.666666666666664%} -.col-lg-push-1 { - left: 8.333333333333332%} -.col-lg-push-0 { - left: 0; -} -.col-lg-offset-12 { - margin-left: 100%} -.col-lg-offset-11 { - margin-left: 91.66666666666666%} -.col-lg-offset-10 { - margin-left: 83.33333333333334%} -.col-lg-offset-9 { - margin-left: 75%} -.col-lg-offset-8 { - margin-left: 66.66666666666666%} -.col-lg-offset-7 { - margin-left: 58.333333333333336%} -.col-lg-offset-6 { - margin-left: 50%} -.col-lg-offset-5 { - margin-left: 41.66666666666667%} -.col-lg-offset-4 { - margin-left: 33.33333333333333%} -.col-lg-offset-3 { - margin-left: 25%} -.col-lg-offset-2 { - margin-left: 16.666666666666664%} -.col-lg-offset-1 { - margin-left: 8.333333333333332%} -.col-lg-offset-0 { - margin-left: 0; -} -}table { - max-width: 100%; - background-color: transparent; -} -th { - text-align: left; -} -.table { - width: 100%; - margin-bottom: 21px; -} -.table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td { - padding: 8px; - line-height: 1.428571429; - vertical-align: top; - border-top: 1px solid #ddd; -} -.table>thead>tr>th { - vertical-align: bottom; - border-bottom: 2px solid #ddd; -} -.table>caption+thead>tr:first-child>th, .table>colgroup+thead>tr:first-child>th, .table>thead:first-child>tr:first-child>th, .table>caption+thead>tr:first-child>td, .table>colgroup+thead>tr:first-child>td, .table>thead:first-child>tr:first-child>td { - border-top: 0; -} -.table>tbody+tbody { - border-top: 2px solid #ddd; -} -.table .table { - background-color: #fff; -} -.table-condensed>thead>tr>th, .table-condensed>tbody>tr>th, .table-condensed>tfoot>tr>th, .table-condensed>thead>tr>td, .table-condensed>tbody>tr>td, .table-condensed>tfoot>tr>td { - padding: 5px; -} -.table-bordered { - border: 1px solid #ddd; -} -.table-bordered>thead>tr>th, .table-bordered>tbody>tr>th, .table-bordered>tfoot>tr>th, .table-bordered>thead>tr>td, .table-bordered>tbody>tr>td, .table-bordered>tfoot>tr>td { - border: 1px solid #ddd; -} -.table-bordered>thead>tr>th, .table-bordered>thead>tr>td { - border-bottom-width: 2px; -} -.table-striped>tbody>tr:nth-child(odd)>td, .table-striped>tbody>tr:nth-child(odd)>th { - background-color: #f9f9f9; -} -.table-hover>tbody>tr:hover>td, .table-hover>tbody>tr:hover>th { - background-color: #f5f5f5; -} -table col[class*="col-"] { - position: static; - display: table-column; - float: none; -} -table td[class*="col-"], table th[class*="col-"] { - display: table-cell; - float: none; -} -.table>thead>tr>.active, .table>tbody>tr>.active, .table>tfoot>tr>.active, .table>thead>.active>td, .table>tbody>.active>td, .table>tfoot>.active>td, .table>thead>.active>th, .table>tbody>.active>th, .table>tfoot>.active>th { - background-color: #f5f5f5; -} -.table-hover>tbody>tr>.active:hover, .table-hover>tbody>.active:hover>td, .table-hover>tbody>.active:hover>th { - background-color: #e8e8e8; -} -.table>thead>tr>.success, .table>tbody>tr>.success, .table>tfoot>tr>.success, .table>thead>.success>td, .table>tbody>.success>td, .table>tfoot>.success>td, .table>thead>.success>th, .table>tbody>.success>th, .table>tfoot>.success>th { - background-color: #dff0d8; -} -.table-hover>tbody>tr>.success:hover, .table-hover>tbody>.success:hover>td, .table-hover>tbody>.success:hover>th { - background-color: #d0e9c6; -} -.table>thead>tr>.danger, .table>tbody>tr>.danger, .table>tfoot>tr>.danger, .table>thead>.danger>td, .table>tbody>.danger>td, .table>tfoot>.danger>td, .table>thead>.danger>th, .table>tbody>.danger>th, .table>tfoot>.danger>th { - background-color: #f2dede; -} -.table-hover>tbody>tr>.danger:hover, .table-hover>tbody>.danger:hover>td, .table-hover>tbody>.danger:hover>th { - background-color: #ebcccc; -} -.table>thead>tr>.warning, .table>tbody>tr>.warning, .table>tfoot>tr>.warning, .table>thead>.warning>td, .table>tbody>.warning>td, .table>tfoot>.warning>td, .table>thead>.warning>th, .table>tbody>.warning>th, .table>tfoot>.warning>th { - background-color: #fcf8e3; -} -.table-hover>tbody>tr>.warning:hover, .table-hover>tbody>.warning:hover>td, .table-hover>tbody>.warning:hover>th { - background-color: #faf2cc; -} -@media(max-width:767px) { - .table-responsive { - width: 100%; - margin-bottom: 15.75px; - overflow-x: scroll; - overflow-y: hidden; - border: 1px solid #ddd; - -ms-overflow-style: -ms-autohiding-scrollbar; - -webkit-overflow-scrolling: touch; -} -.table-responsive>.table { - margin-bottom: 0; -} -.table-responsive>.table>thead>tr>th, .table-responsive>.table>tbody>tr>th, .table-responsive>.table>tfoot>tr>th, .table-responsive>.table>thead>tr>td, .table-responsive>.table>tbody>tr>td, .table-responsive>.table>tfoot>tr>td { - white-space: nowrap; -} -.table-responsive>.table-bordered { - border: 0; -} -.table-responsive>.table-bordered>thead>tr>th:first-child, .table-responsive>.table-bordered>tbody>tr>th:first-child, .table-responsive>.table-bordered>tfoot>tr>th:first-child, .table-responsive>.table-bordered>thead>tr>td:first-child, .table-responsive>.table-bordered>tbody>tr>td:first-child, .table-responsive>.table-bordered>tfoot>tr>td:first-child { - border-left: 0; -} -.table-responsive>.table-bordered>thead>tr>th:last-child, .table-responsive>.table-bordered>tbody>tr>th:last-child, .table-responsive>.table-bordered>tfoot>tr>th:last-child, .table-responsive>.table-bordered>thead>tr>td:last-child, .table-responsive>.table-bordered>tbody>tr>td:last-child, .table-responsive>.table-bordered>tfoot>tr>td:last-child { - border-right: 0; -} -.table-responsive>.table-bordered>tbody>tr:last-child>th, .table-responsive>.table-bordered>tfoot>tr:last-child>th, .table-responsive>.table-bordered>tbody>tr:last-child>td, .table-responsive>.table-bordered>tfoot>tr:last-child>td { - border-bottom: 0; -} -}fieldset { - padding: 0; - margin: 0; - border: 0; -} -legend { - display: block; - width: 100%; - padding: 0; - margin-bottom: 21px; - font-size: 22.5px; - line-height: inherit; - color: #333; - border: 0; - border-bottom: 1px solid #e5e5e5; -} -label { - display: inline-block; - margin-bottom: 5px; - font-weight: bold; -} -input[type="search"] { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -input[type="radio"], input[type="checkbox"] { - margin: 4px 0 0; - margin-top: 1px \9; - line-height: normal; -} -input[type="file"] { - display: block; -} -select[multiple], select[size] { - height: auto; -} -select optgroup { - font-family: inherit; - font-size: inherit; - font-style: inherit; -} -input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus { - outline: thin dotted; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; -} -input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { - height: auto; -} -output { - display: block; - padding-top: 7px; - font-size: 15px; - line-height: 1.428571429; - color: #6f6f6f; - vertical-align: middle; -} -.form-control { - display: block; - width: 100%; - height: 35px; - padding: 6px 12px; - font-size: 15px; - line-height: 1.428571429; - color: #6f6f6f; - vertical-align: middle; - background-color: #fff; - background-image: none; - border: 1px solid #ccc; - border-radius: 0; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; - transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; -} -.form-control:focus { - border-color: #66afe9; - outline: 0; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); -} -.form-control:-moz-placeholder { - color: #999; -} -.form-control::-moz-placeholder { - color: #999; - opacity: 1; -} -.form-control:-ms-input-placeholder { - color: #999; -} -.form-control::-webkit-input-placeholder { - color: #999; -} -.form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control { - cursor: not-allowed; - background-color: #eee; -} -textarea.form-control { - height: auto; -} -.form-group { - margin-bottom: 15px; -} -.radio, .checkbox { - display: block; - min-height: 21px; - padding-left: 20px; - margin-top: 10px; - margin-bottom: 10px; - vertical-align: middle; -} -.radio label, .checkbox label { - display: inline; - margin-bottom: 0; - font-weight: normal; - cursor: pointer; -} -.radio input[type="radio"], .radio-inline input[type="radio"], .checkbox input[type="checkbox"], .checkbox-inline input[type="checkbox"] { - float: left; - margin-left: -20px; -} -.radio+.radio, .checkbox+.checkbox { - margin-top: -5px; -} -.radio-inline, .checkbox-inline { - display: inline-block; - padding-left: 20px; - margin-bottom: 0; - font-weight: normal; - vertical-align: middle; - cursor: pointer; -} -.radio-inline+.radio-inline, .checkbox-inline+.checkbox-inline { - margin-top: 0; - margin-left: 10px; -} -input[type="radio"][disabled], input[type="checkbox"][disabled], .radio[disabled], .radio-inline[disabled], .checkbox[disabled], .checkbox-inline[disabled], fieldset[disabled] input[type="radio"], fieldset[disabled] input[type="checkbox"], fieldset[disabled] .radio, fieldset[disabled] .radio-inline, fieldset[disabled] .checkbox, fieldset[disabled] .checkbox-inline { - cursor: not-allowed; -} -.input-sm { - height: 30px; - padding: 5px 10px; - font-size: 12px; - line-height: 1.5; - border-radius: 0; -} -select.input-sm { - height: 30px; - line-height: 30px; -} -textarea.input-sm { - height: auto; -} -.input-lg { - height: 48px; - padding: 10px 16px; - font-size: 19px; - line-height: 1.33; - border-radius: 0; -} -select.input-lg { - height: 48px; - line-height: 48px; -} -textarea.input-lg { - height: auto; -} -.has-warning .help-block, .has-warning .control-label, .has-warning .radio, .has-warning .checkbox, .has-warning .radio-inline, .has-warning .checkbox-inline { - color: #e99002; -} -.has-warning .form-control { - border-color: #e99002; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -} -.has-warning .form-control:focus { - border-color: #b67102; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #febc53; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #febc53; -} -.has-warning .input-group-addon { - color: #e99002; - background-color: #fcf8e3; - border-color: #e99002; -} -.has-error .help-block, .has-error .control-label, .has-error .radio, .has-error .checkbox, .has-error .radio-inline, .has-error .checkbox-inline { - color: #f04124; -} -.has-error .form-control { - border-color: #f04124; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -} -.has-error .form-control:focus { - border-color: #d32a0e; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f79483; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f79483; -} -.has-error .input-group-addon { - color: #f04124; - background-color: #f2dede; - border-color: #f04124; -} -.has-success .help-block, .has-success .control-label, .has-success .radio, .has-success .checkbox, .has-success .radio-inline, .has-success .checkbox-inline { - color: #43ac6a; -} -.has-success .form-control { - border-color: #43ac6a; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -} -.has-success .form-control:focus { - border-color: #358753; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #85d0a1; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #85d0a1; -} -.has-success .input-group-addon { - color: #43ac6a; - background-color: #dff0d8; - border-color: #43ac6a; -} -.form-control-static { - margin-bottom: 0; -} -.help-block { - display: block; - margin-top: 5px; - margin-bottom: 10px; - color: #626262; -} -@media(min-width:768px) { - .form-inline .form-group { - display: inline-block; - margin-bottom: 0; - vertical-align: middle; -} -.form-inline .form-control { - display: inline-block; -} -.form-inline select.form-control { - width: auto; -} -.form-inline .radio, .form-inline .checkbox { - display: inline-block; - padding-left: 0; - margin-top: 0; - margin-bottom: 0; -} -.form-inline .radio input[type="radio"], .form-inline .checkbox input[type="checkbox"] { - float: none; - margin-left: 0; -} -}.form-horizontal .control-label, .form-horizontal .radio, .form-horizontal .checkbox, .form-horizontal .radio-inline, .form-horizontal .checkbox-inline { - padding-top: 7px; - margin-top: 0; - margin-bottom: 0; -} -.form-horizontal .radio, .form-horizontal .checkbox { - min-height: 28px; -} -.form-horizontal .form-group { - margin-right: -15px; - margin-left: -15px; -} -.form-horizontal .form-group:before, .form-horizontal .form-group:after { - display: table; - content: " "} -.form-horizontal .form-group:after { - clear: both; -} -.form-horizontal .form-group:before, .form-horizontal .form-group:after { - display: table; - content: " "} -.form-horizontal .form-group:after { - clear: both; -} -.form-horizontal .form-group:before, .form-horizontal .form-group:after { - display: table; - content: " "} -.form-horizontal .form-group:after { - clear: both; -} -.form-horizontal .form-group:before, .form-horizontal .form-group:after { - display: table; - content: " "} -.form-horizontal .form-group:after { - clear: both; -} -.form-horizontal .form-group:before, .form-horizontal .form-group:after { - display: table; - content: " "} -.form-horizontal .form-group:after { - clear: both; -} -.form-horizontal .form-control-static { - padding-top: 7px; -} -@media(min-width:768px) { - .form-horizontal .control-label { - text-align: right; -} -}.btn { - display: inline-block; - padding: 6px 12px; - margin-bottom: 0; - font-size: 15px; - font-weight: normal; - line-height: 1.428571429; - text-align: center; - white-space: nowrap; - vertical-align: middle; - cursor: pointer; - background-image: none; - border: 1px solid transparent; - border-radius: 0; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - -o-user-select: none; - user-select: none; -} -.btn:focus { - outline: thin dotted; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; -} -.btn:hover, .btn:focus { - color: #333; - text-decoration: none; -} -.btn:active, .btn.active { - background-image: none; - outline: 0; - -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); - box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); -} -.btn.disabled, .btn[disabled], fieldset[disabled] .btn { - pointer-events: none; - cursor: not-allowed; - opacity: .65; - filter: alpha(opacity=65); - -webkit-box-shadow: none; - box-shadow: none; -} -.btn-default { - color: #333; - background-color: #e7e7e7; - border-color: #dadada; -} -.btn-default:hover, .btn-default:focus, .btn-default:active, .btn-default.active, .open .dropdown-toggle.btn-default { - color: #333; - background-color: #d3d3d3; - border-color: #bbb; -} -.btn-default:active, .btn-default.active, .open .dropdown-toggle.btn-default { - background-image: none; -} -.btn-default.disabled, .btn-default[disabled], fieldset[disabled] .btn-default, .btn-default.disabled:hover, .btn-default[disabled]:hover, fieldset[disabled] .btn-default:hover, .btn-default.disabled:focus, .btn-default[disabled]:focus, fieldset[disabled] .btn-default:focus, .btn-default.disabled:active, .btn-default[disabled]:active, fieldset[disabled] .btn-default:active, .btn-default.disabled.active, .btn-default[disabled].active, fieldset[disabled] .btn-default.active { - background-color: #e7e7e7; - border-color: #dadada; -} -.btn-default .badge { - color: #e7e7e7; - background-color: #fff; -} -.btn-primary { - color: #fff; - background-color: #008cba; - border-color: #0079a1; -} -.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open .dropdown-toggle.btn-primary { - color: #fff; - background-color: #006d91; - border-color: #004b63; -} -.btn-primary:active, .btn-primary.active, .open .dropdown-toggle.btn-primary { - background-image: none; -} -.btn-primary.disabled, .btn-primary[disabled], fieldset[disabled] .btn-primary, .btn-primary.disabled:hover, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus, .btn-primary.disabled:active, .btn-primary[disabled]:active, fieldset[disabled] .btn-primary:active, .btn-primary.disabled.active, .btn-primary[disabled].active, fieldset[disabled] .btn-primary.active { - background-color: #008cba; - border-color: #0079a1; -} -.btn-primary .badge { - color: #008cba; - background-color: #fff; -} -.btn-warning { - color: #fff; - background-color: #e99002; - border-color: #d08002; -} -.btn-warning:hover, .btn-warning:focus, .btn-warning:active, .btn-warning.active, .open .dropdown-toggle.btn-warning { - color: #fff; - background-color: #c17702; - border-color: #935b01; -} -.btn-warning:active, .btn-warning.active, .open .dropdown-toggle.btn-warning { - background-image: none; -} -.btn-warning.disabled, .btn-warning[disabled], fieldset[disabled] .btn-warning, .btn-warning.disabled:hover, .btn-warning[disabled]:hover, fieldset[disabled] .btn-warning:hover, .btn-warning.disabled:focus, .btn-warning[disabled]:focus, fieldset[disabled] .btn-warning:focus, .btn-warning.disabled:active, .btn-warning[disabled]:active, fieldset[disabled] .btn-warning:active, .btn-warning.disabled.active, .btn-warning[disabled].active, fieldset[disabled] .btn-warning.active { - background-color: #e99002; - border-color: #d08002; -} -.btn-warning .badge { - color: #e99002; - background-color: #fff; -} -.btn-danger { - color: #fff; - background-color: #f04124; - border-color: #ea2f10; -} -.btn-danger:hover, .btn-danger:focus, .btn-danger:active, .btn-danger.active, .open .dropdown-toggle.btn-danger { - color: #fff; - background-color: #dc2c0f; - border-color: #b1240c; -} -.btn-danger:active, .btn-danger.active, .open .dropdown-toggle.btn-danger { - background-image: none; -} -.btn-danger.disabled, .btn-danger[disabled], fieldset[disabled] .btn-danger, .btn-danger.disabled:hover, .btn-danger[disabled]:hover, fieldset[disabled] .btn-danger:hover, .btn-danger.disabled:focus, .btn-danger[disabled]:focus, fieldset[disabled] .btn-danger:focus, .btn-danger.disabled:active, .btn-danger[disabled]:active, fieldset[disabled] .btn-danger:active, .btn-danger.disabled.active, .btn-danger[disabled].active, fieldset[disabled] .btn-danger.active { - background-color: #f04124; - border-color: #ea2f10; -} -.btn-danger .badge { - color: #f04124; - background-color: #fff; -} -.btn-success { - color: #fff; - background-color: #43ac6a; - border-color: #3c9a5f; -} -.btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active, .open .dropdown-toggle.btn-success { - color: #fff; - background-color: #388f58; - border-color: #2b6e44; -} -.btn-success:active, .btn-success.active, .open .dropdown-toggle.btn-success { - background-image: none; -} -.btn-success.disabled, .btn-success[disabled], fieldset[disabled] .btn-success, .btn-success.disabled:hover, .btn-success[disabled]:hover, fieldset[disabled] .btn-success:hover, .btn-success.disabled:focus, .btn-success[disabled]:focus, fieldset[disabled] .btn-success:focus, .btn-success.disabled:active, .btn-success[disabled]:active, fieldset[disabled] .btn-success:active, .btn-success.disabled.active, .btn-success[disabled].active, fieldset[disabled] .btn-success.active { - background-color: #43ac6a; - border-color: #3c9a5f; -} -.btn-success .badge { - color: #43ac6a; - background-color: #fff; -} -.btn-info { - color: #fff; - background-color: #5bc0de; - border-color: #46b8da; -} -.btn-info:hover, .btn-info:focus, .btn-info:active, .btn-info.active, .open .dropdown-toggle.btn-info { - color: #fff; - background-color: #39b3d7; - border-color: #269abc; -} -.btn-info:active, .btn-info.active, .open .dropdown-toggle.btn-info { - background-image: none; -} -.btn-info.disabled, .btn-info[disabled], fieldset[disabled] .btn-info, .btn-info.disabled:hover, .btn-info[disabled]:hover, fieldset[disabled] .btn-info:hover, .btn-info.disabled:focus, .btn-info[disabled]:focus, fieldset[disabled] .btn-info:focus, .btn-info.disabled:active, .btn-info[disabled]:active, fieldset[disabled] .btn-info:active, .btn-info.disabled.active, .btn-info[disabled].active, fieldset[disabled] .btn-info.active { - background-color: #5bc0de; - border-color: #46b8da; -} -.btn-info .badge { - color: #5bc0de; - background-color: #fff; -} -.btn-link { - font-weight: normal; - color: #008cba; - cursor: pointer; - border-radius: 0; -} -.btn-link, .btn-link:active, .btn-link[disabled], fieldset[disabled] .btn-link { - background-color: transparent; - -webkit-box-shadow: none; - box-shadow: none; -} -.btn-link, .btn-link:hover, .btn-link:focus, .btn-link:active { - border-color: transparent; -} -.btn-link:hover, .btn-link:focus { - color: #00526e; - text-decoration: underline; - background-color: transparent; -} -.btn-link[disabled]:hover, fieldset[disabled] .btn-link:hover, .btn-link[disabled]:focus, fieldset[disabled] .btn-link:focus { - color: #999; - text-decoration: none; -} -.btn-lg { - padding: 10px 16px; - font-size: 19px; - line-height: 1.33; - border-radius: 0; -} -.btn-sm { - padding: 5px 10px; - font-size: 12px; - line-height: 1.5; - border-radius: 0; -} -.btn-xs { - padding: 1px 5px; - font-size: 12px; - line-height: 1.5; - border-radius: 0; -} -.btn-block { - display: block; - width: 100%; - padding-right: 0; - padding-left: 0; -} -.btn-block+.btn-block { - margin-top: 5px; -} -input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="button"].btn-block { - width: 100%} -.fade { - opacity: 0; - -webkit-transition: opacity .15s linear; - transition: opacity .15s linear; -} -.fade.in { - opacity: 1; -} -.collapse { - display: none; -} -.collapse.in { - display: block; -} -.collapsing { - position: relative; - height: 0; - overflow: hidden; - -webkit-transition: height .35s ease; - transition: height .35s ease; -} -@font-face { - font-family: 'Glyphicons Halflings'; - src: url('../fonts/glyphicons-halflings-regular.eot'); - src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg'); -} -.glyphicon { - position: relative; - top: 1px; - display: inline-block; - font-family: 'Glyphicons Halflings'; - -webkit-font-smoothing: antialiased; - font-style: normal; - font-weight: normal; - line-height: 1; - -moz-osx-font-smoothing: grayscale; -} -.glyphicon:empty { - width: 1em; -} -.glyphicon-asterisk:before { - content: "\2a"} -.glyphicon-plus:before { - content: "\2b"} -.glyphicon-euro:before { - content: "\20ac"} -.glyphicon-minus:before { - content: "\2212"} -.glyphicon-cloud:before { - content: "\2601"} -.glyphicon-envelope:before { - content: "\2709"} -.glyphicon-pencil:before { - content: "\270f"} -.glyphicon-glass:before { - content: "\e001"} -.glyphicon-music:before { - content: "\e002"} -.glyphicon-search:before { - content: "\e003"} -.glyphicon-heart:before { - content: "\e005"} -.glyphicon-star:before { - content: "\e006"} -.glyphicon-star-empty:before { - content: "\e007"} -.glyphicon-user:before { - content: "\e008"} -.glyphicon-film:before { - content: "\e009"} -.glyphicon-th-large:before { - content: "\e010"} -.glyphicon-th:before { - content: "\e011"} -.glyphicon-th-list:before { - content: "\e012"} -.glyphicon-ok:before { - content: "\e013"} -.glyphicon-remove:before { - content: "\e014"} -.glyphicon-zoom-in:before { - content: "\e015"} -.glyphicon-zoom-out:before { - content: "\e016"} -.glyphicon-off:before { - content: "\e017"} -.glyphicon-signal:before { - content: "\e018"} -.glyphicon-cog:before { - content: "\e019"} -.glyphicon-trash:before { - content: "\e020"} -.glyphicon-home:before { - content: "\e021"} -.glyphicon-file:before { - content: "\e022"} -.glyphicon-time:before { - content: "\e023"} -.glyphicon-road:before { - content: "\e024"} -.glyphicon-download-alt:before { - content: "\e025"} -.glyphicon-download:before { - content: "\e026"} -.glyphicon-upload:before { - content: "\e027"} -.glyphicon-inbox:before { - content: "\e028"} -.glyphicon-play-circle:before { - content: "\e029"} -.glyphicon-repeat:before { - content: "\e030"} -.glyphicon-refresh:before { - content: "\e031"} -.glyphicon-list-alt:before { - content: "\e032"} -.glyphicon-lock:before { - content: "\e033"} -.glyphicon-flag:before { - content: "\e034"} -.glyphicon-headphones:before { - content: "\e035"} -.glyphicon-volume-off:before { - content: "\e036"} -.glyphicon-volume-down:before { - content: "\e037"} -.glyphicon-volume-up:before { - content: "\e038"} -.glyphicon-qrcode:before { - content: "\e039"} -.glyphicon-barcode:before { - content: "\e040"} -.glyphicon-tag:before { - content: "\e041"} -.glyphicon-tags:before { - content: "\e042"} -.glyphicon-book:before { - content: "\e043"} -.glyphicon-bookmark:before { - content: "\e044"} -.glyphicon-print:before { - content: "\e045"} -.glyphicon-camera:before { - content: "\e046"} -.glyphicon-font:before { - content: "\e047"} -.glyphicon-bold:before { - content: "\e048"} -.glyphicon-italic:before { - content: "\e049"} -.glyphicon-text-height:before { - content: "\e050"} -.glyphicon-text-width:before { - content: "\e051"} -.glyphicon-align-left:before { - content: "\e052"} -.glyphicon-align-center:before { - content: "\e053"} -.glyphicon-align-right:before { - content: "\e054"} -.glyphicon-align-justify:before { - content: "\e055"} -.glyphicon-list:before { - content: "\e056"} -.glyphicon-indent-left:before { - content: "\e057"} -.glyphicon-indent-right:before { - content: "\e058"} -.glyphicon-facetime-video:before { - content: "\e059"} -.glyphicon-picture:before { - content: "\e060"} -.glyphicon-map-marker:before { - content: "\e062"} -.glyphicon-adjust:before { - content: "\e063"} -.glyphicon-tint:before { - content: "\e064"} -.glyphicon-edit:before { - content: "\e065"} -.glyphicon-share:before { - content: "\e066"} -.glyphicon-check:before { - content: "\e067"} -.glyphicon-move:before { - content: "\e068"} -.glyphicon-step-backward:before { - content: "\e069"} -.glyphicon-fast-backward:before { - content: "\e070"} -.glyphicon-backward:before { - content: "\e071"} -.glyphicon-play:before { - content: "\e072"} -.glyphicon-pause:before { - content: "\e073"} -.glyphicon-stop:before { - content: "\e074"} -.glyphicon-forward:before { - content: "\e075"} -.glyphicon-fast-forward:before { - content: "\e076"} -.glyphicon-step-forward:before { - content: "\e077"} -.glyphicon-eject:before { - content: "\e078"} -.glyphicon-chevron-left:before { - content: "\e079"} -.glyphicon-chevron-right:before { - content: "\e080"} -.glyphicon-plus-sign:before { - content: "\e081"} -.glyphicon-minus-sign:before { - content: "\e082"} -.glyphicon-remove-sign:before { - content: "\e083"} -.glyphicon-ok-sign:before { - content: "\e084"} -.glyphicon-question-sign:before { - content: "\e085"} -.glyphicon-info-sign:before { - content: "\e086"} -.glyphicon-screenshot:before { - content: "\e087"} -.glyphicon-remove-circle:before { - content: "\e088"} -.glyphicon-ok-circle:before { - content: "\e089"} -.glyphicon-ban-circle:before { - content: "\e090"} -.glyphicon-arrow-left:before { - content: "\e091"} -.glyphicon-arrow-right:before { - content: "\e092"} -.glyphicon-arrow-up:before { - content: "\e093"} -.glyphicon-arrow-down:before { - content: "\e094"} -.glyphicon-share-alt:before { - content: "\e095"} -.glyphicon-resize-full:before { - content: "\e096"} -.glyphicon-resize-small:before { - content: "\e097"} -.glyphicon-exclamation-sign:before { - content: "\e101"} -.glyphicon-gift:before { - content: "\e102"} -.glyphicon-leaf:before { - content: "\e103"} -.glyphicon-fire:before { - content: "\e104"} -.glyphicon-eye-open:before { - content: "\e105"} -.glyphicon-eye-close:before { - content: "\e106"} -.glyphicon-warning-sign:before { - content: "\e107"} -.glyphicon-plane:before { - content: "\e108"} -.glyphicon-calendar:before { - content: "\e109"} -.glyphicon-random:before { - content: "\e110"} -.glyphicon-comment:before { - content: "\e111"} -.glyphicon-magnet:before { - content: "\e112"} -.glyphicon-chevron-up:before { - content: "\e113"} -.glyphicon-chevron-down:before { - content: "\e114"} -.glyphicon-retweet:before { - content: "\e115"} -.glyphicon-shopping-cart:before { - content: "\e116"} -.glyphicon-folder-close:before { - content: "\e117"} -.glyphicon-folder-open:before { - content: "\e118"} -.glyphicon-resize-vertical:before { - content: "\e119"} -.glyphicon-resize-horizontal:before { - content: "\e120"} -.glyphicon-hdd:before { - content: "\e121"} -.glyphicon-bullhorn:before { - content: "\e122"} -.glyphicon-bell:before { - content: "\e123"} -.glyphicon-certificate:before { - content: "\e124"} -.glyphicon-thumbs-up:before { - content: "\e125"} -.glyphicon-thumbs-down:before { - content: "\e126"} -.glyphicon-hand-right:before { - content: "\e127"} -.glyphicon-hand-left:before { - content: "\e128"} -.glyphicon-hand-up:before { - content: "\e129"} -.glyphicon-hand-down:before { - content: "\e130"} -.glyphicon-circle-arrow-right:before { - content: "\e131"} -.glyphicon-circle-arrow-left:before { - content: "\e132"} -.glyphicon-circle-arrow-up:before { - content: "\e133"} -.glyphicon-circle-arrow-down:before { - content: "\e134"} -.glyphicon-globe:before { - content: "\e135"} -.glyphicon-wrench:before { - content: "\e136"} -.glyphicon-tasks:before { - content: "\e137"} -.glyphicon-filter:before { - content: "\e138"} -.glyphicon-briefcase:before { - content: "\e139"} -.glyphicon-fullscreen:before { - content: "\e140"} -.glyphicon-dashboard:before { - content: "\e141"} -.glyphicon-paperclip:before { - content: "\e142"} -.glyphicon-heart-empty:before { - content: "\e143"} -.glyphicon-link:before { - content: "\e144"} -.glyphicon-phone:before { - content: "\e145"} -.glyphicon-pushpin:before { - content: "\e146"} -.glyphicon-usd:before { - content: "\e148"} -.glyphicon-gbp:before { - content: "\e149"} -.glyphicon-sort:before { - content: "\e150"} -.glyphicon-sort-by-alphabet:before { - content: "\e151"} -.glyphicon-sort-by-alphabet-alt:before { - content: "\e152"} -.glyphicon-sort-by-order:before { - content: "\e153"} -.glyphicon-sort-by-order-alt:before { - content: "\e154"} -.glyphicon-sort-by-attributes:before { - content: "\e155"} -.glyphicon-sort-by-attributes-alt:before { - content: "\e156"} -.glyphicon-unchecked:before { - content: "\e157"} -.glyphicon-expand:before { - content: "\e158"} -.glyphicon-collapse-down:before { - content: "\e159"} -.glyphicon-collapse-up:before { - content: "\e160"} -.glyphicon-log-in:before { - content: "\e161"} -.glyphicon-flash:before { - content: "\e162"} -.glyphicon-log-out:before { - content: "\e163"} -.glyphicon-new-window:before { - content: "\e164"} -.glyphicon-record:before { - content: "\e165"} -.glyphicon-save:before { - content: "\e166"} -.glyphicon-open:before { - content: "\e167"} -.glyphicon-saved:before { - content: "\e168"} -.glyphicon-import:before { - content: "\e169"} -.glyphicon-export:before { - content: "\e170"} -.glyphicon-send:before { - content: "\e171"} -.glyphicon-floppy-disk:before { - content: "\e172"} -.glyphicon-floppy-saved:before { - content: "\e173"} -.glyphicon-floppy-remove:before { - content: "\e174"} -.glyphicon-floppy-save:before { - content: "\e175"} -.glyphicon-floppy-open:before { - content: "\e176"} -.glyphicon-credit-card:before { - content: "\e177"} -.glyphicon-transfer:before { - content: "\e178"} -.glyphicon-cutlery:before { - content: "\e179"} -.glyphicon-header:before { - content: "\e180"} -.glyphicon-compressed:before { - content: "\e181"} -.glyphicon-earphone:before { - content: "\e182"} -.glyphicon-phone-alt:before { - content: "\e183"} -.glyphicon-tower:before { - content: "\e184"} -.glyphicon-stats:before { - content: "\e185"} -.glyphicon-sd-video:before { - content: "\e186"} -.glyphicon-hd-video:before { - content: "\e187"} -.glyphicon-subtitles:before { - content: "\e188"} -.glyphicon-sound-stereo:before { - content: "\e189"} -.glyphicon-sound-dolby:before { - content: "\e190"} -.glyphicon-sound-5-1:before { - content: "\e191"} -.glyphicon-sound-6-1:before { - content: "\e192"} -.glyphicon-sound-7-1:before { - content: "\e193"} -.glyphicon-copyright-mark:before { - content: "\e194"} -.glyphicon-registration-mark:before { - content: "\e195"} -.glyphicon-cloud-download:before { - content: "\e197"} -.glyphicon-cloud-upload:before { - content: "\e198"} -.glyphicon-tree-conifer:before { - content: "\e199"} -.glyphicon-tree-deciduous:before { - content: "\e200"} -.caret { - display: inline-block; - width: 0; - height: 0; - margin-left: 2px; - vertical-align: middle; - border-top: 4px solid; - border-right: 4px solid transparent; - border-left: 4px solid transparent; -} -.dropdown { - position: relative; -} -.dropdown-toggle:focus { - outline: 0; -} -.dropdown-menu { - position: absolute; - top: 100%; - left: 0; - z-index: 1000; - display: none; - float: left; - min-width: 160px; - padding: 5px 0; - margin: 2px 0 0; - font-size: 15px; - list-style: none; - background-color: #fff; - border: 1px solid #ccc; - border: 1px solid rgba(0, 0, 0, 0.15); - border-radius: 0; - -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); - box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); - background-clip: padding-box; -} -.dropdown-menu.pull-right { - right: 0; - left: auto; -} -.dropdown-menu .divider { - height: 1px; - margin: 9.5px 0; - overflow: hidden; - background-color: rgba(0, 0, 0, 0.2); -} -.dropdown-menu>li>a { - display: block; - padding: 3px 20px; - clear: both; - font-weight: normal; - line-height: 1.428571429; - color: #555; - white-space: nowrap; -} -.dropdown-menu>li>a:hover, .dropdown-menu>li>a:focus { - color: #262626; - text-decoration: none; - background-color: #eee; -} -.dropdown-menu>.active>a, .dropdown-menu>.active>a:hover, .dropdown-menu>.active>a:focus { - color: #fff; - text-decoration: none; - background-color: #008cba; - outline: 0; -} -.dropdown-menu>.disabled>a, .dropdown-menu>.disabled>a:hover, .dropdown-menu>.disabled>a:focus { - color: #999; -} -.dropdown-menu>.disabled>a:hover, .dropdown-menu>.disabled>a:focus { - text-decoration: none; - cursor: not-allowed; - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); -} -.open>.dropdown-menu { - display: block; -} -.open>a { - outline: 0; -} -.dropdown-header { - display: block; - padding: 3px 20px; - font-size: 12px; - line-height: 1.428571429; - color: #999; -} -.dropdown-backdrop { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 990; -} -.pull-right>.dropdown-menu { - right: 0; - left: auto; -} -.dropup .caret, .navbar-fixed-bottom .dropdown .caret { - border-top: 0; - border-bottom: 4px solid; - content: ""} -.dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu { - top: auto; - bottom: 100%; - margin-bottom: 1px; -} -@media(min-width:768px) { - .navbar-right .dropdown-menu { - right: 0; - left: auto; -} -}.btn-group, .btn-group-vertical { - position: relative; - display: inline-block; - vertical-align: middle; -} -.btn-group>.btn, .btn-group-vertical>.btn { - position: relative; - float: left; -} -.btn-group>.btn:hover, .btn-group-vertical>.btn:hover, .btn-group>.btn:focus, .btn-group-vertical>.btn:focus, .btn-group>.btn:active, .btn-group-vertical>.btn:active, .btn-group>.btn.active, .btn-group-vertical>.btn.active { - z-index: 2; -} -.btn-group>.btn:focus, .btn-group-vertical>.btn:focus { - outline: 0; -} -.btn-group .btn+.btn, .btn-group .btn+.btn-group, .btn-group .btn-group+.btn, .btn-group .btn-group+.btn-group { - margin-left: -1px; -} -.btn-toolbar:before, .btn-toolbar:after { - display: table; - content: " "} -.btn-toolbar:after { - clear: both; -} -.btn-toolbar:before, .btn-toolbar:after { - display: table; - content: " "} -.btn-toolbar:after { - clear: both; -} -.btn-toolbar:before, .btn-toolbar:after { - display: table; - content: " "} -.btn-toolbar:after { - clear: both; -} -.btn-toolbar:before, .btn-toolbar:after { - display: table; - content: " "} -.btn-toolbar:after { - clear: both; -} -.btn-toolbar:before, .btn-toolbar:after { - display: table; - content: " "} -.btn-toolbar:after { - clear: both; -} -.btn-toolbar .btn-group { - float: left; -} -.btn-toolbar>.btn+.btn, .btn-toolbar>.btn-group+.btn, .btn-toolbar>.btn+.btn-group, .btn-toolbar>.btn-group+.btn-group { - margin-left: 5px; -} -.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { - border-radius: 0; -} -.btn-group>.btn:first-child { - margin-left: 0; -} -.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle) { - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} -.btn-group>.btn:last-child:not(:first-child), .btn-group>.dropdown-toggle:not(:first-child) { - border-bottom-left-radius: 0; - border-top-left-radius: 0; -} -.btn-group>.btn-group { - float: left; -} -.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn { - border-radius: 0; -} -.btn-group>.btn-group:first-child>.btn:last-child, .btn-group>.btn-group:first-child>.dropdown-toggle { - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} -.btn-group>.btn-group:last-child>.btn:first-child { - border-bottom-left-radius: 0; - border-top-left-radius: 0; -} -.btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle { - outline: 0; -} -.btn-group-xs>.btn { - padding: 1px 5px; - font-size: 12px; - line-height: 1.5; - border-radius: 0; -} -.btn-group-sm>.btn { - padding: 5px 10px; - font-size: 12px; - line-height: 1.5; - border-radius: 0; -} -.btn-group-lg>.btn { - padding: 10px 16px; - font-size: 19px; - line-height: 1.33; - border-radius: 0; -} -.btn-group>.btn+.dropdown-toggle { - padding-right: 8px; - padding-left: 8px; -} -.btn-group>.btn-lg+.dropdown-toggle { - padding-right: 12px; - padding-left: 12px; -} -.btn-group.open .dropdown-toggle { - -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); - box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); -} -.btn-group.open .dropdown-toggle.btn-link { - -webkit-box-shadow: none; - box-shadow: none; -} -.btn .caret { - margin-left: 0; -} -.btn-lg .caret { - border-width: 5px 5px 0; - border-bottom-width: 0; -} -.dropup .btn-lg .caret { - border-width: 0 5px 5px; -} -.btn-group-vertical>.btn, .btn-group-vertical>.btn-group, .btn-group-vertical>.btn-group>.btn { - display: block; - float: none; - width: 100%; - max-width: 100%} -.btn-group-vertical>.btn-group:before, .btn-group-vertical>.btn-group:after { - display: table; - content: " "} -.btn-group-vertical>.btn-group:after { - clear: both; -} -.btn-group-vertical>.btn-group:before, .btn-group-vertical>.btn-group:after { - display: table; - content: " "} -.btn-group-vertical>.btn-group:after { - clear: both; -} -.btn-group-vertical>.btn-group:before, .btn-group-vertical>.btn-group:after { - display: table; - content: " "} -.btn-group-vertical>.btn-group:after { - clear: both; -} -.btn-group-vertical>.btn-group:before, .btn-group-vertical>.btn-group:after { - display: table; - content: " "} -.btn-group-vertical>.btn-group:after { - clear: both; -} -.btn-group-vertical>.btn-group:before, .btn-group-vertical>.btn-group:after { - display: table; - content: " "} -.btn-group-vertical>.btn-group:after { - clear: both; -} -.btn-group-vertical>.btn-group>.btn { - float: none; -} -.btn-group-vertical>.btn+.btn, .btn-group-vertical>.btn+.btn-group, .btn-group-vertical>.btn-group+.btn, .btn-group-vertical>.btn-group+.btn-group { - margin-top: -1px; - margin-left: 0; -} -.btn-group-vertical>.btn:not(:first-child):not(:last-child) { - border-radius: 0; -} -.btn-group-vertical>.btn:first-child:not(:last-child) { - border-top-right-radius: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} -.btn-group-vertical>.btn:last-child:not(:first-child) { - border-top-right-radius: 0; - border-bottom-left-radius: 0; - border-top-left-radius: 0; -} -.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn { - border-radius: 0; -} -.btn-group-vertical>.btn-group:first-child>.btn:last-child, .btn-group-vertical>.btn-group:first-child>.dropdown-toggle { - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} -.btn-group-vertical>.btn-group:last-child>.btn:first-child { - border-top-right-radius: 0; - border-top-left-radius: 0; -} -.btn-group-justified { - display: table; - width: 100%; - border-collapse: separate; - table-layout: fixed; -} -.btn-group-justified>.btn, .btn-group-justified>.btn-group { - display: table-cell; - float: none; - width: 1%} -.btn-group-justified>.btn-group .btn { - width: 100%} -[data-toggle="buttons"]>.btn>input[type="radio"], [data-toggle="buttons"]>.btn>input[type="checkbox"] { - display: none; -} -.input-group { - position: relative; - display: table; - border-collapse: separate; -} -.input-group[class*="col-"] { - float: none; - padding-right: 0; - padding-left: 0; -} -.input-group .form-control { - width: 100%; - margin-bottom: 0; -} -.input-group-lg>.form-control, .input-group-lg>.input-group-addon, .input-group-lg>.input-group-btn>.btn { - height: 48px; - padding: 10px 16px; - font-size: 19px; - line-height: 1.33; - border-radius: 0; -} -select.input-group-lg>.form-control, select.input-group-lg>.input-group-addon, select.input-group-lg>.input-group-btn>.btn { - height: 48px; - line-height: 48px; -} -textarea.input-group-lg>.form-control, textarea.input-group-lg>.input-group-addon, textarea.input-group-lg>.input-group-btn>.btn { - height: auto; -} -.input-group-sm>.form-control, .input-group-sm>.input-group-addon, .input-group-sm>.input-group-btn>.btn { - height: 30px; - padding: 5px 10px; - font-size: 12px; - line-height: 1.5; - border-radius: 0; -} -select.input-group-sm>.form-control, select.input-group-sm>.input-group-addon, select.input-group-sm>.input-group-btn>.btn { - height: 30px; - line-height: 30px; -} -textarea.input-group-sm>.form-control, textarea.input-group-sm>.input-group-addon, textarea.input-group-sm>.input-group-btn>.btn { - height: auto; -} -.input-group-addon, .input-group-btn, .input-group .form-control { - display: table-cell; -} -.input-group-addon:not(:first-child):not(:last-child), .input-group-btn:not(:first-child):not(:last-child), .input-group .form-control:not(:first-child):not(:last-child) { - border-radius: 0; -} -.input-group-addon, .input-group-btn { - width: 1%; - white-space: nowrap; - vertical-align: middle; -} -.input-group-addon { - padding: 6px 12px; - font-size: 15px; - font-weight: normal; - line-height: 1; - color: #6f6f6f; - text-align: center; - background-color: #eee; - border: 1px solid #ccc; - border-radius: 0; -} -.input-group-addon.input-sm { - padding: 5px 10px; - font-size: 12px; - border-radius: 0; -} -.input-group-addon.input-lg { - padding: 10px 16px; - font-size: 19px; - border-radius: 0; -} -.input-group-addon input[type="radio"], .input-group-addon input[type="checkbox"] { - margin-top: 0; -} -.input-group .form-control:first-child, .input-group-addon:first-child, .input-group-btn:first-child>.btn, .input-group-btn:first-child>.dropdown-toggle, .input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle) { - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} -.input-group-addon:first-child { - border-right: 0; -} -.input-group .form-control:last-child, .input-group-addon:last-child, .input-group-btn:last-child>.btn, .input-group-btn:last-child>.dropdown-toggle, .input-group-btn:first-child>.btn:not(:first-child) { - border-bottom-left-radius: 0; - border-top-left-radius: 0; -} -.input-group-addon:last-child { - border-left: 0; -} -.input-group-btn { - position: relative; - white-space: nowrap; -} -.input-group-btn:first-child>.btn { - margin-right: -1px; -} -.input-group-btn:last-child>.btn { - margin-left: -1px; -} -.input-group-btn>.btn { - position: relative; -} -.input-group-btn>.btn+.btn { - margin-left: -4px; -} -.input-group-btn>.btn:hover, .input-group-btn>.btn:active { - z-index: 2; -} -.nav { - font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; - padding-left: 0; - margin-bottom: 0; - list-style: none; -} -.nav:before, .nav:after { - display: table; - content: " "} -.nav:after { - clear: both; -} -.nav:before, .nav:after { - display: table; - content: " "} -.nav:after { - clear: both; -} -.nav:before, .nav:after { - display: table; - content: " "} -.nav:after { - clear: both; -} -.nav:before, .nav:after { - display: table; - content: " "} -.nav:after { - clear: both; -} -.nav:before, .nav:after { - display: table; - content: " "} -.nav:after { - clear: both; -} -.nav>li { - position: relative; - display: block; -} -.nav>li>a { - position: relative; - display: block; - padding: 10px 15px; -} -.nav>li>a:hover, .nav>li>a:focus { - text-decoration: none; - background-color: #eee; -} -.nav>li.disabled>a { - color: #999; -} -.nav>li.disabled>a:hover, .nav>li.disabled>a:focus { - color: #999; - text-decoration: none; - cursor: not-allowed; - background-color: transparent; -} -.nav .open>a, .nav .open>a:hover, .nav .open>a:focus { - background-color: #eee; - border-color: #008cba; -} -.nav .nav-divider { - height: 1px; - margin: 9.5px 0; - overflow: hidden; - background-color: #e5e5e5; -} -.nav>li>a>img { - max-width: none; -} -.nav-tabs { - border-bottom: 1px solid #ddd; -} -.nav-tabs>li { - float: left; - margin-bottom: -1px; -} -.nav-tabs>li>a { - margin-right: 2px; - line-height: 1.428571429; - border: 1px solid transparent; - border-radius: 0; -} -.nav-tabs>li>a:hover { - border-color: #eee #eee #ddd; -} -.nav-tabs>li.active>a, .nav-tabs>li.active>a:hover, .nav-tabs>li.active>a:focus { - color: #6f6f6f; - cursor: default; - background-color: #fff; - border: 1px solid #ddd; - border-bottom-color: transparent; -} -.nav-tabs.nav-justified { - width: 100%; - border-bottom: 0; -} -.nav-tabs.nav-justified>li { - float: none; -} -.nav-tabs.nav-justified>li>a { - margin-bottom: 5px; - text-align: center; -} -.nav-tabs.nav-justified>.dropdown .dropdown-menu { - top: auto; - left: auto; -} -@media(min-width:768px) { - .nav-tabs.nav-justified>li { - display: table-cell; - width: 1%} -.nav-tabs.nav-justified>li>a { - margin-bottom: 0; -} -}.nav-tabs.nav-justified>li>a { - margin-right: 0; - border-radius: 0; -} -.nav-tabs.nav-justified>.active>a, .nav-tabs.nav-justified>.active>a:hover, .nav-tabs.nav-justified>.active>a:focus { - border: 1px solid #ddd; -} -@media(min-width:768px) { - .nav-tabs.nav-justified>li>a { - border-bottom: 1px solid #ddd; - border-radius: 0; -} -.nav-tabs.nav-justified>.active>a, .nav-tabs.nav-justified>.active>a:hover, .nav-tabs.nav-justified>.active>a:focus { - border-bottom-color: #fff; -} -}.nav-pills>li { - float: left; -} -.nav-pills>li>a { - border-radius: 0; -} -.nav-pills>li+li { - margin-left: 2px; -} -.nav-pills>li.active>a, .nav-pills>li.active>a:hover, .nav-pills>li.active>a:focus { - color: #fff; - background-color: #008cba; -} -.nav-stacked>li { - float: none; -} -.nav-stacked>li+li { - margin-top: 2px; - margin-left: 0; -} -.nav-justified { - width: 100%} -.nav-justified>li { - float: none; -} -.nav-justified>li>a { - margin-bottom: 5px; - text-align: center; -} -.nav-justified>.dropdown .dropdown-menu { - top: auto; - left: auto; -} -@media(min-width:768px) { - .nav-justified>li { - display: table-cell; - width: 1%} -.nav-justified>li>a { - margin-bottom: 0; -} -}.nav-tabs-justified { - border-bottom: 0; -} -.nav-tabs-justified>li>a { - margin-right: 0; - border-radius: 0; -} -.nav-tabs-justified>.active>a, .nav-tabs-justified>.active>a:hover, .nav-tabs-justified>.active>a:focus { - border: 1px solid #ddd; -} -@media(min-width:768px) { - .nav-tabs-justified>li>a { - border-bottom: 1px solid #ddd; - border-radius: 0; -} -.nav-tabs-justified>.active>a, .nav-tabs-justified>.active>a:hover, .nav-tabs-justified>.active>a:focus { - border-bottom-color: #fff; -} -}.tab-content>.tab-pane { - display: none; -} -.tab-content>.active { - display: block; -} -.nav-tabs .dropdown-menu { - margin-top: -1px; - border-top-right-radius: 0; - border-top-left-radius: 0; -} -.navbar { - position: relative; - min-height: 45px; - margin-bottom: 21px; - border: 1px solid transparent; -} -.navbar:before, .navbar:after { - display: table; - content: " "} -.navbar:after { - clear: both; -} -.navbar:before, .navbar:after { - display: table; - content: " "} -.navbar:after { - clear: both; -} -.navbar:before, .navbar:after { - display: table; - content: " "} -.navbar:after { - clear: both; -} -.navbar:before, .navbar:after { - display: table; - content: " "} -.navbar:after { - clear: both; -} -.navbar:before, .navbar:after { - display: table; - content: " "} -.navbar:after { - clear: both; -} -@media(min-width:768px) { - .navbar { - border-radius: 0; -} -}.navbar-header:before, .navbar-header:after { - display: table; - content: " "} -.navbar-header:after { - clear: both; -} -.navbar-header:before, .navbar-header:after { - display: table; - content: " "} -.navbar-header:after { - clear: both; -} -.navbar-header:before, .navbar-header:after { - display: table; - content: " "} -.navbar-header:after { - clear: both; -} -.navbar-header:before, .navbar-header:after { - display: table; - content: " "} -.navbar-header:after { - clear: both; -} -.navbar-header:before, .navbar-header:after { - display: table; - content: " "} -.navbar-header:after { - clear: both; -} -@media(min-width:768px) { - .navbar-header { - float: left; -} -}.navbar-collapse { - max-height: 340px; - padding-right: 15px; - padding-left: 15px; - overflow-x: visible; - border-top: 1px solid transparent; - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); - -webkit-overflow-scrolling: touch; -} -.navbar-collapse:before, .navbar-collapse:after { - display: table; - content: " "} -.navbar-collapse:after { - clear: both; -} -.navbar-collapse:before, .navbar-collapse:after { - display: table; - content: " "} -.navbar-collapse:after { - clear: both; -} -.navbar-collapse:before, .navbar-collapse:after { - display: table; - content: " "} -.navbar-collapse:after { - clear: both; -} -.navbar-collapse:before, .navbar-collapse:after { - display: table; - content: " "} -.navbar-collapse:after { - clear: both; -} -.navbar-collapse:before, .navbar-collapse:after { - display: table; - content: " "} -.navbar-collapse:after { - clear: both; -} -.navbar-collapse.in { - overflow-y: auto; -} -@media(min-width:768px) { - .navbar-collapse { - width: auto; - border-top: 0; - box-shadow: none; -} -.navbar-collapse.collapse { - display: block!important; - height: auto!important; - padding-bottom: 0; - overflow: visible!important; -} -.navbar-collapse.in { - overflow-y: visible; -} -.navbar-fixed-top .navbar-collapse, .navbar-static-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { - padding-right: 0; - padding-left: 0; -} -}.container>.navbar-header, .container>.navbar-collapse { - margin-right: -15px; - margin-left: -15px; -} -@media(min-width:768px) { - .container>.navbar-header, .container>.navbar-collapse { - margin-right: 0; - margin-left: 0; -} -}.navbar-static-top { - z-index: 1000; - border-width: 0 0 1px; -} -@media(min-width:768px) { - .navbar-static-top { - border-radius: 0; -} -}.navbar-fixed-top, .navbar-fixed-bottom { - position: fixed; - right: 0; - left: 0; - z-index: 1030; -} -@media(min-width:768px) { - .navbar-fixed-top, .navbar-fixed-bottom { - border-radius: 0; -} -}.navbar-fixed-top { - top: 0; - border-width: 0 0 1px; -} -.navbar-fixed-bottom { - bottom: 0; - margin-bottom: 0; - border-width: 1px 0 0; -} -.navbar-brand { - font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; - float: left; - padding: 12px 15px; - font-size: 19px; - line-height: 21px; -} -.navbar-brand:hover, .navbar-brand:focus { - text-decoration: none; -} -@media(min-width:768px) { - .navbar>.container .navbar-brand { - margin-left: -15px; -} -}.navbar-toggle { - position: relative; - float: right; - padding: 9px 10px; - margin-top: 5.5px; - margin-right: 15px; - margin-bottom: 5.5px; - background-color: transparent; - background-image: none; - border: 1px solid transparent; - border-radius: 0; -} -.navbar-toggle .icon-bar { - display: block; - width: 22px; - height: 2px; - border-radius: 1px; -} -.navbar-toggle .icon-bar+.icon-bar { - margin-top: 4px; -} -@media(min-width:768px) { - .navbar-toggle { - display: none; -} -}.navbar-nav { - margin: 6px -15px; -} -.navbar-nav>li>a { - padding-top: 10px; - padding-bottom: 10px; - line-height: 21px; -} -@media(max-width:767px) { - .navbar-nav .open .dropdown-menu { - position: static; - float: none; - width: auto; - margin-top: 0; - background-color: transparent; - border: 0; - box-shadow: none; -} -.navbar-nav .open .dropdown-menu>li>a, .navbar-nav .open .dropdown-menu .dropdown-header { - padding: 5px 15px 5px 25px; -} -.navbar-nav .open .dropdown-menu>li>a { - line-height: 21px; -} -.navbar-nav .open .dropdown-menu>li>a:hover, .navbar-nav .open .dropdown-menu>li>a:focus { - background-image: none; -} -}@media(min-width:768px) { - .navbar-nav { - float: left; - margin: 0; -} -.navbar-nav>li { - float: left; -} -.navbar-nav>li>a { - padding-top: 12px; - padding-bottom: 12px; -} -.navbar-nav.navbar-right:last-child { - margin-right: -15px; -} -}@media(min-width:768px) { - .navbar-left { - float: left!important; -} -.navbar-right { - float: right!important; -} -}.navbar-form { - padding: 10px 15px; - margin-top: 5px; - margin-right: -15px; - margin-bottom: 5px; - margin-left: -15px; - border-top: 1px solid transparent; - border-bottom: 1px solid transparent; - -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); -} -@media(min-width:768px) { - .navbar-form .form-group { - display: inline-block; - margin-bottom: 0; - vertical-align: middle; -} -.navbar-form .form-control { - display: inline-block; -} -.navbar-form select.form-control { - width: auto; -} -.navbar-form .radio, .navbar-form .checkbox { - display: inline-block; - padding-left: 0; - margin-top: 0; - margin-bottom: 0; -} -.navbar-form .radio input[type="radio"], .navbar-form .checkbox input[type="checkbox"] { - float: none; - margin-left: 0; -} -}@media(max-width:767px) { - .navbar-form .form-group { - margin-bottom: 5px; -} -}@media(min-width:768px) { - .navbar-form { - width: auto; - padding-top: 0; - padding-bottom: 0; - margin-right: 0; - margin-left: 0; - border: 0; - -webkit-box-shadow: none; - box-shadow: none; -} -.navbar-form.navbar-right:last-child { - margin-right: -15px; -} -}.navbar-nav>li>.dropdown-menu { - margin-top: 0; - border-top-right-radius: 0; - border-top-left-radius: 0; -} -.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu { - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} -.navbar-nav.pull-right>li>.dropdown-menu, .navbar-nav>li>.dropdown-menu.pull-right { - right: 0; - left: auto; -} -.navbar-btn { - margin-top: 5px; - margin-bottom: 5px; -} -.navbar-btn.btn-sm { - margin-top: 7.5px; - margin-bottom: 7.5px; -} -.navbar-btn.btn-xs { - margin-top: 11.5px; - margin-bottom: 11.5px; -} -.navbar-text { - margin-top: 12px; - margin-bottom: 12px; -} -@media(min-width:768px) { - .navbar-text { - float: left; - margin-right: 15px; - margin-left: 15px; -} -.navbar-text.navbar-right:last-child { - margin-right: 0; -} -}.navbar-default { - background-color: #333; - border-color: #222; -} -.navbar-default .navbar-brand { - color: #fff; -} -.navbar-default .navbar-brand:hover, .navbar-default .navbar-brand:focus { - color: #fff; - background-color: transparent; -} -.navbar-default .navbar-text { - color: #fff; -} -.navbar-default .navbar-nav>li>a { - color: #fff; -} -.navbar-default .navbar-nav>li>a:hover, .navbar-default .navbar-nav>li>a:focus { - color: #fff; - background-color: #272727; -} -.navbar-default .navbar-nav>.active>a, .navbar-default .navbar-nav>.active>a:hover, .navbar-default .navbar-nav>.active>a:focus { - color: #fff; - background-color: #272727; -} -.navbar-default .navbar-nav>.disabled>a, .navbar-default .navbar-nav>.disabled>a:hover, .navbar-default .navbar-nav>.disabled>a:focus { - color: #ccc; - background-color: transparent; -} -.navbar-default .navbar-toggle { - border-color: transparent; -} -.navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus { - background-color: transparent; -} -.navbar-default .navbar-toggle .icon-bar { - background-color: #fff; -} -.navbar-default .navbar-collapse, .navbar-default .navbar-form { - border-color: #222; -} -.navbar-default .navbar-nav>.open>a, .navbar-default .navbar-nav>.open>a:hover, .navbar-default .navbar-nav>.open>a:focus { - color: #fff; - background-color: #272727; -} -@media(max-width:767px) { - .navbar-default .navbar-nav .open .dropdown-menu>li>a { - color: #fff; -} -.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover, .navbar-default .navbar-nav .open .dropdown-menu>li>a:focus { - color: #fff; - background-color: #272727; -} -.navbar-default .navbar-nav .open .dropdown-menu>.active>a, .navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover, .navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus { - color: #fff; - background-color: #272727; -} -.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a, .navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover, .navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus { - color: #ccc; - background-color: transparent; -} -}.navbar-default .navbar-link { - color: #fff; -} -.navbar-default .navbar-link:hover { - color: #fff; -} -.navbar-inverse { - background-color: #008cba; - border-color: #006687; -} -.navbar-inverse .navbar-brand { - color: #fff; -} -.navbar-inverse .navbar-brand:hover, .navbar-inverse .navbar-brand:focus { - color: #fff; - background-color: transparent; -} -.navbar-inverse .navbar-text { - color: #fff; -} -.navbar-inverse .navbar-nav>li>a { - color: #fff; -} -.navbar-inverse .navbar-nav>li>a:hover, .navbar-inverse .navbar-nav>li>a:focus { - color: #fff; - background-color: #006687; -} -.navbar-inverse .navbar-nav>.active>a, .navbar-inverse .navbar-nav>.active>a:hover, .navbar-inverse .navbar-nav>.active>a:focus { - color: #fff; - background-color: #006687; -} -.navbar-inverse .navbar-nav>.disabled>a, .navbar-inverse .navbar-nav>.disabled>a:hover, .navbar-inverse .navbar-nav>.disabled>a:focus { - color: #444; - background-color: transparent; -} -.navbar-inverse .navbar-toggle { - border-color: transparent; -} -.navbar-inverse .navbar-toggle:hover, .navbar-inverse .navbar-toggle:focus { - background-color: transparent; -} -.navbar-inverse .navbar-toggle .icon-bar { - background-color: #fff; -} -.navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form { - border-color: #007196; -} -.navbar-inverse .navbar-nav>.open>a, .navbar-inverse .navbar-nav>.open>a:hover, .navbar-inverse .navbar-nav>.open>a:focus { - color: #fff; - background-color: #006687; -} -@media(max-width:767px) { - .navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header { - border-color: #006687; -} -.navbar-inverse .navbar-nav .open .dropdown-menu .divider { - background-color: #006687; -} -.navbar-inverse .navbar-nav .open .dropdown-menu>li>a { - color: #fff; -} -.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus { - color: #fff; - background-color: #006687; -} -.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a, .navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus { - color: #fff; - background-color: #006687; -} -.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a, .navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus { - color: #444; - background-color: transparent; -} -}.navbar-inverse .navbar-link { - color: #fff; -} -.navbar-inverse .navbar-link:hover { - color: #fff; -} -.breadcrumb { - padding: 8px 15px; - margin-bottom: 21px; - list-style: none; - background-color: #f5f5f5; - border-radius: 0; -} -.breadcrumb>li { - display: inline-block; -} -.breadcrumb>li+li:before { - padding: 0 5px; - color: #999; - content: "/\00a0"} -.breadcrumb>.active { - color: #333; -} -.pagination { - display: inline-block; - padding-left: 0; - margin: 21px 0; - border-radius: 0; -} -.pagination>li { - display: inline; -} -.pagination>li>a, .pagination>li>span { - position: relative; - float: left; - padding: 6px 12px; - margin-left: -1px; - line-height: 1.428571429; - text-decoration: none; - background-color: transparent; - border: 1px solid transparent; -} -.pagination>li:first-child>a, .pagination>li:first-child>span { - margin-left: 0; - border-bottom-left-radius: 0; - border-top-left-radius: 0; -} -.pagination>li:last-child>a, .pagination>li:last-child>span { - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} -.pagination>li>a:hover, .pagination>li>span:hover, .pagination>li>a:focus, .pagination>li>span:focus { - background-color: #eee; -} -.pagination>.active>a, .pagination>.active>span, .pagination>.active>a:hover, .pagination>.active>span:hover, .pagination>.active>a:focus, .pagination>.active>span:focus { - z-index: 2; - color: #fff; - cursor: default; - background-color: #008cba; - border-color: #008cba; -} -.pagination>.disabled>span, .pagination>.disabled>span:hover, .pagination>.disabled>span:focus, .pagination>.disabled>a, .pagination>.disabled>a:hover, .pagination>.disabled>a:focus { - color: #999; - cursor: not-allowed; - background-color: transparent; - border-color: transparent; -} -.pagination-lg>li>a, .pagination-lg>li>span { - padding: 10px 16px; - font-size: 19px; -} -.pagination-lg>li:first-child>a, .pagination-lg>li:first-child>span { - border-bottom-left-radius: 0; - border-top-left-radius: 0; -} -.pagination-lg>li:last-child>a, .pagination-lg>li:last-child>span { - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} -.pagination-sm>li>a, .pagination-sm>li>span { - padding: 5px 10px; - font-size: 12px; -} -.pagination-sm>li:first-child>a, .pagination-sm>li:first-child>span { - border-bottom-left-radius: 0; - border-top-left-radius: 0; -} -.pagination-sm>li:last-child>a, .pagination-sm>li:last-child>span { - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} -.pager { - padding-left: 0; - margin: 21px 0; - text-align: center; - list-style: none; -} -.pager:before, .pager:after { - display: table; - content: " "} -.pager:after { - clear: both; -} -.pager:before, .pager:after { - display: table; - content: " "} -.pager:after { - clear: both; -} -.pager:before, .pager:after { - display: table; - content: " "} -.pager:after { - clear: both; -} -.pager:before, .pager:after { - display: table; - content: " "} -.pager:after { - clear: both; -} -.pager:before, .pager:after { - display: table; - content: " "} -.pager:after { - clear: both; -} -.pager li { - display: inline; -} -.pager li>a, .pager li>span { - display: inline-block; - padding: 5px 14px; - background-color: transparent; - border: 1px solid transparent; - border-radius: 3px; -} -.pager li>a:hover, .pager li>a:focus { - text-decoration: none; - background-color: #eee; -} -.pager .next>a, .pager .next>span { - float: right; -} -.pager .previous>a, .pager .previous>span { - float: left; -} -.pager .disabled>a, .pager .disabled>a:hover, .pager .disabled>a:focus, .pager .disabled>span { - color: #999; - cursor: not-allowed; - background-color: transparent; -} -.label { - display: inline; - padding: .2em .6em .3em; - font-size: 75%; - font-weight: bold; - line-height: 1; - color: #fff; - text-align: center; - white-space: nowrap; - vertical-align: baseline; - border-radius: .25em; -} -.label[href]:hover, .label[href]:focus { - color: #fff; - text-decoration: none; - cursor: pointer; -} -.label:empty { - display: none; -} -.btn .label { - position: relative; - top: -1px; -} -.label-default { - background-color: #999; -} -.label-default[href]:hover, .label-default[href]:focus { - background-color: #808080; -} -.label-primary { - background-color: #008cba; -} -.label-primary[href]:hover, .label-primary[href]:focus { - background-color: #006687; -} -.label-success { - background-color: #43ac6a; -} -.label-success[href]:hover, .label-success[href]:focus { - background-color: #358753; -} -.label-info { - background-color: #5bc0de; -} -.label-info[href]:hover, .label-info[href]:focus { - background-color: #31b0d5; -} -.label-warning { - background-color: #e99002; -} -.label-warning[href]:hover, .label-warning[href]:focus { - background-color: #b67102; -} -.label-danger { - background-color: #f04124; -} -.label-danger[href]:hover, .label-danger[href]:focus { - background-color: #d32a0e; -} -.badge { - display: inline-block; - min-width: 10px; - padding: 3px 7px; - font-size: 12px; - font-weight: bold; - line-height: 1; - color: #777; - text-align: center; - white-space: nowrap; - vertical-align: baseline; - background-color: #e7e7e7; - border-radius: 10px; -} -.badge:empty { - display: none; -} -.btn .badge { - position: relative; - top: -1px; -} -a.badge:hover, a.badge:focus { - color: #fff; - text-decoration: none; - cursor: pointer; -} -a.list-group-item.active>.badge, .nav-pills>.active>a>.badge { - color: #008cba; - background-color: #fff; -} -.nav-pills>li>a>.badge { - margin-left: 3px; -} -.jumbotron { - padding: 30px; - margin-bottom: 30px; - font-size: 23px; - font-weight: 200; - line-height: 2.1428571435; - color: inherit; - background-color: #fafafa; -} -.jumbotron h1, .jumbotron .h1 { - line-height: 1; - color: inherit; -} -.jumbotron p { - line-height: 1.4; -} -.container .jumbotron { - border-radius: 0; -} -.jumbotron .container { - max-width: 100%} -@media screen and (min-width:768px) { - .jumbotron { - padding-top: 48px; - padding-bottom: 48px; -} -.container .jumbotron { - padding-right: 60px; - padding-left: 60px; -} -.jumbotron h1, .jumbotron .h1 { - font-size: 67.5px; -} -}.thumbnail { - display: block; - padding: 4px; - margin-bottom: 21px; - line-height: 1.428571429; - background-color: #fff; - border: 1px solid #ddd; - border-radius: 0; - -webkit-transition: all .2s ease-in-out; - transition: all .2s ease-in-out; -} -.thumbnail>img, .thumbnail a>img { - display: block; - height: auto; - max-width: 100%; - margin-right: auto; - margin-left: auto; -} -a.thumbnail:hover, a.thumbnail:focus, a.thumbnail.active { - border-color: #008cba; -} -.thumbnail .caption { - padding: 9px; - color: #222; -} -.alert { - padding: 15px; - margin-bottom: 21px; - border: 1px solid transparent; - border-radius: 0; -} -.alert h4 { - margin-top: 0; - color: inherit; -} -.alert .alert-link { - font-weight: bold; -} -.alert>p, .alert>ul { - margin-bottom: 0; -} -.alert>p+p { - margin-top: 5px; -} -.alert-dismissable { - padding-right: 35px; -} -.alert-dismissable .close { - position: relative; - top: -2px; - right: -21px; - color: inherit; -} -.alert-success { - color: #fff; - background-color: #43ac6a; - border-color: #3c9a5f; -} -.alert-success hr { - border-top-color: #358753; -} -.alert-success .alert-link { - color: #e6e6e6; -} -.alert-info { - color: #fff; - background-color: #5bc0de; - border-color: #3db5d8; -} -.alert-info hr { - border-top-color: #2aabd2; -} -.alert-info .alert-link { - color: #e6e6e6; -} -.alert-warning { - color: #fff; - background-color: #e99002; - border-color: #d08002; -} -.alert-warning hr { - border-top-color: #b67102; -} -.alert-warning .alert-link { - color: #e6e6e6; -} -.alert-danger { - color: #fff; - background-color: #f04124; - border-color: #ea2f10; -} -.alert-danger hr { - border-top-color: #d32a0e; -} -.alert-danger .alert-link { - color: #e6e6e6; -} -@-webkit-keyframes progress-bar-stripes { - from { - background-position: 40px 0; -} -to { - background-position: 0 0; -} -}@keyframes progress-bar-stripes { - from { - background-position: 40px 0; -} -to { - background-position: 0 0; -} -}.progress { - height: 21px; - margin-bottom: 21px; - overflow: hidden; - background-color: #f5f5f5; - border-radius: 0; - -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); - box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); -} -.progress-bar { - float: left; - width: 0; - height: 100%; - font-size: 12px; - line-height: 21px; - color: #fff; - text-align: center; - background-color: #008cba; - -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); - box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); - -webkit-transition: width .6s ease; - transition: width .6s ease; -} -.progress-striped .progress-bar { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-size: 40px 40px; -} -.progress.active .progress-bar { - -webkit-animation: progress-bar-stripes 2s linear infinite; - animation: progress-bar-stripes 2s linear infinite; -} -.progress-bar-success { - background-color: #43ac6a; -} -.progress-striped .progress-bar-success { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); -} -.progress-bar-info { - background-color: #5bc0de; -} -.progress-striped .progress-bar-info { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); -} -.progress-bar-warning { - background-color: #e99002; -} -.progress-striped .progress-bar-warning { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); -} -.progress-bar-danger { - background-color: #f04124; -} -.progress-striped .progress-bar-danger { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); -} -.media, .media-body { - overflow: hidden; - zoom: 1; -} -.media, .media .media { - margin-top: 15px; -} -.media:first-child { - margin-top: 0; -} -.media-object { - display: block; -} -.media-heading { - margin: 0 0 5px; -} -.media>.pull-left { - margin-right: 10px; -} -.media>.pull-right { - margin-left: 10px; -} -.media-list { - padding-left: 0; - list-style: none; -} -.list-group { - padding-left: 0; - margin-bottom: 20px; -} -.list-group-item { - position: relative; - display: block; - padding: 10px 15px; - margin-bottom: -1px; - background-color: #fff; - border: 1px solid #ddd; -} -.list-group-item:first-child { - border-top-right-radius: 0; - border-top-left-radius: 0; -} -.list-group-item:last-child { - margin-bottom: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} -.list-group-item>.badge { - float: right; -} -.list-group-item>.badge+.badge { - margin-right: 5px; -} -a.list-group-item { - color: #555; -} -a.list-group-item .list-group-item-heading { - color: #333; -} -a.list-group-item:hover, a.list-group-item:focus { - text-decoration: none; - background-color: #f5f5f5; -} -a.list-group-item.active, a.list-group-item.active:hover, a.list-group-item.active:focus { - z-index: 2; - color: #fff; - background-color: #008cba; - border-color: #008cba; -} -a.list-group-item.active .list-group-item-heading, a.list-group-item.active:hover .list-group-item-heading, a.list-group-item.active:focus .list-group-item-heading { - color: inherit; -} -a.list-group-item.active .list-group-item-text, a.list-group-item.active:hover .list-group-item-text, a.list-group-item.active:focus .list-group-item-text { - color: #87e1ff; -} -.list-group-item-heading { - margin-top: 0; - margin-bottom: 5px; -} -.list-group-item-text { - margin-bottom: 0; - line-height: 1.3; -} -.panel { - margin-bottom: 21px; - background-color: #fff; - border: 1px solid transparent; - border-radius: 0; - -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); -} -.panel-body { - padding: 15px; -} -.panel-body:before, .panel-body:after { - display: table; - content: " "} -.panel-body:after { - clear: both; -} -.panel-body:before, .panel-body:after { - display: table; - content: " "} -.panel-body:after { - clear: both; -} -.panel-body:before, .panel-body:after { - display: table; - content: " "} -.panel-body:after { - clear: both; -} -.panel-body:before, .panel-body:after { - display: table; - content: " "} -.panel-body:after { - clear: both; -} -.panel-body:before, .panel-body:after { - display: table; - content: " "} -.panel-body:after { - clear: both; -} -.panel>.list-group { - margin-bottom: 0; -} -.panel>.list-group .list-group-item { - border-width: 1px 0; -} -.panel>.list-group .list-group-item:first-child { - border-top-right-radius: 0; - border-top-left-radius: 0; -} -.panel>.list-group .list-group-item:last-child { - border-bottom: 0; -} -.panel-heading+.list-group .list-group-item:first-child { - border-top-width: 0; -} -.panel>.table, .panel>.table-responsive>.table { - margin-bottom: 0; -} -.panel>.panel-body+.table, .panel>.panel-body+.table-responsive { - border-top: 1px solid #ddd; -} -.panel>.table>tbody:first-child th, .panel>.table>tbody:first-child td { - border-top: 0; -} -.panel>.table-bordered, .panel>.table-responsive>.table-bordered { - border: 0; -} -.panel>.table-bordered>thead>tr>th:first-child, .panel>.table-responsive>.table-bordered>thead>tr>th:first-child, .panel>.table-bordered>tbody>tr>th:first-child, .panel>.table-responsive>.table-bordered>tbody>tr>th:first-child, .panel>.table-bordered>tfoot>tr>th:first-child, .panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child, .panel>.table-bordered>thead>tr>td:first-child, .panel>.table-responsive>.table-bordered>thead>tr>td:first-child, .panel>.table-bordered>tbody>tr>td:first-child, .panel>.table-responsive>.table-bordered>tbody>tr>td:first-child, .panel>.table-bordered>tfoot>tr>td:first-child, .panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child { - border-left: 0; -} -.panel>.table-bordered>thead>tr>th:last-child, .panel>.table-responsive>.table-bordered>thead>tr>th:last-child, .panel>.table-bordered>tbody>tr>th:last-child, .panel>.table-responsive>.table-bordered>tbody>tr>th:last-child, .panel>.table-bordered>tfoot>tr>th:last-child, .panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child, .panel>.table-bordered>thead>tr>td:last-child, .panel>.table-responsive>.table-bordered>thead>tr>td:last-child, .panel>.table-bordered>tbody>tr>td:last-child, .panel>.table-responsive>.table-bordered>tbody>tr>td:last-child, .panel>.table-bordered>tfoot>tr>td:last-child, .panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child { - border-right: 0; -} -.panel>.table-bordered>thead>tr:last-child>th, .panel>.table-responsive>.table-bordered>thead>tr:last-child>th, .panel>.table-bordered>tbody>tr:last-child>th, .panel>.table-responsive>.table-bordered>tbody>tr:last-child>th, .panel>.table-bordered>tfoot>tr:last-child>th, .panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th, .panel>.table-bordered>thead>tr:last-child>td, .panel>.table-responsive>.table-bordered>thead>tr:last-child>td, .panel>.table-bordered>tbody>tr:last-child>td, .panel>.table-responsive>.table-bordered>tbody>tr:last-child>td, .panel>.table-bordered>tfoot>tr:last-child>td, .panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td { - border-bottom: 0; -} -.panel>.table-responsive { - margin-bottom: 0; - border: 0; -} -.panel-heading { - padding: 10px 15px; - border-bottom: 1px solid transparent; - border-top-right-radius: -1; - border-top-left-radius: -1; -} -.panel-heading>.dropdown .dropdown-toggle { - color: inherit; -} -.panel-title { - margin-top: 0; - margin-bottom: 0; - font-size: 17px; - color: inherit; -} -.panel-title>a { - color: inherit; -} -.panel-footer { - padding: 10px 15px; - background-color: #f5f5f5; - border-top: 1px solid #ddd; - border-bottom-right-radius: -1; - border-bottom-left-radius: -1; -} -.panel-group .panel { - margin-bottom: 0; - overflow: hidden; - border-radius: 0; -} -.panel-group .panel+.panel { - margin-top: 5px; -} -.panel-group .panel-heading { - border-bottom: 0; -} -.panel-group .panel-heading+.panel-collapse .panel-body { - border-top: 1px solid #ddd; -} -.panel-group .panel-footer { - border-top: 0; -} -.panel-group .panel-footer+.panel-collapse .panel-body { - border-bottom: 1px solid #ddd; -} -.panel-default { - border-color: #ddd; -} -.panel-default>.panel-heading { - color: #333; - background-color: #f5f5f5; - border-color: #ddd; -} -.panel-default>.panel-heading+.panel-collapse .panel-body { - border-top-color: #ddd; -} -.panel-default>.panel-footer+.panel-collapse .panel-body { - border-bottom-color: #ddd; -} -.panel-primary { - border-color: #008cba; -} -.panel-primary>.panel-heading { - color: #fff; - background-color: #008cba; - border-color: #008cba; -} -.panel-primary>.panel-heading+.panel-collapse .panel-body { - border-top-color: #008cba; -} -.panel-primary>.panel-footer+.panel-collapse .panel-body { - border-bottom-color: #008cba; -} -.panel-success { - border-color: #3c9a5f; -} -.panel-success>.panel-heading { - color: #43ac6a; - background-color: #dff0d8; - border-color: #3c9a5f; -} -.panel-success>.panel-heading+.panel-collapse .panel-body { - border-top-color: #3c9a5f; -} -.panel-success>.panel-footer+.panel-collapse .panel-body { - border-bottom-color: #3c9a5f; -} -.panel-warning { - border-color: #d08002; -} -.panel-warning>.panel-heading { - color: #e99002; - background-color: #fcf8e3; - border-color: #d08002; -} -.panel-warning>.panel-heading+.panel-collapse .panel-body { - border-top-color: #d08002; -} -.panel-warning>.panel-footer+.panel-collapse .panel-body { - border-bottom-color: #d08002; -} -.panel-danger { - border-color: #ea2f10; -} -.panel-danger>.panel-heading { - color: #f04124; - background-color: #f2dede; - border-color: #ea2f10; -} -.panel-danger>.panel-heading+.panel-collapse .panel-body { - border-top-color: #ea2f10; -} -.panel-danger>.panel-footer+.panel-collapse .panel-body { - border-bottom-color: #ea2f10; -} -.panel-info { - border-color: #3db5d8; -} -.panel-info>.panel-heading { - color: #5bc0de; - background-color: #d9edf7; - border-color: #3db5d8; -} -.panel-info>.panel-heading+.panel-collapse .panel-body { - border-top-color: #3db5d8; -} -.panel-info>.panel-footer+.panel-collapse .panel-body { - border-bottom-color: #3db5d8; -} -.well { - min-height: 20px; - padding: 19px; - margin-bottom: 20px; - background-color: #fafafa; - border: 1px solid #e8e8e8; - border-radius: 0; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); -} -.well blockquote { - border-color: #ddd; - border-color: rgba(0, 0, 0, 0.15); -} -.well-lg { - padding: 24px; - border-radius: 0; -} -.well-sm { - padding: 9px; - border-radius: 0; -} -.close { - float: right; - font-size: 22.5px; - font-weight: bold; - line-height: 1; - color: #000; - text-shadow: 0 1px 0 #fff; - opacity: .2; - filter: alpha(opacity=20); -} -.close:hover, .close:focus { - color: #000; - text-decoration: none; - cursor: pointer; - opacity: .5; - filter: alpha(opacity=50); -} -button.close { - padding: 0; - cursor: pointer; - background: transparent; - border: 0; - -webkit-appearance: none; -} -.modal-open { - overflow: hidden; -} -.modal { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 1040; - display: none; - overflow: auto; - overflow-y: scroll; -} -.modal.fade .modal-dialog { - -webkit-transform: translate(0, -25%); - -ms-transform: translate(0, -25%); - transform: translate(0, -25%); - -webkit-transition: -webkit-transform .3s ease-out; - -moz-transition: -moz-transform .3s ease-out; - -o-transition: -o-transform .3s ease-out; - transition: transform .3s ease-out; -} -.modal.in .modal-dialog { - -webkit-transform: translate(0, 0); - -ms-transform: translate(0, 0); - transform: translate(0, 0); -} -.modal-dialog { - position: relative; - z-index: 1050; - width: auto; - margin: 10px; -} -.modal-content { - position: relative; - background-color: #fff; - border: 1px solid #999; - border: 1px solid rgba(0, 0, 0, 0.2); - border-radius: 0; - outline: 0; - -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); - box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); - background-clip: padding-box; -} -.modal-backdrop { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 1030; - background-color: #000; -} -.modal-backdrop.fade { - opacity: 0; - filter: alpha(opacity=0); -} -.modal-backdrop.in { - opacity: .5; - filter: alpha(opacity=50); -} -.modal-header { - min-height: 16.428571429px; - padding: 15px; - border-bottom: 1px solid #e5e5e5; -} -.modal-header .close { - margin-top: -2px; -} -.modal-title { - margin: 0; - line-height: 1.428571429; -} -.modal-body { - position: relative; - padding: 20px; -} -.modal-footer { - padding: 19px 20px 20px; - margin-top: 15px; - text-align: right; - border-top: 1px solid #e5e5e5; -} -.modal-footer:before, .modal-footer:after { - display: table; - content: " "} -.modal-footer:after { - clear: both; -} -.modal-footer:before, .modal-footer:after { - display: table; - content: " "} -.modal-footer:after { - clear: both; -} -.modal-footer:before, .modal-footer:after { - display: table; - content: " "} -.modal-footer:after { - clear: both; -} -.modal-footer:before, .modal-footer:after { - display: table; - content: " "} -.modal-footer:after { - clear: both; -} -.modal-footer:before, .modal-footer:after { - display: table; - content: " "} -.modal-footer:after { - clear: both; -} -.modal-footer .btn+.btn { - margin-bottom: 0; - margin-left: 5px; -} -.modal-footer .btn-group .btn+.btn { - margin-left: -1px; -} -.modal-footer .btn-block+.btn-block { - margin-left: 0; -} -@media screen and (min-width:768px) { - .modal-dialog { - width: 600px; - margin: 30px auto; -} -.modal-content { - -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); - box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); -} -}.tooltip { - position: absolute; - z-index: 1030; - display: block; - font-size: 12px; - line-height: 1.4; - opacity: 0; - filter: alpha(opacity=0); - visibility: visible; -} -.tooltip.in { - opacity: .9; - filter: alpha(opacity=90); -} -.tooltip.top { - padding: 5px 0; - margin-top: -3px; -} -.tooltip.right { - padding: 0 5px; - margin-left: 3px; -} -.tooltip.bottom { - padding: 5px 0; - margin-top: 3px; -} -.tooltip.left { - padding: 0 5px; - margin-left: -3px; -} -.tooltip-inner { - max-width: 200px; - padding: 3px 8px; - color: #fff; - text-align: center; - text-decoration: none; - background-color: #333; - border-radius: 0; -} -.tooltip-arrow { - position: absolute; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; -} -.tooltip.top .tooltip-arrow { - bottom: 0; - left: 50%; - margin-left: -5px; - border-top-color: #333; - border-width: 5px 5px 0; -} -.tooltip.top-left .tooltip-arrow { - bottom: 0; - left: 5px; - border-top-color: #333; - border-width: 5px 5px 0; -} -.tooltip.top-right .tooltip-arrow { - right: 5px; - bottom: 0; - border-top-color: #333; - border-width: 5px 5px 0; -} -.tooltip.right .tooltip-arrow { - top: 50%; - left: 0; - margin-top: -5px; - border-right-color: #333; - border-width: 5px 5px 5px 0; -} -.tooltip.left .tooltip-arrow { - top: 50%; - right: 0; - margin-top: -5px; - border-left-color: #333; - border-width: 5px 0 5px 5px; -} -.tooltip.bottom .tooltip-arrow { - top: 0; - left: 50%; - margin-left: -5px; - border-bottom-color: #333; - border-width: 0 5px 5px; -} -.tooltip.bottom-left .tooltip-arrow { - top: 0; - left: 5px; - border-bottom-color: #333; - border-width: 0 5px 5px; -} -.tooltip.bottom-right .tooltip-arrow { - top: 0; - right: 5px; - border-bottom-color: #333; - border-width: 0 5px 5px; -} -.popover { - position: absolute; - top: 0; - left: 0; - z-index: 1010; - display: none; - max-width: 276px; - padding: 1px; - text-align: left; - white-space: normal; - background-color: #333; - border: 1px solid #333; - border: 1px solid transparent; - border-radius: 0; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - background-clip: padding-box; -} -.popover.top { - margin-top: -10px; -} -.popover.right { - margin-left: 10px; -} -.popover.bottom { - margin-top: 10px; -} -.popover.left { - margin-left: -10px; -} -.popover-title { - padding: 8px 14px; - margin: 0; - font-size: 15px; - font-weight: normal; - line-height: 18px; - background-color: #333; - border-bottom: 1px solid #262626; - border-radius: 5px 5px 0 0; -} -.popover-content { - padding: 9px 14px; -} -.popover .arrow, .popover .arrow:after { - position: absolute; - display: block; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; -} -.popover .arrow { - border-width: 11px; -} -.popover .arrow:after { - border-width: 10px; - content: ""} -.popover.top .arrow { - bottom: -11px; - left: 50%; - margin-left: -11px; - border-top-color: #999; - border-top-color: rgba(0, 0, 0, 0.25); - border-bottom-width: 0; -} -.popover.top .arrow:after { - bottom: 1px; - margin-left: -10px; - border-top-color: #333; - border-bottom-width: 0; - content: " "} -.popover.right .arrow { - top: 50%; - left: -11px; - margin-top: -11px; - border-right-color: #999; - border-right-color: rgba(0, 0, 0, 0.25); - border-left-width: 0; -} -.popover.right .arrow:after { - bottom: -10px; - left: 1px; - border-right-color: #333; - border-left-width: 0; - content: " "} -.popover.bottom .arrow { - top: -11px; - left: 50%; - margin-left: -11px; - border-bottom-color: #999; - border-bottom-color: rgba(0, 0, 0, 0.25); - border-top-width: 0; -} -.popover.bottom .arrow:after { - top: 1px; - margin-left: -10px; - border-bottom-color: #333; - border-top-width: 0; - content: " "} -.popover.left .arrow { - top: 50%; - right: -11px; - margin-top: -11px; - border-left-color: #999; - border-left-color: rgba(0, 0, 0, 0.25); - border-right-width: 0; -} -.popover.left .arrow:after { - right: 1px; - bottom: -10px; - border-left-color: #333; - border-right-width: 0; - content: " "} -.carousel { - position: relative; -} -.carousel-inner { - position: relative; - width: 100%; - overflow: hidden; -} -.carousel-inner>.item { - position: relative; - display: none; - -webkit-transition: .6s ease-in-out left; - transition: .6s ease-in-out left; -} -.carousel-inner>.item>img, .carousel-inner>.item>a>img { - display: block; - height: auto; - max-width: 100%; - line-height: 1; -} -.carousel-inner>.active, .carousel-inner>.next, .carousel-inner>.prev { - display: block; -} -.carousel-inner>.active { - left: 0; -} -.carousel-inner>.next, .carousel-inner>.prev { - position: absolute; - top: 0; - width: 100%} -.carousel-inner>.next { - left: 100%} -.carousel-inner>.prev { - left: -100%} -.carousel-inner>.next.left, .carousel-inner>.prev.right { - left: 0; -} -.carousel-inner>.active.left { - left: -100%} -.carousel-inner>.active.right { - left: 100%} -.carousel-control { - position: absolute; - top: 0; - bottom: 0; - left: 0; - width: 15%; - font-size: 20px; - color: #fff; - text-align: center; - text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); - opacity: .5; - filter: alpha(opacity=50); -} -.carousel-control.left { - background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.5) 0), color-stop(rgba(0, 0, 0, 0.0001) 100%)); - background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0.0001) 100%); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); -} -.carousel-control.right { - right: 0; - left: auto; - background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.0001) 0), color-stop(rgba(0, 0, 0, 0.5) 100%)); - background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0, rgba(0, 0, 0, 0.5) 100%); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); -} -.carousel-control:hover, .carousel-control:focus { - color: #fff; - text-decoration: none; - outline: 0; - opacity: .9; - filter: alpha(opacity=90); -} -.carousel-control .icon-prev, .carousel-control .icon-next, .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right { - position: absolute; - top: 50%; - z-index: 5; - display: inline-block; -} -.carousel-control .icon-prev, .carousel-control .glyphicon-chevron-left { - left: 50%} -.carousel-control .icon-next, .carousel-control .glyphicon-chevron-right { - right: 50%} -.carousel-control .icon-prev, .carousel-control .icon-next { - width: 20px; - height: 20px; - margin-top: -10px; - margin-left: -10px; - font-family: serif; -} -.carousel-control .icon-prev:before { - content: '\2039'} -.carousel-control .icon-next:before { - content: '\203a'} -.carousel-indicators { - position: absolute; - bottom: 10px; - left: 50%; - z-index: 15; - width: 60%; - padding-left: 0; - margin-left: -30%; - text-align: center; - list-style: none; -} -.carousel-indicators li { - display: inline-block; - width: 10px; - height: 10px; - margin: 1px; - text-indent: -999px; - cursor: pointer; - background-color: #000 \9; - background-color: rgba(0, 0, 0, 0); - border: 1px solid #fff; - border-radius: 10px; -} -.carousel-indicators .active { - width: 12px; - height: 12px; - margin: 0; - background-color: #fff; -} -.carousel-caption { - position: absolute; - right: 15%; - bottom: 20px; - left: 15%; - z-index: 10; - padding-top: 20px; - padding-bottom: 20px; - color: #fff; - text-align: center; - text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); -} -.carousel-caption .btn { - text-shadow: none; -} -@media screen and (min-width:768px) { - .carousel-control .glyphicons-chevron-left, .carousel-control .glyphicons-chevron-right, .carousel-control .icon-prev, .carousel-control .icon-next { - width: 30px; - height: 30px; - margin-top: -15px; - margin-left: -15px; - font-size: 30px; -} -.carousel-caption { - right: 20%; - left: 20%; - padding-bottom: 30px; -} -.carousel-indicators { - bottom: 20px; -} -}.clearfix:before, .clearfix:after { - display: table; - content: " "} -.clearfix:after { - clear: both; -} -.clearfix:before, .clearfix:after { - display: table; - content: " "} -.clearfix:after { - clear: both; -} -.center-block { - display: block; - margin-right: auto; - margin-left: auto; -} -.pull-right { - float: right!important; -} -.pull-left { - float: left!important; -} -.hide { - display: none!important; -} -.show { - display: block!important; -} -.invisible { - visibility: hidden; -} -.text-hide { - font: 0/0 a; - color: transparent; - text-shadow: none; - background-color: transparent; - border: 0; -} -.hidden { - display: none!important; - visibility: hidden!important; -} -.affix { - position: fixed; -} -@-ms-viewport { - width: device-width; -} -.visible-xs, tr.visible-xs, th.visible-xs, td.visible-xs { - display: none!important; -} -@media(max-width:767px) { - .visible-xs { - display: block!important; -} -table.visible-xs { - display: table; -} -tr.visible-xs { - display: table-row!important; -} -th.visible-xs, td.visible-xs { - display: table-cell!important; -} -}@media(min-width:768px) and (max-width:991px) { - .visible-xs.visible-sm { - display: block!important; -} -table.visible-xs.visible-sm { - display: table; -} -tr.visible-xs.visible-sm { - display: table-row!important; -} -th.visible-xs.visible-sm, td.visible-xs.visible-sm { - display: table-cell!important; -} -}@media(min-width:992px) and (max-width:1199px) { - .visible-xs.visible-md { - display: block!important; -} -table.visible-xs.visible-md { - display: table; -} -tr.visible-xs.visible-md { - display: table-row!important; -} -th.visible-xs.visible-md, td.visible-xs.visible-md { - display: table-cell!important; -} -}@media(min-width:1200px) { - .visible-xs.visible-lg { - display: block!important; -} -table.visible-xs.visible-lg { - display: table; -} -tr.visible-xs.visible-lg { - display: table-row!important; -} -th.visible-xs.visible-lg, td.visible-xs.visible-lg { - display: table-cell!important; -} -}.visible-sm, tr.visible-sm, th.visible-sm, td.visible-sm { - display: none!important; -} -@media(max-width:767px) { - .visible-sm.visible-xs { - display: block!important; -} -table.visible-sm.visible-xs { - display: table; -} -tr.visible-sm.visible-xs { - display: table-row!important; -} -th.visible-sm.visible-xs, td.visible-sm.visible-xs { - display: table-cell!important; -} -}@media(min-width:768px) and (max-width:991px) { - .visible-sm { - display: block!important; -} -table.visible-sm { - display: table; -} -tr.visible-sm { - display: table-row!important; -} -th.visible-sm, td.visible-sm { - display: table-cell!important; -} -}@media(min-width:992px) and (max-width:1199px) { - .visible-sm.visible-md { - display: block!important; -} -table.visible-sm.visible-md { - display: table; -} -tr.visible-sm.visible-md { - display: table-row!important; -} -th.visible-sm.visible-md, td.visible-sm.visible-md { - display: table-cell!important; -} -}@media(min-width:1200px) { - .visible-sm.visible-lg { - display: block!important; -} -table.visible-sm.visible-lg { - display: table; -} -tr.visible-sm.visible-lg { - display: table-row!important; -} -th.visible-sm.visible-lg, td.visible-sm.visible-lg { - display: table-cell!important; -} -}.visible-md, tr.visible-md, th.visible-md, td.visible-md { - display: none!important; -} -@media(max-width:767px) { - .visible-md.visible-xs { - display: block!important; -} -table.visible-md.visible-xs { - display: table; -} -tr.visible-md.visible-xs { - display: table-row!important; -} -th.visible-md.visible-xs, td.visible-md.visible-xs { - display: table-cell!important; -} -}@media(min-width:768px) and (max-width:991px) { - .visible-md.visible-sm { - display: block!important; -} -table.visible-md.visible-sm { - display: table; -} -tr.visible-md.visible-sm { - display: table-row!important; -} -th.visible-md.visible-sm, td.visible-md.visible-sm { - display: table-cell!important; -} -}@media(min-width:992px) and (max-width:1199px) { - .visible-md { - display: block!important; -} -table.visible-md { - display: table; -} -tr.visible-md { - display: table-row!important; -} -th.visible-md, td.visible-md { - display: table-cell!important; -} -}@media(min-width:1200px) { - .visible-md.visible-lg { - display: block!important; -} -table.visible-md.visible-lg { - display: table; -} -tr.visible-md.visible-lg { - display: table-row!important; -} -th.visible-md.visible-lg, td.visible-md.visible-lg { - display: table-cell!important; -} -}.visible-lg, tr.visible-lg, th.visible-lg, td.visible-lg { - display: none!important; -} -@media(max-width:767px) { - .visible-lg.visible-xs { - display: block!important; -} -table.visible-lg.visible-xs { - display: table; -} -tr.visible-lg.visible-xs { - display: table-row!important; -} -th.visible-lg.visible-xs, td.visible-lg.visible-xs { - display: table-cell!important; -} -}@media(min-width:768px) and (max-width:991px) { - .visible-lg.visible-sm { - display: block!important; -} -table.visible-lg.visible-sm { - display: table; -} -tr.visible-lg.visible-sm { - display: table-row!important; -} -th.visible-lg.visible-sm, td.visible-lg.visible-sm { - display: table-cell!important; -} -}@media(min-width:992px) and (max-width:1199px) { - .visible-lg.visible-md { - display: block!important; -} -table.visible-lg.visible-md { - display: table; -} -tr.visible-lg.visible-md { - display: table-row!important; -} -th.visible-lg.visible-md, td.visible-lg.visible-md { - display: table-cell!important; -} -}@media(min-width:1200px) { - .visible-lg { - display: block!important; -} -table.visible-lg { - display: table; -} -tr.visible-lg { - display: table-row!important; -} -th.visible-lg, td.visible-lg { - display: table-cell!important; -} -}.hidden-xs { - display: block!important; -} -table.hidden-xs { - display: table; -} -tr.hidden-xs { - display: table-row!important; -} -th.hidden-xs, td.hidden-xs { - display: table-cell!important; -} -@media(max-width:767px) { - .hidden-xs, tr.hidden-xs, th.hidden-xs, td.hidden-xs { - display: none!important; -} -}@media(min-width:768px) and (max-width:991px) { - .hidden-xs.hidden-sm, tr.hidden-xs.hidden-sm, th.hidden-xs.hidden-sm, td.hidden-xs.hidden-sm { - display: none!important; -} -}@media(min-width:992px) and (max-width:1199px) { - .hidden-xs.hidden-md, tr.hidden-xs.hidden-md, th.hidden-xs.hidden-md, td.hidden-xs.hidden-md { - display: none!important; -} -}@media(min-width:1200px) { - .hidden-xs.hidden-lg, tr.hidden-xs.hidden-lg, th.hidden-xs.hidden-lg, td.hidden-xs.hidden-lg { - display: none!important; -} -}.hidden-sm { - display: block!important; -} -table.hidden-sm { - display: table; -} -tr.hidden-sm { - display: table-row!important; -} -th.hidden-sm, td.hidden-sm { - display: table-cell!important; -} -@media(max-width:767px) { - .hidden-sm.hidden-xs, tr.hidden-sm.hidden-xs, th.hidden-sm.hidden-xs, td.hidden-sm.hidden-xs { - display: none!important; -} -}@media(min-width:768px) and (max-width:991px) { - .hidden-sm, tr.hidden-sm, th.hidden-sm, td.hidden-sm { - display: none!important; -} -}@media(min-width:992px) and (max-width:1199px) { - .hidden-sm.hidden-md, tr.hidden-sm.hidden-md, th.hidden-sm.hidden-md, td.hidden-sm.hidden-md { - display: none!important; -} -}@media(min-width:1200px) { - .hidden-sm.hidden-lg, tr.hidden-sm.hidden-lg, th.hidden-sm.hidden-lg, td.hidden-sm.hidden-lg { - display: none!important; -} -}.hidden-md { - display: block!important; -} -table.hidden-md { - display: table; -} -tr.hidden-md { - display: table-row!important; -} -th.hidden-md, td.hidden-md { - display: table-cell!important; -} -@media(max-width:767px) { - .hidden-md.hidden-xs, tr.hidden-md.hidden-xs, th.hidden-md.hidden-xs, td.hidden-md.hidden-xs { - display: none!important; -} -}@media(min-width:768px) and (max-width:991px) { - .hidden-md.hidden-sm, tr.hidden-md.hidden-sm, th.hidden-md.hidden-sm, td.hidden-md.hidden-sm { - display: none!important; -} -}@media(min-width:992px) and (max-width:1199px) { - .hidden-md, tr.hidden-md, th.hidden-md, td.hidden-md { - display: none!important; -} -}@media(min-width:1200px) { - .hidden-md.hidden-lg, tr.hidden-md.hidden-lg, th.hidden-md.hidden-lg, td.hidden-md.hidden-lg { - display: none!important; -} -}.hidden-lg { - display: block!important; -} -table.hidden-lg { - display: table; -} -tr.hidden-lg { - display: table-row!important; -} -th.hidden-lg, td.hidden-lg { - display: table-cell!important; -} -@media(max-width:767px) { - .hidden-lg.hidden-xs, tr.hidden-lg.hidden-xs, th.hidden-lg.hidden-xs, td.hidden-lg.hidden-xs { - display: none!important; -} -}@media(min-width:768px) and (max-width:991px) { - .hidden-lg.hidden-sm, tr.hidden-lg.hidden-sm, th.hidden-lg.hidden-sm, td.hidden-lg.hidden-sm { - display: none!important; -} -}@media(min-width:992px) and (max-width:1199px) { - .hidden-lg.hidden-md, tr.hidden-lg.hidden-md, th.hidden-lg.hidden-md, td.hidden-lg.hidden-md { - display: none!important; -} -}@media(min-width:1200px) { - .hidden-lg, tr.hidden-lg, th.hidden-lg, td.hidden-lg { - display: none!important; -} -}.visible-print, tr.visible-print, th.visible-print, td.visible-print { - display: none!important; -} -@media print { - .visible-print { - display: block!important; -} -table.visible-print { - display: table; -} -tr.visible-print { - display: table-row!important; -} -th.visible-print, td.visible-print { - display: table-cell!important; -} -.hidden-print, tr.hidden-print, th.hidden-print, td.hidden-print { - display: none!important; -} -}.navbar { - font-size: 13px; - font-weight: 300; - border: 0; -} -.navbar .navbar-toggle:hover .icon-bar { - background-color: #b3b3b3; -} -.navbar-collapse { - border-top-color: rgba(0, 0, 0, 0.2); - -webkit-box-shadow: none; - box-shadow: none; -} -.navbar .dropdown-menu { - border: 0; -} -.navbar .dropdown-menu>li>a, .navbar .dropdown-menu>li>a:focus { - font-size: 13px; - font-weight: 300; - background-color: transparent; -} -.navbar .dropdown-header { - color: rgba(255, 255, 255, 0.5); -} -.navbar-default .dropdown-menu { - background-color: #333; -} -.navbar-default .dropdown-menu>li>a, .navbar-default .dropdown-menu>li>a:focus { - color: #fff; -} -.navbar-default .dropdown-menu>li>a:hover, .navbar-default .dropdown-menu>.active>a, .navbar-default .dropdown-menu>.active>a:hover { - background-color: #272727; -} -.navbar-inverse .dropdown-menu { - background-color: #008cba; -} -.navbar-inverse .dropdown-menu>li>a, .navbar-inverse .dropdown-menu>li>a:focus { - color: #fff; -} -.navbar-inverse .dropdown-menu>li>a:hover, .navbar-inverse .dropdown-menu>.active>a, .navbar-inverse .dropdown-menu>.active>a:hover { - background-color: #006687; -} -.btn { - padding: 14px 28px; -} -.btn-lg { - padding: 16px 32px; -} -.btn-sm { - padding: 8px 16px; -} -.btn-xs { - padding: 4px 8px; -} -.btn-group .btn~.dropdown-toggle { - padding-right: 16px; - padding-left: 16px; -} -.btn-group .dropdown-menu { - border-top-width: 0; -} -.btn-group.dropup .dropdown-menu { - margin-bottom: 0; - border-top-width: 1px; - border-bottom-width: 0; -} -.btn-group .dropdown-toggle.btn-default~.dropdown-menu { - background-color: #e7e7e7; - border-color: #dadada; -} -.btn-group .dropdown-toggle.btn-default~.dropdown-menu>li>a { - color: #333; -} -.btn-group .dropdown-toggle.btn-default~.dropdown-menu>li>a:hover { - background-color: #d3d3d3; -} -.btn-group .dropdown-toggle.btn-primary~.dropdown-menu { - background-color: #008cba; - border-color: #0079a1; -} -.btn-group .dropdown-toggle.btn-primary~.dropdown-menu>li>a { - color: #fff; -} -.btn-group .dropdown-toggle.btn-primary~.dropdown-menu>li>a:hover { - background-color: #006d91; -} -.btn-group .dropdown-toggle.btn-success~.dropdown-menu { - background-color: #43ac6a; - border-color: #3c9a5f; -} -.btn-group .dropdown-toggle.btn-success~.dropdown-menu>li>a { - color: #fff; -} -.btn-group .dropdown-toggle.btn-success~.dropdown-menu>li>a:hover { - background-color: #388f58; -} -.btn-group .dropdown-toggle.btn-info~.dropdown-menu { - background-color: #5bc0de; - border-color: #46b8da; -} -.btn-group .dropdown-toggle.btn-info~.dropdown-menu>li>a { - color: #fff; -} -.btn-group .dropdown-toggle.btn-info~.dropdown-menu>li>a:hover { - background-color: #39b3d7; -} -.btn-group .dropdown-toggle.btn-warning~.dropdown-menu { - background-color: #e99002; - border-color: #d08002; -} -.btn-group .dropdown-toggle.btn-warning~.dropdown-menu>li>a { - color: #fff; -} -.btn-group .dropdown-toggle.btn-warning~.dropdown-menu>li>a:hover { - background-color: #c17702; -} -.btn-group .dropdown-toggle.btn-danger~.dropdown-menu { - background-color: #f04124; - border-color: #ea2f10; -} -.btn-group .dropdown-toggle.btn-danger~.dropdown-menu>li>a { - color: #fff; -} -.btn-group .dropdown-toggle.btn-danger~.dropdown-menu>li>a:hover { - background-color: #dc2c0f; -} -.lead { - color: #6f6f6f; -} -cite { - font-style: italic; -} -blockquote { - color: #6f6f6f; - border-left-width: 1px; -} -blockquote.pull-right { - border-right-width: 1px; -} -blockquote small { - font-size: 12px; - font-weight: 300; -} -table { - font-size: 12px; -} -input, .form-control { - padding: 7px; - font-size: 12px; -} -label, .control-label, .help-block, .checkbox, .radio { - font-size: 12px; - font-weight: normal; -} -.form-group .btn, .input-group-addon, .input-group-btn .btn { - padding: 8px 14px; - font-size: 12px; -} -.nav .open>a, .nav .open>a:hover, .nav .open>a:focus { - border-color: transparent; -} -.nav-tabs>li>a { - color: #222; - background-color: #e7e7e7; -} -.nav-tabs .caret { - border-top-color: #222; - border-bottom-color: #222; -} -.nav-pills { - font-weight: 300; -} -.breadcrumb { - font-size: 10px; - font-weight: 300; - text-transform: uppercase; - border: 1px solid #ddd; - border-radius: 3px; -} -.pagination { - font-size: 12px; - font-weight: 300; - color: #999; -} -.pagination>li>a, .pagination>li>span { - margin-left: 4px; - color: #999; -} -.pagination>.active>a, .pagination>.active>span { - color: #fff; -} -.pagination>li>a, .pagination>li:first-child>a, .pagination>li:last-child>a, .pagination>li>span, .pagination>li:first-child>span, .pagination>li:last-child>span { - border-radius: 3px; -} -.pagination-lg>li>a { - padding-right: 22px; - padding-left: 22px; -} -.pagination-sm>li>a { - padding: 0 5px; -} -.pager { - font-size: 12px; - font-weight: 300; - color: #999; -} -.list-group { - font-size: 12px; - font-weight: 300; -} -.alert { - font-size: 12px; - font-weight: 300; -} -.alert a, .alert .alert-link { - font-weight: normal; - color: #fff; - text-decoration: underline; -} -.label { - padding-right: 1em; - padding-left: 1em; - font-weight: 300; - border-radius: 0; -} -.label-default { - color: #333; - background-color: #e7e7e7; -} -.badge { - font-weight: 300; -} -.progress { - height: 22px; - padding: 2px; - background-color: #f6f6f6; - border: 1px solid #ccc; - -webkit-box-shadow: none; - box-shadow: none; -} -.dropdown-menu { - padding: 0; - margin-top: 0; - font-size: 12px; -} -.dropdown-menu>li>a { - padding: 12px 15px; -} -.dropdown-header { - padding-right: 15px; - padding-left: 15px; - font-size: 9px; - text-transform: uppercase; -} -.popover { - font-size: 12px; - font-weight: 300; - color: #fff; -} -.panel-heading, .panel-footer { - border-top-right-radius: 0; - border-top-left-radius: 0; -} -.clearfix:before, .clearfix:after { - display: table; - content: " "} -.clearfix:after { - clear: both; -} -.clearfix:before, .clearfix:after { - display: table; - content: " "} -.clearfix:after { - clear: both; -} -.center-block { - display: block; - margin-right: auto; - margin-left: auto; -} -.pull-right { - float: right!important; -} -.pull-left { - float: left!important; -} -.hide { - display: none!important; -} -.show { - display: block!important; -} -.invisible { - visibility: hidden; -} -.text-hide { - font: 0/0 a; - color: transparent; - text-shadow: none; - background-color: transparent; - border: 0; -} -.hidden { - display: none!important; - visibility: hidden!important; -} -.affix { - position: fixed; -} diff --git a/site/css/bootstrap-custom.min.css b/site/css/bootstrap-custom.min.css deleted file mode 100644 index 7e830b8..0000000 --- a/site/css/bootstrap-custom.min.css +++ /dev/null @@ -1 +0,0 @@ -/*! normalize.css v2.1.3 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden],template{display:none}html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a{background:transparent}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{margin:.67em 0;font-size:2em}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}hr{height:0;-moz-box-sizing:content-box;box-sizing:content-box}mark{color:#000;background:#ff0}code,kbd,pre,samp{font-family:Hack,monospace,serif;font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:0}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}button,input,select,textarea{margin:0;font-family:inherit;font-size:100%}button,input{line-height:normal}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button}button[disabled],html input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{padding:0;box-sizing:border-box}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}@media print{*{color:#000 !important;text-shadow:none !important;background:transparent !important;box-shadow:none !important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:2cm .5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff !important}.navbar{display:none}.table td,.table th{background-color:#fff !important}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000 !important}.label{border:1px solid #000}.table{border-collapse:collapse !important}.table-bordered th,.table-bordered td{border:1px solid #ddd !important}}*,*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:62.5%;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:Merriweather,Georgia,serif;font-size:14px;line-height:1.428571429;color:#222;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#008cba;text-decoration:none}a:hover,a:focus{color:#00526e;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}img{vertical-align:middle}.img-responsive{display:block;height:auto;max-width:100%}.img-rounded{border-radius:0}.img-thumbnail{display:inline-block;height:auto;max-width:100%;padding:4px;line-height:1.428571429;background-color:#fff;border:1px solid #ddd;border-radius:0;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:21px;margin-bottom:21px;border:0;border-top:1px solid #ddd}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:300;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:normal;line-height:1;color:#999}h1,h2,h3{margin-top:21px;margin-bottom:10.5px}h1 small,h2 small,h3 small,h1 .small,h2 .small,h3 .small{font-size:65%}h4,h5,h6{margin-top:10.5px;margin-bottom:10.5px}h4 small,h5 small,h6 small,h4 .small,h5 .small,h6 .small{font-size:75%}h1,.h1{font-size:39px}h2,.h2{font-size:32px}h3,.h3{font-size:26px}h4,.h4{font-size:19px}h5,.h5{font-size:15px}h6,.h6{font-size:13px}p{margin:0 0 10.5px}.lead{margin-bottom:21px;font-size:17px;font-weight:200;line-height:1.4}@media(min-width:768px){.lead{font-size:22.5px}}small,.small{font-size:85%}cite{font-style:normal}.text-muted{color:#999}.text-primary{color:#008cba}.text-primary:hover{color:#006687}.text-warning{color:#e99002}.text-warning:hover{color:#b67102}.text-danger{color:#f04124}.text-danger:hover{color:#d32a0e}.text-success{color:#43ac6a}.text-success:hover{color:#358753}.text-info{color:#5bc0de}.text-info:hover{color:#31b0d5}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.page-header{padding-bottom:9.5px;margin:42px 0 21px;border-bottom:1px solid #ddd}ul,ol{margin-top:0;margin-bottom:10.5px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}.list-inline>li:first-child{padding-left:0}dl{margin-top:0;margin-bottom:21px}dt,dd{line-height:1.428571429}dt{font-weight:bold}dd{margin-left:0}@media(min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}.dl-horizontal dd:before,.dl-horizontal dd:after{display:table;content:" "}.dl-horizontal dd:after{clear:both}.dl-horizontal dd:before,.dl-horizontal dd:after{display:table;content:" "}.dl-horizontal dd:after{clear:both}.dl-horizontal dd:before,.dl-horizontal dd:after{display:table;content:" "}.dl-horizontal dd:after{clear:both}.dl-horizontal dd:before,.dl-horizontal dd:after{display:table;content:" "}.dl-horizontal dd:after{clear:both}.dl-horizontal dd:before,.dl-horizontal dd:after{display:table;content:" "}.dl-horizontal dd:after{clear:both}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10.5px 21px;margin:0 0 21px;border-left:5px solid #ddd}blockquote p{font-size:18.75px;font-weight:300;line-height:1.25}blockquote p:last-child{margin-bottom:0}blockquote small,blockquote .small{display:block;line-height:1.428571429;color:#6f6f6f}blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #ddd;border-left:0}blockquote.pull-right p,blockquote.pull-right small,blockquote.pull-right .small{text-align:right}blockquote.pull-right small:before,blockquote.pull-right .small:before{content:''}blockquote.pull-right small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}blockquote:before,blockquote:after{content:""}address{margin-bottom:21px;font-style:normal;line-height:1.428571429}code,kbd,pre,samp{font-family:Hack,Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;white-space:nowrap;background-color:#f9f2f4;border-radius:0}pre{display:block;padding:10px;margin:0 0 10.5px;font-size:14px;line-height:1.428571429;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:0}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.container:before,.container:after{display:table;content:" "}.container:after{clear:both}.container:before,.container:after{display:table;content:" "}.container:after{clear:both}.container:before,.container:after{display:table;content:" "}.container:after{clear:both}.container:before,.container:after{display:table;content:" "}.container:after{clear:both}.container:before,.container:after{display:table;content:" "}.container:after{clear:both}@media(min-width:768px){.container{width:750px}}@media(min-width:992px){.container{width:970px}}@media(min-width:1200px){.container{width:1170px}}.row{margin-right:-15px;margin-left:-15px}.row:before,.row:after{display:table;content:" "}.row:after{clear:both}.row:before,.row:after{display:table;content:" "}.row:after{clear:both}.row:before,.row:after{display:table;content:" "}.row:after{clear:both}.row:before,.row:after{display:table;content:" "}.row:after{clear:both}.row:before,.row:after{display:table;content:" "}.row:after{clear:both}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666666666666%}.col-xs-10{width:83.33333333333334%}.col-xs-9{width:75%}.col-xs-8{width:66.66666666666666%}.col-xs-7{width:58.333333333333336%}.col-xs-6{width:50%}.col-xs-5{width:41.66666666666667%}.col-xs-4{width:33.33333333333333%}.col-xs-3{width:25%}.col-xs-2{width:16.666666666666664%}.col-xs-1{width:8.333333333333332%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666666666666%}.col-xs-pull-10{right:83.33333333333334%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666666666666%}.col-xs-pull-7{right:58.333333333333336%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666666666667%}.col-xs-pull-4{right:33.33333333333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.666666666666664%}.col-xs-pull-1{right:8.333333333333332%}.col-xs-pull-0{right:0}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666666666666%}.col-xs-push-10{left:83.33333333333334%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666666666666%}.col-xs-push-7{left:58.333333333333336%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666666666667%}.col-xs-push-4{left:33.33333333333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.666666666666664%}.col-xs-push-1{left:8.333333333333332%}.col-xs-push-0{left:0}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666666666666%}.col-xs-offset-10{margin-left:83.33333333333334%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666666666666%}.col-xs-offset-7{margin-left:58.333333333333336%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666666666667%}.col-xs-offset-4{margin-left:33.33333333333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.666666666666664%}.col-xs-offset-1{margin-left:8.333333333333332%}.col-xs-offset-0{margin-left:0}@media(min-width:768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666666666666%}.col-sm-10{width:83.33333333333334%}.col-sm-9{width:75%}.col-sm-8{width:66.66666666666666%}.col-sm-7{width:58.333333333333336%}.col-sm-6{width:50%}.col-sm-5{width:41.66666666666667%}.col-sm-4{width:33.33333333333333%}.col-sm-3{width:25%}.col-sm-2{width:16.666666666666664%}.col-sm-1{width:8.333333333333332%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666666666666%}.col-sm-pull-10{right:83.33333333333334%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666666666666%}.col-sm-pull-7{right:58.333333333333336%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666666666667%}.col-sm-pull-4{right:33.33333333333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.666666666666664%}.col-sm-pull-1{right:8.333333333333332%}.col-sm-pull-0{right:0}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666666666666%}.col-sm-push-10{left:83.33333333333334%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666666666666%}.col-sm-push-7{left:58.333333333333336%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666666666667%}.col-sm-push-4{left:33.33333333333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.666666666666664%}.col-sm-push-1{left:8.333333333333332%}.col-sm-push-0{left:0}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666666666666%}.col-sm-offset-10{margin-left:83.33333333333334%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666666666666%}.col-sm-offset-7{margin-left:58.333333333333336%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666666666667%}.col-sm-offset-4{margin-left:33.33333333333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.666666666666664%}.col-sm-offset-1{margin-left:8.333333333333332%}.col-sm-offset-0{margin-left:0}}@media(min-width:992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666666666666%}.col-md-10{width:83.33333333333334%}.col-md-9{width:75%}.col-md-8{width:66.66666666666666%}.col-md-7{width:58.333333333333336%}.col-md-6{width:50%}.col-md-5{width:41.66666666666667%}.col-md-4{width:33.33333333333333%}.col-md-3{width:25%}.col-md-2{width:16.666666666666664%}.col-md-1{width:8.333333333333332%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666666666666%}.col-md-pull-10{right:83.33333333333334%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666666666666%}.col-md-pull-7{right:58.333333333333336%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666666666667%}.col-md-pull-4{right:33.33333333333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.666666666666664%}.col-md-pull-1{right:8.333333333333332%}.col-md-pull-0{right:0}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666666666666%}.col-md-push-10{left:83.33333333333334%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666666666666%}.col-md-push-7{left:58.333333333333336%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666666666667%}.col-md-push-4{left:33.33333333333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.666666666666664%}.col-md-push-1{left:8.333333333333332%}.col-md-push-0{left:0}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666666666666%}.col-md-offset-10{margin-left:83.33333333333334%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666666666666%}.col-md-offset-7{margin-left:58.333333333333336%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666666666667%}.col-md-offset-4{margin-left:33.33333333333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.666666666666664%}.col-md-offset-1{margin-left:8.333333333333332%}.col-md-offset-0{margin-left:0}}@media(min-width:1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666666666666%}.col-lg-10{width:83.33333333333334%}.col-lg-9{width:75%}.col-lg-8{width:66.66666666666666%}.col-lg-7{width:58.333333333333336%}.col-lg-6{width:50%}.col-lg-5{width:41.66666666666667%}.col-lg-4{width:33.33333333333333%}.col-lg-3{width:25%}.col-lg-2{width:16.666666666666664%}.col-lg-1{width:8.333333333333332%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666666666666%}.col-lg-pull-10{right:83.33333333333334%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666666666666%}.col-lg-pull-7{right:58.333333333333336%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666666666667%}.col-lg-pull-4{right:33.33333333333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.666666666666664%}.col-lg-pull-1{right:8.333333333333332%}.col-lg-pull-0{right:0}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666666666666%}.col-lg-push-10{left:83.33333333333334%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666666666666%}.col-lg-push-7{left:58.333333333333336%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666666666667%}.col-lg-push-4{left:33.33333333333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.666666666666664%}.col-lg-push-1{left:8.333333333333332%}.col-lg-push-0{left:0}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666666666666%}.col-lg-offset-10{margin-left:83.33333333333334%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666666666666%}.col-lg-offset-7{margin-left:58.333333333333336%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666666666667%}.col-lg-offset-4{margin-left:33.33333333333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.666666666666664%}.col-lg-offset-1{margin-left:8.333333333333332%}.col-lg-offset-0{margin-left:0}}table{max-width:100%;background-color:transparent}th{text-align:left}.table{width:100%;margin-bottom:21px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.428571429;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#f5f5f5}table col[class*="col-"]{position:static;display:table-column;float:none}table td[class*="col-"],table th[class*="col-"]{display:table-cell;float:none}.table>thead>tr>.active,.table>tbody>tr>.active,.table>tfoot>tr>.active,.table>thead>.active>td,.table>tbody>.active>td,.table>tfoot>.active>td,.table>thead>.active>th,.table>tbody>.active>th,.table>tfoot>.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>.active:hover,.table-hover>tbody>.active:hover>td,.table-hover>tbody>.active:hover>th{background-color:#e8e8e8}.table>thead>tr>.success,.table>tbody>tr>.success,.table>tfoot>tr>.success,.table>thead>.success>td,.table>tbody>.success>td,.table>tfoot>.success>td,.table>thead>.success>th,.table>tbody>.success>th,.table>tfoot>.success>th{background-color:#dff0d8}.table-hover>tbody>tr>.success:hover,.table-hover>tbody>.success:hover>td,.table-hover>tbody>.success:hover>th{background-color:#d0e9c6}.table>thead>tr>.danger,.table>tbody>tr>.danger,.table>tfoot>tr>.danger,.table>thead>.danger>td,.table>tbody>.danger>td,.table>tfoot>.danger>td,.table>thead>.danger>th,.table>tbody>.danger>th,.table>tfoot>.danger>th{background-color:#f2dede}.table-hover>tbody>tr>.danger:hover,.table-hover>tbody>.danger:hover>td,.table-hover>tbody>.danger:hover>th{background-color:#ebcccc}.table>thead>tr>.warning,.table>tbody>tr>.warning,.table>tfoot>tr>.warning,.table>thead>.warning>td,.table>tbody>.warning>td,.table>tfoot>.warning>td,.table>thead>.warning>th,.table>tbody>.warning>th,.table>tfoot>.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>.warning:hover,.table-hover>tbody>.warning:hover>td,.table-hover>tbody>.warning:hover>th{background-color:#faf2cc}@media(max-width:767px){.table-responsive{width:100%;margin-bottom:15.75px;overflow-x:scroll;overflow-y:hidden;border:1px solid #ddd;-ms-overflow-style:-ms-autohiding-scrollbar;-webkit-overflow-scrolling:touch}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:21px;font-size:22.5px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;margin-bottom:5px;font-weight:bold}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type="file"]{display:block}select[multiple],select[size]{height:auto}select optgroup{font-family:inherit;font-size:inherit;font-style:inherit}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}input[type="number"]::-webkit-outer-spin-button,input[type="number"]::-webkit-inner-spin-button{height:auto}output{display:block;padding-top:7px;font-size:15px;line-height:1.428571429;color:#6f6f6f;vertical-align:middle}.form-control{display:block;width:100%;height:35px;padding:6px 12px;font-size:15px;line-height:1.428571429;color:#6f6f6f;vertical-align:middle;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6)}.form-control:-moz-placeholder{color:#999}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee}textarea.form-control{height:auto}.form-group{margin-bottom:15px}.radio,.checkbox{display:block;min-height:21px;padding-left:20px;margin-top:10px;margin-bottom:10px;vertical-align:middle}.radio label,.checkbox label{display:inline;margin-bottom:0;font-weight:normal;cursor:pointer}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{float:left;margin-left:-20px}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;font-weight:normal;vertical-align:middle;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type="radio"][disabled],input[type="checkbox"][disabled],.radio[disabled],.radio-inline[disabled],.checkbox[disabled],.checkbox-inline[disabled],fieldset[disabled] input[type="radio"],fieldset[disabled] input[type="checkbox"],fieldset[disabled] .radio,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:0}select.input-sm{height:30px;line-height:30px}textarea.input-sm{height:auto}.input-lg{height:48px;padding:10px 16px;font-size:19px;line-height:1.33;border-radius:0}select.input-lg{height:48px;line-height:48px}textarea.input-lg{height:auto}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline{color:#e99002}.has-warning .form-control{border-color:#e99002;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-warning .form-control:focus{border-color:#b67102;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #febc53;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #febc53}.has-warning .input-group-addon{color:#e99002;background-color:#fcf8e3;border-color:#e99002}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline{color:#f04124}.has-error .form-control{border-color:#f04124;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-error .form-control:focus{border-color:#d32a0e;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #f79483;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #f79483}.has-error .input-group-addon{color:#f04124;background-color:#f2dede;border-color:#f04124}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline{color:#43ac6a}.has-success .form-control{border-color:#43ac6a;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-success .form-control:focus{border-color:#358753;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #85d0a1;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #85d0a1}.has-success .input-group-addon{color:#43ac6a;background-color:#dff0d8;border-color:#43ac6a}.form-control-static{margin-bottom:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#626262}@media(min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block}.form-inline select.form-control{width:auto}.form-inline .radio,.form-inline .checkbox{display:inline-block;padding-left:0;margin-top:0;margin-bottom:0}.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:none;margin-left:0}}.form-horizontal .control-label,.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .radio,.form-horizontal .checkbox{min-height:28px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}.form-horizontal .form-group:before,.form-horizontal .form-group:after{display:table;content:" "}.form-horizontal .form-group:after{clear:both}.form-horizontal .form-group:before,.form-horizontal .form-group:after{display:table;content:" "}.form-horizontal .form-group:after{clear:both}.form-horizontal .form-group:before,.form-horizontal .form-group:after{display:table;content:" "}.form-horizontal .form-group:after{clear:both}.form-horizontal .form-group:before,.form-horizontal .form-group:after{display:table;content:" "}.form-horizontal .form-group:after{clear:both}.form-horizontal .form-group:before,.form-horizontal .form-group:after{display:table;content:" "}.form-horizontal .form-group:after{clear:both}.form-horizontal .form-control-static{padding-top:7px}@media(min-width:768px){.form-horizontal .control-label{text-align:right}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:15px;font-weight:normal;line-height:1.428571429;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;background-image:none;border:1px solid transparent;border-radius:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.btn:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus{color:#333;text-decoration:none}.btn:active,.btn.active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{pointer-events:none;cursor:not-allowed;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}.btn-default{color:#333;background-color:#e7e7e7;border-color:#dadada}.btn-default:hover,.btn-default:focus,.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{color:#333;background-color:#d3d3d3;border-color:#bbb}.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#e7e7e7;border-color:#dadada}.btn-default .badge{color:#e7e7e7;background-color:#fff}.btn-primary{color:#fff;background-color:#008cba;border-color:#0079a1}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{color:#fff;background-color:#006d91;border-color:#004b63}.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#008cba;border-color:#0079a1}.btn-primary .badge{color:#008cba;background-color:#fff}.btn-warning{color:#fff;background-color:#e99002;border-color:#d08002}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{color:#fff;background-color:#c17702;border-color:#935b01}.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#e99002;border-color:#d08002}.btn-warning .badge{color:#e99002;background-color:#fff}.btn-danger{color:#fff;background-color:#f04124;border-color:#ea2f10}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{color:#fff;background-color:#dc2c0f;border-color:#b1240c}.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#f04124;border-color:#ea2f10}.btn-danger .badge{color:#f04124;background-color:#fff}.btn-success{color:#fff;background-color:#43ac6a;border-color:#3c9a5f}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{color:#fff;background-color:#388f58;border-color:#2b6e44}.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#43ac6a;border-color:#3c9a5f}.btn-success .badge{color:#43ac6a;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{color:#fff;background-color:#39b3d7;border-color:#269abc}.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-link{font-weight:normal;color:#008cba;cursor:pointer;border-radius:0}.btn-link,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#00526e;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#999;text-decoration:none}.btn-lg{padding:10px 16px;font-size:19px;line-height:1.33;border-radius:0}.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:0}.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:0}.btn-block{display:block;width:100%;padding-right:0;padding-left:0}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;transition:height .35s ease}@font-face{font-family:'Glyphicons Halflings';src:url('../fonts/glyphicons-halflings-regular.eot');src:url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/glyphicons-halflings-regular.woff') format('woff'),url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';-webkit-font-smoothing:antialiased;font-style:normal;font-weight:normal;line-height:1;-moz-osx-font-smoothing:grayscale}.glyphicon:empty{width:1em}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:15px;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);border-radius:0;-webkit-box-shadow:0 6px 12px rgba(0,0,0,0.175);box-shadow:0 6px 12px rgba(0,0,0,0.175);background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9.5px 0;overflow:hidden;background-color:rgba(0,0,0,0.2)}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:1.428571429;color:#555;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{color:#262626;text-decoration:none;background-color:#eee}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;background-color:#008cba;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#999}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.428571429;color:#999}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media(min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group>.btn:focus,.btn-group-vertical>.btn:focus{outline:0}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar:before,.btn-toolbar:after{display:table;content:" "}.btn-toolbar:after{clear:both}.btn-toolbar:before,.btn-toolbar:after{display:table;content:" "}.btn-toolbar:after{clear:both}.btn-toolbar:before,.btn-toolbar:after{display:table;content:" "}.btn-toolbar:after{clear:both}.btn-toolbar:before,.btn-toolbar:after{display:table;content:" "}.btn-toolbar:after{clear:both}.btn-toolbar:before,.btn-toolbar:after{display:table;content:" "}.btn-toolbar:after{clear:both}.btn-toolbar .btn-group{float:left}.btn-toolbar>.btn+.btn,.btn-toolbar>.btn-group+.btn,.btn-toolbar>.btn+.btn-group,.btn-toolbar>.btn-group+.btn-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:0}.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:0}.btn-group-lg>.btn{padding:10px 16px;font-size:19px;line-height:1.33;border-radius:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after{display:table;content:" "}.btn-group-vertical>.btn-group:after{clear:both}.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after{display:table;content:" "}.btn-group-vertical>.btn-group:after{clear:both}.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after{display:table;content:" "}.btn-group-vertical>.btn-group:after{clear:both}.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after{display:table;content:" "}.btn-group-vertical>.btn-group:after{clear:both}.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after{display:table;content:" "}.btn-group-vertical>.btn-group:after{clear:both}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child>.btn:last-child,.btn-group-vertical>.btn-group:first-child>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;border-collapse:separate;table-layout:fixed}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}[data-toggle="buttons"]>.btn>input[type="radio"],[data-toggle="buttons"]>.btn>input[type="checkbox"]{display:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*="col-"]{float:none;padding-right:0;padding-left:0}.input-group .form-control{width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:48px;padding:10px 16px;font-size:19px;line-height:1.33;border-radius:0}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:48px;line-height:48px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:0}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:15px;font-weight:normal;line-height:1;color:#6f6f6f;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:0}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:0}.input-group-addon.input-lg{padding:10px 16px;font-size:19px;border-radius:0}.input-group-addon input[type="radio"],.input-group-addon input[type="checkbox"]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;white-space:nowrap}.input-group-btn:first-child>.btn{margin-right:-1px}.input-group-btn:last-child>.btn{margin-left:-1px}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-4px}.input-group-btn>.btn:hover,.input-group-btn>.btn:active{z-index:2}.nav{font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;padding-left:0;margin-bottom:0;list-style:none}.nav:before,.nav:after{display:table;content:" "}.nav:after{clear:both}.nav:before,.nav:after{display:table;content:" "}.nav:after{clear:both}.nav:before,.nav:after{display:table;content:" "}.nav:after{clear:both}.nav:before,.nav:after{display:table;content:" "}.nav:after{clear:both}.nav:before,.nav:after{display:table;content:" "}.nav:after{clear:both}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#999}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#999;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#008cba}.nav .nav-divider{height:1px;margin:9.5px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.428571429;border:1px solid transparent;border-radius:0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#6f6f6f;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media(min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ddd}@media(min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:0}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#008cba}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media(min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ddd}@media(min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:45px;margin-bottom:21px;border:1px solid transparent}.navbar:before,.navbar:after{display:table;content:" "}.navbar:after{clear:both}.navbar:before,.navbar:after{display:table;content:" "}.navbar:after{clear:both}.navbar:before,.navbar:after{display:table;content:" "}.navbar:after{clear:both}.navbar:before,.navbar:after{display:table;content:" "}.navbar:after{clear:both}.navbar:before,.navbar:after{display:table;content:" "}.navbar:after{clear:both}@media(min-width:768px){.navbar{border-radius:0}}.navbar-header:before,.navbar-header:after{display:table;content:" "}.navbar-header:after{clear:both}.navbar-header:before,.navbar-header:after{display:table;content:" "}.navbar-header:after{clear:both}.navbar-header:before,.navbar-header:after{display:table;content:" "}.navbar-header:after{clear:both}.navbar-header:before,.navbar-header:after{display:table;content:" "}.navbar-header:after{clear:both}.navbar-header:before,.navbar-header:after{display:table;content:" "}.navbar-header:after{clear:both}@media(min-width:768px){.navbar-header{float:left}}.navbar-collapse{max-height:340px;padding-right:15px;padding-left:15px;overflow-x:visible;border-top:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);-webkit-overflow-scrolling:touch}.navbar-collapse:before,.navbar-collapse:after{display:table;content:" "}.navbar-collapse:after{clear:both}.navbar-collapse:before,.navbar-collapse:after{display:table;content:" "}.navbar-collapse:after{clear:both}.navbar-collapse:before,.navbar-collapse:after{display:table;content:" "}.navbar-collapse:after{clear:both}.navbar-collapse:before,.navbar-collapse:after{display:table;content:" "}.navbar-collapse:after{clear:both}.navbar-collapse:before,.navbar-collapse:after{display:table;content:" "}.navbar-collapse:after{clear:both}.navbar-collapse.in{overflow-y:auto}@media(min-width:768px){.navbar-collapse{width:auto;border-top:0;box-shadow:none}.navbar-collapse.collapse{display:block !important;height:auto !important;padding-bottom:0;overflow:visible !important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-right:0;padding-left:0}}.container>.navbar-header,.container>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media(min-width:768px){.container>.navbar-header,.container>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media(min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030}@media(min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;float:left;padding:12px 15px;font-size:19px;line-height:21px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}@media(min-width:768px){.navbar>.container .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:5.5px;margin-right:15px;margin-bottom:5.5px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media(min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:6px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:21px}@media(max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:21px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media(min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:12px;padding-bottom:12px}.navbar-nav.navbar-right:last-child{margin-right:-15px}}@media(min-width:768px){.navbar-left{float:left !important}.navbar-right{float:right !important}}.navbar-form{padding:10px 15px;margin-top:5px;margin-right:-15px;margin-bottom:5px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}@media(min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block}.navbar-form select.form-control{width:auto}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;padding-left:0;margin-top:0;margin-bottom:0}.navbar-form .radio input[type="radio"],.navbar-form .checkbox input[type="checkbox"]{float:none;margin-left:0}}@media(max-width:767px){.navbar-form .form-group{margin-bottom:5px}}@media(min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-form.navbar-right:last-child{margin-right:-15px}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-nav.pull-right>li>.dropdown-menu,.navbar-nav>li>.dropdown-menu.pull-right{right:0;left:auto}.navbar-btn{margin-top:5px;margin-bottom:5px}.navbar-btn.btn-sm{margin-top:7.5px;margin-bottom:7.5px}.navbar-btn.btn-xs{margin-top:11.5px;margin-bottom:11.5px}.navbar-text{margin-top:12px;margin-bottom:12px}@media(min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}.navbar-text.navbar-right:last-child{margin-right:0}}.navbar-default{background-color:#333;border-color:#222}.navbar-default .navbar-brand{color:#fff}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-default .navbar-text{color:#fff}.navbar-default .navbar-nav>li>a{color:#fff}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#fff;background-color:#272727}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#fff;background-color:#272727}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:transparent}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:transparent}.navbar-default .navbar-toggle .icon-bar{background-color:#fff}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#222}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#fff;background-color:#272727}@media(max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#fff}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:#272727}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#272727}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#fff}.navbar-default .navbar-link:hover{color:#fff}.navbar-inverse{background-color:#008cba;border-color:#006687}.navbar-inverse .navbar-brand{color:#fff}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#fff}.navbar-inverse .navbar-nav>li>a{color:#fff}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:#006687}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#006687}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:transparent}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:transparent}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#007196}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{color:#fff;background-color:#006687}@media(max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#006687}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#006687}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#fff}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:#006687}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#006687}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#fff}.navbar-inverse .navbar-link:hover{color:#fff}.breadcrumb{padding:8px 15px;margin-bottom:21px;list-style:none;background-color:#f5f5f5;border-radius:0}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#999;content:"/\00a0"}.breadcrumb>.active{color:#333}.pagination{display:inline-block;padding-left:0;margin:21px 0;border-radius:0}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.428571429;text-decoration:none;background-color:transparent;border:1px solid transparent}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:0;border-top-left-radius:0}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:0;border-bottom-right-radius:0}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{background-color:#eee}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#fff;cursor:default;background-color:#008cba;border-color:#008cba}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#999;cursor:not-allowed;background-color:transparent;border-color:transparent}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:19px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:0;border-top-left-radius:0}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:0;border-bottom-right-radius:0}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:0;border-top-left-radius:0}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:0;border-bottom-right-radius:0}.pager{padding-left:0;margin:21px 0;text-align:center;list-style:none}.pager:before,.pager:after{display:table;content:" "}.pager:after{clear:both}.pager:before,.pager:after{display:table;content:" "}.pager:after{clear:both}.pager:before,.pager:after{display:table;content:" "}.pager:after{clear:both}.pager:before,.pager:after{display:table;content:" "}.pager:after{clear:both}.pager:before,.pager:after{display:table;content:" "}.pager:after{clear:both}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:transparent;border:1px solid transparent;border-radius:3px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#999;cursor:not-allowed;background-color:transparent}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:bold;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}.label[href]:hover,.label[href]:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#999}.label-default[href]:hover,.label-default[href]:focus{background-color:gray}.label-primary{background-color:#008cba}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#006687}.label-success{background-color:#43ac6a}.label-success[href]:hover,.label-success[href]:focus{background-color:#358753}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#e99002}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#b67102}.label-danger{background-color:#f04124}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#d32a0e}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:bold;line-height:1;color:#777;text-align:center;white-space:nowrap;vertical-align:baseline;background-color:#e7e7e7;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}a.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#008cba;background-color:#fff}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px;margin-bottom:30px;font-size:23px;font-weight:200;line-height:2.1428571435;color:inherit;background-color:#fafafa}.jumbotron h1,.jumbotron .h1{line-height:1;color:inherit}.jumbotron p{line-height:1.4}.container .jumbotron{border-radius:0}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron{padding-right:60px;padding-left:60px}.jumbotron h1,.jumbotron .h1{font-size:67.5px}}.thumbnail{display:block;padding:4px;margin-bottom:21px;line-height:1.428571429;background-color:#fff;border:1px solid #ddd;border-radius:0;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.thumbnail>img,.thumbnail a>img{display:block;height:auto;max-width:100%;margin-right:auto;margin-left:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#008cba}.thumbnail .caption{padding:9px;color:#222}.alert{padding:15px;margin-bottom:21px;border:1px solid transparent;border-radius:0}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:bold}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable{padding-right:35px}.alert-dismissable .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#fff;background-color:#43ac6a;border-color:#3c9a5f}.alert-success hr{border-top-color:#358753}.alert-success .alert-link{color:#e6e6e6}.alert-info{color:#fff;background-color:#5bc0de;border-color:#3db5d8}.alert-info hr{border-top-color:#2aabd2}.alert-info .alert-link{color:#e6e6e6}.alert-warning{color:#fff;background-color:#e99002;border-color:#d08002}.alert-warning hr{border-top-color:#b67102}.alert-warning .alert-link{color:#e6e6e6}.alert-danger{color:#fff;background-color:#f04124;border-color:#ea2f10}.alert-danger hr{border-top-color:#d32a0e}.alert-danger .alert-link{color:#e6e6e6}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:21px;margin-bottom:21px;overflow:hidden;background-color:#f5f5f5;border-radius:0;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:21px;color:#fff;text-align:center;background-color:#008cba;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-transition:width .6s ease;transition:width .6s ease}.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-size:40px 40px}.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#43ac6a}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#e99002}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#f04124}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.media,.media-body{overflow:hidden;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media>.pull-left{margin-right:10px}.media>.pull-right{margin-left:10px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,a.list-group-item:focus{text-decoration:none;background-color:#f5f5f5}a.list-group-item.active,a.list-group-item.active:hover,a.list-group-item.active:focus{z-index:2;color:#fff;background-color:#008cba;border-color:#008cba}a.list-group-item.active .list-group-item-heading,a.list-group-item.active:hover .list-group-item-heading,a.list-group-item.active:focus .list-group-item-heading{color:inherit}a.list-group-item.active .list-group-item-text,a.list-group-item.active:hover .list-group-item-text,a.list-group-item.active:focus .list-group-item-text{color:#87e1ff}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:21px;background-color:#fff;border:1px solid transparent;border-radius:0;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}.panel-body{padding:15px}.panel-body:before,.panel-body:after{display:table;content:" "}.panel-body:after{clear:both}.panel-body:before,.panel-body:after{display:table;content:" "}.panel-body:after{clear:both}.panel-body:before,.panel-body:after{display:table;content:" "}.panel-body:after{clear:both}.panel-body:before,.panel-body:after{display:table;content:" "}.panel-body:after{clear:both}.panel-body:before,.panel-body:after{display:table;content:" "}.panel-body:after{clear:both}.panel>.list-group{margin-bottom:0}.panel>.list-group .list-group-item{border-width:1px 0}.panel>.list-group .list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.panel>.list-group .list-group-item:last-child{border-bottom:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive{border-top:1px solid #ddd}.panel>.table>tbody:first-child th,.panel>.table>tbody:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:last-child>th,.panel>.table-responsive>.table-bordered>thead>tr:last-child>th,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th,.panel>.table-bordered>thead>tr:last-child>td,.panel>.table-responsive>.table-bordered>thead>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:-1;border-top-left-radius:-1}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:17px;color:inherit}.panel-title>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:-1;border-bottom-left-radius:-1}.panel-group .panel{margin-bottom:0;overflow:hidden;border-radius:0}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse .panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse .panel-body{border-top-color:#ddd}.panel-default>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#008cba}.panel-primary>.panel-heading{color:#fff;background-color:#008cba;border-color:#008cba}.panel-primary>.panel-heading+.panel-collapse .panel-body{border-top-color:#008cba}.panel-primary>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#008cba}.panel-success{border-color:#3c9a5f}.panel-success>.panel-heading{color:#43ac6a;background-color:#dff0d8;border-color:#3c9a5f}.panel-success>.panel-heading+.panel-collapse .panel-body{border-top-color:#3c9a5f}.panel-success>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#3c9a5f}.panel-warning{border-color:#d08002}.panel-warning>.panel-heading{color:#e99002;background-color:#fcf8e3;border-color:#d08002}.panel-warning>.panel-heading+.panel-collapse .panel-body{border-top-color:#d08002}.panel-warning>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#d08002}.panel-danger{border-color:#ea2f10}.panel-danger>.panel-heading{color:#f04124;background-color:#f2dede;border-color:#ea2f10}.panel-danger>.panel-heading+.panel-collapse .panel-body{border-top-color:#ea2f10}.panel-danger>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ea2f10}.panel-info{border-color:#3db5d8}.panel-info>.panel-heading{color:#5bc0de;background-color:#d9edf7;border-color:#3db5d8}.panel-info>.panel-heading+.panel-collapse .panel-body{border-top-color:#3db5d8}.panel-info>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#3db5d8}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#fafafa;border:1px solid #e8e8e8;border-radius:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-lg{padding:24px;border-radius:0}.well-sm{padding:9px;border-radius:0}.close{float:right;font-size:22.5px;font-weight:bold;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;display:none;overflow:auto;overflow-y:scroll}.modal.fade .modal-dialog{-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);transform:translate(0,-25%);-webkit-transition:-webkit-transform .3s ease-out;-moz-transition:-moz-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);transform:translate(0,0)}.modal-dialog{position:relative;z-index:1050;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.2);border-radius:0;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,0.5);box-shadow:0 3px 9px rgba(0,0,0,0.5);background-clip:padding-box}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1030;background-color:#000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:.5;filter:alpha(opacity=50)}.modal-header{min-height:16.428571429px;padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.428571429}.modal-body{position:relative;padding:20px}.modal-footer{padding:19px 20px 20px;margin-top:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer:before,.modal-footer:after{display:table;content:" "}.modal-footer:after{clear:both}.modal-footer:before,.modal-footer:after{display:table;content:" "}.modal-footer:after{clear:both}.modal-footer:before,.modal-footer:after{display:table;content:" "}.modal-footer:after{clear:both}.modal-footer:before,.modal-footer:after{display:table;content:" "}.modal-footer:after{clear:both}.modal-footer:before,.modal-footer:after{display:table;content:" "}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}@media screen and (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.5);box-shadow:0 5px 15px rgba(0,0,0,0.5)}}.tooltip{position:absolute;z-index:1030;display:block;font-size:12px;line-height:1.4;opacity:0;filter:alpha(opacity=0);visibility:visible}.tooltip.in{opacity:.9;filter:alpha(opacity=90)}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#333;border-radius:0}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-color:#333;border-width:5px 5px 0}.tooltip.top-left .tooltip-arrow{bottom:0;left:5px;border-top-color:#333;border-width:5px 5px 0}.tooltip.top-right .tooltip-arrow{right:5px;bottom:0;border-top-color:#333;border-width:5px 5px 0}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-right-color:#333;border-width:5px 5px 5px 0}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-left-color:#333;border-width:5px 0 5px 5px}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-color:#333;border-width:0 5px 5px}.tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-bottom-color:#333;border-width:0 5px 5px}.tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-bottom-color:#333;border-width:0 5px 5px}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;max-width:276px;padding:1px;text-align:left;white-space:normal;background-color:#333;border:1px solid #333;border:1px solid transparent;border-radius:0;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);background-clip:padding-box}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:15px;font-weight:normal;line-height:18px;background-color:#333;border-bottom:1px solid #262626;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover .arrow,.popover .arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow{border-width:11px}.popover .arrow:after{border-width:10px;content:""}.popover.top .arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);border-bottom-width:0}.popover.top .arrow:after{bottom:1px;margin-left:-10px;border-top-color:#333;border-bottom-width:0;content:" "}.popover.right .arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,0.25);border-left-width:0}.popover.right .arrow:after{bottom:-10px;left:1px;border-right-color:#333;border-left-width:0;content:" "}.popover.bottom .arrow{top:-11px;left:50%;margin-left:-11px;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);border-top-width:0}.popover.bottom .arrow:after{top:1px;margin-left:-10px;border-bottom-color:#333;border-top-width:0;content:" "}.popover.left .arrow{top:50%;right:-11px;margin-top:-11px;border-left-color:#999;border-left-color:rgba(0,0,0,0.25);border-right-width:0}.popover.left .arrow:after{right:1px;bottom:-10px;border-left-color:#333;border-right-width:0;content:" "}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;height:auto;max-width:100%;line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6);opacity:.5;filter:alpha(opacity=50)}.carousel-control.left{background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,0.5) 0),color-stop(rgba(0,0,0,0.0001) 100%));background-image:linear-gradient(to right,rgba(0,0,0,0.5) 0,rgba(0,0,0,0.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000',endColorstr='#00000000',GradientType=1)}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,0.0001) 0),color-stop(rgba(0,0,0,0.5) 100%));background-image:linear-gradient(to right,rgba(0,0,0,0.0001) 0,rgba(0,0,0,0.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000',endColorstr='#80000000',GradientType=1)}.carousel-control:hover,.carousel-control:focus{color:#fff;text-decoration:none;outline:0;opacity:.9;filter:alpha(opacity=90)}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;margin-top:-10px;margin-left:-10px;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicons-chevron-left,.carousel-control .glyphicons-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-15px;margin-left:-15px;font-size:30px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after{display:table;content:" "}.clearfix:after{clear:both}.clearfix:before,.clearfix:after{display:table;content:" "}.clearfix:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right !important}.pull-left{float:left !important}.hide{display:none !important}.show{display:block !important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none !important;visibility:hidden !important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-xs,tr.visible-xs,th.visible-xs,td.visible-xs{display:none !important}@media(max-width:767px){.visible-xs{display:block !important}table.visible-xs{display:table}tr.visible-xs{display:table-row !important}th.visible-xs,td.visible-xs{display:table-cell !important}}@media(min-width:768px) and (max-width:991px){.visible-xs.visible-sm{display:block !important}table.visible-xs.visible-sm{display:table}tr.visible-xs.visible-sm{display:table-row !important}th.visible-xs.visible-sm,td.visible-xs.visible-sm{display:table-cell !important}}@media(min-width:992px) and (max-width:1199px){.visible-xs.visible-md{display:block !important}table.visible-xs.visible-md{display:table}tr.visible-xs.visible-md{display:table-row !important}th.visible-xs.visible-md,td.visible-xs.visible-md{display:table-cell !important}}@media(min-width:1200px){.visible-xs.visible-lg{display:block !important}table.visible-xs.visible-lg{display:table}tr.visible-xs.visible-lg{display:table-row !important}th.visible-xs.visible-lg,td.visible-xs.visible-lg{display:table-cell !important}}.visible-sm,tr.visible-sm,th.visible-sm,td.visible-sm{display:none !important}@media(max-width:767px){.visible-sm.visible-xs{display:block !important}table.visible-sm.visible-xs{display:table}tr.visible-sm.visible-xs{display:table-row !important}th.visible-sm.visible-xs,td.visible-sm.visible-xs{display:table-cell !important}}@media(min-width:768px) and (max-width:991px){.visible-sm{display:block !important}table.visible-sm{display:table}tr.visible-sm{display:table-row !important}th.visible-sm,td.visible-sm{display:table-cell !important}}@media(min-width:992px) and (max-width:1199px){.visible-sm.visible-md{display:block !important}table.visible-sm.visible-md{display:table}tr.visible-sm.visible-md{display:table-row !important}th.visible-sm.visible-md,td.visible-sm.visible-md{display:table-cell !important}}@media(min-width:1200px){.visible-sm.visible-lg{display:block !important}table.visible-sm.visible-lg{display:table}tr.visible-sm.visible-lg{display:table-row !important}th.visible-sm.visible-lg,td.visible-sm.visible-lg{display:table-cell !important}}.visible-md,tr.visible-md,th.visible-md,td.visible-md{display:none !important}@media(max-width:767px){.visible-md.visible-xs{display:block !important}table.visible-md.visible-xs{display:table}tr.visible-md.visible-xs{display:table-row !important}th.visible-md.visible-xs,td.visible-md.visible-xs{display:table-cell !important}}@media(min-width:768px) and (max-width:991px){.visible-md.visible-sm{display:block !important}table.visible-md.visible-sm{display:table}tr.visible-md.visible-sm{display:table-row !important}th.visible-md.visible-sm,td.visible-md.visible-sm{display:table-cell !important}}@media(min-width:992px) and (max-width:1199px){.visible-md{display:block !important}table.visible-md{display:table}tr.visible-md{display:table-row !important}th.visible-md,td.visible-md{display:table-cell !important}}@media(min-width:1200px){.visible-md.visible-lg{display:block !important}table.visible-md.visible-lg{display:table}tr.visible-md.visible-lg{display:table-row !important}th.visible-md.visible-lg,td.visible-md.visible-lg{display:table-cell !important}}.visible-lg,tr.visible-lg,th.visible-lg,td.visible-lg{display:none !important}@media(max-width:767px){.visible-lg.visible-xs{display:block !important}table.visible-lg.visible-xs{display:table}tr.visible-lg.visible-xs{display:table-row !important}th.visible-lg.visible-xs,td.visible-lg.visible-xs{display:table-cell !important}}@media(min-width:768px) and (max-width:991px){.visible-lg.visible-sm{display:block !important}table.visible-lg.visible-sm{display:table}tr.visible-lg.visible-sm{display:table-row !important}th.visible-lg.visible-sm,td.visible-lg.visible-sm{display:table-cell !important}}@media(min-width:992px) and (max-width:1199px){.visible-lg.visible-md{display:block !important}table.visible-lg.visible-md{display:table}tr.visible-lg.visible-md{display:table-row !important}th.visible-lg.visible-md,td.visible-lg.visible-md{display:table-cell !important}}@media(min-width:1200px){.visible-lg{display:block !important}table.visible-lg{display:table}tr.visible-lg{display:table-row !important}th.visible-lg,td.visible-lg{display:table-cell !important}}.hidden-xs{display:block !important}table.hidden-xs{display:table}tr.hidden-xs{display:table-row !important}th.hidden-xs,td.hidden-xs{display:table-cell !important}@media(max-width:767px){.hidden-xs,tr.hidden-xs,th.hidden-xs,td.hidden-xs{display:none !important}}@media(min-width:768px) and (max-width:991px){.hidden-xs.hidden-sm,tr.hidden-xs.hidden-sm,th.hidden-xs.hidden-sm,td.hidden-xs.hidden-sm{display:none !important}}@media(min-width:992px) and (max-width:1199px){.hidden-xs.hidden-md,tr.hidden-xs.hidden-md,th.hidden-xs.hidden-md,td.hidden-xs.hidden-md{display:none !important}}@media(min-width:1200px){.hidden-xs.hidden-lg,tr.hidden-xs.hidden-lg,th.hidden-xs.hidden-lg,td.hidden-xs.hidden-lg{display:none !important}}.hidden-sm{display:block !important}table.hidden-sm{display:table}tr.hidden-sm{display:table-row !important}th.hidden-sm,td.hidden-sm{display:table-cell !important}@media(max-width:767px){.hidden-sm.hidden-xs,tr.hidden-sm.hidden-xs,th.hidden-sm.hidden-xs,td.hidden-sm.hidden-xs{display:none !important}}@media(min-width:768px) and (max-width:991px){.hidden-sm,tr.hidden-sm,th.hidden-sm,td.hidden-sm{display:none !important}}@media(min-width:992px) and (max-width:1199px){.hidden-sm.hidden-md,tr.hidden-sm.hidden-md,th.hidden-sm.hidden-md,td.hidden-sm.hidden-md{display:none !important}}@media(min-width:1200px){.hidden-sm.hidden-lg,tr.hidden-sm.hidden-lg,th.hidden-sm.hidden-lg,td.hidden-sm.hidden-lg{display:none !important}}.hidden-md{display:block !important}table.hidden-md{display:table}tr.hidden-md{display:table-row !important}th.hidden-md,td.hidden-md{display:table-cell !important}@media(max-width:767px){.hidden-md.hidden-xs,tr.hidden-md.hidden-xs,th.hidden-md.hidden-xs,td.hidden-md.hidden-xs{display:none !important}}@media(min-width:768px) and (max-width:991px){.hidden-md.hidden-sm,tr.hidden-md.hidden-sm,th.hidden-md.hidden-sm,td.hidden-md.hidden-sm{display:none !important}}@media(min-width:992px) and (max-width:1199px){.hidden-md,tr.hidden-md,th.hidden-md,td.hidden-md{display:none !important}}@media(min-width:1200px){.hidden-md.hidden-lg,tr.hidden-md.hidden-lg,th.hidden-md.hidden-lg,td.hidden-md.hidden-lg{display:none !important}}.hidden-lg{display:block !important}table.hidden-lg{display:table}tr.hidden-lg{display:table-row !important}th.hidden-lg,td.hidden-lg{display:table-cell !important}@media(max-width:767px){.hidden-lg.hidden-xs,tr.hidden-lg.hidden-xs,th.hidden-lg.hidden-xs,td.hidden-lg.hidden-xs{display:none !important}}@media(min-width:768px) and (max-width:991px){.hidden-lg.hidden-sm,tr.hidden-lg.hidden-sm,th.hidden-lg.hidden-sm,td.hidden-lg.hidden-sm{display:none !important}}@media(min-width:992px) and (max-width:1199px){.hidden-lg.hidden-md,tr.hidden-lg.hidden-md,th.hidden-lg.hidden-md,td.hidden-lg.hidden-md{display:none !important}}@media(min-width:1200px){.hidden-lg,tr.hidden-lg,th.hidden-lg,td.hidden-lg{display:none !important}}.visible-print,tr.visible-print,th.visible-print,td.visible-print{display:none !important}@media print{.visible-print{display:block !important}table.visible-print{display:table}tr.visible-print{display:table-row !important}th.visible-print,td.visible-print{display:table-cell !important}.hidden-print,tr.hidden-print,th.hidden-print,td.hidden-print{display:none !important}}.navbar{font-size:13px;font-weight:300;border:0}.navbar .navbar-toggle:hover .icon-bar{background-color:#b3b3b3}.navbar-collapse{border-top-color:rgba(0,0,0,0.2);-webkit-box-shadow:none;box-shadow:none}.navbar .dropdown-menu{border:0}.navbar .dropdown-menu>li>a,.navbar .dropdown-menu>li>a:focus{font-size:13px;font-weight:300;background-color:transparent}.navbar .dropdown-header{color:rgba(255,255,255,0.5)}.navbar-default .dropdown-menu{background-color:#333}.navbar-default .dropdown-menu>li>a,.navbar-default .dropdown-menu>li>a:focus{color:#fff}.navbar-default .dropdown-menu>li>a:hover,.navbar-default .dropdown-menu>.active>a,.navbar-default .dropdown-menu>.active>a:hover{background-color:#272727}.navbar-inverse .dropdown-menu{background-color:#008cba}.navbar-inverse .dropdown-menu>li>a,.navbar-inverse .dropdown-menu>li>a:focus{color:#fff}.navbar-inverse .dropdown-menu>li>a:hover,.navbar-inverse .dropdown-menu>.active>a,.navbar-inverse .dropdown-menu>.active>a:hover{background-color:#006687}.btn{padding:14px 28px}.btn-lg{padding:16px 32px}.btn-sm{padding:8px 16px}.btn-xs{padding:4px 8px}.btn-group .btn~.dropdown-toggle{padding-right:16px;padding-left:16px}.btn-group .dropdown-menu{border-top-width:0}.btn-group.dropup .dropdown-menu{margin-bottom:0;border-top-width:1px;border-bottom-width:0}.btn-group .dropdown-toggle.btn-default~.dropdown-menu{background-color:#e7e7e7;border-color:#dadada}.btn-group .dropdown-toggle.btn-default~.dropdown-menu>li>a{color:#333}.btn-group .dropdown-toggle.btn-default~.dropdown-menu>li>a:hover{background-color:#d3d3d3}.btn-group .dropdown-toggle.btn-primary~.dropdown-menu{background-color:#008cba;border-color:#0079a1}.btn-group .dropdown-toggle.btn-primary~.dropdown-menu>li>a{color:#fff}.btn-group .dropdown-toggle.btn-primary~.dropdown-menu>li>a:hover{background-color:#006d91}.btn-group .dropdown-toggle.btn-success~.dropdown-menu{background-color:#43ac6a;border-color:#3c9a5f}.btn-group .dropdown-toggle.btn-success~.dropdown-menu>li>a{color:#fff}.btn-group .dropdown-toggle.btn-success~.dropdown-menu>li>a:hover{background-color:#388f58}.btn-group .dropdown-toggle.btn-info~.dropdown-menu{background-color:#5bc0de;border-color:#46b8da}.btn-group .dropdown-toggle.btn-info~.dropdown-menu>li>a{color:#fff}.btn-group .dropdown-toggle.btn-info~.dropdown-menu>li>a:hover{background-color:#39b3d7}.btn-group .dropdown-toggle.btn-warning~.dropdown-menu{background-color:#e99002;border-color:#d08002}.btn-group .dropdown-toggle.btn-warning~.dropdown-menu>li>a{color:#fff}.btn-group .dropdown-toggle.btn-warning~.dropdown-menu>li>a:hover{background-color:#c17702}.btn-group .dropdown-toggle.btn-danger~.dropdown-menu{background-color:#f04124;border-color:#ea2f10}.btn-group .dropdown-toggle.btn-danger~.dropdown-menu>li>a{color:#fff}.btn-group .dropdown-toggle.btn-danger~.dropdown-menu>li>a:hover{background-color:#dc2c0f}.lead{color:#6f6f6f}cite{font-style:italic}blockquote{color:#6f6f6f;border-left-width:1px}blockquote.pull-right{border-right-width:1px}blockquote small{font-size:12px;font-weight:300}table{font-size:12px}input,.form-control{padding:7px;font-size:12px}label,.control-label,.help-block,.checkbox,.radio{font-size:12px;font-weight:normal}.form-group .btn,.input-group-addon,.input-group-btn .btn{padding:8px 14px;font-size:12px}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{border-color:transparent}.nav-tabs>li>a{color:#222;background-color:#e7e7e7}.nav-tabs .caret{border-top-color:#222;border-bottom-color:#222}.nav-pills{font-weight:300}.breadcrumb{font-size:10px;font-weight:300;text-transform:uppercase;border:1px solid #ddd;border-radius:3px}.pagination{font-size:12px;font-weight:300;color:#999}.pagination>li>a,.pagination>li>span{margin-left:4px;color:#999}.pagination>.active>a,.pagination>.active>span{color:#fff}.pagination>li>a,.pagination>li:first-child>a,.pagination>li:last-child>a,.pagination>li>span,.pagination>li:first-child>span,.pagination>li:last-child>span{border-radius:3px}.pagination-lg>li>a{padding-right:22px;padding-left:22px}.pagination-sm>li>a{padding:0 5px}.pager{font-size:12px;font-weight:300;color:#999}.list-group{font-size:12px;font-weight:300}.alert{font-size:12px;font-weight:300}.alert a,.alert .alert-link{font-weight:normal;color:#fff;text-decoration:underline}.label{padding-right:1em;padding-left:1em;font-weight:300;border-radius:0}.label-default{color:#333;background-color:#e7e7e7}.badge{font-weight:300}.progress{height:22px;padding:2px;background-color:#f6f6f6;border:1px solid #ccc;-webkit-box-shadow:none;box-shadow:none}.dropdown-menu{padding:0;margin-top:0;font-size:12px}.dropdown-menu>li>a{padding:12px 15px}.dropdown-header{padding-right:15px;padding-left:15px;font-size:9px;text-transform:uppercase}.popover{font-size:12px;font-weight:300;color:#fff}.panel-heading,.panel-footer{border-top-right-radius:0;border-top-left-radius:0}.clearfix:before,.clearfix:after{display:table;content:" "}.clearfix:after{clear:both}.clearfix:before,.clearfix:after{display:table;content:" "}.clearfix:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right !important}.pull-left{float:left !important}.hide{display:none !important}.show{display:block !important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none !important;visibility:hidden !important}.affix{position:fixed} diff --git a/site/css/cinder.css b/site/css/cinder.css deleted file mode 100644 index eb234ff..0000000 --- a/site/css/cinder.css +++ /dev/null @@ -1,82 +0,0 @@ -/* - Cinder Theme for MkDocs | Copyright 2015 Christopher Simpkins | MIT License -*/ - -body { - font-family:"Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 16px; - line-height: 1.7; - background-color: #FFF; - color: #343838; -} -h1, h2, h3, h4, h5, h6 { - font-family:'PT Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; - color: #222; -} -h1 small, h2 small, h3 small, h4 small, h5 small, h6 small, .h1 small, .h2 small, .h3 small, .h4 small, .h5 small, .h6 small, h1 .small, h2 .small, h3 .small, h4 .small, h5 .small, h6 .small, .h1 .small, .h2 .small, .h3 .small, .h4 .small, .h5 .small, .h6 .small { - color: #B1B7B9; -} -h1, h2 { - font-weight: 700; -} -h4 { - font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; - font-weight: 300; - margin-top: 20px; - font-style: italic; -} -h5 { - font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; - font-weight: 300; - font-variant: small-caps; -} -pre, code { - background-color: #FCFDFF; -} -pre>code { - font-size: 13px; -} -pre { - margin-top: 25px; - margin-bottom: 25px; -} -.lead { - font-family:"Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; - font-weight: 400; - line-height: 1.4; - letter-spacing: 0.0312em; - color: #B1B7B9; -} -.navbar-default { - background-color: #343838; - border-bottom: 8px #EBF2F2 solid; -} -.bs-sidenav { - background-image: url("../img/grid11.png"); - background-repeat: repeat; - font-size: 12px; -} -.well { - background-color: #FCFDFF; -} -.btn-default { - background-color:#FCFDFF; -} -.table-striped > tbody > tr:nth-child(2n+1) > td, .table-striped > tbody > tr:nth-child(2n+1) > th { - background-color: #FCFDFF; -} -#mkdocs-search-query:focus { - outline: none; - -webkit-box-shadow: none; - box-shadow: none; -} -#mkdocs-search-query { - font-family:"Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 20px; - font-weight: 700; - color: #343838; - height: 45px; -} -footer > hr { - width: 35%; -} diff --git a/site/css/font-awesome-4.0.3.css b/site/css/font-awesome-4.0.3.css deleted file mode 100644 index b348de1..0000000 --- a/site/css/font-awesome-4.0.3.css +++ /dev/null @@ -1,1338 +0,0 @@ -/*! - * Font Awesome 4.0.3 by @davegandy - http://fontawesome.io - @fontawesome - * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) - */ -/* FONT PATH - * -------------------------- */ -@font-face { - font-family: 'FontAwesome'; - src: url('../fonts/fontawesome-webfont.eot?v=4.0.3'); - src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.0.3') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff?v=4.0.3') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.0.3') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.0.3#fontawesomeregular') format('svg'); - font-weight: normal; - font-style: normal; -} -.fa { - display: inline-block; - font-family: FontAwesome; - font-style: normal; - font-weight: normal; - line-height: 1; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -/* makes the font 33% larger relative to the icon container */ -.fa-lg { - font-size: 1.3333333333333333em; - line-height: 0.75em; - vertical-align: -15%; -} -.fa-2x { - font-size: 2em; -} -.fa-3x { - font-size: 3em; -} -.fa-4x { - font-size: 4em; -} -.fa-5x { - font-size: 5em; -} -.fa-fw { - width: 1.2857142857142858em; - text-align: center; -} -.fa-ul { - padding-left: 0; - margin-left: 2.142857142857143em; - list-style-type: none; -} -.fa-ul > li { - position: relative; -} -.fa-li { - position: absolute; - left: -2.142857142857143em; - width: 2.142857142857143em; - top: 0.14285714285714285em; - text-align: center; -} -.fa-li.fa-lg { - left: -1.8571428571428572em; -} -.fa-border { - padding: .2em .25em .15em; - border: solid 0.08em #eeeeee; - border-radius: .1em; -} -.pull-right { - float: right; -} -.pull-left { - float: left; -} -.fa.pull-left { - margin-right: .3em; -} -.fa.pull-right { - margin-left: .3em; -} -.fa-spin { - -webkit-animation: spin 2s infinite linear; - -moz-animation: spin 2s infinite linear; - -o-animation: spin 2s infinite linear; - animation: spin 2s infinite linear; -} -@-moz-keyframes spin { - 0% { - -moz-transform: rotate(0deg); - } - 100% { - -moz-transform: rotate(359deg); - } -} -@-webkit-keyframes spin { - 0% { - -webkit-transform: rotate(0deg); - } - 100% { - -webkit-transform: rotate(359deg); - } -} -@-o-keyframes spin { - 0% { - -o-transform: rotate(0deg); - } - 100% { - -o-transform: rotate(359deg); - } -} -@-ms-keyframes spin { - 0% { - -ms-transform: rotate(0deg); - } - 100% { - -ms-transform: rotate(359deg); - } -} -@keyframes spin { - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(359deg); - } -} -.fa-rotate-90 { - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); - -webkit-transform: rotate(90deg); - -moz-transform: rotate(90deg); - -ms-transform: rotate(90deg); - -o-transform: rotate(90deg); - transform: rotate(90deg); -} -.fa-rotate-180 { - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); - -webkit-transform: rotate(180deg); - -moz-transform: rotate(180deg); - -ms-transform: rotate(180deg); - -o-transform: rotate(180deg); - transform: rotate(180deg); -} -.fa-rotate-270 { - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); - -webkit-transform: rotate(270deg); - -moz-transform: rotate(270deg); - -ms-transform: rotate(270deg); - -o-transform: rotate(270deg); - transform: rotate(270deg); -} -.fa-flip-horizontal { - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1); - -webkit-transform: scale(-1, 1); - -moz-transform: scale(-1, 1); - -ms-transform: scale(-1, 1); - -o-transform: scale(-1, 1); - transform: scale(-1, 1); -} -.fa-flip-vertical { - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1); - -webkit-transform: scale(1, -1); - -moz-transform: scale(1, -1); - -ms-transform: scale(1, -1); - -o-transform: scale(1, -1); - transform: scale(1, -1); -} -.fa-stack { - position: relative; - display: inline-block; - width: 2em; - height: 2em; - line-height: 2em; - vertical-align: middle; -} -.fa-stack-1x, -.fa-stack-2x { - position: absolute; - left: 0; - width: 100%; - text-align: center; -} -.fa-stack-1x { - line-height: inherit; -} -.fa-stack-2x { - font-size: 2em; -} -.fa-inverse { - color: #ffffff; -} -/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen - readers do not read off random characters that represent icons */ -.fa-glass:before { - content: "\f000"; -} -.fa-music:before { - content: "\f001"; -} -.fa-search:before { - content: "\f002"; -} -.fa-envelope-o:before { - content: "\f003"; -} -.fa-heart:before { - content: "\f004"; -} -.fa-star:before { - content: "\f005"; -} -.fa-star-o:before { - content: "\f006"; -} -.fa-user:before { - content: "\f007"; -} -.fa-film:before { - content: "\f008"; -} -.fa-th-large:before { - content: "\f009"; -} -.fa-th:before { - content: "\f00a"; -} -.fa-th-list:before { - content: "\f00b"; -} -.fa-check:before { - content: "\f00c"; -} -.fa-times:before { - content: "\f00d"; -} -.fa-search-plus:before { - content: "\f00e"; -} -.fa-search-minus:before { - content: "\f010"; -} -.fa-power-off:before { - content: "\f011"; -} -.fa-signal:before { - content: "\f012"; -} -.fa-gear:before, -.fa-cog:before { - content: "\f013"; -} -.fa-trash-o:before { - content: "\f014"; -} -.fa-home:before { - content: "\f015"; -} -.fa-file-o:before { - content: "\f016"; -} -.fa-clock-o:before { - content: "\f017"; -} -.fa-road:before { - content: "\f018"; -} -.fa-download:before { - content: "\f019"; -} -.fa-arrow-circle-o-down:before { - content: "\f01a"; -} -.fa-arrow-circle-o-up:before { - content: "\f01b"; -} -.fa-inbox:before { - content: "\f01c"; -} -.fa-play-circle-o:before { - content: "\f01d"; -} -.fa-rotate-right:before, -.fa-repeat:before { - content: "\f01e"; -} -.fa-refresh:before { - content: "\f021"; -} -.fa-list-alt:before { - content: "\f022"; -} -.fa-lock:before { - content: "\f023"; -} -.fa-flag:before { - content: "\f024"; -} -.fa-headphones:before { - content: "\f025"; -} -.fa-volume-off:before { - content: "\f026"; -} -.fa-volume-down:before { - content: "\f027"; -} -.fa-volume-up:before { - content: "\f028"; -} -.fa-qrcode:before { - content: "\f029"; -} -.fa-barcode:before { - content: "\f02a"; -} -.fa-tag:before { - content: "\f02b"; -} -.fa-tags:before { - content: "\f02c"; -} -.fa-book:before { - content: "\f02d"; -} -.fa-bookmark:before { - content: "\f02e"; -} -.fa-print:before { - content: "\f02f"; -} -.fa-camera:before { - content: "\f030"; -} -.fa-font:before { - content: "\f031"; -} -.fa-bold:before { - content: "\f032"; -} -.fa-italic:before { - content: "\f033"; -} -.fa-text-height:before { - content: "\f034"; -} -.fa-text-width:before { - content: "\f035"; -} -.fa-align-left:before { - content: "\f036"; -} -.fa-align-center:before { - content: "\f037"; -} -.fa-align-right:before { - content: "\f038"; -} -.fa-align-justify:before { - content: "\f039"; -} -.fa-list:before { - content: "\f03a"; -} -.fa-dedent:before, -.fa-outdent:before { - content: "\f03b"; -} -.fa-indent:before { - content: "\f03c"; -} -.fa-video-camera:before { - content: "\f03d"; -} -.fa-picture-o:before { - content: "\f03e"; -} -.fa-pencil:before { - content: "\f040"; -} -.fa-map-marker:before { - content: "\f041"; -} -.fa-adjust:before { - content: "\f042"; -} -.fa-tint:before { - content: "\f043"; -} -.fa-edit:before, -.fa-pencil-square-o:before { - content: "\f044"; -} -.fa-share-square-o:before { - content: "\f045"; -} -.fa-check-square-o:before { - content: "\f046"; -} -.fa-arrows:before { - content: "\f047"; -} -.fa-step-backward:before { - content: "\f048"; -} -.fa-fast-backward:before { - content: "\f049"; -} -.fa-backward:before { - content: "\f04a"; -} -.fa-play:before { - content: "\f04b"; -} -.fa-pause:before { - content: "\f04c"; -} -.fa-stop:before { - content: "\f04d"; -} -.fa-forward:before { - content: "\f04e"; -} -.fa-fast-forward:before { - content: "\f050"; -} -.fa-step-forward:before { - content: "\f051"; -} -.fa-eject:before { - content: "\f052"; -} -.fa-chevron-left:before { - content: "\f053"; -} -.fa-chevron-right:before { - content: "\f054"; -} -.fa-plus-circle:before { - content: "\f055"; -} -.fa-minus-circle:before { - content: "\f056"; -} -.fa-times-circle:before { - content: "\f057"; -} -.fa-check-circle:before { - content: "\f058"; -} -.fa-question-circle:before { - content: "\f059"; -} -.fa-info-circle:before { - content: "\f05a"; -} -.fa-crosshairs:before { - content: "\f05b"; -} -.fa-times-circle-o:before { - content: "\f05c"; -} -.fa-check-circle-o:before { - content: "\f05d"; -} -.fa-ban:before { - content: "\f05e"; -} -.fa-arrow-left:before { - content: "\f060"; -} -.fa-arrow-right:before { - content: "\f061"; -} -.fa-arrow-up:before { - content: "\f062"; -} -.fa-arrow-down:before { - content: "\f063"; -} -.fa-mail-forward:before, -.fa-share:before { - content: "\f064"; -} -.fa-expand:before { - content: "\f065"; -} -.fa-compress:before { - content: "\f066"; -} -.fa-plus:before { - content: "\f067"; -} -.fa-minus:before { - content: "\f068"; -} -.fa-asterisk:before { - content: "\f069"; -} -.fa-exclamation-circle:before { - content: "\f06a"; -} -.fa-gift:before { - content: "\f06b"; -} -.fa-leaf:before { - content: "\f06c"; -} -.fa-fire:before { - content: "\f06d"; -} -.fa-eye:before { - content: "\f06e"; -} -.fa-eye-slash:before { - content: "\f070"; -} -.fa-warning:before, -.fa-exclamation-triangle:before { - content: "\f071"; -} -.fa-plane:before { - content: "\f072"; -} -.fa-calendar:before { - content: "\f073"; -} -.fa-random:before { - content: "\f074"; -} -.fa-comment:before { - content: "\f075"; -} -.fa-magnet:before { - content: "\f076"; -} -.fa-chevron-up:before { - content: "\f077"; -} -.fa-chevron-down:before { - content: "\f078"; -} -.fa-retweet:before { - content: "\f079"; -} -.fa-shopping-cart:before { - content: "\f07a"; -} -.fa-folder:before { - content: "\f07b"; -} -.fa-folder-open:before { - content: "\f07c"; -} -.fa-arrows-v:before { - content: "\f07d"; -} -.fa-arrows-h:before { - content: "\f07e"; -} -.fa-bar-chart-o:before { - content: "\f080"; -} -.fa-twitter-square:before { - content: "\f081"; -} -.fa-facebook-square:before { - content: "\f082"; -} -.fa-camera-retro:before { - content: "\f083"; -} -.fa-key:before { - content: "\f084"; -} -.fa-gears:before, -.fa-cogs:before { - content: "\f085"; -} -.fa-comments:before { - content: "\f086"; -} -.fa-thumbs-o-up:before { - content: "\f087"; -} -.fa-thumbs-o-down:before { - content: "\f088"; -} -.fa-star-half:before { - content: "\f089"; -} -.fa-heart-o:before { - content: "\f08a"; -} -.fa-sign-out:before { - content: "\f08b"; -} -.fa-linkedin-square:before { - content: "\f08c"; -} -.fa-thumb-tack:before { - content: "\f08d"; -} -.fa-external-link:before { - content: "\f08e"; -} -.fa-sign-in:before { - content: "\f090"; -} -.fa-trophy:before { - content: "\f091"; -} -.fa-github-square:before { - content: "\f092"; -} -.fa-upload:before { - content: "\f093"; -} -.fa-lemon-o:before { - content: "\f094"; -} -.fa-phone:before { - content: "\f095"; -} -.fa-square-o:before { - content: "\f096"; -} -.fa-bookmark-o:before { - content: "\f097"; -} -.fa-phone-square:before { - content: "\f098"; -} -.fa-twitter:before { - content: "\f099"; -} -.fa-facebook:before { - content: "\f09a"; -} -.fa-github:before { - content: "\f09b"; -} -.fa-unlock:before { - content: "\f09c"; -} -.fa-credit-card:before { - content: "\f09d"; -} -.fa-rss:before { - content: "\f09e"; -} -.fa-hdd-o:before { - content: "\f0a0"; -} -.fa-bullhorn:before { - content: "\f0a1"; -} -.fa-bell:before { - content: "\f0f3"; -} -.fa-certificate:before { - content: "\f0a3"; -} -.fa-hand-o-right:before { - content: "\f0a4"; -} -.fa-hand-o-left:before { - content: "\f0a5"; -} -.fa-hand-o-up:before { - content: "\f0a6"; -} -.fa-hand-o-down:before { - content: "\f0a7"; -} -.fa-arrow-circle-left:before { - content: "\f0a8"; -} -.fa-arrow-circle-right:before { - content: "\f0a9"; -} -.fa-arrow-circle-up:before { - content: "\f0aa"; -} -.fa-arrow-circle-down:before { - content: "\f0ab"; -} -.fa-globe:before { - content: "\f0ac"; -} -.fa-wrench:before { - content: "\f0ad"; -} -.fa-tasks:before { - content: "\f0ae"; -} -.fa-filter:before { - content: "\f0b0"; -} -.fa-briefcase:before { - content: "\f0b1"; -} -.fa-arrows-alt:before { - content: "\f0b2"; -} -.fa-group:before, -.fa-users:before { - content: "\f0c0"; -} -.fa-chain:before, -.fa-link:before { - content: "\f0c1"; -} -.fa-cloud:before { - content: "\f0c2"; -} -.fa-flask:before { - content: "\f0c3"; -} -.fa-cut:before, -.fa-scissors:before { - content: "\f0c4"; -} -.fa-copy:before, -.fa-files-o:before { - content: "\f0c5"; -} -.fa-paperclip:before { - content: "\f0c6"; -} -.fa-save:before, -.fa-floppy-o:before { - content: "\f0c7"; -} -.fa-square:before { - content: "\f0c8"; -} -.fa-bars:before { - content: "\f0c9"; -} -.fa-list-ul:before { - content: "\f0ca"; -} -.fa-list-ol:before { - content: "\f0cb"; -} -.fa-strikethrough:before { - content: "\f0cc"; -} -.fa-underline:before { - content: "\f0cd"; -} -.fa-table:before { - content: "\f0ce"; -} -.fa-magic:before { - content: "\f0d0"; -} -.fa-truck:before { - content: "\f0d1"; -} -.fa-pinterest:before { - content: "\f0d2"; -} -.fa-pinterest-square:before { - content: "\f0d3"; -} -.fa-google-plus-square:before { - content: "\f0d4"; -} -.fa-google-plus:before { - content: "\f0d5"; -} -.fa-money:before { - content: "\f0d6"; -} -.fa-caret-down:before { - content: "\f0d7"; -} -.fa-caret-up:before { - content: "\f0d8"; -} -.fa-caret-left:before { - content: "\f0d9"; -} -.fa-caret-right:before { - content: "\f0da"; -} -.fa-columns:before { - content: "\f0db"; -} -.fa-unsorted:before, -.fa-sort:before { - content: "\f0dc"; -} -.fa-sort-down:before, -.fa-sort-asc:before { - content: "\f0dd"; -} -.fa-sort-up:before, -.fa-sort-desc:before { - content: "\f0de"; -} -.fa-envelope:before { - content: "\f0e0"; -} -.fa-linkedin:before { - content: "\f0e1"; -} -.fa-rotate-left:before, -.fa-undo:before { - content: "\f0e2"; -} -.fa-legal:before, -.fa-gavel:before { - content: "\f0e3"; -} -.fa-dashboard:before, -.fa-tachometer:before { - content: "\f0e4"; -} -.fa-comment-o:before { - content: "\f0e5"; -} -.fa-comments-o:before { - content: "\f0e6"; -} -.fa-flash:before, -.fa-bolt:before { - content: "\f0e7"; -} -.fa-sitemap:before { - content: "\f0e8"; -} -.fa-umbrella:before { - content: "\f0e9"; -} -.fa-paste:before, -.fa-clipboard:before { - content: "\f0ea"; -} -.fa-lightbulb-o:before { - content: "\f0eb"; -} -.fa-exchange:before { - content: "\f0ec"; -} -.fa-cloud-download:before { - content: "\f0ed"; -} -.fa-cloud-upload:before { - content: "\f0ee"; -} -.fa-user-md:before { - content: "\f0f0"; -} -.fa-stethoscope:before { - content: "\f0f1"; -} -.fa-suitcase:before { - content: "\f0f2"; -} -.fa-bell-o:before { - content: "\f0a2"; -} -.fa-coffee:before { - content: "\f0f4"; -} -.fa-cutlery:before { - content: "\f0f5"; -} -.fa-file-text-o:before { - content: "\f0f6"; -} -.fa-building-o:before { - content: "\f0f7"; -} -.fa-hospital-o:before { - content: "\f0f8"; -} -.fa-ambulance:before { - content: "\f0f9"; -} -.fa-medkit:before { - content: "\f0fa"; -} -.fa-fighter-jet:before { - content: "\f0fb"; -} -.fa-beer:before { - content: "\f0fc"; -} -.fa-h-square:before { - content: "\f0fd"; -} -.fa-plus-square:before { - content: "\f0fe"; -} -.fa-angle-double-left:before { - content: "\f100"; -} -.fa-angle-double-right:before { - content: "\f101"; -} -.fa-angle-double-up:before { - content: "\f102"; -} -.fa-angle-double-down:before { - content: "\f103"; -} -.fa-angle-left:before { - content: "\f104"; -} -.fa-angle-right:before { - content: "\f105"; -} -.fa-angle-up:before { - content: "\f106"; -} -.fa-angle-down:before { - content: "\f107"; -} -.fa-desktop:before { - content: "\f108"; -} -.fa-laptop:before { - content: "\f109"; -} -.fa-tablet:before { - content: "\f10a"; -} -.fa-mobile-phone:before, -.fa-mobile:before { - content: "\f10b"; -} -.fa-circle-o:before { - content: "\f10c"; -} -.fa-quote-left:before { - content: "\f10d"; -} -.fa-quote-right:before { - content: "\f10e"; -} -.fa-spinner:before { - content: "\f110"; -} -.fa-circle:before { - content: "\f111"; -} -.fa-mail-reply:before, -.fa-reply:before { - content: "\f112"; -} -.fa-github-alt:before { - content: "\f113"; -} -.fa-folder-o:before { - content: "\f114"; -} -.fa-folder-open-o:before { - content: "\f115"; -} -.fa-smile-o:before { - content: "\f118"; -} -.fa-frown-o:before { - content: "\f119"; -} -.fa-meh-o:before { - content: "\f11a"; -} -.fa-gamepad:before { - content: "\f11b"; -} -.fa-keyboard-o:before { - content: "\f11c"; -} -.fa-flag-o:before { - content: "\f11d"; -} -.fa-flag-checkered:before { - content: "\f11e"; -} -.fa-terminal:before { - content: "\f120"; -} -.fa-code:before { - content: "\f121"; -} -.fa-reply-all:before { - content: "\f122"; -} -.fa-mail-reply-all:before { - content: "\f122"; -} -.fa-star-half-empty:before, -.fa-star-half-full:before, -.fa-star-half-o:before { - content: "\f123"; -} -.fa-location-arrow:before { - content: "\f124"; -} -.fa-crop:before { - content: "\f125"; -} -.fa-code-fork:before { - content: "\f126"; -} -.fa-unlink:before, -.fa-chain-broken:before { - content: "\f127"; -} -.fa-question:before { - content: "\f128"; -} -.fa-info:before { - content: "\f129"; -} -.fa-exclamation:before { - content: "\f12a"; -} -.fa-superscript:before { - content: "\f12b"; -} -.fa-subscript:before { - content: "\f12c"; -} -.fa-eraser:before { - content: "\f12d"; -} -.fa-puzzle-piece:before { - content: "\f12e"; -} -.fa-microphone:before { - content: "\f130"; -} -.fa-microphone-slash:before { - content: "\f131"; -} -.fa-shield:before { - content: "\f132"; -} -.fa-calendar-o:before { - content: "\f133"; -} -.fa-fire-extinguisher:before { - content: "\f134"; -} -.fa-rocket:before { - content: "\f135"; -} -.fa-maxcdn:before { - content: "\f136"; -} -.fa-chevron-circle-left:before { - content: "\f137"; -} -.fa-chevron-circle-right:before { - content: "\f138"; -} -.fa-chevron-circle-up:before { - content: "\f139"; -} -.fa-chevron-circle-down:before { - content: "\f13a"; -} -.fa-html5:before { - content: "\f13b"; -} -.fa-css3:before { - content: "\f13c"; -} -.fa-anchor:before { - content: "\f13d"; -} -.fa-unlock-alt:before { - content: "\f13e"; -} -.fa-bullseye:before { - content: "\f140"; -} -.fa-ellipsis-h:before { - content: "\f141"; -} -.fa-ellipsis-v:before { - content: "\f142"; -} -.fa-rss-square:before { - content: "\f143"; -} -.fa-play-circle:before { - content: "\f144"; -} -.fa-ticket:before { - content: "\f145"; -} -.fa-minus-square:before { - content: "\f146"; -} -.fa-minus-square-o:before { - content: "\f147"; -} -.fa-level-up:before { - content: "\f148"; -} -.fa-level-down:before { - content: "\f149"; -} -.fa-check-square:before { - content: "\f14a"; -} -.fa-pencil-square:before { - content: "\f14b"; -} -.fa-external-link-square:before { - content: "\f14c"; -} -.fa-share-square:before { - content: "\f14d"; -} -.fa-compass:before { - content: "\f14e"; -} -.fa-toggle-down:before, -.fa-caret-square-o-down:before { - content: "\f150"; -} -.fa-toggle-up:before, -.fa-caret-square-o-up:before { - content: "\f151"; -} -.fa-toggle-right:before, -.fa-caret-square-o-right:before { - content: "\f152"; -} -.fa-euro:before, -.fa-eur:before { - content: "\f153"; -} -.fa-gbp:before { - content: "\f154"; -} -.fa-dollar:before, -.fa-usd:before { - content: "\f155"; -} -.fa-rupee:before, -.fa-inr:before { - content: "\f156"; -} -.fa-cny:before, -.fa-rmb:before, -.fa-yen:before, -.fa-jpy:before { - content: "\f157"; -} -.fa-ruble:before, -.fa-rouble:before, -.fa-rub:before { - content: "\f158"; -} -.fa-won:before, -.fa-krw:before { - content: "\f159"; -} -.fa-bitcoin:before, -.fa-btc:before { - content: "\f15a"; -} -.fa-file:before { - content: "\f15b"; -} -.fa-file-text:before { - content: "\f15c"; -} -.fa-sort-alpha-asc:before { - content: "\f15d"; -} -.fa-sort-alpha-desc:before { - content: "\f15e"; -} -.fa-sort-amount-asc:before { - content: "\f160"; -} -.fa-sort-amount-desc:before { - content: "\f161"; -} -.fa-sort-numeric-asc:before { - content: "\f162"; -} -.fa-sort-numeric-desc:before { - content: "\f163"; -} -.fa-thumbs-up:before { - content: "\f164"; -} -.fa-thumbs-down:before { - content: "\f165"; -} -.fa-youtube-square:before { - content: "\f166"; -} -.fa-youtube:before { - content: "\f167"; -} -.fa-xing:before { - content: "\f168"; -} -.fa-xing-square:before { - content: "\f169"; -} -.fa-youtube-play:before { - content: "\f16a"; -} -.fa-dropbox:before { - content: "\f16b"; -} -.fa-stack-overflow:before { - content: "\f16c"; -} -.fa-instagram:before { - content: "\f16d"; -} -.fa-flickr:before { - content: "\f16e"; -} -.fa-adn:before { - content: "\f170"; -} -.fa-bitbucket:before { - content: "\f171"; -} -.fa-bitbucket-square:before { - content: "\f172"; -} -.fa-tumblr:before { - content: "\f173"; -} -.fa-tumblr-square:before { - content: "\f174"; -} -.fa-long-arrow-down:before { - content: "\f175"; -} -.fa-long-arrow-up:before { - content: "\f176"; -} -.fa-long-arrow-left:before { - content: "\f177"; -} -.fa-long-arrow-right:before { - content: "\f178"; -} -.fa-apple:before { - content: "\f179"; -} -.fa-windows:before { - content: "\f17a"; -} -.fa-android:before { - content: "\f17b"; -} -.fa-linux:before { - content: "\f17c"; -} -.fa-dribbble:before { - content: "\f17d"; -} -.fa-skype:before { - content: "\f17e"; -} -.fa-foursquare:before { - content: "\f180"; -} -.fa-trello:before { - content: "\f181"; -} -.fa-female:before { - content: "\f182"; -} -.fa-male:before { - content: "\f183"; -} -.fa-gittip:before { - content: "\f184"; -} -.fa-sun-o:before { - content: "\f185"; -} -.fa-moon-o:before { - content: "\f186"; -} -.fa-archive:before { - content: "\f187"; -} -.fa-bug:before { - content: "\f188"; -} -.fa-vk:before { - content: "\f189"; -} -.fa-weibo:before { - content: "\f18a"; -} -.fa-renren:before { - content: "\f18b"; -} -.fa-pagelines:before { - content: "\f18c"; -} -.fa-stack-exchange:before { - content: "\f18d"; -} -.fa-arrow-circle-o-right:before { - content: "\f18e"; -} -.fa-arrow-circle-o-left:before { - content: "\f190"; -} -.fa-toggle-left:before, -.fa-caret-square-o-left:before { - content: "\f191"; -} -.fa-dot-circle-o:before { - content: "\f192"; -} -.fa-wheelchair:before { - content: "\f193"; -} -.fa-vimeo-square:before { - content: "\f194"; -} -.fa-turkish-lira:before, -.fa-try:before { - content: "\f195"; -} -.fa-plus-square-o:before { - content: "\f196"; -} diff --git a/site/css/highlight.css b/site/css/highlight.css deleted file mode 100644 index a5e2cfa..0000000 --- a/site/css/highlight.css +++ /dev/null @@ -1,125 +0,0 @@ -/* -This is the GitHub theme for highlight.js - -github.com style (c) Vasily Polovnyov - -*/ - -.hljs { - display: block; - overflow-x: auto; - padding: 0.5em; - color: #333; - -webkit-text-size-adjust: none; -} - -.hljs-comment, -.diff .hljs-header, -.hljs-javadoc { - color: #998; - font-style: italic; -} - -.hljs-keyword, -.css .rule .hljs-keyword, -.hljs-winutils, -.nginx .hljs-title, -.hljs-subst, -.hljs-request, -.hljs-status { - color: #333; - font-weight: bold; -} - -.hljs-number, -.hljs-hexcolor, -.ruby .hljs-constant { - color: #008080; -} - -.hljs-string, -.hljs-tag .hljs-value, -.hljs-phpdoc, -.hljs-dartdoc, -.tex .hljs-formula { - color: #d14; -} - -.hljs-title, -.hljs-id, -.scss .hljs-preprocessor { - color: #900; - font-weight: bold; -} - -.hljs-list .hljs-keyword, -.hljs-subst { - font-weight: normal; -} - -.hljs-class .hljs-title, -.hljs-type, -.vhdl .hljs-literal, -.tex .hljs-command { - color: #458; - font-weight: bold; -} - -.hljs-tag, -.hljs-tag .hljs-title, -.hljs-rule .hljs-property, -.django .hljs-tag .hljs-keyword { - color: #000080; - font-weight: normal; -} - -.hljs-attribute, -.hljs-variable, -.lisp .hljs-body, -.hljs-name { - color: #008080; -} - -.hljs-regexp { - color: #009926; -} - -.hljs-symbol, -.ruby .hljs-symbol .hljs-string, -.lisp .hljs-keyword, -.clojure .hljs-keyword, -.scheme .hljs-keyword, -.tex .hljs-special, -.hljs-prompt { - color: #990073; -} - -.hljs-built_in { - color: #0086b3; -} - -.hljs-preprocessor, -.hljs-pragma, -.hljs-pi, -.hljs-doctype, -.hljs-shebang, -.hljs-cdata { - color: #999; - font-weight: bold; -} - -.hljs-deletion { - background: #fdd; -} - -.hljs-addition { - background: #dfd; -} - -.diff .hljs-change { - background: #0086b3; -} - -.hljs-chunk { - color: #aaa; -} diff --git a/site/fonts/fontawesome-webfont.eot b/site/fonts/fontawesome-webfont.eot deleted file mode 100644 index 7c79c6a6bc9a128a2a8eaffbe49a4338625fdbc2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 38205 zcmZ^IWlSYp%;vqo1upLH?(XjH?(XhB4DRmk?(Q(SyX)W#I)m#B?7N%&@gNzPg3A9y|F{1i{C~vS%_!vmy8pvq0i*!V z04IP4KosB&umrgOcXRyD0su$=wg0R&z!TsAFa@~%hfn~t{zKgUi?RJbIV1oM026@a zKV<`u{HH7cRsj2daa8}Gnk4^EMF2odUHbodF(eRY6Og71NK*#{I$+FQ#4RkN>Xu5t zDV|CZ0erHH%7mJ7f9C(hMgfc`(&`gnuuiqhEZtN@Gm6qm9jtBTu`bUstuVt`VE1U^ zQeRP-GNx@G1O+8HnNjpn78T|1$sHu=pO{n+?Hbd%?rXh*b{x)ZZ9Ey*heliTM$ph9 zeSOvxJI7sn2z_VOStQwpj}H7Y+@M&VY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}^ z4+HBd(|2gGF>P2X@V2WdAP`hl5OzNW-tpn--;vOvJ>heyF11A#Oo;gW?0Uow;-T@b z87P-Fkc% z~9spB&5E0V2-wEC_4B>(&?nod9X8@&nMmf`& zo$*$@gQu^K+>qXKi|&%C5CBQn7X`%)XlLO0#_N}~Ut#AR2aZTmd*lP))3~cX>ZY-5 z)zaJ>3=Mgmg{PR(r*IL{;-cKyzQcsI%^R(R*z=GO28L`>2+IhR4ekE+4 zM+Gjxzqe4kWU~R-5>VMZT-3ZM(po&(PI(v(&1dv(86XaN;BvHm}^fU38+P=hf%-Z4PrXG}u{ z^{g=)0^+lVS>{0*NjXNV8&_q+Y)FC5rw3J)qxWAWsHWI1Q7czoL5fLjuNaLok>pJ0 zQivnSZfgD;R3V$T#E<_`Og=^fL87?6@mL~$cPHC8+zk`RkkHzqC2ee!6OOT25}?Au z8lo5|NxX-eBv?+_Jl(h9D~;e6g@3JwzU4b}rUS0FtbaUHZZ$m{NtvL!ESZJHISL z#$q3276qW>>e0K9BC6Lm!PDcC*mJ>96;}jV-`)zxB`?jOs*Xw=t0)s{mG?QRw~8qt zfu=rKWTTDPq=!y;1b*tE3H@nBXu_aSH~}ouMp}xlRsiQy|?8 z+=eFuOFpAznJa$ z9HP}Oq&hZZjUr$CB~(eAM!iJ*;=b?Yrx6h>^|H)MP==A9VPv1#j0hS{CaVQ1a0U*_ zOPt|Q3|tBH4>cTq2$K@~xI!3~L_nbiL8%UpJy?`vZOB>f8|q^o(U}ch?lcb}gFn9* z1|~O!l8`0`5O(Y2Oh~*GnI51ZmY26LDazLJ5qc&Ez{Mb8VGH2izKeuw*Z=?k00000 E0QL`y%>V!Z diff --git a/site/fonts/fontawesome-webfont.svg b/site/fonts/fontawesome-webfont.svg deleted file mode 100644 index cfe75c3..0000000 --- a/site/fonts/fontawesome-webfont.svg +++ /dev/null @@ -1,414 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/site/fonts/fontawesome-webfont.ttf b/site/fonts/fontawesome-webfont.ttf deleted file mode 100644 index e89738de5eaf8fca33a2f2cdc5cb4929caa62b71..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 80652 zcmd4434B!5y$62Jx!dgfl1wJaOp=*N2qchXlCUL1*hxS(1pzUj2!bdoh~hR1qKGRh zwYF;1y3o}w_SLrdruJ!H7kRd|tG>S2R@?Wq7TP{rA#?eEf9K95lK|TG|33fEKg+%6 z+hTSaAdmL)uWh^R%I%Bq{=#vIHGE2vyyxxQ zu>PXwf4+35#HOMTl7@fkt@MNGkN*dqzrXxudarck;ms?=9TzfXbVcIGGxh+E^d!f> ztp1kWBdO@h9ZDcN>E)O$)*L%OUQ<(5(?2L3bseob+I4i% z(X~e}J$l2@yN*6`^z%o*bo9v4Umbn#sBz47tm;_Pv94o_j;%d*>9HG*-F57d|CLTs zlc>gL3N=cjYLt$8j>eB>jxIjhe{|c??9qFU4jg^^^s&K$J;*W3T~FTeWV|2+Pm&&ML33QxpS<_UX3 zo}ee-@q2t8ugBw&J>0`QlKZ6FaOd4a?i23g?ho95bN|)-zJuoA|NMsm7K+s}nqB%Y z{lQI|ivK_S=vvsKmRk#edAb%6i2hSQfN{*f8@=C#{(3Md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T-yk{*VhVOLj$uJ1xKbvh0SE)m*>nzH6=ng>sz!`7OU(>i6V* ziB;@#7YHXM2*f#3z5Mc7D{Gy(e%lY9QhNbX`@F?(`Rh45u3vmvGFSMg^<2N}mJ>a} zocBQcUeCD!R@UUV{Ipt$A5h1+&T84Ye&y>gTQ0o((n`H3!fNii;zxTggS6jf0c+<2 zIt*+UP$JHK`Q^K>p*m%z0gXvKYh^Vz@7hg}x#v1d8bFquxDRyqxz0ae8^O9Qfo`0B zcvfkN)!j9l4_|s&V!b8@=m<2WP<=jK*wn%te3JLU5ynUD+iP?{(dOyu=d#Wzp$P!R C0{065 diff --git a/site/img/grid11.png b/site/img/grid11.png deleted file mode 100644 index ef37b27e06d21940965e3662000f99bb9f714dde..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 253 zcmeAS@N?(olHy`uVBq!ia0y~yVEh8YjLblhj}pEoffQSSPl)S(FbJ*rngbMJED7=p zW^j0RBMrz|>gnPbQW5v|oS`6tf&jDQ5rvj-Z}(m*XHat5IdhBo=InA-`@;IgXYB_N Z{AbRVdS&*gHV@=222WQ%mvv4FO#pQROGE$w diff --git a/site/img/grid12.png b/site/img/grid12.png deleted file mode 100644 index 3f100c41ab3dbd3e80aaeaef07057b689eb14208..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 260 zcmeAS@N?(olHy`uVBq!ia0y~yVEh8Yj6eZ~$7>&{11YAGAirP+hO)_LEr7heo-U3d z6^w5$oD_915Ma1a>DL!^q3f2&8s;p8>OVQl&wNX^-B$enpU%W>QOA$Z-J)0b=f}s# i$NS~&2bz)gshZ)NdH@fLcq!033=E#GelF{r5}E)XvW0m7 diff --git a/site/img/grid13.png b/site/img/grid13.png deleted file mode 100644 index 1a0d83f3af56f947e5f8d4f0031a10c6d2766ce1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 266 zcmeAS@N?(olHy`uVBq!ia0y~yVEh8YjLblhj}pEoffQSSPl)S(FbJ*rngbMJED7=p zW^j0RBMr#ehjcb>g%{ht>=jDMW jeEIWnInW;L%==8Y9-OUOnY2_M=z0cES3j3^P6&{11YAGAirP+hO)_LEr7h0o-U3d z6^w7M9AtEMU~oM+U*%vRr&r*tNu>_l3@3IROenAPoK-Vfuk@bhY_0W{?S7wa&VN3< zYOVQyoAdgge;xm9v%VfELI&e`#k}WV`=3|F{U^Y9uW|nKo`1dmChwe2di~D_dBxM! K&t;ucLK6V42YIOg diff --git a/site/img/grid15.png b/site/img/grid15.png deleted file mode 100644 index 1f0417a5d4d9713ed1ddcfe0cbdb91da24273143..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 442 zcmeAS@N?(olHy`uVBq!ia0y~yVEh8YOw2%$Z9B{*ffQ$ePlzj!{tpJl6-$$W9Hx>W zzhH)j+1h>*K=pB+E{-7;jBjtYcW!VHal5!&)Q8h-sqBq8zO#}UpM8G5VK@7a2cHs@ zlw8gJ2d%01ni&6C{>%LrB~?3rhrRz76Z=uVZ29GvQR(GYbJvx^nRP$01tGVyi6<@yyH1)C-$kr&J>{dUJN!vL=mX(9mUAsBgZ#h^CSQ%C;;ZFN* zmI(B~yLAv}q8pko406u%bub4ac@*r{UAxc4!rg%6n|o?jToXKw%nv&!1`KxwPgg&e IbxsLQ00E-nuK)l5 diff --git a/site/img/grid16.png b/site/img/grid16.png deleted file mode 100644 index 984454f49d69835c0f85405fb519b07b4a03d838..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 442 zcmeAS@N?(olHy`uVBq!ia0y~yVEh8YOw2%$Z9B{*ffP@GPl)S(B=B`9UolXexg^Lh zn4#f7)WmtJKs`~OE{-7;ac^&Lpp>^m41Y z>q^Uj8ln))@ALQD?Y{i7qQ{f Vsk7s_5-`viJYD@<);T3K0RaA@>23f3 diff --git a/site/img/grid17.png b/site/img/grid17.png deleted file mode 100644 index fe48c9dd67a4d0104ef7451d9fcc5960361ffa35..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 442 zcmeAS@N?(olHy`uVBq!ia0y~yVEh8YOw2%$Z9B{*ffP@GPlzj!{tp8d2dq~B`OGCj ze!&b4J*vMa&jad-@^oA7d*LUtinNQWuKvl%% zDYZlN&eb!Y=n1uL`s@V|YqzhT3}a58{bBuLi0Jg$8!f;xePoSb%z&zrdW5}KyY zn^5X^X_LzBA6GYp+05`*e);9~`SQEPUzS+y{l0m>{rUXrqs+VOU0#&zx^{D}-}3Ca zcVCvQwQh3|wb@`j*YA5=db!oyb){uMeNiChyZ<2eR=?LE4VkiY{mSE>@96{SyLJ(% zaWha)dH$hyC02KBy~|?-5^sX5yKDtCYR|b!paIvd)-Hw_ey;_j=eyPJ%Mi2H zl}5QQzkGLg0j5@<6|t}1_yOH=4rJS2PLQ7WrN%En;&8|1AKJ?aazDrzh@(Hl4F}o` v((_#nXiE0n??4wJtE(1%=X(L@irtKrRpG`xlUa`dW zzhDO6x_=);f$IG|T^vIy7~ftqWNc7ia6M=*6)@Fe$^sV6PR0i-H{Cl{zjCM1TaWoa zm)NRa=ChjnPrUY9tohG*%P+rdf3@q}v5PNv`CY&GvLtr->lY=v)?F?wv5LL^(#mS? zy4N`}bN#NDn)UfDe{Ci0zWj3O+}_2PU+x0)W5N7&AU?A8&4nQCH!V=KUoXX>C;c(V yO6urAIJ-m^;C-sIM9suOj3zE-%SxHR|WaY)78&qol`;+07Qp{vH$=8 diff --git a/site/img/grid20.png b/site/img/grid20.png deleted file mode 100644 index 30e3faeaf7ea78d396cc74d350a0e456dc459560..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 493 zcmeAS@N?(olHy`uVBq!ia0y~yVEh8YOw2%$Z9B{*ffQ$ePl)S(80hnQ`VT0`R1)MD z%-~!1?}I2%{X|a}$B>G+x3>(r4jYIt2TYuta&qFFo8J1@gUeR@jNL84{>Q3i8rwa! zoFyvheWCrmC029)#r^aw+PZsdxNTM6`|VX{s#C@1`YpFteqDFcx@b}V{Kxkr*XJy} z{PGKX>fO+XG5uW6E7!kSaQS6P zuCtv`&XN}(&X$GfYR_`c_1kV)xNh;~muBj}%B|++6)&2+2*kP61~(y~OJ7GZ%jE<(I#1*wp8@{Iu0y zYmmJc`G5|dEez%C2YP6>FxUz0OE15yiimVa^BbB{s6Nk&*wo%_f%xqw!-FG?k1|^V R?SWCn;OXk;vd$@?2>^Y2`>Fr{ diff --git a/site/img/grid3.png b/site/img/grid3.png deleted file mode 100644 index 4617c9d981cbfd853a1f26f2fc23551f5db55343..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 266 zcmeAS@N?(olHy`uVBq!ia0y~yVEh8YjLblhj}pEoffQSSPlzj!27;yOJI@0t#*!ev zUf8IzarXUY zKQ4YQk6-`X|NQ;id*|8P*8h3&^YZ88{cz^;=lwv@s((K&f5yp_2P?P;Qh=4|e_kGF j!k0fEmjms=&b-fb>%rNol}StGL0bP0l+XkKyNQLl diff --git a/site/img/grid4.png b/site/img/grid4.png deleted file mode 100644 index 2a1f1801b129d2c80047823fa45dff8a7b40b08c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 244 zcmeAS@N?(olHy`uVBq!ia0y~yVEh8YjLblhj}pEoffQSSPlzj!27;yOJI@0t#*!ev zUGm};{#E&`a^Car zS9SkC|Cv|u_i^RC>-O`WSK?#*KKj{aeZ9^3&%ch7$+-LBS2=@v&<=(M>)lU5j`wu+ Kb6Mw<&;$U~w|7eb diff --git a/site/img/grid5.png b/site/img/grid5.png deleted file mode 100644 index a1d710e03008c0416911a07c095bc55eb6182b54..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 442 zcmeAS@N?(olHy`uVBq!ia0y~yVEh8YOw2%$Z9B{*ffQ$ePlzj!hJfbemj{3>rjj7P zV1|a-+I|v1^>Lmqjv*C{Z*R7DZg3EBySQA`htq7S?2S3TvyvH~eSW@SH~WtVpAwXm zT+RLmt*Q5#82?%R%l#K6RXcx&z5f>z`%%7Z`Q?{U>E%{)*OkJVbwB!_oy!Mt-&yUx z{IX>2X6w0r*Wt`}xrc7E%=Ih3zVr2ql3mv_WkHf_7embf%DyYHx*LmRru*{C`xj=< zz5B9c*LF^;x$o8$U%v=6^|BSn)+nItRzHwQ+c`m&m4nq?yE)fyIamu=8CEOdPWx__ z2=u_abr5Hw8=5Z+a?bO0Fb5)e6ztYryU)eK-GJnqdumo(6FiR04?8CYiUChoKbLh* G2~7a9w%t(x diff --git a/site/img/grid6.png b/site/img/grid6.png deleted file mode 100644 index 71b4148db2e42061888a8e7d9edc23bd093408a8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 460 zcmeAS@N?(olHy`uVBq!ia0y~yVEh8YOw2%$Z9B{*ffP@GPlzj!h6B@==F@;2=8_=4 zV1|YRQ4{B>0`=s0x;TbZFuuKgd}gx)PeWku-2*1i|3xogJmBuWZq}D4XJ5X3`QKnc z$BMvzdv>PRJQmY!pJ!Q8RT=X)+WnCEmUl%jN_Jh#l%4B$-D>UP%P*srmjd}$-`WOn z-oIdFHTT^Pzt@;5eif~?j(!#8zWlQ6byU4pv9GuE-Aj7$O>Ik`-*W49mw{%iD+Q_C z3NdJ_jMdz{d?%2hkKs0gbgi4~w>*39wTmxHs)aF3z7BWhcJqa$C02I}!7A5Y-c^Qb z{$5UyFZzIv0GbwidLhI|U|0Dqzdak~rCTpCd~J32UJJkisc@b)>BI84 z&xeDRq*j(#&GlP;`Q?{iLD4Rc=lwQ1qq1nC7f=8szJ71i`iJL5FB*J5F920mb~SE& zRJ(n+i}KB7Q$QL^tnSK|{VAE&;id&PsKn~;kIhDZSAY#ze);X|JNKc?r)p=QDq{1L z+97)9>X}dUgxWTJ_5z5t+t*KqF{jV|uzoQ_bo%TK%a_8K6J#N3^~@E`9U=Pj;?-eH zJ@dqOP=6H(f7=3K-c5X}_5#9us`doI#B|@TJ1uuuAWq$7y#~&_bA)qZsk_&CD_18_ O40yWwxvX0`+8ix;TbZ#J#<}aczr%i0i@Kx7aj}p0x>NRNYZ$mg?&EVM2o056*)u z;Z~d0yjM}4pYrp+@u#;xJ}AxgTmHWM-@mA?7EhFoUgQIgY{g$@^zbmFD(PA@_YRPs4PkU5gel28^sdC}?oOadFhk!-S^>3!#ba^kyliDP_ubu=yDv+270(5c*KPuxnhj#U zSKBjt!R41x%S%B9ZUNf1dwp@dJH)Y2EB4MtcCOXjb)`{21$$?I$ZLW-4s69fBxiw` scXx9FJs0&n24o(>TR_L|<^&mIUs)AyTslkbJSajuUHx3vIVCg!04|Q`CIA2c diff --git a/site/img/grid9.png b/site/img/grid9.png deleted file mode 100644 index 627dda51304ff75b255426e84f012d6a41d0304c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 456 zcmeAS@N?(olHy`uVBq!ia0y~yVEh8YOw2%$Z9B{*ffP@GPlzj!h6B@==F@;2=8_=4 zUg;&O1RM#r3(c3xYjiSFDQaZ-y!-G8o+o8(;f zwQkwPmnBsze|l}I*>|$EI=phx<(HRVEPZymckyNQi*I+m{D=D7UwS1a>AzvZt>Z?Vo@cl{<%?cH^k zL2BdDL27sVtzQgMDGk){)#_~%NM)YPT)*qDw{U|DM^X|CRPxqpFW9g$S(uV_*LN0z z?7yrBGV}Sdi!aOO#(@pn4ODr%v2VD$`G d3GrUJ%YX0`-_up!f)0Y>!_(EzWt~$(69BQE>Hz=% diff --git a/site/index.html b/site/index.html index db80538..a95d0c5 100644 --- a/site/index.html +++ b/site/index.html @@ -1,228 +1,414 @@ - - - - - - - - - - - Python Synopsis - - - - - - - - - - - - - - - - - - - - - -
- -
- -
-
- -

Welcome to MkDocs

-

For full documentation visit mkdocs.org.

-

Commands

-
    -
  • mkdocs new [dir-name] - Create a new project.
  • -
  • mkdocs serve - Start the live-reloading docs server.
  • -
  • mkdocs build - Build the documentation site.
  • -
  • mkdocs help - Print this help message.
  • -
-

Commands

-
    -
  • mkdocs new [dir-name] - Create a new project.
  • -
  • mkdocs serve - Start the live-reloading docs server.
  • -
  • mkdocs build - Build the documentation site.
  • -
  • mkdocs help - Print this help message.
  • -
-

Commands

-
    -
  • mkdocs new [dir-name] - Create a new project.
  • -
  • mkdocs serve - Start the live-reloading docs server.
  • -
  • mkdocs build - Build the documentation site.
  • -
  • mkdocs help - Print this help message.
  • -
-

Project layout

-
mkdocs.yml    # The configuration file.
-docs/
-    index.md  # The documentation homepage.
-    ...       # Other markdown pages, images and other files.
-
- -
- -
-
-

- Ent1c3d
- - Documentation built with MkDocs.

-
- - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + Python Synopsis + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + +
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+ + + +

Welcome to Python Synopsis!

+

Python Study Guide

+

In this repository I want to share resources, that helped me understand python programing language deeply. +It was not easy to find appropriate books, articles, answers from Stackoverflow, online courses, videos from py conferences and etc.

+

So, after all I decided to share top resources for everyone about each topic, that you need to know about python, if you want to be senior python Software Engineer.

+

Of course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than 30-40 chapters.

+ + + + + + + + +
+
+
+
+ + + + +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/site/js/base.js b/site/js/base.js deleted file mode 100644 index 166d7d4..0000000 --- a/site/js/base.js +++ /dev/null @@ -1,20 +0,0 @@ - -/* Highlight */ -$( document ).ready(function() { - hljs.initHighlightingOnLoad(); - $('table').addClass('table table-striped table-hover'); -}); - - -$('body').scrollspy({ - target: '.bs-sidebar', -}); - - -/* Prevent disabled links from causing a page reload */ -$("li.disabled a").click(function() { - event.preventDefault(); -}); - - - diff --git a/site/js/bootstrap-3.0.3.min.js b/site/js/bootstrap-3.0.3.min.js deleted file mode 100644 index 6354707..0000000 --- a/site/js/bootstrap-3.0.3.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * Bootstrap v3.0.3 (http://getbootstrap.com) - * Copyright 2013 Twitter, Inc. - * Licensed under http://www.apache.org/licenses/LICENSE-2.0 - */ - -if("undefined"==typeof jQuery)throw new Error("Bootstrap requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d)};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.is("input")?"val":"html",e=c.data();a+="Text",e.resetText||c.data("resetText",c[d]()),c[d](e[a]||this.options[a]),setTimeout(function(){"loadingText"==a?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons"]'),b=!0;if(a.length){var c=this.$element.find("input");"radio"===c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?b=!1:a.find(".active").removeClass("active")),b&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}b&&this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(!e.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(j),j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(j),j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")}return f&&this.cycle(),this}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?(this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350),void 0):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(''}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#\w/.test(e)&&a(e);return f&&f.length&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parents(".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top()),"function"==typeof h&&(h=f.bottom());var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;this.affixed!==i&&(this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin="bottom"==i?e.top-d:null,this.$element.removeClass(b.RESET).addClass("affix"+(i?"-"+i:"")),"bottom"==i&&this.$element.offset({top:document.body.offsetHeight-h-this.$element.height()}))}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(jQuery); \ No newline at end of file diff --git a/site/js/highlight.pack.js b/site/js/highlight.pack.js deleted file mode 100644 index e88fabb..0000000 --- a/site/js/highlight.pack.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e){"undefined"!=typeof exports?e(exports):(window.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return window.hljs}))}(function(e){function n(e){return e.replace(/&/gm,"&").replace(//gm,">")}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0==t.index}function a(e){var n=(e.className+" "+(e.parentNode?e.parentNode.className:"")).split(/\s+/);return n=n.map(function(e){return e.replace(/^lang(uage)?-/,"")}),n.filter(function(e){return N(e)||/no(-?)highlight|plain|text/.test(e)})[0]}function i(e,n){var t,r={};for(t in e)r[t]=e[t];if(n)for(t in n)r[t]=n[t];return r}function o(e){var n=[];return function r(e,a){for(var i=e.firstChild;i;i=i.nextSibling)3==i.nodeType?a+=i.nodeValue.length:1==i.nodeType&&(n.push({event:"start",offset:a,node:i}),a=r(i,a),t(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:i}));return a}(e,0),n}function u(e,r,a){function i(){return e.length&&r.length?e[0].offset!=r[0].offset?e[0].offset"}function u(e){l+=""}function c(e){("start"==e.event?o:u)(e.node)}for(var s=0,l="",f=[];e.length||r.length;){var g=i();if(l+=n(a.substr(s,g[0].offset-s)),s=g[0].offset,g==e){f.reverse().forEach(u);do c(g.splice(0,1)[0]),g=i();while(g==e&&g.length&&g[0].offset==s);f.reverse().forEach(o)}else"start"==g[0].event?f.push(g[0].node):f.pop(),c(g.splice(0,1)[0])}return l+n(a.substr(s))}function c(e){function n(e){return e&&e.source||e}function t(t,r){return new RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(a,o){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var u={},c=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");u[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof a.k?c("keyword",a.k):Object.keys(a.k).forEach(function(e){c(e,a.k[e])}),a.k=u}a.lR=t(a.l||/\b\w+\b/,!0),o&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),a.b||(a.b=/\B|\b/),a.bR=t(a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=t(a.e)),a.tE=n(a.e)||"",a.eW&&o.tE&&(a.tE+=(a.e?"|":"")+o.tE)),a.i&&(a.iR=t(a.i)),void 0===a.r&&(a.r=1),a.c||(a.c=[]);var s=[];a.c.forEach(function(e){e.v?e.v.forEach(function(n){s.push(i(e,n))}):s.push("self"==e?a:e)}),a.c=s,a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,o);var l=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(n).filter(Boolean);a.t=l.length?t(l.join("|"),!0):{exec:function(){return null}}}}r(e)}function s(e,t,a,i){function o(e,n){for(var t=0;t";return i+=e+'">',i+n+o}function d(){if(!L.k)return n(y);var e="",t=0;L.lR.lastIndex=0;for(var r=L.lR.exec(y);r;){e+=n(y.substr(t,r.index-t));var a=g(L,r);a?(B+=a[1],e+=p(a[0],n(r[0]))):e+=n(r[0]),t=L.lR.lastIndex,r=L.lR.exec(y)}return e+n(y.substr(t))}function h(){if(L.sL&&!w[L.sL])return n(y);var e=L.sL?s(L.sL,y,!0,M[L.sL]):l(y);return L.r>0&&(B+=e.r),"continuous"==L.subLanguageMode&&(M[L.sL]=e.top),p(e.language,e.value,!1,!0)}function b(){return void 0!==L.sL?h():d()}function v(e,t){var r=e.cN?p(e.cN,"",!0):"";e.rB?(k+=r,y=""):e.eB?(k+=n(t)+r,y=""):(k+=r,y=t),L=Object.create(e,{parent:{value:L}})}function m(e,t){if(y+=e,void 0===t)return k+=b(),0;var r=o(t,L);if(r)return k+=b(),v(r,t),r.rB?0:t.length;var a=u(L,t);if(a){var i=L;i.rE||i.eE||(y+=t),k+=b();do L.cN&&(k+=""),B+=L.r,L=L.parent;while(L!=a.parent);return i.eE&&(k+=n(t)),y="",a.starts&&v(a.starts,""),i.rE?0:t.length}if(f(t,L))throw new Error('Illegal lexeme "'+t+'" for mode "'+(L.cN||"")+'"');return y+=t,t.length||1}var E=N(e);if(!E)throw new Error('Unknown language: "'+e+'"');c(E);var R,L=i||E,M={},k="";for(R=L;R!=E;R=R.parent)R.cN&&(k=p(R.cN,"",!0)+k);var y="",B=0;try{for(var C,j,I=0;;){if(L.t.lastIndex=I,C=L.t.exec(t),!C)break;j=m(t.substr(I,C.index-I),C[0]),I=C.index+j}for(m(t.substr(I)),R=L;R.parent;R=R.parent)R.cN&&(k+="");return{r:B,value:k,language:e,top:L}}catch(S){if(-1!=S.message.indexOf("Illegal"))return{r:0,value:n(t)};throw S}}function l(e,t){t=t||x.languages||Object.keys(w);var r={r:0,value:n(e)},a=r;return t.forEach(function(n){if(N(n)){var t=s(n,e,!1);t.language=n,t.r>a.r&&(a=t),t.r>r.r&&(a=r,r=t)}}),a.language&&(r.second_best=a),r}function f(e){return x.tabReplace&&(e=e.replace(/^((<[^>]+>|\t)+)/gm,function(e,n){return n.replace(/\t/g,x.tabReplace)})),x.useBR&&(e=e.replace(/\n/g,"
")),e}function g(e,n,t){var r=n?E[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),-1===e.indexOf(r)&&a.push(r),a.join(" ").trim()}function p(e){var n=a(e);if(!/no(-?)highlight|plain|text/.test(n)){var t;x.useBR?(t=document.createElementNS("http://www.w3.org/1999/xhtml","div"),t.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n")):t=e;var r=t.textContent,i=n?s(n,r,!0):l(r),c=o(t);if(c.length){var p=document.createElementNS("http://www.w3.org/1999/xhtml","div");p.innerHTML=i.value,i.value=u(c,o(p),r)}i.value=f(i.value),e.innerHTML=i.value,e.className=g(e.className,n,i.language),e.result={language:i.language,re:i.r},i.second_best&&(e.second_best={language:i.second_best.language,re:i.second_best.r})}}function d(e){x=i(x,e)}function h(){if(!h.called){h.called=!0;var e=document.querySelectorAll("pre code");Array.prototype.forEach.call(e,p)}}function b(){addEventListener("DOMContentLoaded",h,!1),addEventListener("load",h,!1)}function v(n,t){var r=w[n]=t(e);r.aliases&&r.aliases.forEach(function(e){E[e]=n})}function m(){return Object.keys(w)}function N(e){return w[e]||w[E[e]]}var x={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0},w={},E={};return e.highlight=s,e.highlightAuto=l,e.fixMarkup=f,e.highlightBlock=p,e.configure=d,e.initHighlighting=h,e.initHighlightingOnLoad=b,e.registerLanguage=v,e.listLanguages=m,e.getLanguage=N,e.inherit=i,e.IR="[a-zA-Z]\\w*",e.UIR="[a-zA-Z_]\\w*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="\\b(0[xX][a-fA-F0-9]+|(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such)\b/},e.C=function(n,t,r){var a=e.inherit({cN:"comment",b:n,e:t,c:[]},r||{});return a.c.push(e.PWM),a},e.CLCM=e.C("//","$"),e.CBCM=e.C("/\\*","\\*/"),e.HCM=e.C("#","$"),e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e});hljs.registerLanguage("objectivec",function(e){var t={cN:"built_in",b:"(AV|CA|CF|CG|CI|MK|MP|NS|UI)\\w+"},i={keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"},o=/[a-zA-Z@][a-zA-Z0-9_]*/,n="@interface @class @protocol @implementation";return{aliases:["m","mm","objc","obj-c"],k:i,l:o,i:""}]}]},{cN:"class",b:"("+n.split(" ").join("|")+")\\b",e:"({|$)",eE:!0,k:n,l:o,c:[e.UTM]},{cN:"variable",b:"\\."+e.UIR,r:0}]}});hljs.registerLanguage("sql",function(e){var t=e.C("--","$");return{cI:!0,i:/[<>]/,c:[{cN:"operator",bK:"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate savepoint release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup revoke",e:/;/,eW:!0,k:{keyword:"abs absolute acos action add adddate addtime aes_decrypt aes_encrypt after aggregate all allocate alter analyze and any are as asc ascii asin assertion at atan atan2 atn2 authorization authors avg backup before begin benchmark between bin binlog bit_and bit_count bit_length bit_or bit_xor both by cache call cascade cascaded case cast catalog ceil ceiling chain change changed char_length character_length charindex charset check checksum checksum_agg choose close coalesce coercibility collate collation collationproperty column columns columns_updated commit compress concat concat_ws concurrent connect connection connection_id consistent constraint constraints continue contributors conv convert convert_tz corresponding cos cot count count_big crc32 create cross cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime data database databases datalength date_add date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts datetimeoffsetfromparts day dayname dayofmonth dayofweek dayofyear deallocate declare decode default deferrable deferred degrees delayed delete des_decrypt des_encrypt des_key_file desc describe descriptor diagnostics difference disconnect distinct distinctrow div do domain double drop dumpfile each else elt enclosed encode encrypt end end-exec engine engines eomonth errors escape escaped event eventdata events except exception exec execute exists exp explain export_set extended external extract fast fetch field fields find_in_set first first_value floor flush for force foreign format found found_rows from from_base64 from_days from_unixtime full function get get_format get_lock getdate getutcdate global go goto grant grants greatest group group_concat grouping grouping_id gtid_subset gtid_subtract handler having help hex high_priority hosts hour ident_current ident_incr ident_seed identified identity if ifnull ignore iif ilike immediate in index indicator inet6_aton inet6_ntoa inet_aton inet_ntoa infile initially inner innodb input insert install instr intersect into is is_free_lock is_ipv4 is_ipv4_compat is_ipv4_mapped is_not is_not_null is_used_lock isdate isnull isolation join key kill language last last_day last_insert_id last_value lcase lead leading least leaves left len lenght level like limit lines ln load load_file local localtime localtimestamp locate lock log log10 log2 logfile logs low_priority lower lpad ltrim make_set makedate maketime master master_pos_wait match matched max md5 medium merge microsecond mid min minute mod mode module month monthname mutex name_const names national natural nchar next no no_write_to_binlog not now nullif nvarchar oct octet_length of old_password on only open optimize option optionally or ord order outer outfile output pad parse partial partition password patindex percent_rank percentile_cont percentile_disc period_add period_diff pi plugin position pow power pragma precision prepare preserve primary prior privileges procedure procedure_analyze processlist profile profiles public publishingservername purge quarter query quick quote quotename radians rand read references regexp relative relaylog release release_lock rename repair repeat replace replicate reset restore restrict return returns reverse revoke right rlike rollback rollup round row row_count rows rpad rtrim savepoint schema scroll sec_to_time second section select serializable server session session_user set sha sha1 sha2 share show sign sin size slave sleep smalldatetimefromparts snapshot some soname soundex sounds_like space sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sql_variant_property sqlstate sqrt square start starting status std stddev stddev_pop stddev_samp stdev stdevp stop str str_to_date straight_join strcmp string stuff subdate substr substring subtime subtring_index sum switchoffset sysdate sysdatetime sysdatetimeoffset system_user sysutcdatetime table tables tablespace tan temporary terminated tertiary_weights then time time_format time_to_sec timediff timefromparts timestamp timestampadd timestampdiff timezone_hour timezone_minute to to_base64 to_days to_seconds todatetimeoffset trailing transaction translation trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse ucase uncompress uncompressed_length unhex unicode uninstall union unique unix_timestamp unknown unlock update upgrade upped upper usage use user user_resources using utc_date utc_time utc_timestamp uuid uuid_short validate_password_strength value values var var_pop var_samp variables variance varp version view warnings week weekday weekofyear weight_string when whenever where with work write xml xor year yearweek zon",literal:"true false null",built_in:"array bigint binary bit blob boolean char character date dec decimal float int integer interval number numeric real serial smallint varchar varying int8 serial8 text"},c:[{cN:"string",b:"'",e:"'",c:[e.BE,{b:"''"}]},{cN:"string",b:'"',e:'"',c:[e.BE,{b:'""'}]},{cN:"string",b:"`",e:"`",c:[e.BE]},e.CNM,e.CBCM,t]},e.CBCM,t]}});hljs.registerLanguage("javascript",function(e){return{aliases:["js"],k:{keyword:"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as await",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise"},c:[{cN:"pi",r:10,v:[{b:/^\s*('|")use strict('|")/},{b:/^\s*('|")use asm('|")/}]},e.ASM,e.QSM,{cN:"string",b:"`",e:"`",c:[e.BE,{cN:"subst",b:"\\$\\{",e:"\\}"}]},e.CLCM,e.CBCM,{cN:"number",b:"\\b(0[xXbBoO][a-fA-F0-9]+|(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",r:0},{b:"("+e.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[e.CLCM,e.CBCM,e.RM,{b:/\s*[);\]]/,r:0,sL:"xml"}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[e.inherit(e.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,c:[e.CLCM,e.CBCM],i:/["'\(]/}],i:/\[|%/},{b:/\$[(.]/},{b:"\\."+e.IR,r:0},{bK:"import",e:"[;$]",k:"import from as",c:[e.ASM,e.QSM]},{cN:"class",bK:"class",e:/[{;=]/,eE:!0,i:/[:"\[\]]/,c:[{bK:"extends"},e.UTM]}]}});hljs.registerLanguage("scss",function(e){{var t="[a-zA-Z-][a-zA-Z0-9_-]*",i={cN:"variable",b:"(\\$"+t+")\\b"},r={cN:"function",b:t+"\\(",rB:!0,eE:!0,e:"\\("},o={cN:"hexcolor",b:"#[0-9A-Fa-f]+"};({cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:!0,i:"[^\\s]",starts:{cN:"value",eW:!0,eE:!0,c:[r,o,e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"important",b:"!important"}]}})}return{cI:!0,i:"[=/|']",c:[e.CLCM,e.CBCM,r,{cN:"id",b:"\\#[A-Za-z0-9_-]+",r:0},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"tag",b:"\\b(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|mark|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|samp|script|section|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)\\b",r:0},{cN:"pseudo",b:":(visited|valid|root|right|required|read-write|read-only|out-range|optional|only-of-type|only-child|nth-of-type|nth-last-of-type|nth-last-child|nth-child|not|link|left|last-of-type|last-child|lang|invalid|indeterminate|in-range|hover|focus|first-of-type|first-line|first-letter|first-child|first|enabled|empty|disabled|default|checked|before|after|active)"},{cN:"pseudo",b:"::(after|before|choices|first-letter|first-line|repeat-index|repeat-item|selection|value)"},i,{cN:"attribute",b:"\\b(z-index|word-wrap|word-spacing|word-break|width|widows|white-space|visibility|vertical-align|unicode-bidi|transition-timing-function|transition-property|transition-duration|transition-delay|transition|transform-style|transform-origin|transform|top|text-underline-position|text-transform|text-shadow|text-rendering|text-overflow|text-indent|text-decoration-style|text-decoration-line|text-decoration-color|text-decoration|text-align-last|text-align|tab-size|table-layout|right|resize|quotes|position|pointer-events|perspective-origin|perspective|page-break-inside|page-break-before|page-break-after|padding-top|padding-right|padding-left|padding-bottom|padding|overflow-y|overflow-x|overflow-wrap|overflow|outline-width|outline-style|outline-offset|outline-color|outline|orphans|order|opacity|object-position|object-fit|normal|none|nav-up|nav-right|nav-left|nav-index|nav-down|min-width|min-height|max-width|max-height|mask|marks|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|letter-spacing|left|justify-content|initial|inherit|ime-mode|image-orientation|image-resolution|image-rendering|icon|hyphens|height|font-weight|font-variant-ligatures|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-language-override|font-kerning|font-feature-settings|font-family|font|float|flex-wrap|flex-shrink|flex-grow|flex-flow|flex-direction|flex-basis|flex|filter|empty-cells|display|direction|cursor|counter-reset|counter-increment|content|column-width|column-span|column-rule-width|column-rule-style|column-rule-color|column-rule|column-gap|column-fill|column-count|columns|color|clip-path|clip|clear|caption-side|break-inside|break-before|break-after|box-sizing|box-shadow|box-decoration-break|bottom|border-width|border-top-width|border-top-style|border-top-right-radius|border-top-left-radius|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-radius|border-left-width|border-left-style|border-left-color|border-left|border-image-width|border-image-source|border-image-slice|border-image-repeat|border-image-outset|border-image|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-right-radius|border-bottom-left-radius|border-bottom-color|border-bottom|border|background-size|background-repeat|background-position|background-origin|background-image|background-color|background-clip|background-attachment|background-blend-mode|background|backface-visibility|auto|animation-timing-function|animation-play-state|animation-name|animation-iteration-count|animation-fill-mode|animation-duration|animation-direction|animation-delay|animation|align-self|align-items|align-content)\\b",i:"[^\\s]"},{cN:"value",b:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{cN:"value",b:":",e:";",c:[r,i,o,e.CSSNM,e.QSM,e.ASM,{cN:"important",b:"!important"}]},{cN:"at_rule",b:"@",e:"[{;]",k:"mixin include extend for if else each while charset import debug media page content font-face namespace warn",c:[r,i,e.QSM,e.ASM,o,e.CSSNM,{cN:"preprocessor",b:"\\s[A-Za-z0-9_.-]+",r:0}]}]}});hljs.registerLanguage("mel",function(e){return{k:"int float string vector matrix if else switch case default while do for in break continue global proc return about abs addAttr addAttributeEditorNodeHelp addDynamic addNewShelfTab addPP addPanelCategory addPrefixToName advanceToNextDrivenKey affectedNet affects aimConstraint air alias aliasAttr align alignCtx alignCurve alignSurface allViewFit ambientLight angle angleBetween animCone animCurveEditor animDisplay animView annotate appendStringArray applicationName applyAttrPreset applyTake arcLenDimContext arcLengthDimension arclen arrayMapper art3dPaintCtx artAttrCtx artAttrPaintVertexCtx artAttrSkinPaintCtx artAttrTool artBuildPaintMenu artFluidAttrCtx artPuttyCtx artSelectCtx artSetPaintCtx artUserPaintCtx assignCommand assignInputDevice assignViewportFactories attachCurve attachDeviceAttr attachSurface attrColorSliderGrp attrCompatibility attrControlGrp attrEnumOptionMenu attrEnumOptionMenuGrp attrFieldGrp attrFieldSliderGrp attrNavigationControlGrp attrPresetEditWin attributeExists attributeInfo attributeMenu attributeQuery autoKeyframe autoPlace bakeClip bakeFluidShading bakePartialHistory bakeResults bakeSimulation basename basenameEx batchRender bessel bevel bevelPlus binMembership bindSkin blend2 blendShape blendShapeEditor blendShapePanel blendTwoAttr blindDataType boneLattice boundary boxDollyCtx boxZoomCtx bufferCurve buildBookmarkMenu buildKeyframeMenu button buttonManip CBG cacheFile cacheFileCombine cacheFileMerge cacheFileTrack camera cameraView canCreateManip canvas capitalizeString catch catchQuiet ceil changeSubdivComponentDisplayLevel changeSubdivRegion channelBox character characterMap characterOutlineEditor characterize chdir checkBox checkBoxGrp checkDefaultRenderGlobals choice circle circularFillet clamp clear clearCache clip clipEditor clipEditorCurrentTimeCtx clipSchedule clipSchedulerOutliner clipTrimBefore closeCurve closeSurface cluster cmdFileOutput cmdScrollFieldExecuter cmdScrollFieldReporter cmdShell coarsenSubdivSelectionList collision color colorAtPoint colorEditor colorIndex colorIndexSliderGrp colorSliderButtonGrp colorSliderGrp columnLayout commandEcho commandLine commandPort compactHairSystem componentEditor compositingInterop computePolysetVolume condition cone confirmDialog connectAttr connectControl connectDynamic connectJoint connectionInfo constrain constrainValue constructionHistory container containsMultibyte contextInfo control convertFromOldLayers convertIffToPsd convertLightmap convertSolidTx convertTessellation convertUnit copyArray copyFlexor copyKey copySkinWeights cos cpButton cpCache cpClothSet cpCollision cpConstraint cpConvClothToMesh cpForces cpGetSolverAttr cpPanel cpProperty cpRigidCollisionFilter cpSeam cpSetEdit cpSetSolverAttr cpSolver cpSolverTypes cpTool cpUpdateClothUVs createDisplayLayer createDrawCtx createEditor createLayeredPsdFile createMotionField createNewShelf createNode createRenderLayer createSubdivRegion cross crossProduct ctxAbort ctxCompletion ctxEditMode ctxTraverse currentCtx currentTime currentTimeCtx currentUnit curve curveAddPtCtx curveCVCtx curveEPCtx curveEditorCtx curveIntersect curveMoveEPCtx curveOnSurface curveSketchCtx cutKey cycleCheck cylinder dagPose date defaultLightListCheckBox defaultNavigation defineDataServer defineVirtualDevice deformer deg_to_rad delete deleteAttr deleteShadingGroupsAndMaterials deleteShelfTab deleteUI deleteUnusedBrushes delrandstr detachCurve detachDeviceAttr detachSurface deviceEditor devicePanel dgInfo dgdirty dgeval dgtimer dimWhen directKeyCtx directionalLight dirmap dirname disable disconnectAttr disconnectJoint diskCache displacementToPoly displayAffected displayColor displayCull displayLevelOfDetail displayPref displayRGBColor displaySmoothness displayStats displayString displaySurface distanceDimContext distanceDimension doBlur dolly dollyCtx dopeSheetEditor dot dotProduct doubleProfileBirailSurface drag dragAttrContext draggerContext dropoffLocator duplicate duplicateCurve duplicateSurface dynCache dynControl dynExport dynExpression dynGlobals dynPaintEditor dynParticleCtx dynPref dynRelEdPanel dynRelEditor dynamicLoad editAttrLimits editDisplayLayerGlobals editDisplayLayerMembers editRenderLayerAdjustment editRenderLayerGlobals editRenderLayerMembers editor editorTemplate effector emit emitter enableDevice encodeString endString endsWith env equivalent equivalentTol erf error eval evalDeferred evalEcho event exactWorldBoundingBox exclusiveLightCheckBox exec executeForEachObject exists exp expression expressionEditorListen extendCurve extendSurface extrude fcheck fclose feof fflush fgetline fgetword file fileBrowserDialog fileDialog fileExtension fileInfo filetest filletCurve filter filterCurve filterExpand filterStudioImport findAllIntersections findAnimCurves findKeyframe findMenuItem findRelatedSkinCluster finder firstParentOf fitBspline flexor floatEq floatField floatFieldGrp floatScrollBar floatSlider floatSlider2 floatSliderButtonGrp floatSliderGrp floor flow fluidCacheInfo fluidEmitter fluidVoxelInfo flushUndo fmod fontDialog fopen formLayout format fprint frameLayout fread freeFormFillet frewind fromNativePath fwrite gamma gauss geometryConstraint getApplicationVersionAsFloat getAttr getClassification getDefaultBrush getFileList getFluidAttr getInputDeviceRange getMayaPanelTypes getModifiers getPanel getParticleAttr getPluginResource getenv getpid glRender glRenderEditor globalStitch gmatch goal gotoBindPose grabColor gradientControl gradientControlNoAttr graphDollyCtx graphSelectContext graphTrackCtx gravity grid gridLayout group groupObjectsByName HfAddAttractorToAS HfAssignAS HfBuildEqualMap HfBuildFurFiles HfBuildFurImages HfCancelAFR HfConnectASToHF HfCreateAttractor HfDeleteAS HfEditAS HfPerformCreateAS HfRemoveAttractorFromAS HfSelectAttached HfSelectAttractors HfUnAssignAS hardenPointCurve hardware hardwareRenderPanel headsUpDisplay headsUpMessage help helpLine hermite hide hilite hitTest hotBox hotkey hotkeyCheck hsv_to_rgb hudButton hudSlider hudSliderButton hwReflectionMap hwRender hwRenderLoad hyperGraph hyperPanel hyperShade hypot iconTextButton iconTextCheckBox iconTextRadioButton iconTextRadioCollection iconTextScrollList iconTextStaticLabel ikHandle ikHandleCtx ikHandleDisplayScale ikSolver ikSplineHandleCtx ikSystem ikSystemInfo ikfkDisplayMethod illustratorCurves image imfPlugins inheritTransform insertJoint insertJointCtx insertKeyCtx insertKnotCurve insertKnotSurface instance instanceable instancer intField intFieldGrp intScrollBar intSlider intSliderGrp interToUI internalVar intersect iprEngine isAnimCurve isConnected isDirty isParentOf isSameObject isTrue isValidObjectName isValidString isValidUiName isolateSelect itemFilter itemFilterAttr itemFilterRender itemFilterType joint jointCluster jointCtx jointDisplayScale jointLattice keyTangent keyframe keyframeOutliner keyframeRegionCurrentTimeCtx keyframeRegionDirectKeyCtx keyframeRegionDollyCtx keyframeRegionInsertKeyCtx keyframeRegionMoveKeyCtx keyframeRegionScaleKeyCtx keyframeRegionSelectKeyCtx keyframeRegionSetKeyCtx keyframeRegionTrackCtx keyframeStats lassoContext lattice latticeDeformKeyCtx launch launchImageEditor layerButton layeredShaderPort layeredTexturePort layout layoutDialog lightList lightListEditor lightListPanel lightlink lineIntersection linearPrecision linstep listAnimatable listAttr listCameras listConnections listDeviceAttachments listHistory listInputDeviceAxes listInputDeviceButtons listInputDevices listMenuAnnotation listNodeTypes listPanelCategories listRelatives listSets listTransforms listUnselected listerEditor loadFluid loadNewShelf loadPlugin loadPluginLanguageResources loadPrefObjects localizedPanelLabel lockNode loft log longNameOf lookThru ls lsThroughFilter lsType lsUI Mayatomr mag makeIdentity makeLive makePaintable makeRoll makeSingleSurface makeTubeOn makebot manipMoveContext manipMoveLimitsCtx manipOptions manipRotateContext manipRotateLimitsCtx manipScaleContext manipScaleLimitsCtx marker match max memory menu menuBarLayout menuEditor menuItem menuItemToShelf menuSet menuSetPref messageLine min minimizeApp mirrorJoint modelCurrentTimeCtx modelEditor modelPanel mouse movIn movOut move moveIKtoFK moveKeyCtx moveVertexAlongDirection multiProfileBirailSurface mute nParticle nameCommand nameField namespace namespaceInfo newPanelItems newton nodeCast nodeIconButton nodeOutliner nodePreset nodeType noise nonLinear normalConstraint normalize nurbsBoolean nurbsCopyUVSet nurbsCube nurbsEditUV nurbsPlane nurbsSelect nurbsSquare nurbsToPoly nurbsToPolygonsPref nurbsToSubdiv nurbsToSubdivPref nurbsUVSet nurbsViewDirectionVector objExists objectCenter objectLayer objectType objectTypeUI obsoleteProc oceanNurbsPreviewPlane offsetCurve offsetCurveOnSurface offsetSurface openGLExtension openMayaPref optionMenu optionMenuGrp optionVar orbit orbitCtx orientConstraint outlinerEditor outlinerPanel overrideModifier paintEffectsDisplay pairBlend palettePort paneLayout panel panelConfiguration panelHistory paramDimContext paramDimension paramLocator parent parentConstraint particle particleExists particleInstancer particleRenderInfo partition pasteKey pathAnimation pause pclose percent performanceOptions pfxstrokes pickWalk picture pixelMove planarSrf plane play playbackOptions playblast plugAttr plugNode pluginInfo pluginResourceUtil pointConstraint pointCurveConstraint pointLight pointMatrixMult pointOnCurve pointOnSurface pointPosition poleVectorConstraint polyAppend polyAppendFacetCtx polyAppendVertex polyAutoProjection polyAverageNormal polyAverageVertex polyBevel polyBlendColor polyBlindData polyBoolOp polyBridgeEdge polyCacheMonitor polyCheck polyChipOff polyClipboard polyCloseBorder polyCollapseEdge polyCollapseFacet polyColorBlindData polyColorDel polyColorPerVertex polyColorSet polyCompare polyCone polyCopyUV polyCrease polyCreaseCtx polyCreateFacet polyCreateFacetCtx polyCube polyCut polyCutCtx polyCylinder polyCylindricalProjection polyDelEdge polyDelFacet polyDelVertex polyDuplicateAndConnect polyDuplicateEdge polyEditUV polyEditUVShell polyEvaluate polyExtrudeEdge polyExtrudeFacet polyExtrudeVertex polyFlipEdge polyFlipUV polyForceUV polyGeoSampler polyHelix polyInfo polyInstallAction polyLayoutUV polyListComponentConversion polyMapCut polyMapDel polyMapSew polyMapSewMove polyMergeEdge polyMergeEdgeCtx polyMergeFacet polyMergeFacetCtx polyMergeUV polyMergeVertex polyMirrorFace polyMoveEdge polyMoveFacet polyMoveFacetUV polyMoveUV polyMoveVertex polyNormal polyNormalPerVertex polyNormalizeUV polyOptUvs polyOptions polyOutput polyPipe polyPlanarProjection polyPlane polyPlatonicSolid polyPoke polyPrimitive polyPrism polyProjection polyPyramid polyQuad polyQueryBlindData polyReduce polySelect polySelectConstraint polySelectConstraintMonitor polySelectCtx polySelectEditCtx polySeparate polySetToFaceNormal polySewEdge polyShortestPathCtx polySmooth polySoftEdge polySphere polySphericalProjection polySplit polySplitCtx polySplitEdge polySplitRing polySplitVertex polyStraightenUVBorder polySubdivideEdge polySubdivideFacet polyToSubdiv polyTorus polyTransfer polyTriangulate polyUVSet polyUnite polyWedgeFace popen popupMenu pose pow preloadRefEd print progressBar progressWindow projFileViewer projectCurve projectTangent projectionContext projectionManip promptDialog propModCtx propMove psdChannelOutliner psdEditTextureFile psdExport psdTextureFile putenv pwd python querySubdiv quit rad_to_deg radial radioButton radioButtonGrp radioCollection radioMenuItemCollection rampColorPort rand randomizeFollicles randstate rangeControl readTake rebuildCurve rebuildSurface recordAttr recordDevice redo reference referenceEdit referenceQuery refineSubdivSelectionList refresh refreshAE registerPluginResource rehash reloadImage removeJoint removeMultiInstance removePanelCategory rename renameAttr renameSelectionList renameUI render renderGlobalsNode renderInfo renderLayerButton renderLayerParent renderLayerPostProcess renderLayerUnparent renderManip renderPartition renderQualityNode renderSettings renderThumbnailUpdate renderWindowEditor renderWindowSelectContext renderer reorder reorderDeformers requires reroot resampleFluid resetAE resetPfxToPolyCamera resetTool resolutionNode retarget reverseCurve reverseSurface revolve rgb_to_hsv rigidBody rigidSolver roll rollCtx rootOf rot rotate rotationInterpolation roundConstantRadius rowColumnLayout rowLayout runTimeCommand runup sampleImage saveAllShelves saveAttrPreset saveFluid saveImage saveInitialState saveMenu savePrefObjects savePrefs saveShelf saveToolSettings scale scaleBrushBrightness scaleComponents scaleConstraint scaleKey scaleKeyCtx sceneEditor sceneUIReplacement scmh scriptCtx scriptEditorInfo scriptJob scriptNode scriptTable scriptToShelf scriptedPanel scriptedPanelType scrollField scrollLayout sculpt searchPathArray seed selLoadSettings select selectContext selectCurveCV selectKey selectKeyCtx selectKeyframeRegionCtx selectMode selectPref selectPriority selectType selectedNodes selectionConnection separator setAttr setAttrEnumResource setAttrMapping setAttrNiceNameResource setConstraintRestPosition setDefaultShadingGroup setDrivenKeyframe setDynamic setEditCtx setEditor setFluidAttr setFocus setInfinity setInputDeviceMapping setKeyCtx setKeyPath setKeyframe setKeyframeBlendshapeTargetWts setMenuMode setNodeNiceNameResource setNodeTypeFlag setParent setParticleAttr setPfxToPolyCamera setPluginResource setProject setStampDensity setStartupMessage setState setToolTo setUITemplate setXformManip sets shadingConnection shadingGeometryRelCtx shadingLightRelCtx shadingNetworkCompare shadingNode shapeCompare shelfButton shelfLayout shelfTabLayout shellField shortNameOf showHelp showHidden showManipCtx showSelectionInTitle showShadingGroupAttrEditor showWindow sign simplify sin singleProfileBirailSurface size sizeBytes skinCluster skinPercent smoothCurve smoothTangentSurface smoothstep snap2to2 snapKey snapMode snapTogetherCtx snapshot soft softMod softModCtx sort sound soundControl source spaceLocator sphere sphrand spotLight spotLightPreviewPort spreadSheetEditor spring sqrt squareSurface srtContext stackTrace startString startsWith stitchAndExplodeShell stitchSurface stitchSurfacePoints strcmp stringArrayCatenate stringArrayContains stringArrayCount stringArrayInsertAtIndex stringArrayIntersector stringArrayRemove stringArrayRemoveAtIndex stringArrayRemoveDuplicates stringArrayRemoveExact stringArrayToString stringToStringArray strip stripPrefixFromName stroke subdAutoProjection subdCleanTopology subdCollapse subdDuplicateAndConnect subdEditUV subdListComponentConversion subdMapCut subdMapSewMove subdMatchTopology subdMirror subdToBlind subdToPoly subdTransferUVsToCache subdiv subdivCrease subdivDisplaySmoothness substitute substituteAllString substituteGeometry substring surface surfaceSampler surfaceShaderList swatchDisplayPort switchTable symbolButton symbolCheckBox sysFile system tabLayout tan tangentConstraint texLatticeDeformContext texManipContext texMoveContext texMoveUVShellContext texRotateContext texScaleContext texSelectContext texSelectShortestPathCtx texSmudgeUVContext texWinToolCtx text textCurves textField textFieldButtonGrp textFieldGrp textManip textScrollList textToShelf textureDisplacePlane textureHairColor texturePlacementContext textureWindow threadCount threePointArcCtx timeControl timePort timerX toNativePath toggle toggleAxis toggleWindowVisibility tokenize tokenizeList tolerance tolower toolButton toolCollection toolDropped toolHasOptions toolPropertyWindow torus toupper trace track trackCtx transferAttributes transformCompare transformLimits translator trim trunc truncateFluidCache truncateHairCache tumble tumbleCtx turbulence twoPointArcCtx uiRes uiTemplate unassignInputDevice undo undoInfo ungroup uniform unit unloadPlugin untangleUV untitledFileName untrim upAxis updateAE userCtx uvLink uvSnapshot validateShelfName vectorize view2dToolCtx viewCamera viewClipPlane viewFit viewHeadOn viewLookAt viewManip viewPlace viewSet visor volumeAxis vortex waitCursor warning webBrowser webBrowserPrefs whatIs window windowPref wire wireContext workspace wrinkle wrinkleContext writeTake xbmLangPathList xform",i:"",o={cN:"params",b:"\\([^\\(]",rB:!0,c:[{b:/\(/,e:/\)/,k:c,c:["self"].concat(r)}]};return{aliases:["coffee","cson","iced"],k:c,i:/\/\*/,c:r.concat([e.C("###","###"),e.HCM,{cN:"function",b:"^\\s*"+n+"\\s*=\\s*"+s,e:"[-=]>",rB:!0,c:[i,o]},{b:/[:\(,=]\s*/,r:0,c:[{cN:"function",b:s,e:"[-=]>",rB:!0,c:[o]}]},{cN:"class",bK:"class",e:"$",i:/[:="\[\]]/,c:[{bK:"extends",eW:!0,i:/[:="\[\]]/,c:[i]},i]},{cN:"attribute",b:n+":",e:":",rB:!0,rE:!0,r:0}])}});hljs.registerLanguage("tex",function(c){var e={cN:"command",b:"\\\\[a-zA-Zа-яА-я]+[\\*]?"},m={cN:"command",b:"\\\\[^a-zA-Zа-яА-я0-9]"},r={cN:"special",b:"[{}\\[\\]\\&#~]",r:0};return{c:[{b:"\\\\[a-zA-Zа-яА-я]+[\\*]? *= *-?\\d*\\.?\\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?",rB:!0,c:[e,m,{cN:"number",b:" *=",e:"-?\\d*\\.?\\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?",eB:!0}],r:10},e,m,r,{cN:"formula",b:"\\$\\$",e:"\\$\\$",c:[e,m,r],r:0},{cN:"formula",b:"\\$",e:"\\$",c:[e,m,r],r:0},c.C("%","$",{r:0})]}});hljs.registerLanguage("go",function(e){var t={keyword:"break default func interface select case map struct chan else goto package switch const fallthrough if range type continue for import return var go defer",constant:"true false iota nil",typename:"bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune",built_in:"append cap close complex copy imag len make new panic print println real recover delete"};return{aliases:["golang"],k:t,i:"",sL:"vbscript"}]}});hljs.registerLanguage("haskell",function(e){var c=[e.C("--","$"),e.C("{-","-}",{c:["self"]})],a={cN:"pragma",b:"{-#",e:"#-}"},i={cN:"preprocessor",b:"^#",e:"$"},n={cN:"type",b:"\\b[A-Z][\\w']*",r:0},t={cN:"container",b:"\\(",e:"\\)",i:'"',c:[a,i,{cN:"type",b:"\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?"},e.inherit(e.TM,{b:"[_a-z][\\w']*"})].concat(c)},l={cN:"container",b:"{",e:"}",c:t.c};return{aliases:["hs"],k:"let in if then else case of where do module import hiding qualified type data newtype deriving class instance as default infix infixl infixr foreign export ccall stdcall cplusplus jvm dotnet safe unsafe family forall mdo proc rec",c:[{cN:"module",b:"\\bmodule\\b",e:"where",k:"module where",c:[t].concat(c),i:"\\W\\.|;"},{cN:"import",b:"\\bimport\\b",e:"$",k:"import|0 qualified as hiding",c:[t].concat(c),i:"\\W\\.|;"},{cN:"class",b:"^(\\s*)?(class|instance)\\b",e:"where",k:"class family instance where",c:[n,t].concat(c)},{cN:"typedef",b:"\\b(data|(new)?type)\\b",e:"$",k:"data family type newtype deriving",c:[a,n,t,l].concat(c)},{cN:"default",bK:"default",e:"$",c:[n,t].concat(c)},{cN:"infix",bK:"infix infixl infixr",e:"$",c:[e.CNM].concat(c)},{cN:"foreign",b:"\\bforeign\\b",e:"$",k:"foreign import export ccall stdcall cplusplus jvm dotnet safe unsafe",c:[n,e.QSM].concat(c)},{cN:"shebang",b:"#!\\/usr\\/bin\\/env runhaskell",e:"$"},a,i,e.QSM,e.CNM,n,e.inherit(e.TM,{b:"^[_a-z][\\w']*"}),{b:"->|<-"}].concat(c)}});hljs.registerLanguage("scilab",function(e){var n=[e.CNM,{cN:"string",b:"'|\"",e:"'|\"",c:[e.BE,{b:"''"}]}];return{aliases:["sci"],k:{keyword:"abort break case clear catch continue do elseif else endfunction end for functionglobal if pause return resume select try then while%f %F %t %T %pi %eps %inf %nan %e %i %z %s",built_in:"abs and acos asin atan ceil cd chdir clearglobal cosh cos cumprod deff disp errorexec execstr exists exp eye gettext floor fprintf fread fsolve imag isdef isemptyisinfisnan isvector lasterror length load linspace list listfiles log10 log2 logmax min msprintf mclose mopen ones or pathconvert poly printf prod pwd rand realround sinh sin size gsort sprintf sqrt strcat strcmps tring sum system tanh tantype typename warning zeros matrix"},i:'("|#|/\\*|\\s+/\\w+)',c:[{cN:"function",bK:"function endfunction",e:"$",k:"function endfunction|10",c:[e.UTM,{cN:"params",b:"\\(",e:"\\)"}]},{cN:"transposed_variable",b:"[a-zA-Z_][a-zA-Z_0-9]*('+[\\.']*|[\\.']+)",e:"",r:0},{cN:"matrix",b:"\\[",e:"\\]'*[\\.']*",r:0,c:n},e.C("//","$")].concat(n)}});hljs.registerLanguage("profile",function(e){return{c:[e.CNM,{cN:"built_in",b:"{",e:"}$",eB:!0,eE:!0,c:[e.ASM,e.QSM],r:0},{cN:"filename",b:"[a-zA-Z_][\\da-zA-Z_]+\\.[\\da-zA-Z_]{1,3}",e:":",eE:!0},{cN:"header",b:"(ncalls|tottime|cumtime)",e:"$",k:"ncalls tottime|10 cumtime|10 filename",r:10},{cN:"summary",b:"function calls",e:"$",c:[e.CNM],r:10},e.ASM,e.QSM,{cN:"function",b:"\\(",e:"\\)$",c:[e.UTM],r:0}]}});hljs.registerLanguage("thrift",function(e){var t="bool byte i16 i32 i64 double string binary";return{k:{keyword:"namespace const typedef struct enum service exception void oneway set list map required optional",built_in:t,literal:"true false"},c:[e.QSM,e.NM,e.CLCM,e.CBCM,{cN:"class",bK:"struct enum service exception",e:/\{/,i:/\n/,c:[e.inherit(e.TM,{starts:{eW:!0,eE:!0}})]},{b:"\\b(set|list|map)\\s*<",e:">",k:t,c:["self"]}]}});hljs.registerLanguage("matlab",function(e){var a=[e.CNM,{cN:"string",b:"'",e:"'",c:[e.BE,{b:"''"}]}],s={r:0,c:[{cN:"operator",b:/'['\.]*/}]};return{k:{keyword:"break case catch classdef continue else elseif end enumerated events for function global if methods otherwise parfor persistent properties return spmd switch try while",built_in:"sin sind sinh asin asind asinh cos cosd cosh acos acosd acosh tan tand tanh atan atand atan2 atanh sec secd sech asec asecd asech csc cscd csch acsc acscd acsch cot cotd coth acot acotd acoth hypot exp expm1 log log1p log10 log2 pow2 realpow reallog realsqrt sqrt nthroot nextpow2 abs angle complex conj imag real unwrap isreal cplxpair fix floor ceil round mod rem sign airy besselj bessely besselh besseli besselk beta betainc betaln ellipj ellipke erf erfc erfcx erfinv expint gamma gammainc gammaln psi legendre cross dot factor isprime primes gcd lcm rat rats perms nchoosek factorial cart2sph cart2pol pol2cart sph2cart hsv2rgb rgb2hsv zeros ones eye repmat rand randn linspace logspace freqspace meshgrid accumarray size length ndims numel disp isempty isequal isequalwithequalnans cat reshape diag blkdiag tril triu fliplr flipud flipdim rot90 find sub2ind ind2sub bsxfun ndgrid permute ipermute shiftdim circshift squeeze isscalar isvector ans eps realmax realmin pi i inf nan isnan isinf isfinite j why compan gallery hadamard hankel hilb invhilb magic pascal rosser toeplitz vander wilkinson"},i:'(//|"|#|/\\*|\\s+/\\w+)',c:[{cN:"function",bK:"function",e:"$",c:[e.UTM,{cN:"params",b:"\\(",e:"\\)"},{cN:"params",b:"\\[",e:"\\]"}]},{b:/[a-zA-Z_][a-zA-Z_0-9]*'['\.]*/,rB:!0,r:0,c:[{b:/[a-zA-Z_][a-zA-Z_0-9]*/,r:0},s.c[0]]},{cN:"matrix",b:"\\[",e:"\\]",c:a,r:0,starts:s},{cN:"cell",b:"\\{",e:/}/,c:a,r:0,starts:s},{b:/\)/,r:0,starts:s},e.C("^\\s*\\%\\{\\s*$","^\\s*\\%\\}\\s*$"),e.C("\\%","$")].concat(a)}});hljs.registerLanguage("vbscript",function(e){return{aliases:["vbs"],cI:!0,k:{keyword:"call class const dim do loop erase execute executeglobal exit for each next function if then else on error option explicit new private property let get public randomize redim rem select case set stop sub while wend with end to elseif is or xor and not class_initialize class_terminate default preserve in me byval byref step resume goto",built_in:"lcase month vartype instrrev ubound setlocale getobject rgb getref string weekdayname rnd dateadd monthname now day minute isarray cbool round formatcurrency conversions csng timevalue second year space abs clng timeserial fixs len asc isempty maths dateserial atn timer isobject filter weekday datevalue ccur isdate instr datediff formatdatetime replace isnull right sgn array snumeric log cdbl hex chr lbound msgbox ucase getlocale cos cdate cbyte rtrim join hour oct typename trim strcomp int createobject loadpicture tan formatnumber mid scriptenginebuildversion scriptengine split scriptengineminorversion cint sin datepart ltrim sqr scriptenginemajorversion time derived eval date formatpercent exp inputbox left ascw chrw regexp server response request cstr err",literal:"true false null nothing empty"},i:"//",c:[e.inherit(e.QSM,{c:[{b:'""'}]}),e.C(/'/,/$/,{r:0}),e.CNM]}});hljs.registerLanguage("capnproto",function(t){return{aliases:["capnp"],k:{keyword:"struct enum interface union group import using const annotation extends in of on as with from fixed",built_in:"Void Bool Int8 Int16 Int32 Int64 UInt8 UInt16 UInt32 UInt64 Float32 Float64 Text Data AnyPointer AnyStruct Capability List",literal:"true false"},c:[t.QSM,t.NM,t.HCM,{cN:"shebang",b:/@0x[\w\d]{16};/,i:/\n/},{cN:"number",b:/@\d+\b/},{cN:"class",bK:"struct enum",e:/\{/,i:/\n/,c:[t.inherit(t.TM,{starts:{eW:!0,eE:!0}})]},{cN:"class",bK:"interface",e:/\{/,i:/\n/,c:[t.inherit(t.TM,{starts:{eW:!0,eE:!0}})]}]}});hljs.registerLanguage("xl",function(e){var t="ObjectLoader Animate MovieCredits Slides Filters Shading Materials LensFlare Mapping VLCAudioVideo StereoDecoder PointCloud NetworkAccess RemoteControl RegExp ChromaKey Snowfall NodeJS Speech Charts",o={keyword:"if then else do while until for loop import with is as where when by data constant",literal:"true false nil",type:"integer real text name boolean symbol infix prefix postfix block tree",built_in:"in mod rem and or xor not abs sign floor ceil sqrt sin cos tan asin acos atan exp expm1 log log2 log10 log1p pi at",module:t,id:"text_length text_range text_find text_replace contains page slide basic_slide title_slide title subtitle fade_in fade_out fade_at clear_color color line_color line_width texture_wrap texture_transform texture scale_?x scale_?y scale_?z? translate_?x translate_?y translate_?z? rotate_?x rotate_?y rotate_?z? rectangle circle ellipse sphere path line_to move_to quad_to curve_to theme background contents locally time mouse_?x mouse_?y mouse_buttons"},a={cN:"constant",b:"[A-Z][A-Z_0-9]+",r:0},r={cN:"variable",b:"([A-Z][a-z_0-9]+)+",r:0},i={cN:"id",b:"[a-z][a-z_0-9]+",r:0},l={cN:"string",b:'"',e:'"',i:"\\n"},n={cN:"string",b:"'",e:"'",i:"\\n"},s={cN:"string",b:"<<",e:">>"},c={cN:"number",b:"[0-9]+#[0-9A-Z_]+(\\.[0-9-A-Z_]+)?#?([Ee][+-]?[0-9]+)?",r:10},_={cN:"import",bK:"import",e:"$",k:{keyword:"import",module:t},r:0,c:[l]},d={cN:"function",b:"[a-z].*->"};return{aliases:["tao"],l:/[a-zA-Z][a-zA-Z0-9_?]*/,k:o,c:[e.CLCM,e.CBCM,l,n,s,d,_,a,r,i,c,e.NM]}});hljs.registerLanguage("scala",function(e){var t={cN:"annotation",b:"@[A-Za-z]+"},a={cN:"string",b:'u?r?"""',e:'"""',r:10},r={cN:"symbol",b:"'\\w[\\w\\d_]*(?!')"},c={cN:"type",b:"\\b[A-Z][A-Za-z0-9_]*",r:0},i={cN:"title",b:/[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/,r:0},l={cN:"class",bK:"class object trait type",e:/[:={\[(\n;]/,c:[{cN:"keyword",bK:"extends with",r:10},i]},n={cN:"function",bK:"def val",e:/[:={\[(\n;]/,c:[i]};return{k:{literal:"true false null",keyword:"type yield lazy override def with val var sealed abstract private trait object if forSome for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit"},c:[e.CLCM,e.CBCM,a,e.QSM,r,c,n,l,e.CNM,t]}});hljs.registerLanguage("elixir",function(e){var n="[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?",r="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",b="and false then defined module in return redo retry end for true self when next until do begin unless nil break not case cond alias while ensure or include use alias fn quote",c={cN:"subst",b:"#\\{",e:"}",l:n,k:b},a={cN:"string",c:[e.BE,c],v:[{b:/'/,e:/'/},{b:/"/,e:/"/}]},i={cN:"function",bK:"def defp defmacro",e:/\B\b/,c:[e.inherit(e.TM,{b:n,endsParent:!0})]},s=e.inherit(i,{cN:"class",bK:"defmodule defrecord",e:/\bdo\b|$|;/}),l=[a,e.HCM,s,i,{cN:"constant",b:"(\\b[A-Z_]\\w*(.)?)+",r:0},{cN:"symbol",b:":",c:[a,{b:r}],r:0},{cN:"symbol",b:n+":",r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"->"},{b:"("+e.RSR+")\\s*",c:[e.HCM,{cN:"regexp",i:"\\n",c:[e.BE,c],v:[{b:"/",e:"/[a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}],r:0}];return c.c=l,{l:n,k:b,c:l}});hljs.registerLanguage("sml",function(e){return{aliases:["ml"],k:{keyword:"abstype and andalso as case datatype do else end eqtype exception fn fun functor handle if in include infix infixr let local nonfix of op open orelse raise rec sharing sig signature struct structure then type val with withtype where while",built_in:"array bool char exn int list option order real ref string substring vector unit word",literal:"true false NONE SOME LESS EQUAL GREATER nil"},i:/\/\/|>>/,l:"[a-z_]\\w*!?",c:[{cN:"literal",b:"\\[(\\|\\|)?\\]|\\(\\)"},e.C("\\(\\*","\\*\\)",{c:["self"]}),{cN:"symbol",b:"'[A-Za-z_](?!')[\\w']*"},{cN:"tag",b:"`[A-Z][\\w']*"},{cN:"type",b:"\\b[A-Z][\\w']*",r:0},{b:"[a-z_]\\w*'[\\w']*"},e.inherit(e.ASM,{cN:"char",r:0}),e.inherit(e.QSM,{i:null}),{cN:"number",b:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",r:0},{b:/[-=]>/}]}});hljs.registerLanguage("apache",function(e){var r={cN:"number",b:"[\\$%]\\d+"};return{aliases:["apacheconf"],cI:!0,c:[e.HCM,{cN:"tag",b:""},{cN:"keyword",b:/\w+/,r:0,k:{common:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{e:/$/,r:0,k:{literal:"on off all"},c:[{cN:"sqbracket",b:"\\s\\[",e:"\\]$"},{cN:"cbracket",b:"[\\$%]\\{",e:"\\}",c:["self",r]},r,e.QSM]}}],i:/\S/}});hljs.registerLanguage("dockerfile",function(n){return{aliases:["docker"],cI:!0,k:{built_ins:"from maintainer cmd expose add copy entrypoint volume user workdir onbuild run env"},c:[n.HCM,{k:{built_in:"run cmd entrypoint volume add copy workdir onbuild"},b:/^ *(onbuild +)?(run|cmd|entrypoint|volume|add|copy|workdir) +/,starts:{e:/[^\\]\n/,sL:"bash",subLanguageMode:"continuous"}},{k:{built_in:"from maintainer expose env user onbuild"},b:/^ *(onbuild +)?(from|maintainer|expose|env|user|onbuild) +/,e:/[^\\]\n/,c:[n.ASM,n.QSM,n.NM,n.HCM]}]}});hljs.registerLanguage("markdown",function(e){return{aliases:["md","mkdown","mkd"],c:[{cN:"header",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"blockquote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"`.+?`"},{b:"^( {4}| )",e:"$",r:0}]},{cN:"horizontal_rule",b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].*?[\\)\\]]",rB:!0,c:[{cN:"link_label",b:"\\[",e:"\\]",eB:!0,rE:!0,r:0},{cN:"link_url",b:"\\]\\(",e:"\\)",eB:!0,eE:!0},{cN:"link_reference",b:"\\]\\[",e:"\\]",eB:!0,eE:!0}],r:10},{b:"^\\[.+\\]:",rB:!0,c:[{cN:"link_reference",b:"\\[",e:"\\]:",eB:!0,eE:!0,starts:{cN:"link_url",e:"$"}}]}]}});hljs.registerLanguage("haml",function(s){return{cI:!0,c:[{cN:"doctype",b:"^!!!( (5|1\\.1|Strict|Frameset|Basic|Mobile|RDFa|XML\\b.*))?$",r:10},s.C("^\\s*(!=#|=#|-#|/).*$",!1,{r:0}),{b:"^\\s*(-|=|!=)(?!#)",starts:{e:"\\n",sL:"ruby"}},{cN:"tag",b:"^\\s*%",c:[{cN:"title",b:"\\w+"},{cN:"value",b:"[#\\.]\\w+"},{b:"{\\s*",e:"\\s*}",eE:!0,c:[{b:":\\w+\\s*=>",e:",\\s+",rB:!0,eW:!0,c:[{cN:"symbol",b:":\\w+"},{cN:"string",b:'"',e:'"'},{cN:"string",b:"'",e:"'"},{b:"\\w+",r:0}]}]},{b:"\\(\\s*",e:"\\s*\\)",eE:!0,c:[{b:"\\w+\\s*=",e:"\\s+",rB:!0,eW:!0,c:[{cN:"attribute",b:"\\w+",r:0},{cN:"string",b:'"',e:'"'},{cN:"string",b:"'",e:"'"},{b:"\\w+",r:0}]}]}]},{cN:"bullet",b:"^\\s*[=~]\\s*",r:0},{b:"#{",starts:{e:"}",sL:"ruby"}}]}});hljs.registerLanguage("fortran",function(e){var t={cN:"params",b:"\\(",e:"\\)"},n={constant:".False. .True.",type:"integer real character complex logical dimension allocatable|10 parameter external implicit|10 none double precision assign intent optional pointer target in out common equivalence data",keyword:"kind do while private call intrinsic where elsewhere type endtype endmodule endselect endinterface end enddo endif if forall endforall only contains default return stop then public subroutine|10 function program .and. .or. .not. .le. .eq. .ge. .gt. .lt. goto save else use module select case access blank direct exist file fmt form formatted iostat name named nextrec number opened rec recl sequential status unformatted unit continue format pause cycle exit c_null_char c_alert c_backspace c_form_feed flush wait decimal round iomsg synchronous nopass non_overridable pass protected volatile abstract extends import non_intrinsic value deferred generic final enumerator class associate bind enum c_int c_short c_long c_long_long c_signed_char c_size_t c_int8_t c_int16_t c_int32_t c_int64_t c_int_least8_t c_int_least16_t c_int_least32_t c_int_least64_t c_int_fast8_t c_int_fast16_t c_int_fast32_t c_int_fast64_t c_intmax_t C_intptr_t c_float c_double c_long_double c_float_complex c_double_complex c_long_double_complex c_bool c_char c_null_ptr c_null_funptr c_new_line c_carriage_return c_horizontal_tab c_vertical_tab iso_c_binding c_loc c_funloc c_associated c_f_pointer c_ptr c_funptr iso_fortran_env character_storage_size error_unit file_storage_size input_unit iostat_end iostat_eor numeric_storage_size output_unit c_f_procpointer ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode newunit contiguous pad position action delim readwrite eor advance nml interface procedure namelist include sequence elemental pure",built_in:"alog alog10 amax0 amax1 amin0 amin1 amod cabs ccos cexp clog csin csqrt dabs dacos dasin datan datan2 dcos dcosh ddim dexp dint dlog dlog10 dmax1 dmin1 dmod dnint dsign dsin dsinh dsqrt dtan dtanh float iabs idim idint idnint ifix isign max0 max1 min0 min1 sngl algama cdabs cdcos cdexp cdlog cdsin cdsqrt cqabs cqcos cqexp cqlog cqsin cqsqrt dcmplx dconjg derf derfc dfloat dgamma dimag dlgama iqint qabs qacos qasin qatan qatan2 qcmplx qconjg qcos qcosh qdim qerf qerfc qexp qgamma qimag qlgama qlog qlog10 qmax1 qmin1 qmod qnint qsign qsin qsinh qsqrt qtan qtanh abs acos aimag aint anint asin atan atan2 char cmplx conjg cos cosh exp ichar index int log log10 max min nint sign sin sinh sqrt tan tanh print write dim lge lgt lle llt mod nullify allocate deallocate adjustl adjustr all allocated any associated bit_size btest ceiling count cshift date_and_time digits dot_product eoshift epsilon exponent floor fraction huge iand ibclr ibits ibset ieor ior ishft ishftc lbound len_trim matmul maxexponent maxloc maxval merge minexponent minloc minval modulo mvbits nearest pack present product radix random_number random_seed range repeat reshape rrspacing scale scan selected_int_kind selected_real_kind set_exponent shape size spacing spread sum system_clock tiny transpose trim ubound unpack verify achar iachar transfer dble entry dprod cpu_time command_argument_count get_command get_command_argument get_environment_variable is_iostat_end ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode is_iostat_eor move_alloc new_line selected_char_kind same_type_as extends_type_ofacosh asinh atanh bessel_j0 bessel_j1 bessel_jn bessel_y0 bessel_y1 bessel_yn erf erfc erfc_scaled gamma log_gamma hypot norm2 atomic_define atomic_ref execute_command_line leadz trailz storage_size merge_bits bge bgt ble blt dshiftl dshiftr findloc iall iany iparity image_index lcobound ucobound maskl maskr num_images parity popcnt poppar shifta shiftl shiftr this_image"};return{cI:!0,aliases:["f90","f95"],k:n,c:[e.inherit(e.ASM,{cN:"string",r:0}),e.inherit(e.QSM,{cN:"string",r:0}),{cN:"function",bK:"subroutine function program",i:"[${=\\n]",c:[e.UTM,t]},e.C("!","$",{r:0}),{cN:"number",b:"(?=\\b|\\+|\\-|\\.)(?=\\.\\d|\\d)(?:\\d+)?(?:\\.?\\d*)(?:[de][+-]?\\d+)?\\b\\.?",r:0}]}});hljs.registerLanguage("smali",function(r){var t=["add","and","cmp","cmpg","cmpl","const","div","double","float","goto","if","int","long","move","mul","neg","new","nop","not","or","rem","return","shl","shr","sput","sub","throw","ushr","xor"],n=["aget","aput","array","check","execute","fill","filled","goto/16","goto/32","iget","instance","invoke","iput","monitor","packed","sget","sparse"],s=["transient","constructor","abstract","final","synthetic","public","private","protected","static","bridge","system"];return{aliases:["smali"],c:[{cN:"string",b:'"',e:'"',r:0},r.C("#","$",{r:0}),{cN:"keyword",b:"\\s*\\.end\\s[a-zA-Z0-9]*",r:1},{cN:"keyword",b:"^[ ]*\\.[a-zA-Z]*",r:0},{cN:"keyword",b:"\\s:[a-zA-Z_0-9]*",r:0},{cN:"keyword",b:"\\s("+s.join("|")+")",r:1},{cN:"keyword",b:"\\[",r:0},{cN:"instruction",b:"\\s("+t.join("|")+")\\s",r:1},{cN:"instruction",b:"\\s("+t.join("|")+")((\\-|/)[a-zA-Z0-9]+)+\\s",r:10},{cN:"instruction",b:"\\s("+n.join("|")+")((\\-|/)[a-zA-Z0-9]+)*\\s",r:10},{cN:"class",b:"L[^(;:\n]*;",r:0},{cN:"function",b:'( |->)[^(\n ;"]*\\(',r:0},{cN:"function",b:"\\)",r:0},{cN:"variable",b:"[vp][0-9]+",r:0}]}});hljs.registerLanguage("julia",function(r){var e={keyword:"in abstract baremodule begin bitstype break catch ccall const continue do else elseif end export finally for function global if immutable import importall let local macro module quote return try type typealias using while",literal:"true false ANY ARGS CPU_CORES C_NULL DL_LOAD_PATH DevNull ENDIAN_BOM ENV I|0 Inf Inf16 Inf32 InsertionSort JULIA_HOME LOAD_PATH MS_ASYNC MS_INVALIDATE MS_SYNC MergeSort NaN NaN16 NaN32 OS_NAME QuickSort RTLD_DEEPBIND RTLD_FIRST RTLD_GLOBAL RTLD_LAZY RTLD_LOCAL RTLD_NODELETE RTLD_NOLOAD RTLD_NOW RoundDown RoundFromZero RoundNearest RoundToZero RoundUp STDERR STDIN STDOUT VERSION WORD_SIZE catalan cglobal e eu eulergamma golden im nothing pi γ π φ",built_in:"ASCIIString AbstractArray AbstractRNG AbstractSparseArray Any ArgumentError Array Associative Base64Pipe Bidiagonal BigFloat BigInt BitArray BitMatrix BitVector Bool BoundsError Box CFILE Cchar Cdouble Cfloat Char CharString Cint Clong Clonglong ClusterManager Cmd Coff_t Colon Complex Complex128 Complex32 Complex64 Condition Cptrdiff_t Cshort Csize_t Cssize_t Cuchar Cuint Culong Culonglong Cushort Cwchar_t DArray DataType DenseArray Diagonal Dict DimensionMismatch DirectIndexString Display DivideError DomainError EOFError EachLine Enumerate ErrorException Exception Expr Factorization FileMonitor FileOffset Filter Float16 Float32 Float64 FloatRange FloatingPoint Function GetfieldNode GotoNode Hermitian IO IOBuffer IOStream IPv4 IPv6 InexactError Int Int128 Int16 Int32 Int64 Int8 IntSet Integer InterruptException IntrinsicFunction KeyError LabelNode LambdaStaticData LineNumberNode LoadError LocalProcess MIME MathConst MemoryError MersenneTwister Method MethodError MethodTable Module NTuple NewvarNode Nothing Number ObjectIdDict OrdinalRange OverflowError ParseError PollingFileWatcher ProcessExitedException ProcessGroup Ptr QuoteNode Range Range1 Ranges Rational RawFD Real Regex RegexMatch RemoteRef RepString RevString RopeString RoundingMode Set SharedArray Signed SparseMatrixCSC StackOverflowError Stat StatStruct StepRange String SubArray SubString SymTridiagonal Symbol SymbolNode Symmetric SystemError Task TextDisplay Timer TmStruct TopNode Triangular Tridiagonal Type TypeConstructor TypeError TypeName TypeVar UTF16String UTF32String UTF8String UdpSocket Uint Uint128 Uint16 Uint32 Uint64 Uint8 UndefRefError UndefVarError UniformScaling UnionType UnitRange Unsigned Vararg VersionNumber WString WeakKeyDict WeakRef Woodbury Zip"},t="[A-Za-z_\\u00A1-\\uFFFF][A-Za-z_0-9\\u00A1-\\uFFFF]*",o={l:t,k:e},n={cN:"type-annotation",b:/::/},a={cN:"subtype",b:/<:/},i={cN:"number",b:/(\b0x[\d_]*(\.[\d_]*)?|0x\.\d[\d_]*)p[-+]?\d+|\b0[box][a-fA-F0-9][a-fA-F0-9_]*|(\b\d[\d_]*(\.[\d_]*)?|\.\d[\d_]*)([eEfF][-+]?\d+)?/,r:0},l={cN:"char",b:/'(.|\\[xXuU][a-zA-Z0-9]+)'/},c={cN:"subst",b:/\$\(/,e:/\)/,k:e},u={cN:"variable",b:"\\$"+t},d={cN:"string",c:[r.BE,c,u],v:[{b:/\w*"/,e:/"\w*/},{b:/\w*"""/,e:/"""\w*/}]},g={cN:"string",c:[r.BE,c,u],b:"`",e:"`"},s={cN:"macrocall",b:"@"+t},S={cN:"comment",v:[{b:"#=",e:"=#",r:10},{b:"#",e:"$"}]};return o.c=[i,l,n,a,d,g,s,S,r.HCM],c.c=o.c,o});hljs.registerLanguage("delphi",function(e){var r="exports register file shl array record property for mod while set ally label uses raise not stored class safecall var interface or private static exit index inherited to else stdcall override shr asm far resourcestring finalization packed virtual out and protected library do xorwrite goto near function end div overload object unit begin string on inline repeat until destructor write message program with read initialization except default nil if case cdecl in downto threadvar of try pascal const external constructor type public then implementation finally published procedure",t=[e.CLCM,e.C(/\{/,/\}/,{r:0}),e.C(/\(\*/,/\*\)/,{r:10})],i={cN:"string",b:/'/,e:/'/,c:[{b:/''/}]},c={cN:"string",b:/(#\d+)+/},o={b:e.IR+"\\s*=\\s*class\\s*\\(",rB:!0,c:[e.TM]},n={cN:"function",bK:"function constructor destructor procedure",e:/[:;]/,k:"function constructor|10 destructor|10 procedure|10",c:[e.TM,{cN:"params",b:/\(/,e:/\)/,k:r,c:[i,c]}].concat(t)};return{cI:!0,k:r,i:/"|\$[G-Zg-z]|\/\*|<\/|\|/,c:[i,c,e.NM,o,n].concat(t)}});hljs.registerLanguage("brainfuck",function(r){var n={cN:"literal",b:"[\\+\\-]",r:0};return{aliases:["bf"],c:[r.C("[^\\[\\]\\.,\\+\\-<> \r\n]","[\\[\\]\\.,\\+\\-<> \r\n]",{rE:!0,r:0}),{cN:"title",b:"[\\[\\]]",r:0},{cN:"string",b:"[\\.,]",r:0},{b:/\+\+|\-\-/,rB:!0,c:[n]},n]}});hljs.registerLanguage("ini",function(e){return{cI:!0,i:/\S/,c:[e.C(";","$"),{cN:"title",b:"^\\[",e:"\\]"},{cN:"setting",b:"^[a-z0-9\\[\\]_-]+[ \\t]*=[ \\t]*",e:"$",c:[{cN:"value",eW:!0,k:"on off true false yes no",c:[e.QSM,e.NM],r:0}]}]}});hljs.registerLanguage("json",function(e){var t={literal:"true false null"},i=[e.QSM,e.CNM],l={cN:"value",e:",",eW:!0,eE:!0,c:i,k:t},c={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:!0,eE:!0,c:[e.BE],i:"\\n",starts:l}],i:"\\S"},n={b:"\\[",e:"\\]",c:[e.inherit(l,{cN:null})],i:"\\S"};return i.splice(i.length,0,c,n),{c:i,k:t,i:"\\S"}});hljs.registerLanguage("powershell",function(e){var t={b:"`[\\s\\S]",r:0},r={cN:"variable",v:[{b:/\$[\w\d][\w\d_:]*/}]},o={cN:"string",b:/"/,e:/"/,c:[t,r,{cN:"variable",b:/\$[A-z]/,e:/[^A-z]/}]},a={cN:"string",b:/'/,e:/'/};return{aliases:["ps"],l:/-?[A-z\.\-]+/,cI:!0,k:{keyword:"if else foreach return function do while until elseif begin for trap data dynamicparam end break throw param continue finally in switch exit filter try process catch",literal:"$null $true $false",built_in:"Add-Content Add-History Add-Member Add-PSSnapin Clear-Content Clear-Item Clear-Item Property Clear-Variable Compare-Object ConvertFrom-SecureString Convert-Path ConvertTo-Html ConvertTo-SecureString Copy-Item Copy-ItemProperty Export-Alias Export-Clixml Export-Console Export-Csv ForEach-Object Format-Custom Format-List Format-Table Format-Wide Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command Get-Content Get-Credential Get-Culture Get-Date Get-EventLog Get-ExecutionPolicy Get-Help Get-History Get-Host Get-Item Get-ItemProperty Get-Location Get-Member Get-PfxCertificate Get-Process Get-PSDrive Get-PSProvider Get-PSSnapin Get-Service Get-TraceSource Get-UICulture Get-Unique Get-Variable Get-WmiObject Group-Object Import-Alias Import-Clixml Import-Csv Invoke-Expression Invoke-History Invoke-Item Join-Path Measure-Command Measure-Object Move-Item Move-ItemProperty New-Alias New-Item New-ItemProperty New-Object New-PSDrive New-Service New-TimeSpan New-Variable Out-Default Out-File Out-Host Out-Null Out-Printer Out-String Pop-Location Push-Location Read-Host Remove-Item Remove-ItemProperty Remove-PSDrive Remove-PSSnapin Remove-Variable Rename-Item Rename-ItemProperty Resolve-Path Restart-Service Resume-Service Select-Object Select-String Set-Acl Set-Alias Set-AuthenticodeSignature Set-Content Set-Date Set-ExecutionPolicy Set-Item Set-ItemProperty Set-Location Set-PSDebug Set-Service Set-TraceSource Set-Variable Sort-Object Split-Path Start-Service Start-Sleep Start-Transcript Stop-Process Stop-Service Stop-Transcript Suspend-Service Tee-Object Test-Path Trace-Command Update-FormatData Update-TypeData Where-Object Write-Debug Write-Error Write-Host Write-Output Write-Progress Write-Verbose Write-Warning",operator:"-ne -eq -lt -gt -ge -le -not -like -notlike -match -notmatch -contains -notcontains -in -notin -replace"},c:[e.HCM,e.NM,o,a,r]}});hljs.registerLanguage("gradle",function(e){return{cI:!0,k:{keyword:"task project allprojects subprojects artifacts buildscript configurations dependencies repositories sourceSets description delete from into include exclude source classpath destinationDir includes options sourceCompatibility targetCompatibility group flatDir doLast doFirst flatten todir fromdir ant def abstract break case catch continue default do else extends final finally for if implements instanceof native new private protected public return static switch synchronized throw throws transient try volatile while strictfp package import false null super this true antlrtask checkstyle codenarc copy boolean byte char class double float int interface long short void compile runTime file fileTree abs any append asList asWritable call collect compareTo count div dump each eachByte eachFile eachLine every find findAll flatten getAt getErr getIn getOut getText grep immutable inject inspect intersect invokeMethods isCase join leftShift minus multiply newInputStream newOutputStream newPrintWriter newReader newWriter next plus pop power previous print println push putAt read readBytes readLines reverse reverseEach round size sort splitEachLine step subMap times toInteger toList tokenize upto waitForOrKill withPrintWriter withReader withStream withWriter withWriterAppend write writeLine"},c:[e.CLCM,e.CBCM,e.ASM,e.QSM,e.NM,e.RM]}});hljs.registerLanguage("erb",function(e){return{sL:"xml",subLanguageMode:"continuous",c:[e.C("<%#","%>"),{b:"<%[%=-]?",e:"[%-]?%>",sL:"ruby",eB:!0,eE:!0}]}});hljs.registerLanguage("swift",function(e){var i={keyword:"class deinit enum extension func import init let protocol static struct subscript typealias var break case continue default do else fallthrough if in for return switch where while as dynamicType is new super self Self Type __COLUMN__ __FILE__ __FUNCTION__ __LINE__ associativity didSet get infix inout left mutating none nonmutating operator override postfix precedence prefix right set unowned unowned safe unsafe weak willSet",literal:"true false nil",built_in:"abs advance alignof alignofValue assert bridgeFromObjectiveC bridgeFromObjectiveCUnconditional bridgeToObjectiveC bridgeToObjectiveCUnconditional c contains count countElements countLeadingZeros debugPrint debugPrintln distance dropFirst dropLast dump encodeBitsAsWords enumerate equal false filter find getBridgedObjectiveCType getVaList indices insertionSort isBridgedToObjectiveC isBridgedVerbatimToObjectiveC isUniquelyReferenced join lexicographicalCompare map max maxElement min minElement nil numericCast partition posix print println quickSort reduce reflect reinterpretCast reverse roundUpToAlignment sizeof sizeofValue sort split startsWith strideof strideofValue swap swift toString transcode true underestimateCount unsafeReflect withExtendedLifetime withObjectAtPlusZero withUnsafePointer withUnsafePointerToObject withUnsafePointers withVaList"},t={cN:"type",b:"\\b[A-Z][\\w']*",r:0},n=e.C("/\\*","\\*/",{c:["self"]}),r={cN:"subst",b:/\\\(/,e:"\\)",k:i,c:[]},s={cN:"number",b:"\\b([\\d_]+(\\.[\\deE_]+)?|0x[a-fA-F0-9_]+(\\.[a-fA-F0-9p_]+)?|0b[01_]+|0o[0-7_]+)\\b",r:0},o=e.inherit(e.QSM,{c:[r,e.BE]});return r.c=[s],{k:i,c:[o,e.CLCM,n,t,s,{cN:"func",bK:"func",e:"{",eE:!0,c:[e.inherit(e.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/,i:/\(/}),{cN:"generics",b://,i:/>/},{cN:"params",b:/\(/,e:/\)/,endsParent:!0,k:i,c:["self",s,o,e.CBCM,{b:":"}],i:/["']/}],i:/\[|%/},{cN:"class",bK:"struct protocol class extension enum",k:i,e:"\\{",eE:!0,c:[e.inherit(e.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/})]},{cN:"preprocessor",b:"(@assignment|@class_protocol|@exported|@final|@lazy|@noreturn|@NSCopying|@NSManaged|@objc|@optional|@required|@auto_closure|@noreturn|@IBAction|@IBDesignable|@IBInspectable|@IBOutlet|@infix|@prefix|@postfix)"}]}});hljs.registerLanguage("lisp",function(b){var e="[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#!]*",c="\\|[^]*?\\|",r="(\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s|D|E|F|L|S)(\\+|\\-)?\\d+)?",a={cN:"shebang",b:"^#!",e:"$"},i={cN:"literal",b:"\\b(t{1}|nil)\\b"},l={cN:"number",v:[{b:r,r:0},{b:"#(b|B)[0-1]+(/[0-1]+)?"},{b:"#(o|O)[0-7]+(/[0-7]+)?"},{b:"#(x|X)[0-9a-fA-F]+(/[0-9a-fA-F]+)?"},{b:"#(c|C)\\("+r+" +"+r,e:"\\)"}]},t=b.inherit(b.QSM,{i:null}),d=b.C(";","$",{r:0}),n={cN:"variable",b:"\\*",e:"\\*"},u={cN:"keyword",b:"[:&]"+e},N={b:e,r:0},o={b:c},s={b:"\\(",e:"\\)",c:["self",i,t,l,N]},v={cN:"quoted",c:[l,t,n,u,s,N],v:[{b:"['`]\\(",e:"\\)"},{b:"\\(quote ",e:"\\)",k:"quote"},{b:"'"+c}]},f={cN:"quoted",v:[{b:"'"+e},{b:"#'"+e+"(::"+e+")*"}]},g={cN:"list",b:"\\(\\s*",e:"\\)"},q={eW:!0,r:0};return g.c=[{cN:"keyword",v:[{b:e},{b:c}]},q],q.c=[v,f,g,i,l,t,d,n,u,o,N],{i:/\S/,c:[l,a,i,t,d,v,f,g,N]}});hljs.registerLanguage("rsl",function(e){return{k:{keyword:"float color point normal vector matrix while for if do return else break extern continue",built_in:"abs acos ambient area asin atan atmosphere attribute calculatenormal ceil cellnoise clamp comp concat cos degrees depth Deriv diffuse distance Du Dv environment exp faceforward filterstep floor format fresnel incident length lightsource log match max min mod noise normalize ntransform opposite option phong pnoise pow printf ptlined radians random reflect refract renderinfo round setcomp setxcomp setycomp setzcomp shadow sign sin smoothstep specular specularbrdf spline sqrt step tan texture textureinfo trace transform vtransform xcomp ycomp zcomp"},i:" > >= ` abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string=? string>? string? substring symbol->string symbol? tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"},n={cN:"shebang",b:"^#!",e:"$"},c={cN:"literal",b:"(#t|#f|#\\\\"+t+"|#\\\\.)"},l={cN:"number",v:[{b:r,r:0},{b:i,r:0},{b:"#b[0-1]+(/[0-1]+)?"},{b:"#o[0-7]+(/[0-7]+)?"},{b:"#x[0-9a-f]+(/[0-9a-f]+)?"}]},s=e.QSM,o=[e.C(";","$",{r:0}),e.C("#\\|","\\|#")],u={b:t,r:0},p={cN:"variable",b:"'"+t},d={eW:!0,r:0},g={cN:"list",v:[{b:"\\(",e:"\\)"},{b:"\\[",e:"\\]"}],c:[{cN:"keyword",b:t,l:t,k:a},d]};return d.c=[c,l,s,u,p,g].concat(o),{i:/\S/,c:[n,l,s,p,g].concat(o)}});hljs.registerLanguage("stata",function(e){return{aliases:["do","ado"],cI:!0,k:"if else in foreach for forv forva forval forvalu forvalue forvalues by bys bysort xi quietly qui capture about ac ac_7 acprplot acprplot_7 adjust ado adopath adoupdate alpha ameans an ano anov anova anova_estat anova_terms anovadef aorder ap app appe appen append arch arch_dr arch_estat arch_p archlm areg areg_p args arima arima_dr arima_estat arima_p as asmprobit asmprobit_estat asmprobit_lf asmprobit_mfx__dlg asmprobit_p ass asse asser assert avplot avplot_7 avplots avplots_7 bcskew0 bgodfrey binreg bip0_lf biplot bipp_lf bipr_lf bipr_p biprobit bitest bitesti bitowt blogit bmemsize boot bootsamp bootstrap bootstrap_8 boxco_l boxco_p boxcox boxcox_6 boxcox_p bprobit br break brier bro brow brows browse brr brrstat bs bs_7 bsampl_w bsample bsample_7 bsqreg bstat bstat_7 bstat_8 bstrap bstrap_7 ca ca_estat ca_p cabiplot camat canon canon_8 canon_8_p canon_estat canon_p cap caprojection capt captu captur capture cat cc cchart cchart_7 cci cd censobs_table centile cf char chdir checkdlgfiles checkestimationsample checkhlpfiles checksum chelp ci cii cl class classutil clear cli clis clist clo clog clog_lf clog_p clogi clogi_sw clogit clogit_lf clogit_p clogitp clogl_sw cloglog clonevar clslistarray cluster cluster_measures cluster_stop cluster_tree cluster_tree_8 clustermat cmdlog cnr cnre cnreg cnreg_p cnreg_sw cnsreg codebook collaps4 collapse colormult_nb colormult_nw compare compress conf confi confir confirm conren cons const constr constra constrai constrain constraint continue contract copy copyright copysource cor corc corr corr2data corr_anti corr_kmo corr_smc corre correl correla correlat correlate corrgram cou coun count cox cox_p cox_sw coxbase coxhaz coxvar cprplot cprplot_7 crc cret cretu cretur creturn cross cs cscript cscript_log csi ct ct_is ctset ctst_5 ctst_st cttost cumsp cumsp_7 cumul cusum cusum_7 cutil d datasig datasign datasigna datasignat datasignatu datasignatur datasignature datetof db dbeta de dec deco decod decode deff des desc descr descri describ describe destring dfbeta dfgls dfuller di di_g dir dirstats dis discard disp disp_res disp_s displ displa display distinct do doe doed doedi doedit dotplot dotplot_7 dprobit drawnorm drop ds ds_util dstdize duplicates durbina dwstat dydx e ed edi edit egen eivreg emdef en enc enco encod encode eq erase ereg ereg_lf ereg_p ereg_sw ereghet ereghet_glf ereghet_glf_sh ereghet_gp ereghet_ilf ereghet_ilf_sh ereghet_ip eret eretu eretur ereturn err erro error est est_cfexist est_cfname est_clickable est_expand est_hold est_table est_unhold est_unholdok estat estat_default estat_summ estat_vce_only esti estimates etodow etof etomdy ex exi exit expand expandcl fac fact facto factor factor_estat factor_p factor_pca_rotated factor_rotate factormat fcast fcast_compute fcast_graph fdades fdadesc fdadescr fdadescri fdadescrib fdadescribe fdasav fdasave fdause fh_st file open file read file close file filefilter fillin find_hlp_file findfile findit findit_7 fit fl fli flis flist for5_0 form forma format fpredict frac_154 frac_adj frac_chk frac_cox frac_ddp frac_dis frac_dv frac_in frac_mun frac_pp frac_pq frac_pv frac_wgt frac_xo fracgen fracplot fracplot_7 fracpoly fracpred fron_ex fron_hn fron_p fron_tn fron_tn2 frontier ftodate ftoe ftomdy ftowdate g gamhet_glf gamhet_gp gamhet_ilf gamhet_ip gamma gamma_d2 gamma_p gamma_sw gammahet gdi_hexagon gdi_spokes ge gen gene gener genera generat generate genrank genstd genvmean gettoken gl gladder gladder_7 glim_l01 glim_l02 glim_l03 glim_l04 glim_l05 glim_l06 glim_l07 glim_l08 glim_l09 glim_l10 glim_l11 glim_l12 glim_lf glim_mu glim_nw1 glim_nw2 glim_nw3 glim_p glim_v1 glim_v2 glim_v3 glim_v4 glim_v5 glim_v6 glim_v7 glm glm_6 glm_p glm_sw glmpred glo glob globa global glogit glogit_8 glogit_p gmeans gnbre_lf gnbreg gnbreg_5 gnbreg_p gomp_lf gompe_sw gomper_p gompertz gompertzhet gomphet_glf gomphet_glf_sh gomphet_gp gomphet_ilf gomphet_ilf_sh gomphet_ip gphdot gphpen gphprint gprefs gprobi_p gprobit gprobit_8 gr gr7 gr_copy gr_current gr_db gr_describe gr_dir gr_draw gr_draw_replay gr_drop gr_edit gr_editviewopts gr_example gr_example2 gr_export gr_print gr_qscheme gr_query gr_read gr_rename gr_replay gr_save gr_set gr_setscheme gr_table gr_undo gr_use graph graph7 grebar greigen greigen_7 greigen_8 grmeanby grmeanby_7 gs_fileinfo gs_filetype gs_graphinfo gs_stat gsort gwood h hadimvo hareg hausman haver he heck_d2 heckma_p heckman heckp_lf heckpr_p heckprob hel help hereg hetpr_lf hetpr_p hetprob hettest hexdump hilite hist hist_7 histogram hlogit hlu hmeans hotel hotelling hprobit hreg hsearch icd9 icd9_ff icd9p iis impute imtest inbase include inf infi infil infile infix inp inpu input ins insheet insp inspe inspec inspect integ inten intreg intreg_7 intreg_p intrg2_ll intrg_ll intrg_ll2 ipolate iqreg ir irf irf_create irfm iri is_svy is_svysum isid istdize ivprob_1_lf ivprob_lf ivprobit ivprobit_p ivreg ivreg_footnote ivtob_1_lf ivtob_lf ivtobit ivtobit_p jackknife jacknife jknife jknife_6 jknife_8 jkstat joinby kalarma1 kap kap_3 kapmeier kappa kapwgt kdensity kdensity_7 keep ksm ksmirnov ktau kwallis l la lab labe label labelbook ladder levels levelsof leverage lfit lfit_p li lincom line linktest lis list lloghet_glf lloghet_glf_sh lloghet_gp lloghet_ilf lloghet_ilf_sh lloghet_ip llogi_sw llogis_p llogist llogistic llogistichet lnorm_lf lnorm_sw lnorma_p lnormal lnormalhet lnormhet_glf lnormhet_glf_sh lnormhet_gp lnormhet_ilf lnormhet_ilf_sh lnormhet_ip lnskew0 loadingplot loc loca local log logi logis_lf logistic logistic_p logit logit_estat logit_p loglogs logrank loneway lookfor lookup lowess lowess_7 lpredict lrecomp lroc lroc_7 lrtest ls lsens lsens_7 lsens_x lstat ltable ltable_7 ltriang lv lvr2plot lvr2plot_7 m ma mac macr macro makecns man manova manova_estat manova_p manovatest mantel mark markin markout marksample mat mat_capp mat_order mat_put_rr mat_rapp mata mata_clear mata_describe mata_drop mata_matdescribe mata_matsave mata_matuse mata_memory mata_mlib mata_mosave mata_rename mata_which matalabel matcproc matlist matname matr matri matrix matrix_input__dlg matstrik mcc mcci md0_ md1_ md1debug_ md2_ md2debug_ mds mds_estat mds_p mdsconfig mdslong mdsmat mdsshepard mdytoe mdytof me_derd mean means median memory memsize meqparse mer merg merge mfp mfx mhelp mhodds minbound mixed_ll mixed_ll_reparm mkassert mkdir mkmat mkspline ml ml_5 ml_adjs ml_bhhhs ml_c_d ml_check ml_clear ml_cnt ml_debug ml_defd ml_e0 ml_e0_bfgs ml_e0_cycle ml_e0_dfp ml_e0i ml_e1 ml_e1_bfgs ml_e1_bhhh ml_e1_cycle ml_e1_dfp ml_e2 ml_e2_cycle ml_ebfg0 ml_ebfr0 ml_ebfr1 ml_ebh0q ml_ebhh0 ml_ebhr0 ml_ebr0i ml_ecr0i ml_edfp0 ml_edfr0 ml_edfr1 ml_edr0i ml_eds ml_eer0i ml_egr0i ml_elf ml_elf_bfgs ml_elf_bhhh ml_elf_cycle ml_elf_dfp ml_elfi ml_elfs ml_enr0i ml_enrr0 ml_erdu0 ml_erdu0_bfgs ml_erdu0_bhhh ml_erdu0_bhhhq ml_erdu0_cycle ml_erdu0_dfp ml_erdu0_nrbfgs ml_exde ml_footnote ml_geqnr ml_grad0 ml_graph ml_hbhhh ml_hd0 ml_hold ml_init ml_inv ml_log ml_max ml_mlout ml_mlout_8 ml_model ml_nb0 ml_opt ml_p ml_plot ml_query ml_rdgrd ml_repor ml_s_e ml_score ml_searc ml_technique ml_unhold mleval mlf_ mlmatbysum mlmatsum mlog mlogi mlogit mlogit_footnote mlogit_p mlopts mlsum mlvecsum mnl0_ mor more mov move mprobit mprobit_lf mprobit_p mrdu0_ mrdu1_ mvdecode mvencode mvreg mvreg_estat n nbreg nbreg_al nbreg_lf nbreg_p nbreg_sw nestreg net newey newey_7 newey_p news nl nl_7 nl_9 nl_9_p nl_p nl_p_7 nlcom nlcom_p nlexp2 nlexp2_7 nlexp2a nlexp2a_7 nlexp3 nlexp3_7 nlgom3 nlgom3_7 nlgom4 nlgom4_7 nlinit nllog3 nllog3_7 nllog4 nllog4_7 nlog_rd nlogit nlogit_p nlogitgen nlogittree nlpred no nobreak noi nois noisi noisil noisily note notes notes_dlg nptrend numlabel numlist odbc old_ver olo olog ologi ologi_sw ologit ologit_p ologitp on one onew onewa oneway op_colnm op_comp op_diff op_inv op_str opr opro oprob oprob_sw oprobi oprobi_p oprobit oprobitp opts_exclusive order orthog orthpoly ou out outf outfi outfil outfile outs outsh outshe outshee outsheet ovtest pac pac_7 palette parse parse_dissim pause pca pca_8 pca_display pca_estat pca_p pca_rotate pcamat pchart pchart_7 pchi pchi_7 pcorr pctile pentium pergram pergram_7 permute permute_8 personal peto_st pkcollapse pkcross pkequiv pkexamine pkexamine_7 pkshape pksumm pksumm_7 pl plo plot plugin pnorm pnorm_7 poisgof poiss_lf poiss_sw poisso_p poisson poisson_estat post postclose postfile postutil pperron pr prais prais_e prais_e2 prais_p predict predictnl preserve print pro prob probi probit probit_estat probit_p proc_time procoverlay procrustes procrustes_estat procrustes_p profiler prog progr progra program prop proportion prtest prtesti pwcorr pwd q\\s qby qbys qchi qchi_7 qladder qladder_7 qnorm qnorm_7 qqplot qqplot_7 qreg qreg_c qreg_p qreg_sw qu quadchk quantile quantile_7 que quer query range ranksum ratio rchart rchart_7 rcof recast reclink recode reg reg3 reg3_p regdw regr regre regre_p2 regres regres_p regress regress_estat regriv_p remap ren rena renam rename renpfix repeat replace report reshape restore ret retu retur return rm rmdir robvar roccomp roccomp_7 roccomp_8 rocf_lf rocfit rocfit_8 rocgold rocplot rocplot_7 roctab roctab_7 rolling rologit rologit_p rot rota rotat rotate rotatemat rreg rreg_p ru run runtest rvfplot rvfplot_7 rvpplot rvpplot_7 sa safesum sample sampsi sav save savedresults saveold sc sca scal scala scalar scatter scm_mine sco scob_lf scob_p scobi_sw scobit scor score scoreplot scoreplot_help scree screeplot screeplot_help sdtest sdtesti se search separate seperate serrbar serrbar_7 serset set set_defaults sfrancia sh she shel shell shewhart shewhart_7 signestimationsample signrank signtest simul simul_7 simulate simulate_8 sktest sleep slogit slogit_d2 slogit_p smooth snapspan so sor sort spearman spikeplot spikeplot_7 spikeplt spline_x split sqreg sqreg_p sret sretu sretur sreturn ssc st st_ct st_hc st_hcd st_hcd_sh st_is st_issys st_note st_promo st_set st_show st_smpl st_subid stack statsby statsby_8 stbase stci stci_7 stcox stcox_estat stcox_fr stcox_fr_ll stcox_p stcox_sw stcoxkm stcoxkm_7 stcstat stcurv stcurve stcurve_7 stdes stem stepwise stereg stfill stgen stir stjoin stmc stmh stphplot stphplot_7 stphtest stphtest_7 stptime strate strate_7 streg streg_sw streset sts sts_7 stset stsplit stsum sttocc sttoct stvary stweib su suest suest_8 sum summ summa summar summari summariz summarize sunflower sureg survcurv survsum svar svar_p svmat svy svy_disp svy_dreg svy_est svy_est_7 svy_estat svy_get svy_gnbreg_p svy_head svy_header svy_heckman_p svy_heckprob_p svy_intreg_p svy_ivreg_p svy_logistic_p svy_logit_p svy_mlogit_p svy_nbreg_p svy_ologit_p svy_oprobit_p svy_poisson_p svy_probit_p svy_regress_p svy_sub svy_sub_7 svy_x svy_x_7 svy_x_p svydes svydes_8 svygen svygnbreg svyheckman svyheckprob svyintreg svyintreg_7 svyintrg svyivreg svylc svylog_p svylogit svymarkout svymarkout_8 svymean svymlog svymlogit svynbreg svyolog svyologit svyoprob svyoprobit svyopts svypois svypois_7 svypoisson svyprobit svyprobt svyprop svyprop_7 svyratio svyreg svyreg_p svyregress svyset svyset_7 svyset_8 svytab svytab_7 svytest svytotal sw sw_8 swcnreg swcox swereg swilk swlogis swlogit swologit swoprbt swpois swprobit swqreg swtobit swweib symmetry symmi symplot symplot_7 syntax sysdescribe sysdir sysuse szroeter ta tab tab1 tab2 tab_or tabd tabdi tabdis tabdisp tabi table tabodds tabodds_7 tabstat tabu tabul tabula tabulat tabulate te tempfile tempname tempvar tes test testnl testparm teststd tetrachoric time_it timer tis tob tobi tobit tobit_p tobit_sw token tokeni tokeniz tokenize tostring total translate translator transmap treat_ll treatr_p treatreg trim trnb_cons trnb_mean trpoiss_d2 trunc_ll truncr_p truncreg tsappend tset tsfill tsline tsline_ex tsreport tsrevar tsrline tsset tssmooth tsunab ttest ttesti tut_chk tut_wait tutorial tw tware_st two twoway twoway__fpfit_serset twoway__function_gen twoway__histogram_gen twoway__ipoint_serset twoway__ipoints_serset twoway__kdensity_gen twoway__lfit_serset twoway__normgen_gen twoway__pci_serset twoway__qfit_serset twoway__scatteri_serset twoway__sunflower_gen twoway_ksm_serset ty typ type typeof u unab unabbrev unabcmd update us use uselabel var var_mkcompanion var_p varbasic varfcast vargranger varirf varirf_add varirf_cgraph varirf_create varirf_ctable varirf_describe varirf_dir varirf_drop varirf_erase varirf_graph varirf_ograph varirf_rename varirf_set varirf_table varlist varlmar varnorm varsoc varstable varstable_w varstable_w2 varwle vce vec vec_fevd vec_mkphi vec_p vec_p_w vecirf_create veclmar veclmar_w vecnorm vecnorm_w vecrank vecstable verinst vers versi versio version view viewsource vif vwls wdatetof webdescribe webseek webuse weib1_lf weib2_lf weib_lf weib_lf0 weibhet_glf weibhet_glf_sh weibhet_glfa weibhet_glfa_sh weibhet_gp weibhet_ilf weibhet_ilf_sh weibhet_ilfa weibhet_ilfa_sh weibhet_ip weibu_sw weibul_p weibull weibull_c weibull_s weibullhet wh whelp whi which whil while wilc_st wilcoxon win wind windo window winexec wntestb wntestb_7 wntestq xchart xchart_7 xcorr xcorr_7 xi xi_6 xmlsav xmlsave xmluse xpose xsh xshe xshel xshell xt_iis xt_tis xtab_p xtabond xtbin_p xtclog xtcloglog xtcloglog_8 xtcloglog_d2 xtcloglog_pa_p xtcloglog_re_p xtcnt_p xtcorr xtdata xtdes xtfront_p xtfrontier xtgee xtgee_elink xtgee_estat xtgee_makeivar xtgee_p xtgee_plink xtgls xtgls_p xthaus xthausman xtht_p xthtaylor xtile xtint_p xtintreg xtintreg_8 xtintreg_d2 xtintreg_p xtivp_1 xtivp_2 xtivreg xtline xtline_ex xtlogit xtlogit_8 xtlogit_d2 xtlogit_fe_p xtlogit_pa_p xtlogit_re_p xtmixed xtmixed_estat xtmixed_p xtnb_fe xtnb_lf xtnbreg xtnbreg_pa_p xtnbreg_refe_p xtpcse xtpcse_p xtpois xtpoisson xtpoisson_d2 xtpoisson_pa_p xtpoisson_refe_p xtpred xtprobit xtprobit_8 xtprobit_d2 xtprobit_re_p xtps_fe xtps_lf xtps_ren xtps_ren_8 xtrar_p xtrc xtrc_p xtrchh xtrefe_p xtreg xtreg_be xtreg_fe xtreg_ml xtreg_pa_p xtreg_re xtregar xtrere_p xtset xtsf_ll xtsf_llti xtsum xttab xttest0 xttobit xttobit_8 xttobit_p xttrans yx yxview__barlike_draw yxview_area_draw yxview_bar_draw yxview_dot_draw yxview_dropline_draw yxview_function_draw yxview_iarrow_draw yxview_ilabels_draw yxview_normal_draw yxview_pcarrow_draw yxview_pcbarrow_draw yxview_pccapsym_draw yxview_pcscatter_draw yxview_pcspike_draw yxview_rarea_draw yxview_rbar_draw yxview_rbarm_draw yxview_rcap_draw yxview_rcapsym_draw yxview_rconnected_draw yxview_rline_draw yxview_rscatter_draw yxview_rspike_draw yxview_spike_draw yxview_sunflower_draw zap_s zinb zinb_llf zinb_plf zip zip_llf zip_p zip_plf zt_ct_5 zt_hc_5 zt_hcd_5 zt_is_5 zt_iss_5 zt_sho_5 zt_smp_5 ztbase_5 ztcox_5 ztdes_5 ztereg_5 ztfill_5 ztgen_5 ztir_5 ztjoin_5 ztnb ztnb_p ztp ztp_p zts_5 ztset_5 ztspli_5 ztsum_5 zttoct_5 ztvary_5 ztweib_5",c:[{cN:"label",v:[{b:"\\$\\{?[a-zA-Z0-9_]+\\}?"},{b:"`[a-zA-Z0-9_]+'"}]},{cN:"string",v:[{b:'`"[^\r\n]*?"\''},{b:'"[^\r\n"]*"'}]},{cN:"literal",v:[{b:"\\b(abs|acos|asin|atan|atan2|atanh|ceil|cloglog|comb|cos|digamma|exp|floor|invcloglog|invlogit|ln|lnfact|lnfactorial|lngamma|log|log10|max|min|mod|reldif|round|sign|sin|sqrt|sum|tan|tanh|trigamma|trunc|betaden|Binomial|binorm|binormal|chi2|chi2tail|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|F|Fden|Ftail|gammaden|gammap|ibeta|invbinomial|invchi2|invchi2tail|invF|invFtail|invgammap|invibeta|invnchi2|invnFtail|invnibeta|invnorm|invnormal|invttail|nbetaden|nchi2|nFden|nFtail|nibeta|norm|normal|normalden|normd|npnchi2|tden|ttail|uniform|abbrev|char|index|indexnot|length|lower|ltrim|match|plural|proper|real|regexm|regexr|regexs|reverse|rtrim|string|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrtrim|strtrim|strupper|subinstr|subinword|substr|trim|upper|word|wordcount|_caller|autocode|byteorder|chop|clip|cond|e|epsdouble|epsfloat|group|inlist|inrange|irecode|matrix|maxbyte|maxdouble|maxfloat|maxint|maxlong|mi|minbyte|mindouble|minfloat|minint|minlong|missing|r|recode|replay|return|s|scalar|d|date|day|dow|doy|halfyear|mdy|month|quarter|week|year|d|daily|dofd|dofh|dofm|dofq|dofw|dofy|h|halfyearly|hofd|m|mofd|monthly|q|qofd|quarterly|tin|twithin|w|weekly|wofd|y|yearly|yh|ym|yofd|yq|yw|cholesky|colnumb|colsof|corr|det|diag|diag0cnt|el|get|hadamard|I|inv|invsym|issym|issymmetric|J|matmissing|matuniform|mreldif|nullmat|rownumb|rowsof|sweep|syminv|trace|vec|vecdiag)(?=\\(|$)"}]},e.C("^[ ]*\\*.*$",!1),e.CLCM,e.CBCM]}});hljs.registerLanguage("asciidoc",function(e){return{aliases:["adoc"],c:[e.C("^/{4,}\\n","\\n/{4,}$",{r:10}),e.C("^//","$",{r:0}),{cN:"title",b:"^\\.\\w.*$"},{b:"^[=\\*]{4,}\\n",e:"\\n^[=\\*]{4,}$",r:10},{cN:"header",b:"^(={1,5}) .+?( \\1)?$",r:10},{cN:"header",b:"^[^\\[\\]\\n]+?\\n[=\\-~\\^\\+]{2,}$",r:10},{cN:"attribute",b:"^:.+?:",e:"\\s",eE:!0,r:10},{cN:"attribute",b:"^\\[.+?\\]$",r:0},{cN:"blockquote",b:"^_{4,}\\n",e:"\\n_{4,}$",r:10},{cN:"code",b:"^[\\-\\.]{4,}\\n",e:"\\n[\\-\\.]{4,}$",r:10},{b:"^\\+{4,}\\n",e:"\\n\\+{4,}$",c:[{b:"<",e:">",sL:"xml",r:0}],r:10},{cN:"bullet",b:"^(\\*+|\\-+|\\.+|[^\\n]+?::)\\s+"},{cN:"label",b:"^(NOTE|TIP|IMPORTANT|WARNING|CAUTION):\\s+",r:10},{cN:"strong",b:"\\B\\*(?![\\*\\s])",e:"(\\n{2}|\\*)",c:[{b:"\\\\*\\w",r:0}]},{cN:"emphasis",b:"\\B'(?!['\\s])",e:"(\\n{2}|')",c:[{b:"\\\\'\\w",r:0}],r:0},{cN:"emphasis",b:"_(?![_\\s])",e:"(\\n{2}|_)",r:0},{cN:"smartquote",v:[{b:"``.+?''"},{b:"`.+?'"}]},{cN:"code",b:"(`.+?`|\\+.+?\\+)",r:0},{cN:"code",b:"^[ \\t]",e:"$",r:0},{cN:"horizontal_rule",b:"^'{3,}[ \\t]*$",r:10},{b:"(link:)?(http|https|ftp|file|irc|image:?):\\S+\\[.*?\\]",rB:!0,c:[{b:"(link|image:?):",r:0},{cN:"link_url",b:"\\w",e:"[^\\[]+",r:0},{cN:"link_label",b:"\\[",e:"\\]",eB:!0,eE:!0,r:0}],r:10}]}});hljs.registerLanguage("php",function(e){var c={cN:"variable",b:"\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*"},i={cN:"preprocessor",b:/<\?(php)?|\?>/},a={cN:"string",c:[e.BE,i],v:[{b:'b"',e:'"'},{b:"b'",e:"'"},e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null})]},n={v:[e.BNM,e.CNM]};return{aliases:["php3","php4","php5","php6"],cI:!0,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally",c:[e.CLCM,e.HCM,e.C("/\\*","\\*/",{c:[{cN:"phpdoc",b:"\\s@[A-Za-z]+"},i]}),e.C("__halt_compiler.+?;",!1,{eW:!0,k:"__halt_compiler",l:e.UIR}),{cN:"string",b:"<<<['\"]?\\w+['\"]?$",e:"^\\w+;",c:[e.BE]},i,c,{b:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{cN:"function",bK:"function",e:/[;{]/,eE:!0,i:"\\$|\\[|%",c:[e.UTM,{cN:"params",b:"\\(",e:"\\)",c:["self",c,e.CBCM,a,n]}]},{cN:"class",bK:"class interface",e:"{",eE:!0,i:/[:\(\$"]/,c:[{bK:"extends implements"},e.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[e.UTM]},{bK:"use",e:";",c:[e.UTM]},{b:"=>"},a,n]}});hljs.registerLanguage("java",function(e){var a=e.UIR+"(<"+e.UIR+">)?",t="false synchronized int abstract float private char boolean static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private",c="(\\b(0b[01_]+)|\\b0[xX][a-fA-F0-9_]+|(\\b[\\d_]+(\\.[\\d_]*)?|\\.[\\d_]+)([eE][-+]?\\d+)?)[lLfF]?",r={cN:"number",b:c,r:0};return{aliases:["jsp"],k:t,i:/<\//,c:[{cN:"javadoc",b:"/\\*\\*",e:"\\*/",r:0,c:[{cN:"javadoctag",b:"(^|\\s)@[A-Za-z]+"}]},e.CLCM,e.CBCM,e.ASM,e.QSM,{cN:"class",bK:"class interface",e:/[{;=]/,eE:!0,k:"class interface",i:/[:"\[\]]/,c:[{bK:"extends implements"},e.UTM]},{bK:"new throw return",r:0},{cN:"function",b:"("+a+"\\s+)+"+e.UIR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:t,c:[{b:e.UIR+"\\s*\\(",rB:!0,r:0,c:[e.UTM]},{cN:"params",b:/\(/,e:/\)/,k:t,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]},r,{cN:"annotation",b:"@[A-Za-z]+"}]}});hljs.registerLanguage("glsl",function(e){return{k:{keyword:"atomic_uint attribute bool break bvec2 bvec3 bvec4 case centroid coherent const continue default discard dmat2 dmat2x2 dmat2x3 dmat2x4 dmat3 dmat3x2 dmat3x3 dmat3x4 dmat4 dmat4x2 dmat4x3 dmat4x4 do double dvec2 dvec3 dvec4 else flat float for highp if iimage1D iimage1DArray iimage2D iimage2DArray iimage2DMS iimage2DMSArray iimage2DRect iimage3D iimageBuffer iimageCube iimageCubeArray image1D image1DArray image2D image2DArray image2DMS image2DMSArray image2DRect image3D imageBuffer imageCube imageCubeArray in inout int invariant isampler1D isampler1DArray isampler2D isampler2DArray isampler2DMS isampler2DMSArray isampler2DRect isampler3D isamplerBuffer isamplerCube isamplerCubeArray ivec2 ivec3 ivec4 layout lowp mat2 mat2x2 mat2x3 mat2x4 mat3 mat3x2 mat3x3 mat3x4 mat4 mat4x2 mat4x3 mat4x4 mediump noperspective out patch precision readonly restrict return sample sampler1D sampler1DArray sampler1DArrayShadow sampler1DShadow sampler2D sampler2DArray sampler2DArrayShadow sampler2DMS sampler2DMSArray sampler2DRect sampler2DRectShadow sampler2DShadow sampler3D samplerBuffer samplerCube samplerCubeArray samplerCubeArrayShadow samplerCubeShadow smooth struct subroutine switch uimage1D uimage1DArray uimage2D uimage2DArray uimage2DMS uimage2DMSArray uimage2DRect uimage3D uimageBuffer uimageCube uimageCubeArray uint uniform usampler1D usampler1DArray usampler2D usampler2DArray usampler2DMS usampler2DMSArray usampler2DRect usampler3D usamplerBuffer usamplerCube usamplerCubeArray uvec2 uvec3 uvec4 varying vec2 vec3 vec4 void volatile while writeonly",built_in:"gl_BackColor gl_BackLightModelProduct gl_BackLightProduct gl_BackMaterial gl_BackSecondaryColor gl_ClipDistance gl_ClipPlane gl_ClipVertex gl_Color gl_DepthRange gl_EyePlaneQ gl_EyePlaneR gl_EyePlaneS gl_EyePlaneT gl_Fog gl_FogCoord gl_FogFragCoord gl_FragColor gl_FragCoord gl_FragData gl_FragDepth gl_FrontColor gl_FrontFacing gl_FrontLightModelProduct gl_FrontLightProduct gl_FrontMaterial gl_FrontSecondaryColor gl_InstanceID gl_InvocationID gl_Layer gl_LightModel gl_LightSource gl_MaxAtomicCounterBindings gl_MaxAtomicCounterBufferSize gl_MaxClipDistances gl_MaxClipPlanes gl_MaxCombinedAtomicCounterBuffers gl_MaxCombinedAtomicCounters gl_MaxCombinedImageUniforms gl_MaxCombinedImageUnitsAndFragmentOutputs gl_MaxCombinedTextureImageUnits gl_MaxDrawBuffers gl_MaxFragmentAtomicCounterBuffers gl_MaxFragmentAtomicCounters gl_MaxFragmentImageUniforms gl_MaxFragmentInputComponents gl_MaxFragmentUniformComponents gl_MaxFragmentUniformVectors gl_MaxGeometryAtomicCounterBuffers gl_MaxGeometryAtomicCounters gl_MaxGeometryImageUniforms gl_MaxGeometryInputComponents gl_MaxGeometryOutputComponents gl_MaxGeometryOutputVertices gl_MaxGeometryTextureImageUnits gl_MaxGeometryTotalOutputComponents gl_MaxGeometryUniformComponents gl_MaxGeometryVaryingComponents gl_MaxImageSamples gl_MaxImageUnits gl_MaxLights gl_MaxPatchVertices gl_MaxProgramTexelOffset gl_MaxTessControlAtomicCounterBuffers gl_MaxTessControlAtomicCounters gl_MaxTessControlImageUniforms gl_MaxTessControlInputComponents gl_MaxTessControlOutputComponents gl_MaxTessControlTextureImageUnits gl_MaxTessControlTotalOutputComponents gl_MaxTessControlUniformComponents gl_MaxTessEvaluationAtomicCounterBuffers gl_MaxTessEvaluationAtomicCounters gl_MaxTessEvaluationImageUniforms gl_MaxTessEvaluationInputComponents gl_MaxTessEvaluationOutputComponents gl_MaxTessEvaluationTextureImageUnits gl_MaxTessEvaluationUniformComponents gl_MaxTessGenLevel gl_MaxTessPatchComponents gl_MaxTextureCoords gl_MaxTextureImageUnits gl_MaxTextureUnits gl_MaxVaryingComponents gl_MaxVaryingFloats gl_MaxVaryingVectors gl_MaxVertexAtomicCounterBuffers gl_MaxVertexAtomicCounters gl_MaxVertexAttribs gl_MaxVertexImageUniforms gl_MaxVertexOutputComponents gl_MaxVertexTextureImageUnits gl_MaxVertexUniformComponents gl_MaxVertexUniformVectors gl_MaxViewports gl_MinProgramTexelOffsetgl_ModelViewMatrix gl_ModelViewMatrixInverse gl_ModelViewMatrixInverseTranspose gl_ModelViewMatrixTranspose gl_ModelViewProjectionMatrix gl_ModelViewProjectionMatrixInverse gl_ModelViewProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixTranspose gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_Normal gl_NormalMatrix gl_NormalScale gl_ObjectPlaneQ gl_ObjectPlaneR gl_ObjectPlaneS gl_ObjectPlaneT gl_PatchVerticesIn gl_PerVertex gl_Point gl_PointCoord gl_PointSize gl_Position gl_PrimitiveID gl_PrimitiveIDIn gl_ProjectionMatrix gl_ProjectionMatrixInverse gl_ProjectionMatrixInverseTranspose gl_ProjectionMatrixTranspose gl_SampleID gl_SampleMask gl_SampleMaskIn gl_SamplePosition gl_SecondaryColor gl_TessCoord gl_TessLevelInner gl_TessLevelOuter gl_TexCoord gl_TextureEnvColor gl_TextureMatrixInverseTranspose gl_TextureMatrixTranspose gl_Vertex gl_VertexID gl_ViewportIndex gl_in gl_out EmitStreamVertex EmitVertex EndPrimitive EndStreamPrimitive abs acos acosh all any asin asinh atan atanh atomicCounter atomicCounterDecrement atomicCounterIncrement barrier bitCount bitfieldExtract bitfieldInsert bitfieldReverse ceil clamp cos cosh cross dFdx dFdy degrees determinant distance dot equal exp exp2 faceforward findLSB findMSB floatBitsToInt floatBitsToUint floor fma fract frexp ftransform fwidth greaterThan greaterThanEqual imageAtomicAdd imageAtomicAnd imageAtomicCompSwap imageAtomicExchange imageAtomicMax imageAtomicMin imageAtomicOr imageAtomicXor imageLoad imageStore imulExtended intBitsToFloat interpolateAtCentroid interpolateAtOffset interpolateAtSample inverse inversesqrt isinf isnan ldexp length lessThan lessThanEqual log log2 matrixCompMult max memoryBarrier min mix mod modf noise1 noise2 noise3 noise4 normalize not notEqual outerProduct packDouble2x32 packHalf2x16 packSnorm2x16 packSnorm4x8 packUnorm2x16 packUnorm4x8 pow radians reflect refract round roundEven shadow1D shadow1DLod shadow1DProj shadow1DProjLod shadow2D shadow2DLod shadow2DProj shadow2DProjLod sign sin sinh smoothstep sqrt step tan tanh texelFetch texelFetchOffset texture texture1D texture1DLod texture1DProj texture1DProjLod texture2D texture2DLod texture2DProj texture2DProjLod texture3D texture3DLod texture3DProj texture3DProjLod textureCube textureCubeLod textureGather textureGatherOffset textureGatherOffsets textureGrad textureGradOffset textureLod textureLodOffset textureOffset textureProj textureProjGrad textureProjGradOffset textureProjLod textureProjLodOffset textureProjOffset textureQueryLod textureSize transpose trunc uaddCarry uintBitsToFloat umulExtended unpackDouble2x32 unpackHalf2x16 unpackSnorm2x16 unpackSnorm4x8 unpackUnorm2x16 unpackUnorm4x8 usubBorrow gl_TextureMatrix gl_TextureMatrixInverse",literal:"true false"},i:'"',c:[e.CLCM,e.CBCM,e.CNM,{cN:"preprocessor",b:"#",e:"$"}]}});hljs.registerLanguage("lua",function(e){var t="\\[=*\\[",a="\\]=*\\]",r={b:t,e:a,c:["self"]},n=[e.C("--(?!"+t+")","$"),e.C("--"+t,a,{c:[r],r:10})];return{l:e.UIR,k:{keyword:"and break do else elseif end false for if in local nil not or repeat return then true until while",built_in:"_G _VERSION assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall coroutine debug io math os package string table"},c:n.concat([{cN:"function",bK:"function",e:"\\)",c:[e.inherit(e.TM,{b:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{cN:"params",b:"\\(",eW:!0,c:n}].concat(n)},e.CNM,e.ASM,e.QSM,{cN:"string",b:t,e:a,c:[r],r:5}])}});hljs.registerLanguage("protobuf",function(e){return{k:{keyword:"package import option optional required repeated group",built_in:"double float int32 int64 uint32 uint64 sint32 sint64 fixed32 fixed64 sfixed32 sfixed64 bool string bytes",literal:"true false"},c:[e.QSM,e.NM,e.CLCM,{cN:"class",bK:"message enum service",e:/\{/,i:/\n/,c:[e.inherit(e.TM,{starts:{eW:!0,eE:!0}})]},{cN:"function",bK:"rpc",e:/;/,eE:!0,k:"rpc returns"},{cN:"constant",b:/^\s*[A-Z_]+/,e:/\s*=/,eE:!0}]}});hljs.registerLanguage("gcode",function(e){var N="[A-Z_][A-Z0-9_.]*",i="\\%",c={literal:"",built_in:"",keyword:"IF DO WHILE ENDWHILE CALL ENDIF SUB ENDSUB GOTO REPEAT ENDREPEAT EQ LT GT NE GE LE OR XOR"},r={cN:"preprocessor",b:"([O])([0-9]+)"},l=[e.CLCM,e.CBCM,e.C(/\(/,/\)/),e.inherit(e.CNM,{b:"([-+]?([0-9]*\\.?[0-9]+\\.?))|"+e.CNR}),e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null}),{cN:"keyword",b:"([G])([0-9]+\\.?[0-9]?)"},{cN:"title",b:"([M])([0-9]+\\.?[0-9]?)"},{cN:"title",b:"(VC|VS|#)",e:"(\\d+)"},{cN:"title",b:"(VZOFX|VZOFY|VZOFZ)"},{cN:"built_in",b:"(ATAN|ABS|ACOS|ASIN|SIN|COS|EXP|FIX|FUP|ROUND|LN|TAN)(\\[)",e:"([-+]?([0-9]*\\.?[0-9]+\\.?))(\\])"},{cN:"label",v:[{b:"N",e:"\\d+",i:"\\W"}]}];return{aliases:["nc"],cI:!0,l:N,k:c,c:[{cN:"preprocessor",b:i},r].concat(l)}});hljs.registerLanguage("vim",function(e){return{l:/[!#@\w]+/,k:{keyword:"N|0 P|0 X|0 a|0 ab abc abo al am an|0 ar arga argd arge argdo argg argl argu as au aug aun b|0 bN ba bad bd be bel bf bl bm bn bo bp br brea breaka breakd breakl bro bufdo buffers bun bw c|0 cN cNf ca cabc caddb cad caddf cal cat cb cc ccl cd ce cex cf cfir cgetb cgete cg changes chd che checkt cl cla clo cm cmapc cme cn cnew cnf cno cnorea cnoreme co col colo com comc comp con conf cope cp cpf cq cr cs cst cu cuna cunme cw d|0 delm deb debugg delc delf dif diffg diffo diffp diffpu diffs diffthis dig di dl dell dj dli do doautoa dp dr ds dsp e|0 ea ec echoe echoh echom echon el elsei em en endfo endf endt endw ene ex exe exi exu f|0 files filet fin fina fini fir fix fo foldc foldd folddoc foldo for fu g|0 go gr grepa gu gv ha h|0 helpf helpg helpt hi hid his i|0 ia iabc if ij il im imapc ime ino inorea inoreme int is isp iu iuna iunme j|0 ju k|0 keepa kee keepj lN lNf l|0 lad laddb laddf la lan lat lb lc lch lcl lcs le lefta let lex lf lfir lgetb lgete lg lgr lgrepa lh ll lla lli lmak lm lmapc lne lnew lnf ln loadk lo loc lockv lol lope lp lpf lr ls lt lu lua luad luaf lv lvimgrepa lw m|0 ma mak map mapc marks mat me menut mes mk mks mksp mkv mkvie mod mz mzf nbc nb nbs n|0 new nm nmapc nme nn nnoreme noa no noh norea noreme norm nu nun nunme ol o|0 om omapc ome on ono onoreme opt ou ounme ow p|0 profd prof pro promptr pc ped pe perld po popu pp pre prev ps pt ptN ptf ptj ptl ptn ptp ptr pts pu pw py3 python3 py3d py3f py pyd pyf q|0 quita qa r|0 rec red redi redr redraws reg res ret retu rew ri rightb rub rubyd rubyf rund ru rv s|0 sN san sa sal sav sb sbN sba sbf sbl sbm sbn sbp sbr scrip scripte scs se setf setg setl sf sfir sh sim sig sil sl sla sm smap smapc sme sn sni sno snor snoreme sor so spelld spe spelli spellr spellu spellw sp spr sre st sta startg startr star stopi stj sts sun sunm sunme sus sv sw sy synti sync t|0 tN tabN tabc tabdo tabe tabf tabfir tabl tabm tabnew tabn tabo tabp tabr tabs tab ta tags tc tcld tclf te tf th tj tl tm tn to tp tr try ts tu u|0 undoj undol una unh unl unlo unm unme uns up v|0 ve verb vert vim vimgrepa vi viu vie vm vmapc vme vne vn vnoreme vs vu vunme windo w|0 wN wa wh wi winc winp wn wp wq wqa ws wu wv x|0 xa xmapc xm xme xn xnoreme xu xunme y|0 z|0 ~ Next Print append abbreviate abclear aboveleft all amenu anoremenu args argadd argdelete argedit argglobal arglocal argument ascii autocmd augroup aunmenu buffer bNext ball badd bdelete behave belowright bfirst blast bmodified bnext botright bprevious brewind break breakadd breakdel breaklist browse bunload bwipeout change cNext cNfile cabbrev cabclear caddbuffer caddexpr caddfile call catch cbuffer cclose center cexpr cfile cfirst cgetbuffer cgetexpr cgetfile chdir checkpath checktime clist clast close cmap cmapclear cmenu cnext cnewer cnfile cnoremap cnoreabbrev cnoremenu copy colder colorscheme command comclear compiler continue confirm copen cprevious cpfile cquit crewind cscope cstag cunmap cunabbrev cunmenu cwindow delete delmarks debug debuggreedy delcommand delfunction diffupdate diffget diffoff diffpatch diffput diffsplit digraphs display deletel djump dlist doautocmd doautoall deletep drop dsearch dsplit edit earlier echo echoerr echohl echomsg else elseif emenu endif endfor endfunction endtry endwhile enew execute exit exusage file filetype find finally finish first fixdel fold foldclose folddoopen folddoclosed foldopen function global goto grep grepadd gui gvim hardcopy help helpfind helpgrep helptags highlight hide history insert iabbrev iabclear ijump ilist imap imapclear imenu inoremap inoreabbrev inoremenu intro isearch isplit iunmap iunabbrev iunmenu join jumps keepalt keepmarks keepjumps lNext lNfile list laddexpr laddbuffer laddfile last language later lbuffer lcd lchdir lclose lcscope left leftabove lexpr lfile lfirst lgetbuffer lgetexpr lgetfile lgrep lgrepadd lhelpgrep llast llist lmake lmap lmapclear lnext lnewer lnfile lnoremap loadkeymap loadview lockmarks lockvar lolder lopen lprevious lpfile lrewind ltag lunmap luado luafile lvimgrep lvimgrepadd lwindow move mark make mapclear match menu menutranslate messages mkexrc mksession mkspell mkvimrc mkview mode mzscheme mzfile nbclose nbkey nbsart next nmap nmapclear nmenu nnoremap nnoremenu noautocmd noremap nohlsearch noreabbrev noremenu normal number nunmap nunmenu oldfiles open omap omapclear omenu only onoremap onoremenu options ounmap ounmenu ownsyntax print profdel profile promptfind promptrepl pclose pedit perl perldo pop popup ppop preserve previous psearch ptag ptNext ptfirst ptjump ptlast ptnext ptprevious ptrewind ptselect put pwd py3do py3file python pydo pyfile quit quitall qall read recover redo redir redraw redrawstatus registers resize retab return rewind right rightbelow ruby rubydo rubyfile rundo runtime rviminfo substitute sNext sandbox sargument sall saveas sbuffer sbNext sball sbfirst sblast sbmodified sbnext sbprevious sbrewind scriptnames scriptencoding scscope set setfiletype setglobal setlocal sfind sfirst shell simalt sign silent sleep slast smagic smapclear smenu snext sniff snomagic snoremap snoremenu sort source spelldump spellgood spellinfo spellrepall spellundo spellwrong split sprevious srewind stop stag startgreplace startreplace startinsert stopinsert stjump stselect sunhide sunmap sunmenu suspend sview swapname syntax syntime syncbind tNext tabNext tabclose tabedit tabfind tabfirst tablast tabmove tabnext tabonly tabprevious tabrewind tag tcl tcldo tclfile tearoff tfirst throw tjump tlast tmenu tnext topleft tprevious trewind tselect tunmenu undo undojoin undolist unabbreviate unhide unlet unlockvar unmap unmenu unsilent update vglobal version verbose vertical vimgrep vimgrepadd visual viusage view vmap vmapclear vmenu vnew vnoremap vnoremenu vsplit vunmap vunmenu write wNext wall while winsize wincmd winpos wnext wprevious wqall wsverb wundo wviminfo xit xall xmapclear xmap xmenu xnoremap xnoremenu xunmap xunmenu yank",built_in:"abs acos add and append argc argidx argv asin atan atan2 browse browsedir bufexists buflisted bufloaded bufname bufnr bufwinnr byte2line byteidx call ceil changenr char2nr cindent clearmatches col complete complete_add complete_check confirm copy cos cosh count cscope_connection cursor deepcopy delete did_filetype diff_filler diff_hlID empty escape eval eventhandler executable exists exp expand extend feedkeys filereadable filewritable filter finddir findfile float2nr floor fmod fnameescape fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreground function garbagecollect get getbufline getbufvar getchar getcharmod getcmdline getcmdpos getcmdtype getcwd getfontname getfperm getfsize getftime getftype getline getloclist getmatches getpid getpos getqflist getreg getregtype gettabvar gettabwinvar getwinposx getwinposy getwinvar glob globpath has has_key haslocaldir hasmapto histadd histdel histget histnr hlexists hlID hostname iconv indent index input inputdialog inputlist inputrestore inputsave inputsecret insert invert isdirectory islocked items join keys len libcall libcallnr line line2byte lispindent localtime log log10 luaeval map maparg mapcheck match matchadd matcharg matchdelete matchend matchlist matchstr max min mkdir mode mzeval nextnonblank nr2char or pathshorten pow prevnonblank printf pumvisible py3eval pyeval range readfile reltime reltimestr remote_expr remote_foreground remote_peek remote_read remote_send remove rename repeat resolve reverse round screenattr screenchar screencol screenrow search searchdecl searchpair searchpairpos searchpos server2client serverlist setbufvar setcmdpos setline setloclist setmatches setpos setqflist setreg settabvar settabwinvar setwinvar sha256 shellescape shiftwidth simplify sin sinh sort soundfold spellbadword spellsuggest split sqrt str2float str2nr strchars strdisplaywidth strftime stridx string strlen strpart strridx strtrans strwidth submatch substitute synconcealed synID synIDattr synIDtrans synstack system tabpagebuflist tabpagenr tabpagewinnr tagfiles taglist tan tanh tempname tolower toupper tr trunc type undofile undotree values virtcol visualmode wildmenumode winbufnr wincol winheight winline winnr winrestcmd winrestview winsaveview winwidth writefile xor"},i:/[{:]/,c:[e.NM,e.ASM,{cN:"string",b:/"((\\")|[^"\n])*("|\n)/},{cN:"variable",b:/[bwtglsav]:[\w\d_]*/},{cN:"function",bK:"function function!",e:"$",r:0,c:[e.TM,{cN:"params",b:"\\(",e:"\\)"}]}]}});hljs.registerLanguage("processing",function(e){return{k:{keyword:"BufferedReader PVector PFont PImage PGraphics HashMap boolean byte char color double float int long String Array FloatDict FloatList IntDict IntList JSONArray JSONObject Object StringDict StringList Table TableRow XML false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private",constant:"P2D P3D HALF_PI PI QUARTER_PI TAU TWO_PI",variable:"displayHeight displayWidth mouseY mouseX mousePressed pmouseX pmouseY key keyCode pixels focused frameCount frameRate height width",title:"setup draw",built_in:"size createGraphics beginDraw createShape loadShape PShape arc ellipse line point quad rect triangle bezier bezierDetail bezierPoint bezierTangent curve curveDetail curvePoint curveTangent curveTightness shape shapeMode beginContour beginShape bezierVertex curveVertex endContour endShape quadraticVertex vertex ellipseMode noSmooth rectMode smooth strokeCap strokeJoin strokeWeight mouseClicked mouseDragged mouseMoved mousePressed mouseReleased mouseWheel keyPressed keyPressedkeyReleased keyTyped print println save saveFrame day hour millis minute month second year background clear colorMode fill noFill noStroke stroke alpha blue brightness color green hue lerpColor red saturation modelX modelY modelZ screenX screenY screenZ ambient emissive shininess specular add createImage beginCamera camera endCamera frustum ortho perspective printCamera printProjection cursor frameRate noCursor exit loop noLoop popStyle pushStyle redraw binary boolean byte char float hex int str unbinary unhex join match matchAll nf nfc nfp nfs split splitTokens trim append arrayCopy concat expand reverse shorten sort splice subset box sphere sphereDetail createInput createReader loadBytes loadJSONArray loadJSONObject loadStrings loadTable loadXML open parseXML saveTable selectFolder selectInput beginRaw beginRecord createOutput createWriter endRaw endRecord PrintWritersaveBytes saveJSONArray saveJSONObject saveStream saveStrings saveXML selectOutput popMatrix printMatrix pushMatrix resetMatrix rotate rotateX rotateY rotateZ scale shearX shearY translate ambientLight directionalLight lightFalloff lights lightSpecular noLights normal pointLight spotLight image imageMode loadImage noTint requestImage tint texture textureMode textureWrap blend copy filter get loadPixels set updatePixels blendMode loadShader PShaderresetShader shader createFont loadFont text textFont textAlign textLeading textMode textSize textWidth textAscent textDescent abs ceil constrain dist exp floor lerp log mag map max min norm pow round sq sqrt acos asin atan atan2 cos degrees radians sin tan noise noiseDetail noiseSeed random randomGaussian randomSeed"},c:[e.CLCM,e.CBCM,e.ASM,e.QSM,e.CNM]}});hljs.registerLanguage("mizar",function(e){return{k:"environ vocabularies notations constructors definitions registrations theorems schemes requirements begin end definition registration cluster existence pred func defpred deffunc theorem proof let take assume then thus hence ex for st holds consider reconsider such that and in provided of as from be being by means equals implies iff redefine define now not or attr is mode suppose per cases set thesis contradiction scheme reserve struct correctness compatibility coherence symmetry assymetry reflexivity irreflexivity connectedness uniqueness commutativity idempotence involutiveness projectivity",c:[e.C("::","$")]}});hljs.registerLanguage("vbnet",function(e){return{aliases:["vb"],cI:!0,k:{keyword:"addhandler addressof alias and andalso aggregate ansi as assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into is isfalse isnot istrue join key let lib like loop me mid mod module mustinherit mustoverride mybase myclass namespace narrowing new next not notinheritable notoverridable of off on operator option optional or order orelse overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim rem removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly xor",built_in:"boolean byte cbool cbyte cchar cdate cdec cdbl char cint clng cobj csbyte cshort csng cstr ctype date decimal directcast double gettype getxmlnamespace iif integer long object sbyte short single string trycast typeof uinteger ulong ushort",literal:"true false nothing"},i:"//|{|}|endif|gosub|variant|wend",c:[e.inherit(e.QSM,{c:[{b:'""'}]}),e.C("'","$",{rB:!0,c:[{cN:"xmlDocTag",b:"'''|",c:[e.PWM]},{cN:"xmlDocTag",b:"",c:[e.PWM]}]}),e.CNM,{cN:"preprocessor",b:"#",e:"$",k:"if else elseif end region externalsource"}]}});hljs.registerLanguage("q",function(e){var s={keyword:"do while select delete by update from",constant:"0b 1b",built_in:"neg not null string reciprocal floor ceiling signum mod xbar xlog and or each scan over prior mmu lsq inv md5 ltime gtime count first var dev med cov cor all any rand sums prds mins maxs fills deltas ratios avgs differ prev next rank reverse iasc idesc asc desc msum mcount mavg mdev xrank mmin mmax xprev rotate distinct group where flip type key til get value attr cut set upsert raze union inter except cross sv vs sublist enlist read0 read1 hopen hclose hdel hsym hcount peach system ltrim rtrim trim lower upper ssr view tables views cols xcols keys xkey xcol xasc xdesc fkeys meta lj aj aj0 ij pj asof uj ww wj wj1 fby xgroup ungroup ej save load rsave rload show csv parse eval min max avg wavg wsum sin cos tan sum",typename:"`float `double int `timestamp `timespan `datetime `time `boolean `symbol `char `byte `short `long `real `month `date `minute `second `guid"};return{aliases:["k","kdb"],k:s,l:/\b(`?)[A-Za-z0-9_]+\b/,c:[e.CLCM,e.QSM,e.CNM]}});hljs.registerLanguage("livescript",function(e){var t={keyword:"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger case default function var with then unless until loop of by when and or is isnt not it that otherwise from to til fallthrough super case default function var void const let enum export import native __hasProp __extends __slice __bind __indexOf",literal:"true false null undefined yes no on off it that void",built_in:"npm require console print module global window document"},s="[A-Za-z$_](?:-[0-9A-Za-z$_]|[0-9A-Za-z$_])*",i=e.inherit(e.TM,{b:s}),n={cN:"subst",b:/#\{/,e:/}/,k:t},r={cN:"subst",b:/#[A-Za-z$_]/,e:/(?:\-[0-9A-Za-z$_]|[0-9A-Za-z$_])*/,k:t},c=[e.BNM,{cN:"number",b:"(\\b0[xX][a-fA-F0-9_]+)|(\\b\\d(\\d|_\\d)*(\\.(\\d(\\d|_\\d)*)?)?(_*[eE]([-+]\\d(_\\d|\\d)*)?)?[_a-z]*)",r:0,starts:{e:"(\\s*/)?",r:0}},{cN:"string",v:[{b:/'''/,e:/'''/,c:[e.BE]},{b:/'/,e:/'/,c:[e.BE]},{b:/"""/,e:/"""/,c:[e.BE,n,r]},{b:/"/,e:/"/,c:[e.BE,n,r]},{b:/\\/,e:/(\s|$)/,eE:!0}]},{cN:"pi",v:[{b:"//",e:"//[gim]*",c:[n,e.HCM]},{b:/\/(?![ *])(\\\/|.)*?\/[gim]*(?=\W|$)/}]},{cN:"property",b:"@"+s},{b:"``",e:"``",eB:!0,eE:!0,sL:"javascript"}];n.c=c;var a={cN:"params",b:"\\(",rB:!0,c:[{b:/\(/,e:/\)/,k:t,c:["self"].concat(c)}]};return{aliases:["ls"],k:t,i:/\/\*/,c:c.concat([e.C("\\/\\*","\\*\\/"),e.HCM,{cN:"function",c:[i,a],rB:!0,v:[{b:"("+s+"\\s*(?:=|:=)\\s*)?(\\(.*\\))?\\s*\\B\\->\\*?",e:"\\->\\*?"},{b:"("+s+"\\s*(?:=|:=)\\s*)?!?(\\(.*\\))?\\s*\\B[-~]{1,2}>\\*?",e:"[-~]{1,2}>\\*?"},{b:"("+s+"\\s*(?:=|:=)\\s*)?(\\(.*\\))?\\s*\\B!?[-~]{1,2}>\\*?",e:"!?[-~]{1,2}>\\*?"}]},{cN:"class",bK:"class",e:"$",i:/[:="\[\]]/,c:[{bK:"extends",eW:!0,i:/[:="\[\]]/,c:[i]},i]},{cN:"attribute",b:s+":",e:":",rB:!0,rE:!0,r:0}])}});hljs.registerLanguage("haxe",function(e){var r="([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)";return{aliases:["hx"],k:{keyword:"break callback case cast catch class continue default do dynamic else enum extends extern for function here if implements import in inline interface never new override package private public return static super switch this throw trace try typedef untyped using var while",literal:"true false null"},c:[e.ASM,e.QSM,e.CLCM,e.CBCM,e.CNM,{cN:"class",bK:"class interface",e:"{",eE:!0,c:[{bK:"extends implements"},e.TM]},{cN:"preprocessor",b:"#",e:"$",k:"if else elseif end error"},{cN:"function",bK:"function",e:"[{;]",eE:!0,i:"\\S",c:[e.TM,{cN:"params",b:"\\(",e:"\\)",c:[e.ASM,e.QSM,e.CLCM,e.CBCM]},{cN:"type",b:":",e:r,r:10}]}]}});hljs.registerLanguage("monkey",function(e){var n={cN:"number",r:0,v:[{b:"[$][a-fA-F0-9]+"},e.NM]};return{cI:!0,k:{keyword:"public private property continue exit extern new try catch eachin not abstract final select case default const local global field end if then else elseif endif while wend repeat until forever for to step next return module inline throw",built_in:"DebugLog DebugStop Error Print ACos ACosr ASin ASinr ATan ATan2 ATan2r ATanr Abs Abs Ceil Clamp Clamp Cos Cosr Exp Floor Log Max Max Min Min Pow Sgn Sgn Sin Sinr Sqrt Tan Tanr Seed PI HALFPI TWOPI",literal:"true false null and or shl shr mod"},c:[e.C("#rem","#end"),e.C("'","$",{r:0}),{cN:"function",bK:"function method",e:"[(=:]|$",i:/\n/,c:[e.UTM]},{cN:"class",bK:"class interface",e:"$",c:[{bK:"extends implements"},e.UTM]},{cN:"variable",b:"\\b(self|super)\\b"},{cN:"preprocessor",bK:"import",e:"$"},{cN:"preprocessor",b:"\\s*#",e:"$",k:"if else elseif endif end then"},{cN:"pi",b:"^\\s*strict\\b"},{bK:"alias",e:"=",c:[e.UTM]},e.QSM,n]}});hljs.registerLanguage("bash",function(e){var t={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)}/}]},s={cN:"string",b:/"/,e:/"/,c:[e.BE,t,{cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]}]},a={cN:"string",b:/'/,e:/'/};return{aliases:["sh","zsh"],l:/-?[a-z\.]+/,k:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",operator:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"shebang",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:!0,c:[e.inherit(e.TM,{b:/\w[\w\d_]*/})],r:0},e.HCM,e.NM,s,a,t]}});hljs.registerLanguage("erlang",function(e){var r="[a-z'][a-zA-Z0-9_']*",c="("+r+":"+r+"|"+r+")",a={keyword:"after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun if let not of orelse|10 query receive rem try when xor",literal:"false true"},n=e.C("%","$"),i={cN:"number",b:"\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)",r:0},b={b:"fun\\s+"+r+"/\\d+"},d={b:c+"\\(",e:"\\)",rB:!0,r:0,c:[{cN:"function_name",b:c,r:0},{b:"\\(",e:"\\)",eW:!0,rE:!0,r:0}]},o={cN:"tuple",b:"{",e:"}",r:0},t={cN:"variable",b:"\\b_([A-Z][A-Za-z0-9_]*)?",r:0},l={cN:"variable",b:"[A-Z][a-zA-Z0-9_]*",r:0},f={b:"#"+e.UIR,r:0,rB:!0,c:[{cN:"record_name",b:"#"+e.UIR,r:0},{b:"{",e:"}",r:0}]},s={bK:"fun receive if try case",e:"end",k:a};s.c=[n,b,e.inherit(e.ASM,{cN:""}),s,d,e.QSM,i,o,t,l,f];var u=[n,b,s,d,e.QSM,i,o,t,l,f];d.c[1].c=u,o.c=u,f.c[1].c=u;var v={cN:"params",b:"\\(",e:"\\)",c:u};return{aliases:["erl"],k:a,i:"(",rB:!0,i:"\\(|#|//|/\\*|\\\\|:|;",c:[v,e.inherit(e.TM,{b:r})],starts:{e:";|\\.",k:a,c:u}},n,{cN:"pp",b:"^-",e:"\\.",r:0,eE:!0,rB:!0,l:"-"+e.IR,k:"-module -record -undef -export -ifdef -ifndef -author -copyright -doc -vsn -import -include -include_lib -compile -define -else -endif -file -behaviour -behavior -spec",c:[v]},i,e.QSM,f,t,l,o,{b:/\.$/}]}});hljs.registerLanguage("kotlin",function(e){var a="val var get set class trait object public open private protected final enum if else do while for when break continue throw try catch finally import package is as in return fun override default companion reified inline volatile transient native";return{k:{typename:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null",keyword:a},c:[e.CLCM,{cN:"javadoc",b:"/\\*\\*",e:"\\*//*",r:0,c:[{cN:"javadoctag",b:"(^|\\s)@[A-Za-z]+"}]},e.CBCM,{cN:"type",b://,rB:!0,eE:!1,r:0},{cN:"function",bK:"fun",e:"[(]|$",rB:!0,eE:!0,k:a,i:/fun\s+(<.*>)?[^\s\(]+(\s+[^\s\(]+)\s*=/,r:5,c:[{b:e.UIR+"\\s*\\(",rB:!0,r:0,c:[e.UTM]},{cN:"type",b://,k:"reified",r:0},{cN:"params",b:/\(/,e:/\)/,k:a,r:0,i:/\([^\(,\s:]+,/,c:[{cN:"typename",b:/:\s*/,e:/\s*[=\)]/,eB:!0,rE:!0,r:0}]},e.CLCM,e.CBCM]},{cN:"class",bK:"class trait",e:/[:\{(]|$/,eE:!0,i:"extends implements",c:[e.UTM,{cN:"type",b://,eB:!0,eE:!0,r:0},{cN:"typename",b:/[,:]\s*/,e:/[<\(,]|$/,eB:!0,rE:!0}]},{cN:"variable",bK:"var val",e:/\s*[=:$]/,eE:!0},e.QSM,{cN:"shebang",b:"^#!/usr/bin/env",e:"$",i:"\n"},e.CNM]}});hljs.registerLanguage("stylus",function(t){var e={cN:"variable",b:"\\$"+t.IR},o={cN:"hexcolor",b:"#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})",r:10},i=["charset","css","debug","extend","font-face","for","import","include","media","mixin","page","warn","while"],r=["after","before","first-letter","first-line","active","first-child","focus","hover","lang","link","visited"],n=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],a="[\\.\\s\\n\\[\\:,]",l=["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","auto","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","clip-path","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-variant-ligatures","font-weight","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inherit","initial","justify-content","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","max-height","max-width","min-height","min-width","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","pointer-events","position","quotes","resize","right","tab-size","table-layout","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"],d=["\\{","\\}","\\?","(\\bReturn\\b)","(\\bEnd\\b)","(\\bend\\b)",";","#\\s","\\*\\s","===\\s","\\|","%"];return{aliases:["styl"],cI:!1,i:"("+d.join("|")+")",k:"if else for in",c:[t.QSM,t.ASM,t.CLCM,t.CBCM,o,{b:"\\.[a-zA-Z][a-zA-Z0-9_-]*"+a,rB:!0,c:[{cN:"class",b:"\\.[a-zA-Z][a-zA-Z0-9_-]*"}]},{b:"\\#[a-zA-Z][a-zA-Z0-9_-]*"+a,rB:!0,c:[{cN:"id",b:"\\#[a-zA-Z][a-zA-Z0-9_-]*"}]},{b:"\\b("+n.join("|")+")"+a,rB:!0,c:[{cN:"tag",b:"\\b[a-zA-Z][a-zA-Z0-9_-]*"}]},{cN:"pseudo",b:"&?:?:\\b("+r.join("|")+")"+a},{cN:"at_rule",b:"@("+i.join("|")+")\\b"},e,t.CSSNM,t.NM,{cN:"function",b:"\\b[a-zA-Z][a-zA-Z0-9_-]*\\(.*\\)",i:"[\\n]",rB:!0,c:[{cN:"title",b:"\\b[a-zA-Z][a-zA-Z0-9_-]*"},{cN:"params",b:/\(/,e:/\)/,c:[o,e,t.ASM,t.CSSNM,t.NM,t.QSM]}]},{cN:"attribute",b:"\\b("+l.reverse().join("|")+")\\b"}]}});hljs.registerLanguage("css",function(e){var c="[a-zA-Z-][a-zA-Z0-9_-]*",a={cN:"function",b:c+"\\(",rB:!0,eE:!0,e:"\\("},r={cN:"rule",b:/[A-Z\_\.\-]+\s*:/,rB:!0,e:";",eW:!0,c:[{cN:"attribute",b:/\S/,e:":",eE:!0,starts:{cN:"value",eW:!0,eE:!0,c:[a,e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"hexcolor",b:"#[0-9A-Fa-f]+"},{cN:"important",b:"!important"}]}}]};return{cI:!0,i:/[=\/|']/,c:[e.CBCM,r,{cN:"id",b:/\#[A-Za-z0-9_-]+/},{cN:"class",b:/\.[A-Za-z0-9_-]+/,r:0},{cN:"attr_selector",b:/\[/,e:/\]/,i:"$"},{cN:"pseudo",b:/:(:)?[a-zA-Z0-9\_\-\+\(\)"']+/},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{cN:"at_rule",b:"@",e:"[{;]",c:[{cN:"keyword",b:/\S+/},{b:/\s/,eW:!0,eE:!0,r:0,c:[a,e.ASM,e.QSM,e.CSSNM]}]},{cN:"tag",b:c,r:0},{cN:"rules",b:"{",e:"}",i:/\S/,r:0,c:[e.CBCM,r]}]}});hljs.registerLanguage("puppet",function(e){var s="augeas computer cron exec file filebucket host interface k5login macauthorization mailalias maillist mcx mount nagios_command nagios_contact nagios_contactgroup nagios_host nagios_hostdependency nagios_hostescalation nagios_hostextinfo nagios_hostgroup nagios_service firewall nagios_servicedependency nagios_serviceescalation nagios_serviceextinfo nagios_servicegroup nagios_timeperiod notify package resources router schedule scheduled_task selboolean selmodule service ssh_authorized_key sshkey stage tidy user vlan yumrepo zfs zone zpool",r="alias audit before loglevel noop require subscribe tag owner ensure group mode name|0 changes context force incl lens load_path onlyif provider returns root show_diff type_check en_address ip_address realname command environment hour monute month monthday special target weekday creates cwd ogoutput refresh refreshonly tries try_sleep umask backup checksum content ctime force ignore links mtime purge recurse recurselimit replace selinux_ignore_defaults selrange selrole seltype seluser source souirce_permissions sourceselect validate_cmd validate_replacement allowdupe attribute_membership auth_membership forcelocal gid ia_load_module members system host_aliases ip allowed_trunk_vlans description device_url duplex encapsulation etherchannel native_vlan speed principals allow_root auth_class auth_type authenticate_user k_of_n mechanisms rule session_owner shared options device fstype enable hasrestart directory present absent link atboot blockdevice device dump pass remounts poller_tag use message withpath adminfile allow_virtual allowcdrom category configfiles flavor install_options instance package_settings platform responsefile status uninstall_options vendor unless_system_user unless_uid binary control flags hasstatus manifest pattern restart running start stop allowdupe auths expiry gid groups home iterations key_membership keys managehome membership password password_max_age password_min_age profile_membership profiles project purge_ssh_keys role_membership roles salt shell uid baseurl cost descr enabled enablegroups exclude failovermethod gpgcheck gpgkey http_caching include includepkgs keepalive metadata_expire metalink mirrorlist priority protect proxy proxy_password proxy_username repo_gpgcheck s3_enabled skip_if_unavailable sslcacert sslclientcert sslclientkey sslverify mounted",a={keyword:"and case class default define else elsif false if in import enherits node or true undef unless main settings $string "+s,literal:r,built_in:"architecture augeasversion blockdevices boardmanufacturer boardproductname boardserialnumber cfkey dhcp_servers domain ec2_ ec2_userdata facterversion filesystems ldom fqdn gid hardwareisa hardwaremodel hostname id|0 interfaces ipaddress ipaddress_ ipaddress6 ipaddress6_ iphostnumber is_virtual kernel kernelmajversion kernelrelease kernelversion kernelrelease kernelversion lsbdistcodename lsbdistdescription lsbdistid lsbdistrelease lsbmajdistrelease lsbminordistrelease lsbrelease macaddress macaddress_ macosx_buildversion macosx_productname macosx_productversion macosx_productverson_major macosx_productversion_minor manufacturer memoryfree memorysize netmask metmask_ network_ operatingsystem operatingsystemmajrelease operatingsystemrelease osfamily partitions path physicalprocessorcount processor processorcount productname ps puppetversion rubysitedir rubyversion selinux selinux_config_mode selinux_config_policy selinux_current_mode selinux_current_mode selinux_enforced selinux_policyversion serialnumber sp_ sshdsakey sshecdsakey sshrsakey swapencrypted swapfree swapsize timezone type uniqueid uptime uptime_days uptime_hours uptime_seconds uuid virtual vlans xendomains zfs_version zonenae zones zpool_version"},i=e.C("#","$"),o={cN:"string",c:[e.BE],v:[{b:/'/,e:/'/},{b:/"/,e:/"/}]},n=[o,i,{cN:"keyword",bK:"class",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"(::)?[A-Za-z_]\\w*(::\\w+)*"}),i,o]},{cN:"keyword",b:"([a-zA-Z_(::)]+ *\\{)",c:[o,i],r:0},{cN:"keyword",b:"(\\}|\\{)",r:0},{cN:"function",b:"[a-zA-Z_]+\\s*=>"},{cN:"constant",b:"(::)?(\\b[A-Z][a-z_]*(::)?)+",r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0}];return{aliases:["pp"],k:a,c:n}});hljs.registerLanguage("nimrod",function(t){return{aliases:["nim"],k:{keyword:"addr and as asm bind block break|0 case|0 cast const|0 continue|0 converter discard distinct|10 div do elif else|0 end|0 enum|0 except export finally for from generic if|0 import|0 in include|0 interface is isnot|10 iterator|10 let|0 macro method|10 mixin mod nil not notin|10 object|0 of or out proc|10 ptr raise ref|10 return shl shr static template|10 try|0 tuple type|0 using|0 var|0 when while|0 with without xor yield",literal:"shared guarded stdin stdout stderr result|10 true false"},c:[{cN:"decorator",b:/{\./,e:/\.}/,r:10},{cN:"string",b:/[a-zA-Z]\w*"/,e:/"/,c:[{b:/""/}]},{cN:"string",b:/([a-zA-Z]\w*)?"""/,e:/"""/},t.QSM,{cN:"type",b:/\b[A-Z]\w+\b/,r:0},{cN:"type",b:/\b(int|int8|int16|int32|int64|uint|uint8|uint16|uint32|uint64|float|float32|float64|bool|char|string|cstring|pointer|expr|stmt|void|auto|any|range|array|openarray|varargs|seq|set|clong|culong|cchar|cschar|cshort|cint|csize|clonglong|cfloat|cdouble|clongdouble|cuchar|cushort|cuint|culonglong|cstringarray|semistatic)\b/},{cN:"number",b:/\b(0[xX][0-9a-fA-F][_0-9a-fA-F]*)('?[iIuU](8|16|32|64))?/,r:0},{cN:"number",b:/\b(0o[0-7][_0-7]*)('?[iIuUfF](8|16|32|64))?/,r:0},{cN:"number",b:/\b(0(b|B)[01][_01]*)('?[iIuUfF](8|16|32|64))?/,r:0},{cN:"number",b:/\b(\d[_\d]*)('?[iIuUfF](8|16|32|64))?/,r:0},t.HCM]}});hljs.registerLanguage("smalltalk",function(a){var r="[a-z][a-zA-Z0-9_]*",s={cN:"char",b:"\\$.{1}"},c={cN:"symbol",b:"#"+a.UIR};return{aliases:["st"],k:"self super nil true false thisContext",c:[a.C('"','"'),a.ASM,{cN:"class",b:"\\b[A-Z][A-Za-z0-9_]*",r:0},{cN:"method",b:r+":",r:0},a.CNM,c,s,{cN:"localvars",b:"\\|[ ]*"+r+"([ ]+"+r+")*[ ]*\\|",rB:!0,e:/\|/,i:/\S/,c:[{b:"(\\|[ ]*)?"+r}]},{cN:"array",b:"\\#\\(",e:"\\)",c:[a.ASM,s,a.CNM,c]}]}});hljs.registerLanguage("x86asm",function(s){return{cI:!0,l:"\\.?"+s.IR,k:{keyword:"lock rep repe repz repne repnz xaquire xrelease bnd nobnd aaa aad aam aas adc add and arpl bb0_reset bb1_reset bound bsf bsr bswap bt btc btr bts call cbw cdq cdqe clc cld cli clts cmc cmp cmpsb cmpsd cmpsq cmpsw cmpxchg cmpxchg486 cmpxchg8b cmpxchg16b cpuid cpu_read cpu_write cqo cwd cwde daa das dec div dmint emms enter equ f2xm1 fabs fadd faddp fbld fbstp fchs fclex fcmovb fcmovbe fcmove fcmovnb fcmovnbe fcmovne fcmovnu fcmovu fcom fcomi fcomip fcomp fcompp fcos fdecstp fdisi fdiv fdivp fdivr fdivrp femms feni ffree ffreep fiadd ficom ficomp fidiv fidivr fild fimul fincstp finit fist fistp fisttp fisub fisubr fld fld1 fldcw fldenv fldl2e fldl2t fldlg2 fldln2 fldpi fldz fmul fmulp fnclex fndisi fneni fninit fnop fnsave fnstcw fnstenv fnstsw fpatan fprem fprem1 fptan frndint frstor fsave fscale fsetpm fsin fsincos fsqrt fst fstcw fstenv fstp fstsw fsub fsubp fsubr fsubrp ftst fucom fucomi fucomip fucomp fucompp fxam fxch fxtract fyl2x fyl2xp1 hlt ibts icebp idiv imul in inc incbin insb insd insw int int01 int1 int03 int3 into invd invpcid invlpg invlpga iret iretd iretq iretw jcxz jecxz jrcxz jmp jmpe lahf lar lds lea leave les lfence lfs lgdt lgs lidt lldt lmsw loadall loadall286 lodsb lodsd lodsq lodsw loop loope loopne loopnz loopz lsl lss ltr mfence monitor mov movd movq movsb movsd movsq movsw movsx movsxd movzx mul mwait neg nop not or out outsb outsd outsw packssdw packsswb packuswb paddb paddd paddsb paddsiw paddsw paddusb paddusw paddw pand pandn pause paveb pavgusb pcmpeqb pcmpeqd pcmpeqw pcmpgtb pcmpgtd pcmpgtw pdistib pf2id pfacc pfadd pfcmpeq pfcmpge pfcmpgt pfmax pfmin pfmul pfrcp pfrcpit1 pfrcpit2 pfrsqit1 pfrsqrt pfsub pfsubr pi2fd pmachriw pmaddwd pmagw pmulhriw pmulhrwa pmulhrwc pmulhw pmullw pmvgezb pmvlzb pmvnzb pmvzb pop popa popad popaw popf popfd popfq popfw por prefetch prefetchw pslld psllq psllw psrad psraw psrld psrlq psrlw psubb psubd psubsb psubsiw psubsw psubusb psubusw psubw punpckhbw punpckhdq punpckhwd punpcklbw punpckldq punpcklwd push pusha pushad pushaw pushf pushfd pushfq pushfw pxor rcl rcr rdshr rdmsr rdpmc rdtsc rdtscp ret retf retn rol ror rdm rsdc rsldt rsm rsts sahf sal salc sar sbb scasb scasd scasq scasw sfence sgdt shl shld shr shrd sidt sldt skinit smi smint smintold smsw stc std sti stosb stosd stosq stosw str sub svdc svldt svts swapgs syscall sysenter sysexit sysret test ud0 ud1 ud2b ud2 ud2a umov verr verw fwait wbinvd wrshr wrmsr xadd xbts xchg xlatb xlat xor cmove cmovz cmovne cmovnz cmova cmovnbe cmovae cmovnb cmovb cmovnae cmovbe cmovna cmovg cmovnle cmovge cmovnl cmovl cmovnge cmovle cmovng cmovc cmovnc cmovo cmovno cmovs cmovns cmovp cmovpe cmovnp cmovpo je jz jne jnz ja jnbe jae jnb jb jnae jbe jna jg jnle jge jnl jl jnge jle jng jc jnc jo jno js jns jpo jnp jpe jp sete setz setne setnz seta setnbe setae setnb setnc setb setnae setcset setbe setna setg setnle setge setnl setl setnge setle setng sets setns seto setno setpe setp setpo setnp addps addss andnps andps cmpeqps cmpeqss cmpleps cmpless cmpltps cmpltss cmpneqps cmpneqss cmpnleps cmpnless cmpnltps cmpnltss cmpordps cmpordss cmpunordps cmpunordss cmpps cmpss comiss cvtpi2ps cvtps2pi cvtsi2ss cvtss2si cvttps2pi cvttss2si divps divss ldmxcsr maxps maxss minps minss movaps movhps movlhps movlps movhlps movmskps movntps movss movups mulps mulss orps rcpps rcpss rsqrtps rsqrtss shufps sqrtps sqrtss stmxcsr subps subss ucomiss unpckhps unpcklps xorps fxrstor fxrstor64 fxsave fxsave64 xgetbv xsetbv xsave xsave64 xsaveopt xsaveopt64 xrstor xrstor64 prefetchnta prefetcht0 prefetcht1 prefetcht2 maskmovq movntq pavgb pavgw pextrw pinsrw pmaxsw pmaxub pminsw pminub pmovmskb pmulhuw psadbw pshufw pf2iw pfnacc pfpnacc pi2fw pswapd maskmovdqu clflush movntdq movnti movntpd movdqa movdqu movdq2q movq2dq paddq pmuludq pshufd pshufhw pshuflw pslldq psrldq psubq punpckhqdq punpcklqdq addpd addsd andnpd andpd cmpeqpd cmpeqsd cmplepd cmplesd cmpltpd cmpltsd cmpneqpd cmpneqsd cmpnlepd cmpnlesd cmpnltpd cmpnltsd cmpordpd cmpordsd cmpunordpd cmpunordsd cmppd comisd cvtdq2pd cvtdq2ps cvtpd2dq cvtpd2pi cvtpd2ps cvtpi2pd cvtps2dq cvtps2pd cvtsd2si cvtsd2ss cvtsi2sd cvtss2sd cvttpd2pi cvttpd2dq cvttps2dq cvttsd2si divpd divsd maxpd maxsd minpd minsd movapd movhpd movlpd movmskpd movupd mulpd mulsd orpd shufpd sqrtpd sqrtsd subpd subsd ucomisd unpckhpd unpcklpd xorpd addsubpd addsubps haddpd haddps hsubpd hsubps lddqu movddup movshdup movsldup clgi stgi vmcall vmclear vmfunc vmlaunch vmload vmmcall vmptrld vmptrst vmread vmresume vmrun vmsave vmwrite vmxoff vmxon invept invvpid pabsb pabsw pabsd palignr phaddw phaddd phaddsw phsubw phsubd phsubsw pmaddubsw pmulhrsw pshufb psignb psignw psignd extrq insertq movntsd movntss lzcnt blendpd blendps blendvpd blendvps dppd dpps extractps insertps movntdqa mpsadbw packusdw pblendvb pblendw pcmpeqq pextrb pextrd pextrq phminposuw pinsrb pinsrd pinsrq pmaxsb pmaxsd pmaxud pmaxuw pminsb pminsd pminud pminuw pmovsxbw pmovsxbd pmovsxbq pmovsxwd pmovsxwq pmovsxdq pmovzxbw pmovzxbd pmovzxbq pmovzxwd pmovzxwq pmovzxdq pmuldq pmulld ptest roundpd roundps roundsd roundss crc32 pcmpestri pcmpestrm pcmpistri pcmpistrm pcmpgtq popcnt getsec pfrcpv pfrsqrtv movbe aesenc aesenclast aesdec aesdeclast aesimc aeskeygenassist vaesenc vaesenclast vaesdec vaesdeclast vaesimc vaeskeygenassist vaddpd vaddps vaddsd vaddss vaddsubpd vaddsubps vandpd vandps vandnpd vandnps vblendpd vblendps vblendvpd vblendvps vbroadcastss vbroadcastsd vbroadcastf128 vcmpeq_ospd vcmpeqpd vcmplt_ospd vcmpltpd vcmple_ospd vcmplepd vcmpunord_qpd vcmpunordpd vcmpneq_uqpd vcmpneqpd vcmpnlt_uspd vcmpnltpd vcmpnle_uspd vcmpnlepd vcmpord_qpd vcmpordpd vcmpeq_uqpd vcmpnge_uspd vcmpngepd vcmpngt_uspd vcmpngtpd vcmpfalse_oqpd vcmpfalsepd vcmpneq_oqpd vcmpge_ospd vcmpgepd vcmpgt_ospd vcmpgtpd vcmptrue_uqpd vcmptruepd vcmplt_oqpd vcmple_oqpd vcmpunord_spd vcmpneq_uspd vcmpnlt_uqpd vcmpnle_uqpd vcmpord_spd vcmpeq_uspd vcmpnge_uqpd vcmpngt_uqpd vcmpfalse_ospd vcmpneq_ospd vcmpge_oqpd vcmpgt_oqpd vcmptrue_uspd vcmppd vcmpeq_osps vcmpeqps vcmplt_osps vcmpltps vcmple_osps vcmpleps vcmpunord_qps vcmpunordps vcmpneq_uqps vcmpneqps vcmpnlt_usps vcmpnltps vcmpnle_usps vcmpnleps vcmpord_qps vcmpordps vcmpeq_uqps vcmpnge_usps vcmpngeps vcmpngt_usps vcmpngtps vcmpfalse_oqps vcmpfalseps vcmpneq_oqps vcmpge_osps vcmpgeps vcmpgt_osps vcmpgtps vcmptrue_uqps vcmptrueps vcmplt_oqps vcmple_oqps vcmpunord_sps vcmpneq_usps vcmpnlt_uqps vcmpnle_uqps vcmpord_sps vcmpeq_usps vcmpnge_uqps vcmpngt_uqps vcmpfalse_osps vcmpneq_osps vcmpge_oqps vcmpgt_oqps vcmptrue_usps vcmpps vcmpeq_ossd vcmpeqsd vcmplt_ossd vcmpltsd vcmple_ossd vcmplesd vcmpunord_qsd vcmpunordsd vcmpneq_uqsd vcmpneqsd vcmpnlt_ussd vcmpnltsd vcmpnle_ussd vcmpnlesd vcmpord_qsd vcmpordsd vcmpeq_uqsd vcmpnge_ussd vcmpngesd vcmpngt_ussd vcmpngtsd vcmpfalse_oqsd vcmpfalsesd vcmpneq_oqsd vcmpge_ossd vcmpgesd vcmpgt_ossd vcmpgtsd vcmptrue_uqsd vcmptruesd vcmplt_oqsd vcmple_oqsd vcmpunord_ssd vcmpneq_ussd vcmpnlt_uqsd vcmpnle_uqsd vcmpord_ssd vcmpeq_ussd vcmpnge_uqsd vcmpngt_uqsd vcmpfalse_ossd vcmpneq_ossd vcmpge_oqsd vcmpgt_oqsd vcmptrue_ussd vcmpsd vcmpeq_osss vcmpeqss vcmplt_osss vcmpltss vcmple_osss vcmpless vcmpunord_qss vcmpunordss vcmpneq_uqss vcmpneqss vcmpnlt_usss vcmpnltss vcmpnle_usss vcmpnless vcmpord_qss vcmpordss vcmpeq_uqss vcmpnge_usss vcmpngess vcmpngt_usss vcmpngtss vcmpfalse_oqss vcmpfalsess vcmpneq_oqss vcmpge_osss vcmpgess vcmpgt_osss vcmpgtss vcmptrue_uqss vcmptruess vcmplt_oqss vcmple_oqss vcmpunord_sss vcmpneq_usss vcmpnlt_uqss vcmpnle_uqss vcmpord_sss vcmpeq_usss vcmpnge_uqss vcmpngt_uqss vcmpfalse_osss vcmpneq_osss vcmpge_oqss vcmpgt_oqss vcmptrue_usss vcmpss vcomisd vcomiss vcvtdq2pd vcvtdq2ps vcvtpd2dq vcvtpd2ps vcvtps2dq vcvtps2pd vcvtsd2si vcvtsd2ss vcvtsi2sd vcvtsi2ss vcvtss2sd vcvtss2si vcvttpd2dq vcvttps2dq vcvttsd2si vcvttss2si vdivpd vdivps vdivsd vdivss vdppd vdpps vextractf128 vextractps vhaddpd vhaddps vhsubpd vhsubps vinsertf128 vinsertps vlddqu vldqqu vldmxcsr vmaskmovdqu vmaskmovps vmaskmovpd vmaxpd vmaxps vmaxsd vmaxss vminpd vminps vminsd vminss vmovapd vmovaps vmovd vmovq vmovddup vmovdqa vmovqqa vmovdqu vmovqqu vmovhlps vmovhpd vmovhps vmovlhps vmovlpd vmovlps vmovmskpd vmovmskps vmovntdq vmovntqq vmovntdqa vmovntpd vmovntps vmovsd vmovshdup vmovsldup vmovss vmovupd vmovups vmpsadbw vmulpd vmulps vmulsd vmulss vorpd vorps vpabsb vpabsw vpabsd vpacksswb vpackssdw vpackuswb vpackusdw vpaddb vpaddw vpaddd vpaddq vpaddsb vpaddsw vpaddusb vpaddusw vpalignr vpand vpandn vpavgb vpavgw vpblendvb vpblendw vpcmpestri vpcmpestrm vpcmpistri vpcmpistrm vpcmpeqb vpcmpeqw vpcmpeqd vpcmpeqq vpcmpgtb vpcmpgtw vpcmpgtd vpcmpgtq vpermilpd vpermilps vperm2f128 vpextrb vpextrw vpextrd vpextrq vphaddw vphaddd vphaddsw vphminposuw vphsubw vphsubd vphsubsw vpinsrb vpinsrw vpinsrd vpinsrq vpmaddwd vpmaddubsw vpmaxsb vpmaxsw vpmaxsd vpmaxub vpmaxuw vpmaxud vpminsb vpminsw vpminsd vpminub vpminuw vpminud vpmovmskb vpmovsxbw vpmovsxbd vpmovsxbq vpmovsxwd vpmovsxwq vpmovsxdq vpmovzxbw vpmovzxbd vpmovzxbq vpmovzxwd vpmovzxwq vpmovzxdq vpmulhuw vpmulhrsw vpmulhw vpmullw vpmulld vpmuludq vpmuldq vpor vpsadbw vpshufb vpshufd vpshufhw vpshuflw vpsignb vpsignw vpsignd vpslldq vpsrldq vpsllw vpslld vpsllq vpsraw vpsrad vpsrlw vpsrld vpsrlq vptest vpsubb vpsubw vpsubd vpsubq vpsubsb vpsubsw vpsubusb vpsubusw vpunpckhbw vpunpckhwd vpunpckhdq vpunpckhqdq vpunpcklbw vpunpcklwd vpunpckldq vpunpcklqdq vpxor vrcpps vrcpss vrsqrtps vrsqrtss vroundpd vroundps vroundsd vroundss vshufpd vshufps vsqrtpd vsqrtps vsqrtsd vsqrtss vstmxcsr vsubpd vsubps vsubsd vsubss vtestps vtestpd vucomisd vucomiss vunpckhpd vunpckhps vunpcklpd vunpcklps vxorpd vxorps vzeroall vzeroupper pclmullqlqdq pclmulhqlqdq pclmullqhqdq pclmulhqhqdq pclmulqdq vpclmullqlqdq vpclmulhqlqdq vpclmullqhqdq vpclmulhqhqdq vpclmulqdq vfmadd132ps vfmadd132pd vfmadd312ps vfmadd312pd vfmadd213ps vfmadd213pd vfmadd123ps vfmadd123pd vfmadd231ps vfmadd231pd vfmadd321ps vfmadd321pd vfmaddsub132ps vfmaddsub132pd vfmaddsub312ps vfmaddsub312pd vfmaddsub213ps vfmaddsub213pd vfmaddsub123ps vfmaddsub123pd vfmaddsub231ps vfmaddsub231pd vfmaddsub321ps vfmaddsub321pd vfmsub132ps vfmsub132pd vfmsub312ps vfmsub312pd vfmsub213ps vfmsub213pd vfmsub123ps vfmsub123pd vfmsub231ps vfmsub231pd vfmsub321ps vfmsub321pd vfmsubadd132ps vfmsubadd132pd vfmsubadd312ps vfmsubadd312pd vfmsubadd213ps vfmsubadd213pd vfmsubadd123ps vfmsubadd123pd vfmsubadd231ps vfmsubadd231pd vfmsubadd321ps vfmsubadd321pd vfnmadd132ps vfnmadd132pd vfnmadd312ps vfnmadd312pd vfnmadd213ps vfnmadd213pd vfnmadd123ps vfnmadd123pd vfnmadd231ps vfnmadd231pd vfnmadd321ps vfnmadd321pd vfnmsub132ps vfnmsub132pd vfnmsub312ps vfnmsub312pd vfnmsub213ps vfnmsub213pd vfnmsub123ps vfnmsub123pd vfnmsub231ps vfnmsub231pd vfnmsub321ps vfnmsub321pd vfmadd132ss vfmadd132sd vfmadd312ss vfmadd312sd vfmadd213ss vfmadd213sd vfmadd123ss vfmadd123sd vfmadd231ss vfmadd231sd vfmadd321ss vfmadd321sd vfmsub132ss vfmsub132sd vfmsub312ss vfmsub312sd vfmsub213ss vfmsub213sd vfmsub123ss vfmsub123sd vfmsub231ss vfmsub231sd vfmsub321ss vfmsub321sd vfnmadd132ss vfnmadd132sd vfnmadd312ss vfnmadd312sd vfnmadd213ss vfnmadd213sd vfnmadd123ss vfnmadd123sd vfnmadd231ss vfnmadd231sd vfnmadd321ss vfnmadd321sd vfnmsub132ss vfnmsub132sd vfnmsub312ss vfnmsub312sd vfnmsub213ss vfnmsub213sd vfnmsub123ss vfnmsub123sd vfnmsub231ss vfnmsub231sd vfnmsub321ss vfnmsub321sd rdfsbase rdgsbase rdrand wrfsbase wrgsbase vcvtph2ps vcvtps2ph adcx adox rdseed clac stac xstore xcryptecb xcryptcbc xcryptctr xcryptcfb xcryptofb montmul xsha1 xsha256 llwpcb slwpcb lwpval lwpins vfmaddpd vfmaddps vfmaddsd vfmaddss vfmaddsubpd vfmaddsubps vfmsubaddpd vfmsubaddps vfmsubpd vfmsubps vfmsubsd vfmsubss vfnmaddpd vfnmaddps vfnmaddsd vfnmaddss vfnmsubpd vfnmsubps vfnmsubsd vfnmsubss vfrczpd vfrczps vfrczsd vfrczss vpcmov vpcomb vpcomd vpcomq vpcomub vpcomud vpcomuq vpcomuw vpcomw vphaddbd vphaddbq vphaddbw vphadddq vphaddubd vphaddubq vphaddubw vphaddudq vphadduwd vphadduwq vphaddwd vphaddwq vphsubbw vphsubdq vphsubwd vpmacsdd vpmacsdqh vpmacsdql vpmacssdd vpmacssdqh vpmacssdql vpmacsswd vpmacssww vpmacswd vpmacsww vpmadcsswd vpmadcswd vpperm vprotb vprotd vprotq vprotw vpshab vpshad vpshaq vpshaw vpshlb vpshld vpshlq vpshlw vbroadcasti128 vpblendd vpbroadcastb vpbroadcastw vpbroadcastd vpbroadcastq vpermd vpermpd vpermps vpermq vperm2i128 vextracti128 vinserti128 vpmaskmovd vpmaskmovq vpsllvd vpsllvq vpsravd vpsrlvd vpsrlvq vgatherdpd vgatherqpd vgatherdps vgatherqps vpgatherdd vpgatherqd vpgatherdq vpgatherqq xabort xbegin xend xtest andn bextr blci blcic blsi blsic blcfill blsfill blcmsk blsmsk blsr blcs bzhi mulx pdep pext rorx sarx shlx shrx tzcnt tzmsk t1mskc valignd valignq vblendmpd vblendmps vbroadcastf32x4 vbroadcastf64x4 vbroadcasti32x4 vbroadcasti64x4 vcompresspd vcompressps vcvtpd2udq vcvtps2udq vcvtsd2usi vcvtss2usi vcvttpd2udq vcvttps2udq vcvttsd2usi vcvttss2usi vcvtudq2pd vcvtudq2ps vcvtusi2sd vcvtusi2ss vexpandpd vexpandps vextractf32x4 vextractf64x4 vextracti32x4 vextracti64x4 vfixupimmpd vfixupimmps vfixupimmsd vfixupimmss vgetexppd vgetexpps vgetexpsd vgetexpss vgetmantpd vgetmantps vgetmantsd vgetmantss vinsertf32x4 vinsertf64x4 vinserti32x4 vinserti64x4 vmovdqa32 vmovdqa64 vmovdqu32 vmovdqu64 vpabsq vpandd vpandnd vpandnq vpandq vpblendmd vpblendmq vpcmpltd vpcmpled vpcmpneqd vpcmpnltd vpcmpnled vpcmpd vpcmpltq vpcmpleq vpcmpneqq vpcmpnltq vpcmpnleq vpcmpq vpcmpequd vpcmpltud vpcmpleud vpcmpnequd vpcmpnltud vpcmpnleud vpcmpud vpcmpequq vpcmpltuq vpcmpleuq vpcmpnequq vpcmpnltuq vpcmpnleuq vpcmpuq vpcompressd vpcompressq vpermi2d vpermi2pd vpermi2ps vpermi2q vpermt2d vpermt2pd vpermt2ps vpermt2q vpexpandd vpexpandq vpmaxsq vpmaxuq vpminsq vpminuq vpmovdb vpmovdw vpmovqb vpmovqd vpmovqw vpmovsdb vpmovsdw vpmovsqb vpmovsqd vpmovsqw vpmovusdb vpmovusdw vpmovusqb vpmovusqd vpmovusqw vpord vporq vprold vprolq vprolvd vprolvq vprord vprorq vprorvd vprorvq vpscatterdd vpscatterdq vpscatterqd vpscatterqq vpsraq vpsravq vpternlogd vpternlogq vptestmd vptestmq vptestnmd vptestnmq vpxord vpxorq vrcp14pd vrcp14ps vrcp14sd vrcp14ss vrndscalepd vrndscaleps vrndscalesd vrndscaless vrsqrt14pd vrsqrt14ps vrsqrt14sd vrsqrt14ss vscalefpd vscalefps vscalefsd vscalefss vscatterdpd vscatterdps vscatterqpd vscatterqps vshuff32x4 vshuff64x2 vshufi32x4 vshufi64x2 kandnw kandw kmovw knotw kortestw korw kshiftlw kshiftrw kunpckbw kxnorw kxorw vpbroadcastmb2q vpbroadcastmw2d vpconflictd vpconflictq vplzcntd vplzcntq vexp2pd vexp2ps vrcp28pd vrcp28ps vrcp28sd vrcp28ss vrsqrt28pd vrsqrt28ps vrsqrt28sd vrsqrt28ss vgatherpf0dpd vgatherpf0dps vgatherpf0qpd vgatherpf0qps vgatherpf1dpd vgatherpf1dps vgatherpf1qpd vgatherpf1qps vscatterpf0dpd vscatterpf0dps vscatterpf0qpd vscatterpf0qps vscatterpf1dpd vscatterpf1dps vscatterpf1qpd vscatterpf1qps prefetchwt1 bndmk bndcl bndcu bndcn bndmov bndldx bndstx sha1rnds4 sha1nexte sha1msg1 sha1msg2 sha256rnds2 sha256msg1 sha256msg2 hint_nop0 hint_nop1 hint_nop2 hint_nop3 hint_nop4 hint_nop5 hint_nop6 hint_nop7 hint_nop8 hint_nop9 hint_nop10 hint_nop11 hint_nop12 hint_nop13 hint_nop14 hint_nop15 hint_nop16 hint_nop17 hint_nop18 hint_nop19 hint_nop20 hint_nop21 hint_nop22 hint_nop23 hint_nop24 hint_nop25 hint_nop26 hint_nop27 hint_nop28 hint_nop29 hint_nop30 hint_nop31 hint_nop32 hint_nop33 hint_nop34 hint_nop35 hint_nop36 hint_nop37 hint_nop38 hint_nop39 hint_nop40 hint_nop41 hint_nop42 hint_nop43 hint_nop44 hint_nop45 hint_nop46 hint_nop47 hint_nop48 hint_nop49 hint_nop50 hint_nop51 hint_nop52 hint_nop53 hint_nop54 hint_nop55 hint_nop56 hint_nop57 hint_nop58 hint_nop59 hint_nop60 hint_nop61 hint_nop62 hint_nop63",literal:"ip eip rip al ah bl bh cl ch dl dh sil dil bpl spl r8b r9b r10b r11b r12b r13b r14b r15b ax bx cx dx si di bp sp r8w r9w r10w r11w r12w r13w r14w r15w eax ebx ecx edx esi edi ebp esp eip r8d r9d r10d r11d r12d r13d r14d r15d rax rbx rcx rdx rsi rdi rbp rsp r8 r9 r10 r11 r12 r13 r14 r15 cs ds es fs gs ss st st0 st1 st2 st3 st4 st5 st6 st7 mm0 mm1 mm2 mm3 mm4 mm5 mm6 mm7 xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8 xmm9 xmm10 xmm11 xmm12 xmm13 xmm14 xmm15 xmm16 xmm17 xmm18 xmm19 xmm20 xmm21 xmm22 xmm23 xmm24 xmm25 xmm26 xmm27 xmm28 xmm29 xmm30 xmm31 ymm0 ymm1 ymm2 ymm3 ymm4 ymm5 ymm6 ymm7 ymm8 ymm9 ymm10 ymm11 ymm12 ymm13 ymm14 ymm15 ymm16 ymm17 ymm18 ymm19 ymm20 ymm21 ymm22 ymm23 ymm24 ymm25 ymm26 ymm27 ymm28 ymm29 ymm30 ymm31 zmm0 zmm1 zmm2 zmm3 zmm4 zmm5 zmm6 zmm7 zmm8 zmm9 zmm10 zmm11 zmm12 zmm13 zmm14 zmm15 zmm16 zmm17 zmm18 zmm19 zmm20 zmm21 zmm22 zmm23 zmm24 zmm25 zmm26 zmm27 zmm28 zmm29 zmm30 zmm31 k0 k1 k2 k3 k4 k5 k6 k7 bnd0 bnd1 bnd2 bnd3 cr0 cr1 cr2 cr3 cr4 cr8 dr0 dr1 dr2 dr3 dr8 tr3 tr4 tr5 tr6 tr7 r0 r1 r2 r3 r4 r5 r6 r7 r0b r1b r2b r3b r4b r5b r6b r7b r0w r1w r2w r3w r4w r5w r6w r7w r0d r1d r2d r3d r4d r5d r6d r7d r0h r1h r2h r3h r0l r1l r2l r3l r4l r5l r6l r7l r8l r9l r10l r11l r12l r13l r14l r15l",pseudo:"db dw dd dq dt ddq do dy dz resb resw resd resq rest resdq reso resy resz incbin equ times",preprocessor:"%define %xdefine %+ %undef %defstr %deftok %assign %strcat %strlen %substr %rotate %elif %else %endif %ifmacro %ifctx %ifidn %ifidni %ifid %ifnum %ifstr %iftoken %ifempty %ifenv %error %warning %fatal %rep %endrep %include %push %pop %repl %pathsearch %depend %use %arg %stacksize %local %line %comment %endcomment .nolist byte word dword qword nosplit rel abs seg wrt strict near far a32 ptr __FILE__ __LINE__ __SECT__ __BITS__ __OUTPUT_FORMAT__ __DATE__ __TIME__ __DATE_NUM__ __TIME_NUM__ __UTC_DATE__ __UTC_TIME__ __UTC_DATE_NUM__ __UTC_TIME_NUM__ __PASS__ struc endstruc istruc at iend align alignb sectalign daz nodaz up down zero default option assume public ",built_in:"bits use16 use32 use64 default section segment absolute extern global common cpu float __utf16__ __utf16le__ __utf16be__ __utf32__ __utf32le__ __utf32be__ __float8__ __float16__ __float32__ __float64__ __float80m__ __float80e__ __float128l__ __float128h__ __Infinity__ __QNaN__ __SNaN__ Inf NaN QNaN SNaN float8 float16 float32 float64 float80m float80e float128l float128h __FLOAT_DAZ__ __FLOAT_ROUND__ __FLOAT__"},c:[s.C(";","$",{r:0}),{cN:"number",b:"\\b(?:([0-9][0-9_]*)?\\.[0-9_]*(?:[eE][+-]?[0-9_]+)?|(0[Xx])?[0-9][0-9_]*\\.?[0-9_]*(?:[pP](?:[+-]?[0-9_]+)?)?)\\b",r:0},{cN:"number",b:"\\$[0-9][0-9A-Fa-f]*",r:0},{cN:"number",b:"\\b(?:[0-9A-Fa-f][0-9A-Fa-f_]*[HhXx]|[0-9][0-9_]*[DdTt]?|[0-7][0-7_]*[QqOo]|[0-1][0-1_]*[BbYy])\\b"},{cN:"number",b:"\\b(?:0[HhXx][0-9A-Fa-f_]+|0[DdTt][0-9_]+|0[QqOo][0-7_]+|0[BbYy][0-1_]+)\\b"},s.QSM,{cN:"string",b:"'",e:"[^\\\\]'",r:0},{cN:"string",b:"`",e:"[^\\\\]`",r:0},{cN:"string",b:"\\.[A-Za-z0-9]+",r:0},{cN:"label",b:"^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)",r:0},{cN:"label",b:"^\\s*%%[A-Za-z0-9_$#@~.?]*:",r:0},{cN:"argument",b:"%[0-9]+",r:0},{cN:"built_in",b:"%!S+",r:0}]}});hljs.registerLanguage("roboconf",function(e){var n="[a-zA-Z-_][^\n{\r\n]+\\{";return{aliases:["graph","instances"],cI:!0,k:"import",c:[{cN:"facet",b:"^facet "+n,e:"}",k:"facet installer exports children extends",c:[e.HCM]},{cN:"instance-of",b:"^instance of "+n,e:"}",k:"name count channels instance-data instance-state instance of",c:[{cN:"keyword",b:"[a-zA-Z-_]+( | )*:"},e.HCM]},{cN:"component",b:"^"+n,e:"}",l:"\\(?[a-zA-Z]+\\)?",k:"installer exports children extends imports facets alias (optional)",c:[{cN:"string",b:"\\.[a-zA-Z-_]+",e:"\\s|,|;",eE:!0},e.HCM]},e.HCM]}});hljs.registerLanguage("ruby",function(e){var c="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",r="and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",b={cN:"yardoctag",b:"@[A-Za-z]+"},a={cN:"value",b:"#<",e:">"},n=[e.C("#","$",{c:[b]}),e.C("^\\=begin","^\\=end",{c:[b],r:10}),e.C("^__END__","\\n$")],s={cN:"subst",b:"#\\{",e:"}",k:r},t={cN:"string",c:[e.BE,s],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/`/,e:/`/},{b:"%[qQwWx]?\\(",e:"\\)"},{b:"%[qQwWx]?\\[",e:"\\]"},{b:"%[qQwWx]?{",e:"}"},{b:"%[qQwWx]?<",e:">"},{b:"%[qQwWx]?/",e:"/"},{b:"%[qQwWx]?%",e:"%"},{b:"%[qQwWx]?-",e:"-"},{b:"%[qQwWx]?\\|",e:"\\|"},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/}]},i={cN:"params",b:"\\(",e:"\\)",k:r},d=[t,a,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+e.IR+"::)?"+e.IR}]}].concat(n)},{cN:"function",bK:"def",e:" |$|;",r:0,c:[e.inherit(e.TM,{b:c}),i].concat(n)},{cN:"constant",b:"(::)?(\\b[A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":",c:[t,{b:c}],r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"("+e.RSR+")\\s*",c:[a,{cN:"regexp",c:[e.BE,s],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}].concat(n),r:0}].concat(n);s.c=d,i.c=d;var o="[>?]>",l="[\\w#]+\\(\\w+\\):\\d+:\\d+>",u="(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>",N=[{b:/^\s*=>/,cN:"status",starts:{e:"$",c:d}},{cN:"prompt",b:"^("+o+"|"+l+"|"+u+")",starts:{e:"$",c:d}}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:r,c:n.concat(N).concat(d)}});hljs.registerLanguage("typescript",function(e){return{aliases:["ts"],k:{keyword:"in if for while finally var new function|0 do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const class public private get set super interface extendsstatic constructor implements enum export import declare type protected",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document any number boolean string void"},c:[{cN:"pi",b:/^\s*('|")use strict('|")/,r:0},e.ASM,e.QSM,e.CLCM,e.CBCM,e.CNM,{b:"("+e.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[e.CLCM,e.CBCM,e.RM,{b:/;/,r:0,sL:"xml"}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[e.inherit(e.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,c:[e.CLCM,e.CBCM],i:/["'\(]/}],i:/\[|%/,r:0},{cN:"constructor",bK:"constructor",e:/\{/,eE:!0,r:10},{cN:"module",bK:"module",e:/\{/,eE:!0},{cN:"interface",bK:"interface",e:/\{/,eE:!0},{b:/\$[(.]/},{b:"\\."+e.IR,r:0}]}});hljs.registerLanguage("handlebars",function(e){var a="each in with if else unless bindattr action collection debugger log outlet template unbound view yield";return{aliases:["hbs","html.hbs","html.handlebars"],cI:!0,sL:"xml",subLanguageMode:"continuous",c:[{cN:"expression",b:"{{",e:"}}",c:[{cN:"begin-block",b:"#[a-zA-Z- .]+",k:a},{cN:"string",b:'"',e:'"'},{cN:"end-block",b:"\\/[a-zA-Z- .]+",k:a},{cN:"variable",b:"[a-zA-Z-.]+",k:a}]}]}});hljs.registerLanguage("mercury",function(e){var i={keyword:"module use_module import_module include_module end_module initialise mutable initialize finalize finalise interface implementation pred mode func type inst solver any_pred any_func is semidet det nondet multi erroneous failure cc_nondet cc_multi typeclass instance where pragma promise external trace atomic or_else require_complete_switch require_det require_semidet require_multi require_nondet require_cc_multi require_cc_nondet require_erroneous require_failure",pragma:"inline no_inline type_spec source_file fact_table obsolete memo loop_check minimal_model terminates does_not_terminate check_termination promise_equivalent_clauses",preprocessor:"foreign_proc foreign_decl foreign_code foreign_type foreign_import_module foreign_export_enum foreign_export foreign_enum may_call_mercury will_not_call_mercury thread_safe not_thread_safe maybe_thread_safe promise_pure promise_semipure tabled_for_io local untrailed trailed attach_to_io_state can_pass_as_mercury_type stable will_not_throw_exception may_modify_trail will_not_modify_trail may_duplicate may_not_duplicate affects_liveness does_not_affect_liveness doesnt_affect_liveness no_sharing unknown_sharing sharing",built_in:"some all not if then else true fail false try catch catch_any semidet_true semidet_false semidet_fail impure_true impure semipure"},r={cN:"label",b:"XXX",e:"$",eW:!0,r:0},t=e.inherit(e.CLCM,{b:"%"}),_=e.inherit(e.CBCM,{r:0});t.c.push(r),_.c.push(r);var n={cN:"number",b:"0'.\\|0[box][0-9a-fA-F]*"},a=e.inherit(e.ASM,{r:0}),o=e.inherit(e.QSM,{r:0}),l={cN:"constant",b:"\\\\[abfnrtv]\\|\\\\x[0-9a-fA-F]*\\\\\\|%[-+# *.0-9]*[dioxXucsfeEgGp]",r:0};o.c.push(l);var s={cN:"built_in",v:[{b:"<=>"},{b:"<=",r:0},{b:"=>",r:0},{b:"/\\\\"},{b:"\\\\/"}]},c={cN:"built_in",v:[{b:":-\\|-->"},{b:"=",r:0}]};return{aliases:["m","moo"],k:i,c:[s,c,t,_,n,e.NM,a,o,{b:/:-/}]}});hljs.registerLanguage("fix",function(u){return{c:[{b:/[^\u2401\u0001]+/,e:/[\u2401\u0001]/,eE:!0,rB:!0,rE:!1,c:[{b:/([^\u2401\u0001=]+)/,e:/=([^\u2401\u0001=]+)/,rE:!0,rB:!1,cN:"attribute"},{b:/=/,e:/([\u2401\u0001])/,eE:!0,eB:!0,cN:"string"}]}],cI:!0}});hljs.registerLanguage("clojure",function(e){var t={built_in:"def cond apply if-not if-let if not not= = < > <= >= == + / * - rem quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? class? distinct? isa? float? rational? reduced? ratio? odd? even? char? seq? vector? string? map? nil? contains? zero? instance? not-every? not-any? libspec? -> ->> .. . inc compare do dotimes mapcat take remove take-while drop letfn drop-last take-last drop-while while intern condp case reduced cycle split-at split-with repeat replicate iterate range merge zipmap declare line-seq sort comparator sort-by dorun doall nthnext nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter monitor-exit defmacro defn defn- macroexpand macroexpand-1 for dosync and or when when-not when-let comp juxt partial sequence memoize constantly complement identity assert peek pop doto proxy defstruct first rest cons defprotocol cast coll deftype defrecord last butlast sigs reify second ffirst fnext nfirst nnext defmulti defmethod meta with-meta ns in-ns create-ns import refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! assoc! dissoc! pop! disj! use class type num float double short byte boolean bigint biginteger bigdec print-method print-dup throw-if printf format load compile get-in update-in pr pr-on newline flush read slurp read-line subvec with-open memfn time re-find re-groups rand-int rand mod locking assert-valid-fdecl alias resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! reset-meta! commute get-validator alter ref-set ref-history-count ref-min-history ref-max-history ensure sync io! new next conj set! to-array future future-call into-array aset gen-class reduce map filter find empty hash-map hash-set sorted-map sorted-map-by sorted-set sorted-set-by vec vector seq flatten reverse assoc dissoc list disj get union difference intersection extend extend-type extend-protocol int nth delay count concat chunk chunk-buffer chunk-append chunk-first chunk-rest max min dec unchecked-inc-int unchecked-inc unchecked-dec-inc unchecked-dec unchecked-negate unchecked-add-int unchecked-add unchecked-subtract-int unchecked-subtract chunk-next chunk-cons chunked-seq? prn vary-meta lazy-seq spread list* str find-keyword keyword symbol gensym force rationalize"},r="a-zA-Z_\\-!.?+*=<>&#'",n="["+r+"]["+r+"0-9/;:]*",a="[-+]?\\d+(\\.\\d+)?",o={b:n,r:0},s={cN:"number",b:a,r:0},i=e.inherit(e.QSM,{i:null}),c=e.C(";","$",{r:0}),d={cN:"literal",b:/\b(true|false|nil)\b/},l={cN:"collection",b:"[\\[\\{]",e:"[\\]\\}]"},m={cN:"comment",b:"\\^"+n},p=e.C("\\^\\{","\\}"),u={cN:"attribute",b:"[:]"+n},f={cN:"list",b:"\\(",e:"\\)"},h={eW:!0,r:0},y={k:t,l:n,cN:"keyword",b:n,starts:h},b=[f,i,m,p,c,u,l,s,d,o];return f.c=[e.C("comment",""),y,h],h.c=b,l.c=b,{aliases:["clj"],i:/\S/,c:[f,i,m,p,c,u,l,s,d]}});hljs.registerLanguage("perl",function(e){var t="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when",r={cN:"subst",b:"[$@]\\{",e:"\\}",k:t},s={b:"->{",e:"}"},n={cN:"variable",v:[{b:/\$\d/},{b:/[\$%@](\^\w\b|#\w+(::\w+)*|{\w+}|\w+(::\w*)*)/},{b:/[\$%@][^\s\w{]/,r:0}]},i=e.C("^(__END__|__DATA__)","\\n$",{r:5}),o=[e.BE,r,n],a=[n,e.HCM,i,e.C("^\\=\\w","\\=cut",{eW:!0}),s,{cN:"string",c:o,v:[{b:"q[qwxr]?\\s*\\(",e:"\\)",r:5},{b:"q[qwxr]?\\s*\\[",e:"\\]",r:5},{b:"q[qwxr]?\\s*\\{",e:"\\}",r:5},{b:"q[qwxr]?\\s*\\|",e:"\\|",r:5},{b:"q[qwxr]?\\s*\\<",e:"\\>",r:5},{b:"qw\\s+q",e:"q",r:5},{b:"'",e:"'",c:[e.BE]},{b:'"',e:'"'},{b:"`",e:"`",c:[e.BE]},{b:"{\\w+}",c:[],r:0},{b:"-?\\w+\\s*\\=\\>",c:[],r:0}]},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\/\\/|"+e.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[e.HCM,i,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[e.BE],r:0}]},{cN:"sub",bK:"sub",e:"(\\s*\\(.*?\\))?[;{]",r:5},{cN:"operator",b:"-\\w\\b",r:0}];return r.c=a,s.c=a,{aliases:["pl"],k:t,c:a}});hljs.registerLanguage("twig",function(e){var t={cN:"params",b:"\\(",e:"\\)"},a="attribute block constant cycle date dump include max min parent random range source template_from_string",r={cN:"function",bK:a,r:0,c:[t]},c={cN:"filter",b:/\|[A-Za-z_]+:?/,k:"abs batch capitalize convert_encoding date date_modify default escape first format join json_encode keys last length lower merge nl2br number_format raw replace reverse round slice sort split striptags title trim upper url_encode",c:[r]},n="autoescape block do embed extends filter flush for if import include macro sandbox set spaceless use verbatim";return n=n+" "+n.split(" ").map(function(e){return"end"+e}).join(" "),{aliases:["craftcms"],cI:!0,sL:"xml",subLanguageMode:"continuous",c:[e.C(/\{#/,/#}/),{cN:"template_tag",b:/\{%/,e:/%}/,k:n,c:[c,r]},{cN:"variable",b:/\{\{/,e:/}}/,c:[c,r]}]}});hljs.registerLanguage("livecodeserver",function(e){var r={cN:"variable",b:"\\b[gtps][A-Z]+[A-Za-z0-9_\\-]*\\b|\\$_[A-Z]+",r:0},t=[e.CBCM,e.HCM,e.C("--","$"),e.C("[^:]//","$")],a=e.inherit(e.TM,{v:[{b:"\\b_*rig[A-Z]+[A-Za-z0-9_\\-]*"},{b:"\\b_[a-z0-9\\-]+"}]}),o=e.inherit(e.TM,{b:"\\b([A-Za-z0-9_\\-]+)\\b"});return{cI:!1,k:{keyword:"$_COOKIE $_FILES $_GET $_GET_BINARY $_GET_RAW $_POST $_POST_BINARY $_POST_RAW $_SESSION $_SERVER codepoint codepoints segment segments codeunit codeunits sentence sentences trueWord trueWords paragraph after byte bytes english the until http forever descending using line real8 with seventh for stdout finally element word words fourth before black ninth sixth characters chars stderr uInt1 uInt1s uInt2 uInt2s stdin string lines relative rel any fifth items from middle mid at else of catch then third it file milliseconds seconds second secs sec int1 int1s int4 int4s internet int2 int2s normal text item last long detailed effective uInt4 uInt4s repeat end repeat URL in try into switch to words https token binfile each tenth as ticks tick system real4 by dateItems without char character ascending eighth whole dateTime numeric short first ftp integer abbreviated abbr abbrev private case while if",constant:"SIX TEN FORMFEED NINE ZERO NONE SPACE FOUR FALSE COLON CRLF PI COMMA ENDOFFILE EOF EIGHT FIVE QUOTE EMPTY ONE TRUE RETURN CR LINEFEED RIGHT BACKSLASH NULL SEVEN TAB THREE TWO six ten formfeed nine zero none space four false colon crlf pi comma endoffile eof eight five quote empty one true return cr linefeed right backslash null seven tab three two RIVERSION RISTATE FILE_READ_MODE FILE_WRITE_MODE FILE_WRITE_MODE DIR_WRITE_MODE FILE_READ_UMASK FILE_WRITE_UMASK DIR_READ_UMASK DIR_WRITE_UMASK",operator:"div mod wrap and or bitAnd bitNot bitOr bitXor among not in a an within contains ends with begins the keys of keys",built_in:"put abs acos aliasReference annuity arrayDecode arrayEncode asin atan atan2 average avg avgDev base64Decode base64Encode baseConvert binaryDecode binaryEncode byteOffset byteToNum cachedURL cachedURLs charToNum cipherNames codepointOffset codepointProperty codepointToNum codeunitOffset commandNames compound compress constantNames cos date dateFormat decompress directories diskSpace DNSServers exp exp1 exp2 exp10 extents files flushEvents folders format functionNames geometricMean global globals hasMemory harmonicMean hostAddress hostAddressToName hostName hostNameToAddress isNumber ISOToMac itemOffset keys len length libURLErrorData libUrlFormData libURLftpCommand libURLLastHTTPHeaders libURLLastRHHeaders libUrlMultipartFormAddPart libUrlMultipartFormData libURLVersion lineOffset ln ln1 localNames log log2 log10 longFilePath lower macToISO matchChunk matchText matrixMultiply max md5Digest median merge millisec millisecs millisecond milliseconds min monthNames nativeCharToNum normalizeText num number numToByte numToChar numToCodepoint numToNativeChar offset open openfiles openProcesses openProcessIDs openSockets paragraphOffset paramCount param params peerAddress pendingMessages platform popStdDev populationStandardDeviation populationVariance popVariance processID random randomBytes replaceText result revCreateXMLTree revCreateXMLTreeFromFile revCurrentRecord revCurrentRecordIsFirst revCurrentRecordIsLast revDatabaseColumnCount revDatabaseColumnIsNull revDatabaseColumnLengths revDatabaseColumnNames revDatabaseColumnNamed revDatabaseColumnNumbered revDatabaseColumnTypes revDatabaseConnectResult revDatabaseCursors revDatabaseID revDatabaseTableNames revDatabaseType revDataFromQuery revdb_closeCursor revdb_columnbynumber revdb_columncount revdb_columnisnull revdb_columnlengths revdb_columnnames revdb_columntypes revdb_commit revdb_connect revdb_connections revdb_connectionerr revdb_currentrecord revdb_cursorconnection revdb_cursorerr revdb_cursors revdb_dbtype revdb_disconnect revdb_execute revdb_iseof revdb_isbof revdb_movefirst revdb_movelast revdb_movenext revdb_moveprev revdb_query revdb_querylist revdb_recordcount revdb_rollback revdb_tablenames revGetDatabaseDriverPath revNumberOfRecords revOpenDatabase revOpenDatabases revQueryDatabase revQueryDatabaseBlob revQueryResult revQueryIsAtStart revQueryIsAtEnd revUnixFromMacPath revXMLAttribute revXMLAttributes revXMLAttributeValues revXMLChildContents revXMLChildNames revXMLCreateTreeFromFileWithNamespaces revXMLCreateTreeWithNamespaces revXMLDataFromXPathQuery revXMLEvaluateXPath revXMLFirstChild revXMLMatchingNode revXMLNextSibling revXMLNodeContents revXMLNumberOfChildren revXMLParent revXMLPreviousSibling revXMLRootNode revXMLRPC_CreateRequest revXMLRPC_Documents revXMLRPC_Error revXMLRPC_GetHost revXMLRPC_GetMethod revXMLRPC_GetParam revXMLText revXMLRPC_Execute revXMLRPC_GetParamCount revXMLRPC_GetParamNode revXMLRPC_GetParamType revXMLRPC_GetPath revXMLRPC_GetPort revXMLRPC_GetProtocol revXMLRPC_GetRequest revXMLRPC_GetResponse revXMLRPC_GetSocket revXMLTree revXMLTrees revXMLValidateDTD revZipDescribeItem revZipEnumerateItems revZipOpenArchives round sampVariance sec secs seconds sentenceOffset sha1Digest shell shortFilePath sin specialFolderPath sqrt standardDeviation statRound stdDev sum sysError systemVersion tan tempName textDecode textEncode tick ticks time to tokenOffset toLower toUpper transpose truewordOffset trunc uniDecode uniEncode upper URLDecode URLEncode URLStatus uuid value variableNames variance version waitDepth weekdayNames wordOffset xsltApplyStylesheet xsltApplyStylesheetFromFile xsltLoadStylesheet xsltLoadStylesheetFromFile add breakpoint cancel clear local variable file word line folder directory URL close socket process combine constant convert create new alias folder directory decrypt delete variable word line folder directory URL dispatch divide do encrypt filter get include intersect kill libURLDownloadToFile libURLFollowHttpRedirects libURLftpUpload libURLftpUploadFile libURLresetAll libUrlSetAuthCallback libURLSetCustomHTTPHeaders libUrlSetExpect100 libURLSetFTPListCommand libURLSetFTPMode libURLSetFTPStopTime libURLSetStatusCallback load multiply socket prepare process post seek rel relative read from process rename replace require resetAll resolve revAddXMLNode revAppendXML revCloseCursor revCloseDatabase revCommitDatabase revCopyFile revCopyFolder revCopyXMLNode revDeleteFolder revDeleteXMLNode revDeleteAllXMLTrees revDeleteXMLTree revExecuteSQL revGoURL revInsertXMLNode revMoveFolder revMoveToFirstRecord revMoveToLastRecord revMoveToNextRecord revMoveToPreviousRecord revMoveToRecord revMoveXMLNode revPutIntoXMLNode revRollBackDatabase revSetDatabaseDriverPath revSetXMLAttribute revXMLRPC_AddParam revXMLRPC_DeleteAllDocuments revXMLAddDTD revXMLRPC_Free revXMLRPC_FreeAll revXMLRPC_DeleteDocument revXMLRPC_DeleteParam revXMLRPC_SetHost revXMLRPC_SetMethod revXMLRPC_SetPort revXMLRPC_SetProtocol revXMLRPC_SetSocket revZipAddItemWithData revZipAddItemWithFile revZipAddUncompressedItemWithData revZipAddUncompressedItemWithFile revZipCancel revZipCloseArchive revZipDeleteItem revZipExtractItemToFile revZipExtractItemToVariable revZipSetProgressCallback revZipRenameItem revZipReplaceItemWithData revZipReplaceItemWithFile revZipOpenArchive send set sort split start stop subtract union unload wait write"},c:[r,{cN:"keyword",b:"\\bend\\sif\\b"},{cN:"function",bK:"function",e:"$",c:[r,o,e.ASM,e.QSM,e.BNM,e.CNM,a]},{cN:"function",bK:"end",e:"$",c:[o,a]},{cN:"command",bK:"command on",e:"$",c:[r,o,e.ASM,e.QSM,e.BNM,e.CNM,a]},{cN:"command",bK:"end",e:"$",c:[o,a]},{cN:"preprocessor",b:"<\\?rev|<\\?lc|<\\?livecode",r:10},{cN:"preprocessor",b:"<\\?"},{cN:"preprocessor",b:"\\?>"},e.ASM,e.QSM,e.BNM,e.CNM,a].concat(t),i:";$|^\\[|^="}});hljs.registerLanguage("step21",function(e){var r="[A-Z_][A-Z0-9_.]*",i="END-ISO-10303-21;",l={literal:"",built_in:"",keyword:"HEADER ENDSEC DATA"},s={cN:"preprocessor",b:"ISO-10303-21;",r:10},t=[e.CLCM,e.CBCM,e.C("/\\*\\*!","\\*/"),e.CNM,e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null}),{cN:"string",b:"'",e:"'"},{cN:"label",v:[{b:"#",e:"\\d+",i:"\\W"}]}];return{aliases:["p21","step","stp"],cI:!0,l:r,k:l,c:[{cN:"preprocessor",b:i,r:10},s].concat(t)}});hljs.registerLanguage("cpp",function(t){var i={keyword:"false int float while private char catch export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using true class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue wchar_t inline delete alignof char16_t char32_t constexpr decltype noexcept nullptr static_assert thread_local restrict _Bool complex _Complex _Imaginary intmax_t uintmax_t int8_t uint8_t int16_t uint16_t int32_t uint32_t int64_t uint64_t int_least8_t uint_least8_t int_least16_t uint_least16_t int_least32_t uint_least32_t int_least64_t uint_least64_t int_fast8_t uint_fast8_t int_fast16_t uint_fast16_t int_fast32_t uint_fast32_t int_fast64_t uint_fast64_t intptr_t uintptr_t atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong atomic_wchar_t atomic_char16_t atomic_char32_t atomic_intmax_t atomic_uintmax_t atomic_intptr_t atomic_uintptr_t atomic_size_t atomic_ptrdiff_t atomic_int_least8_t atomic_int_least16_t atomic_int_least32_t atomic_int_least64_t atomic_uint_least8_t atomic_uint_least16_t atomic_uint_least32_t atomic_uint_least64_t atomic_int_fast8_t atomic_int_fast16_t atomic_int_fast32_t atomic_int_fast64_t atomic_uint_fast8_t atomic_uint_fast16_t atomic_uint_fast32_t atomic_uint_fast64_t",built_in:"std string cin cout cerr clog stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf"};return{aliases:["c","cc","h","c++","h++","hpp"],k:i,i:""]',k:"include",i:"\\n"},t.CLCM]},{b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:i,c:["self"]},{b:t.IR+"::",k:i},{bK:"new throw return else",r:0},{cN:"function",b:"("+t.IR+"\\s+)+"+t.IR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:i,c:[{b:t.IR+"\\s*\\(",rB:!0,c:[t.TM],r:0},{cN:"params",b:/\(/,e:/\)/,k:i,r:0,c:[t.CBCM]},t.CLCM,t.CBCM]}]}});hljs.registerLanguage("vala",function(e){return{k:{keyword:"char uchar unichar int uint long ulong short ushort int8 int16 int32 int64 uint8 uint16 uint32 uint64 float double bool struct enum string void weak unowned owned async signal static abstract interface override while do for foreach else switch case break default return try catch public private protected internal using new this get set const stdout stdin stderr var",built_in:"DBus GLib CCode Gee Object",literal:"false true null"},c:[{cN:"class",bK:"class interface delegate namespace",e:"{",eE:!0,i:"[^,:\\n\\s\\.]",c:[e.UTM]},e.CLCM,e.CBCM,{cN:"string",b:'"""',e:'"""',r:5},e.ASM,e.QSM,e.CNM,{cN:"preprocessor",b:"^#",e:"$",r:2},{cN:"constant",b:" [A-Z_]+ ",r:0}]}});hljs.registerLanguage("http",function(t){return{aliases:["https"],i:"\\S",c:[{cN:"status",b:"^HTTP/[0-9\\.]+",e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{cN:"request",b:"^[A-Z]+ (.*?) HTTP/[0-9\\.]+$",rB:!0,e:"$",c:[{cN:"string",b:" ",e:" ",eB:!0,eE:!0}]},{cN:"attribute",b:"^\\w",e:": ",eE:!0,i:"\\n|\\s|=",starts:{cN:"string",e:"$"}},{b:"\\n\\n",starts:{sL:"",eW:!0}}]}});hljs.registerLanguage("avrasm",function(r){return{cI:!0,l:"\\.?"+r.IR,k:{keyword:"adc add adiw and andi asr bclr bld brbc brbs brcc brcs break breq brge brhc brhs brid brie brlo brlt brmi brne brpl brsh brtc brts brvc brvs bset bst call cbi cbr clc clh cli cln clr cls clt clv clz com cp cpc cpi cpse dec eicall eijmp elpm eor fmul fmuls fmulsu icall ijmp in inc jmp ld ldd ldi lds lpm lsl lsr mov movw mul muls mulsu neg nop or ori out pop push rcall ret reti rjmp rol ror sbc sbr sbrc sbrs sec seh sbi sbci sbic sbis sbiw sei sen ser ses set sev sez sleep spm st std sts sub subi swap tst wdr",built_in:"r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 r23 r24 r25 r26 r27 r28 r29 r30 r31 x|0 xh xl y|0 yh yl z|0 zh zl ucsr1c udr1 ucsr1a ucsr1b ubrr1l ubrr1h ucsr0c ubrr0h tccr3c tccr3a tccr3b tcnt3h tcnt3l ocr3ah ocr3al ocr3bh ocr3bl ocr3ch ocr3cl icr3h icr3l etimsk etifr tccr1c ocr1ch ocr1cl twcr twdr twar twsr twbr osccal xmcra xmcrb eicra spmcsr spmcr portg ddrg ping portf ddrf sreg sph spl xdiv rampz eicrb eimsk gimsk gicr eifr gifr timsk tifr mcucr mcucsr tccr0 tcnt0 ocr0 assr tccr1a tccr1b tcnt1h tcnt1l ocr1ah ocr1al ocr1bh ocr1bl icr1h icr1l tccr2 tcnt2 ocr2 ocdr wdtcr sfior eearh eearl eedr eecr porta ddra pina portb ddrb pinb portc ddrc pinc portd ddrd pind spdr spsr spcr udr0 ucsr0a ucsr0b ubrr0l acsr admux adcsr adch adcl porte ddre pine pinf",preprocessor:".byte .cseg .db .def .device .dseg .dw .endmacro .equ .eseg .exit .include .list .listmac .macro .nolist .org .set"},c:[r.CBCM,r.C(";","$",{r:0}),r.CNM,r.BNM,{cN:"number",b:"\\b(\\$[a-zA-Z0-9]+|0o[0-7]+)"},r.QSM,{cN:"string",b:"'",e:"[^\\\\]'",i:"[^\\\\][^']"},{cN:"label",b:"^[A-Za-z0-9_.$]+:"},{cN:"preprocessor",b:"#",e:"$"},{cN:"localvars",b:"@[0-9]+"}]}});hljs.registerLanguage("aspectj",function(e){var t="false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else extends implements break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws privileged aspectOf adviceexecution proceed cflowbelow cflow initialization preinitialization staticinitialization withincode target within execution getWithinTypeName handler thisJoinPoint thisJoinPointStaticPart thisEnclosingJoinPointStaticPart declare parents warning error soft precedence thisAspectInstance",i="get set args call";return{k:t,i:/<\//,c:[{cN:"javadoc",b:"/\\*\\*",e:"\\*/",r:0,c:[{cN:"javadoctag",b:"(^|\\s)@[A-Za-z]+"}]},e.CLCM,e.CBCM,e.ASM,e.QSM,{cN:"aspect",bK:"aspect",e:/[{;=]/,eE:!0,i:/[:;"\[\]]/,c:[{bK:"extends implements pertypewithin perthis pertarget percflowbelow percflow issingleton"},e.UTM,{b:/\([^\)]*/,e:/[)]+/,k:t+" "+i,eE:!1}]},{cN:"class",bK:"class interface",e:/[{;=]/,eE:!0,r:0,k:"class interface",i:/[:"\[\]]/,c:[{bK:"extends implements"},e.UTM]},{bK:"pointcut after before around throwing returning",e:/[)]/,eE:!1,i:/["\[\]]/,c:[{b:e.UIR+"\\s*\\(",rB:!0,c:[e.UTM]}]},{b:/[:]/,rB:!0,e:/[{;]/,r:0,eE:!1,k:t,i:/["\[\]]/,c:[{b:e.UIR+"\\s*\\(",k:t+" "+i},e.QSM]},{bK:"new throw",r:0},{cN:"function",b:/\w+ +\w+(\.)?\w+\s*\([^\)]*\)\s*((throws)[\w\s,]+)?[\{;]/,rB:!0,e:/[{;=]/,k:t,eE:!0,c:[{b:e.UIR+"\\s*\\(",rB:!0,r:0,c:[e.UTM]},{cN:"params",b:/\(/,e:/\)/,r:0,k:t,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]},e.CNM,{cN:"annotation",b:"@[A-Za-z]+"}]}});hljs.registerLanguage("rib",function(e){return{k:"ArchiveRecord AreaLightSource Atmosphere Attribute AttributeBegin AttributeEnd Basis Begin Blobby Bound Clipping ClippingPlane Color ColorSamples ConcatTransform Cone CoordinateSystem CoordSysTransform CropWindow Curves Cylinder DepthOfField Detail DetailRange Disk Displacement Display End ErrorHandler Exposure Exterior Format FrameAspectRatio FrameBegin FrameEnd GeneralPolygon GeometricApproximation Geometry Hider Hyperboloid Identity Illuminate Imager Interior LightSource MakeCubeFaceEnvironment MakeLatLongEnvironment MakeShadow MakeTexture Matte MotionBegin MotionEnd NuPatch ObjectBegin ObjectEnd ObjectInstance Opacity Option Orientation Paraboloid Patch PatchMesh Perspective PixelFilter PixelSamples PixelVariance Points PointsGeneralPolygons PointsPolygons Polygon Procedural Projection Quantize ReadArchive RelativeDetail ReverseOrientation Rotate Scale ScreenWindow ShadingInterpolation ShadingRate Shutter Sides Skew SolidBegin SolidEnd Sphere SubdivisionMesh Surface TextureCoordinates Torus Transform TransformBegin TransformEnd TransformPoints Translate TrimCurve WorldBegin WorldEnd",i:">>|\.\.\.) /},b={cN:"string",c:[e.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[r],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[r],r:10},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)"/,e:/"/},e.ASM,e.QSM]},l={cN:"number",r:0,v:[{b:e.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:e.CNR+"[lLjJ]?"}]},c={cN:"params",b:/\(/,e:/\)/,c:["self",r,l,b]};return{aliases:["py","gyp"],k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},i:/(<\/|->|\?)/,c:[r,l,b,e.HCM,{v:[{cN:"function",bK:"def",r:10},{cN:"class",bK:"class"}],e:/:/,i:/[${=;\n,]/,c:[e.UTM,c]},{cN:"decorator",b:/@/,e:/$/},{b:/\b(print|exec)\(/}]}});hljs.registerLanguage("axapta",function(e){return{k:"false int abstract private char boolean static null if for true while long throw finally protected final return void enum else break new catch byte super case short default double public try this switch continue reverse firstfast firstonly forupdate nofetch sum avg minof maxof count order group by asc desc index hint like dispaly edit client server ttsbegin ttscommit str real date container anytype common div mod",c:[e.CLCM,e.CBCM,e.ASM,e.QSM,e.CNM,{cN:"preprocessor",b:"#",e:"$"},{cN:"class",bK:"class interface",e:"{",eE:!0,i:":",c:[{bK:"extends implements"},e.UTM]}]}});hljs.registerLanguage("nix",function(e){var t={keyword:"rec with let in inherit assert if else then",constant:"true false or and null",built_in:"import abort baseNameOf dirOf isNull builtins map removeAttrs throw toString derivation"},i={cN:"subst",b:/\$\{/,e:/}/,k:t},r={cN:"variable",b:/[a-zA-Z0-9-_]+(\s*=)/},n={cN:"string",b:"''",e:"''",c:[i]},s={cN:"string",b:'"',e:'"',c:[i]},a=[e.NM,e.HCM,e.CBCM,n,s,r];return i.c=a,{aliases:["nixos"],k:t,c:a}});hljs.registerLanguage("diff",function(e){return{aliases:["patch"],c:[{cN:"chunk",r:10,v:[{b:/^@@ +\-\d+,\d+ +\+\d+,\d+ +@@$/},{b:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{b:/^\-\-\- +\d+,\d+ +\-\-\-\-$/}]},{cN:"header",v:[{b:/Index: /,e:/$/},{b:/=====/,e:/=====$/},{b:/^\-\-\-/,e:/$/},{b:/^\*{3} /,e:/$/},{b:/^\+\+\+/,e:/$/},{b:/\*{5}/,e:/\*{5}$/}]},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"change",b:"^\\!",e:"$"}]}});hljs.registerLanguage("parser3",function(r){var e=r.C("{","}",{c:["self"]});return{sL:"xml",r:0,c:[r.C("^#","$"),r.C("\\^rem{","}",{r:10,c:[e]}),{cN:"preprocessor",b:"^@(?:BASE|USE|CLASS|OPTIONS)$",r:10},{cN:"title",b:"@[\\w\\-]+\\[[\\w^;\\-]*\\](?:\\[[\\w^;\\-]*\\])?(?:.*)$"},{cN:"variable",b:"\\$\\{?[\\w\\-\\.\\:]+\\}?"},{cN:"keyword",b:"\\^[\\w\\-\\.\\:]+"},{cN:"number",b:"\\^#[0-9a-fA-F]+"},r.CNM]}});hljs.registerLanguage("django",function(e){var t={cN:"filter",b:/\|[A-Za-z]+:?/,k:"truncatewords removetags linebreaksbr yesno get_digit timesince random striptags filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort dictsortreversed default_if_none pluralize lower join center default truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize localtime utc timezone",c:[{cN:"argument",b:/"/,e:/"/},{cN:"argument",b:/'/,e:/'/}]};return{aliases:["jinja"],cI:!0,sL:"xml",subLanguageMode:"continuous",c:[e.C(/\{%\s*comment\s*%}/,/\{%\s*endcomment\s*%}/),e.C(/\{#/,/#}/),{cN:"template_tag",b:/\{%/,e:/%}/,k:"comment endcomment load templatetag ifchanged endifchanged if endif firstof for endfor in ifnotequal endifnotequal widthratio extends include spaceless endspaceless regroup by as ifequal endifequal ssi now with cycle url filter endfilter debug block endblock else autoescape endautoescape csrf_token empty elif endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix plural get_current_language language get_available_languages get_current_language_bidi get_language_info get_language_info_list localize endlocalize localtime endlocaltime timezone endtimezone get_current_timezone verbatim",c:[t]},{cN:"variable",b:/\{\{/,e:/}}/,c:[t]}]}});hljs.registerLanguage("rust",function(e){var t=e.inherit(e.CBCM);return t.c.push("self"),{aliases:["rs"],k:{keyword:"alignof as be box break const continue crate do else enum extern false fn for if impl in let loop match mod mut offsetof once priv proc pub pure ref return self sizeof static struct super trait true type typeof unsafe unsized use virtual while yield int i8 i16 i32 i64 uint u8 u32 u64 float f32 f64 str char bool",built_in:"assert! assert_eq! bitflags! bytes! cfg! col! concat! concat_idents! debug_assert! debug_assert_eq! env! panic! file! format! format_args! include_bin! include_str! line! local_data_key! module_path! option_env! print! println! select! stringify! try! unimplemented! unreachable! vec! write! writeln!"},l:e.IR+"!?",i:""}]}});hljs.registerLanguage("vhdl",function(e){var t="\\d(_|\\d)*",r="[eE][-+]?"+t,n=t+"(\\."+t+")?("+r+")?",o="\\w+",i=t+"#"+o+"(\\."+o+")?#("+r+")?",a="\\b("+i+"|"+n+")";return{cI:!0,k:{keyword:"abs access after alias all and architecture array assert attribute begin block body buffer bus case component configuration constant context cover disconnect downto default else elsif end entity exit fairness file for force function generate generic group guarded if impure in inertial inout is label library linkage literal loop map mod nand new next nor not null of on open or others out package port postponed procedure process property protected pure range record register reject release rem report restrict restrict_guarantee return rol ror select sequence severity shared signal sla sll sra srl strong subtype then to transport type unaffected units until use variable vmode vprop vunit wait when while with xnor xor",typename:"boolean bit character severity_level integer time delay_length natural positive string bit_vector file_open_kind file_open_status std_ulogic std_ulogic_vector std_logic std_logic_vector unsigned signed boolean_vector integer_vector real_vector time_vector"},i:"{",c:[e.CBCM,e.C("--","$"),e.QSM,{cN:"number",b:a,r:0},{cN:"literal",b:"'(U|X|0|1|Z|W|L|H|-)'",c:[e.BE]},{cN:"attribute",b:"'[A-Za-z](_?[A-Za-z0-9])*",c:[e.BE]}]}});hljs.registerLanguage("ocaml",function(e){return{aliases:["ml"],k:{keyword:"and as assert asr begin class constraint do done downto else end exception external for fun function functor if in include inherit! inherit initializer land lazy let lor lsl lsr lxor match method!|10 method mod module mutable new object of open! open or private rec sig struct then to try type val! val virtual when while with parser value",built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 string unit in_channel out_channel ref",literal:"true false"},i:/\/\/|>>/,l:"[a-z_]\\w*!?",c:[{cN:"literal",b:"\\[(\\|\\|)?\\]|\\(\\)"},e.C("\\(\\*","\\*\\)",{c:["self"]}),{cN:"symbol",b:"'[A-Za-z_](?!')[\\w']*"},{cN:"tag",b:"`[A-Z][\\w']*"},{cN:"type",b:"\\b[A-Z][\\w']*",r:0},{b:"[a-z_]\\w*'[\\w']*"},e.inherit(e.ASM,{cN:"char",r:0}),e.inherit(e.QSM,{i:null}),{cN:"number",b:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",r:0},{b:/[-=]>/}]}});hljs.registerLanguage("cmake",function(e){return{aliases:["cmake.in"],cI:!0,k:{keyword:"add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library add_subdirectory add_test aux_source_directory break build_command cmake_minimum_required cmake_policy configure_file create_test_sourcelist define_property else elseif enable_language enable_testing endforeach endfunction endif endmacro endwhile execute_process export find_file find_library find_package find_path find_program fltk_wrap_ui foreach function get_cmake_property get_directory_property get_filename_component get_property get_source_file_property get_target_property get_test_property if include include_directories include_external_msproject include_regular_expression install link_directories load_cache load_command macro mark_as_advanced message option output_required_files project qt_wrap_cpp qt_wrap_ui remove_definitions return separate_arguments set set_directory_properties set_property set_source_files_properties set_target_properties set_tests_properties site_name source_group string target_link_libraries try_compile try_run unset variable_watch while build_name exec_program export_library_dependencies install_files install_programs install_targets link_libraries make_directory remove subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file qt5_use_modules qt5_use_package qt5_wrap_cpp on off true false and or",operator:"equal less greater strless strgreater strequal matches"},c:[{cN:"envvar",b:"\\${",e:"}"},e.HCM,e.QSM,e.NM]}});hljs.registerLanguage("1c",function(c){var e="[a-zA-Zа-яА-Я][a-zA-Z0-9_а-яА-Я]*",r="возврат дата для если и или иначе иначеесли исключение конецесли конецпопытки конецпроцедуры конецфункции конеццикла константа не перейти перем перечисление по пока попытка прервать продолжить процедура строка тогда фс функция цикл число экспорт",t="ansitooem oemtoansi ввестивидсубконто ввестидату ввестизначение ввестиперечисление ввестипериод ввестиплансчетов ввестистроку ввестичисло вопрос восстановитьзначение врег выбранныйплансчетов вызватьисключение датагод датамесяц датачисло добавитьмесяц завершитьработусистемы заголовоксистемы записьжурналарегистрации запуститьприложение зафиксироватьтранзакцию значениевстроку значениевстрокувнутр значениевфайл значениеизстроки значениеизстрокивнутр значениеизфайла имякомпьютера имяпользователя каталогвременныхфайлов каталогиб каталогпользователя каталогпрограммы кодсимв командасистемы конгода конецпериодаби конецрассчитанногопериодаби конецстандартногоинтервала конквартала конмесяца коннедели лев лог лог10 макс максимальноеколичествосубконто мин монопольныйрежим названиеинтерфейса названиенабораправ назначитьвид назначитьсчет найти найтипомеченныенаудаление найтиссылки началопериодаби началостандартногоинтервала начатьтранзакцию начгода начквартала начмесяца начнедели номерднягода номерднянедели номернеделигода нрег обработкаожидания окр описаниеошибки основнойжурналрасчетов основнойплансчетов основнойязык открытьформу открытьформумодально отменитьтранзакцию очиститьокносообщений периодстр полноеимяпользователя получитьвремята получитьдатута получитьдокументта получитьзначенияотбора получитьпозициюта получитьпустоезначение получитьта прав праводоступа предупреждение префиксавтонумерации пустаястрока пустоезначение рабочаядаттьпустоезначение рабочаядата разделительстраниц разделительстрок разм разобратьпозициюдокумента рассчитатьрегистрына рассчитатьрегистрыпо сигнал симв символтабуляции создатьобъект сокрл сокрлп сокрп сообщить состояние сохранитьзначение сред статусвозврата стрдлина стрзаменить стрколичествострок стрполучитьстроку стрчисловхождений сформироватьпозициюдокумента счетпокоду текущаядата текущеевремя типзначения типзначениястр удалитьобъекты установитьтана установитьтапо фиксшаблон формат цел шаблон",i={cN:"dquote",b:'""'},n={cN:"string",b:'"',e:'"|$',c:[i]},a={cN:"string",b:"\\|",e:'"|$',c:[i]};return{cI:!0,l:e,k:{keyword:r,built_in:t},c:[c.CLCM,c.NM,n,a,{cN:"function",b:"(процедура|функция)",e:"$",l:e,k:"процедура функция",c:[c.inherit(c.TM,{b:e}),{cN:"tail",eW:!0,c:[{cN:"params",b:"\\(",e:"\\)",l:e,k:"знач",c:[n,a]},{cN:"export",b:"экспорт",eW:!0,l:e,k:"экспорт",c:[c.CLCM]}]},c.CLCM]},{cN:"preprocessor",b:"#",e:"$"},{cN:"date",b:"'\\d{2}\\.\\d{2}\\.(\\d{2}|\\d{4})'"}]}});hljs.registerLanguage("tcl",function(e){return{aliases:["tk"],k:"after append apply array auto_execok auto_import auto_load auto_mkindex auto_mkindex_old auto_qualify auto_reset bgerror binary break catch cd chan clock close concat continue dde dict encoding eof error eval exec exit expr fblocked fconfigure fcopy file fileevent filename flush for foreach format gets glob global history http if incr info interp join lappend|10 lassign|10 lindex|10 linsert|10 list llength|10 load lrange|10 lrepeat|10 lreplace|10 lreverse|10 lsearch|10 lset|10 lsort|10 mathfunc mathop memory msgcat namespace open package parray pid pkg::create pkg_mkIndex platform platform::shell proc puts pwd read refchan regexp registry regsub|10 rename return safe scan seek set socket source split string subst switch tcl_endOfWord tcl_findLibrary tcl_startOfNextWord tcl_startOfPreviousWord tcl_wordBreakAfter tcl_wordBreakBefore tcltest tclvars tell time tm trace unknown unload unset update uplevel upvar variable vwait while",c:[e.C(";[ \\t]*#","$"),e.C("^[ \\t]*#","$"),{bK:"proc",e:"[\\{]",eE:!0,c:[{cN:"symbol",b:"[ \\t\\n\\r]+(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",e:"[ \\t\\n\\r]",eW:!0,eE:!0}]},{cN:"variable",eE:!0,v:[{b:"\\$(\\{)?(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*\\(([a-zA-Z0-9_])*\\)",e:"[^a-zA-Z0-9_\\}\\$]"},{b:"\\$(\\{)?(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",e:"(\\))?[^a-zA-Z0-9_\\}\\$]"}]},{cN:"string",c:[e.BE],v:[e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null})]},{cN:"number",v:[e.BNM,e.CNM]}]}});hljs.registerLanguage("groovy",function(e){return{k:{typename:"byte short char int long boolean float double void",literal:"true false null",keyword:"def as in assert trait super this abstract static volatile transient public private protected synchronized final class interface enum if else for while switch case break default continue throw throws try catch finally implements extends new import package return instanceof"},c:[e.CLCM,{cN:"javadoc",b:"/\\*\\*",e:"\\*//*",r:0,c:[{cN:"javadoctag",b:"(^|\\s)@[A-Za-z]+"}]},e.CBCM,{cN:"string",b:'"""',e:'"""'},{cN:"string",b:"'''",e:"'''"},{cN:"string",b:"\\$/",e:"/\\$",r:10},e.ASM,{cN:"regexp",b:/~?\/[^\/\n]+\//,c:[e.BE]},e.QSM,{cN:"shebang",b:"^#!/usr/bin/env",e:"$",i:"\n"},e.BNM,{cN:"class",bK:"class interface trait enum",e:"{",i:":",c:[{bK:"extends implements"},e.UTM]},e.CNM,{cN:"annotation",b:"@[A-Za-z]+"},{cN:"string",b:/[^\?]{0}[A-Za-z0-9_$]+ *:/},{b:/\?/,e:/\:/},{cN:"label",b:"^\\s*[A-Za-z0-9_$]+:",r:0}]}});hljs.registerLanguage("erlang-repl",function(r){return{k:{special_functions:"spawn spawn_link self",reserved:"after and andalso|10 band begin bnot bor bsl bsr bxor case catch cond div end fun if let not of or orelse|10 query receive rem try when xor"},c:[{cN:"prompt",b:"^[0-9]+> ",r:10},r.C("%","$"),{cN:"number",b:"\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)",r:0},r.ASM,r.QSM,{cN:"constant",b:"\\?(::)?([A-Z]\\w*(::)?)+"},{cN:"arrow",b:"->"},{cN:"ok",b:"ok"},{cN:"exclamation_mark",b:"!"},{cN:"function_or_atom",b:"(\\b[a-z'][a-zA-Z0-9_']*:[a-z'][a-zA-Z0-9_']*)|(\\b[a-z'][a-zA-Z0-9_']*)",r:0},{cN:"variable",b:"[A-Z][a-zA-Z0-9_']*",r:0}]}});hljs.registerLanguage("nginx",function(e){var r={cN:"variable",v:[{b:/\$\d+/},{b:/\$\{/,e:/}/},{b:"[\\$\\@]"+e.UIR}]},b={eW:!0,l:"[a-z/_]+",k:{built_in:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},r:0,i:"=>",c:[e.HCM,{cN:"string",c:[e.BE,r],v:[{b:/"/,e:/"/},{b:/'/,e:/'/}]},{cN:"url",b:"([a-z]+):/",e:"\\s",eW:!0,eE:!0,c:[r]},{cN:"regexp",c:[e.BE,r],v:[{b:"\\s\\^",e:"\\s|{|;",rE:!0},{b:"~\\*?\\s+",e:"\\s|{|;",rE:!0},{b:"\\*(\\.[a-z\\-]+)+"},{b:"([a-z\\-]+\\.)+\\*"}]},{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+[kKmMgGdshdwy]*\\b",r:0},r]};return{aliases:["nginxconf"],c:[e.HCM,{b:e.UIR+"\\s",e:";|{",rB:!0,c:[{cN:"title",b:e.UIR,starts:b}],r:0}],i:"[^\\s\\}]"}});hljs.registerLanguage("mathematica",function(e){return{aliases:["mma"],l:"(\\$|\\b)"+e.IR+"\\b",k:"AbelianGroup Abort AbortKernels AbortProtect Above Abs Absolute AbsoluteCorrelation AbsoluteCorrelationFunction AbsoluteCurrentValue AbsoluteDashing AbsoluteFileName AbsoluteOptions AbsolutePointSize AbsoluteThickness AbsoluteTime AbsoluteTiming AccountingForm Accumulate Accuracy AccuracyGoal ActionDelay ActionMenu ActionMenuBox ActionMenuBoxOptions Active ActiveItem ActiveStyle AcyclicGraphQ AddOnHelpPath AddTo AdjacencyGraph AdjacencyList AdjacencyMatrix AdjustmentBox AdjustmentBoxOptions AdjustTimeSeriesForecast AffineTransform After AiryAi AiryAiPrime AiryAiZero AiryBi AiryBiPrime AiryBiZero AlgebraicIntegerQ AlgebraicNumber AlgebraicNumberDenominator AlgebraicNumberNorm AlgebraicNumberPolynomial AlgebraicNumberTrace AlgebraicRules AlgebraicRulesData Algebraics AlgebraicUnitQ Alignment AlignmentMarker AlignmentPoint All AllowedDimensions AllowGroupClose AllowInlineCells AllowKernelInitialization AllowReverseGroupClose AllowScriptLevelChange AlphaChannel AlternatingGroup AlternativeHypothesis Alternatives AmbientLight Analytic AnchoredSearch And AndersonDarlingTest AngerJ AngleBracket AngularGauge Animate AnimationCycleOffset AnimationCycleRepetitions AnimationDirection AnimationDisplayTime AnimationRate AnimationRepetitions AnimationRunning Animator AnimatorBox AnimatorBoxOptions AnimatorElements Annotation Annuity AnnuityDue Antialiasing Antisymmetric Apart ApartSquareFree Appearance AppearanceElements AppellF1 Append AppendTo Apply ArcCos ArcCosh ArcCot ArcCoth ArcCsc ArcCsch ArcSec ArcSech ArcSin ArcSinDistribution ArcSinh ArcTan ArcTanh Arg ArgMax ArgMin ArgumentCountQ ARIMAProcess ArithmeticGeometricMean ARMAProcess ARProcess Array ArrayComponents ArrayDepth ArrayFlatten ArrayPad ArrayPlot ArrayQ ArrayReshape ArrayRules Arrays Arrow Arrow3DBox ArrowBox Arrowheads AspectRatio AspectRatioFixed Assert Assuming Assumptions AstronomicalData Asynchronous AsynchronousTaskObject AsynchronousTasks AtomQ Attributes AugmentedSymmetricPolynomial AutoAction AutoDelete AutoEvaluateEvents AutoGeneratedPackage AutoIndent AutoIndentSpacings AutoItalicWords AutoloadPath AutoMatch Automatic AutomaticImageSize AutoMultiplicationSymbol AutoNumberFormatting AutoOpenNotebooks AutoOpenPalettes AutorunSequencing AutoScaling AutoScroll AutoSpacing AutoStyleOptions AutoStyleWords Axes AxesEdge AxesLabel AxesOrigin AxesStyle Axis BabyMonsterGroupB Back Background BackgroundTasksSettings Backslash Backsubstitution Backward Band BandpassFilter BandstopFilter BarabasiAlbertGraphDistribution BarChart BarChart3D BarLegend BarlowProschanImportance BarnesG BarOrigin BarSpacing BartlettHannWindow BartlettWindow BaseForm Baseline BaselinePosition BaseStyle BatesDistribution BattleLemarieWavelet Because BeckmannDistribution Beep Before Begin BeginDialogPacket BeginFrontEndInteractionPacket BeginPackage BellB BellY Below BenfordDistribution BeniniDistribution BenktanderGibratDistribution BenktanderWeibullDistribution BernoulliB BernoulliDistribution BernoulliGraphDistribution BernoulliProcess BernsteinBasis BesselFilterModel BesselI BesselJ BesselJZero BesselK BesselY BesselYZero Beta BetaBinomialDistribution BetaDistribution BetaNegativeBinomialDistribution BetaPrimeDistribution BetaRegularized BetweennessCentrality BezierCurve BezierCurve3DBox BezierCurve3DBoxOptions BezierCurveBox BezierCurveBoxOptions BezierFunction BilateralFilter Binarize BinaryFormat BinaryImageQ BinaryRead BinaryReadList BinaryWrite BinCounts BinLists Binomial BinomialDistribution BinomialProcess BinormalDistribution BiorthogonalSplineWavelet BipartiteGraphQ BirnbaumImportance BirnbaumSaundersDistribution BitAnd BitClear BitGet BitLength BitNot BitOr BitSet BitShiftLeft BitShiftRight BitXor Black BlackmanHarrisWindow BlackmanNuttallWindow BlackmanWindow Blank BlankForm BlankNullSequence BlankSequence Blend Block BlockRandom BlomqvistBeta BlomqvistBetaTest Blue Blur BodePlot BohmanWindow Bold Bookmarks Boole BooleanConsecutiveFunction BooleanConvert BooleanCountingFunction BooleanFunction BooleanGraph BooleanMaxterms BooleanMinimize BooleanMinterms Booleans BooleanTable BooleanVariables BorderDimensions BorelTannerDistribution Bottom BottomHatTransform BoundaryStyle Bounds Box BoxBaselineShift BoxData BoxDimensions Boxed Boxes BoxForm BoxFormFormatTypes BoxFrame BoxID BoxMargins BoxMatrix BoxRatios BoxRotation BoxRotationPoint BoxStyle BoxWhiskerChart Bra BracketingBar BraKet BrayCurtisDistance BreadthFirstScan Break Brown BrownForsytheTest BrownianBridgeProcess BrowserCategory BSplineBasis BSplineCurve BSplineCurve3DBox BSplineCurveBox BSplineCurveBoxOptions BSplineFunction BSplineSurface BSplineSurface3DBox BubbleChart BubbleChart3D BubbleScale BubbleSizes BulletGauge BusinessDayQ ButterflyGraph ButterworthFilterModel Button ButtonBar ButtonBox ButtonBoxOptions ButtonCell ButtonContents ButtonData ButtonEvaluator ButtonExpandable ButtonFrame ButtonFunction ButtonMargins ButtonMinHeight ButtonNote ButtonNotebook ButtonSource ButtonStyle ButtonStyleMenuListing Byte ByteCount ByteOrdering C CachedValue CacheGraphics CalendarData CalendarType CallPacket CanberraDistance Cancel CancelButton CandlestickChart Cap CapForm CapitalDifferentialD CardinalBSplineBasis CarmichaelLambda Cases Cashflow Casoratian Catalan CatalanNumber Catch CauchyDistribution CauchyWindow CayleyGraph CDF CDFDeploy CDFInformation CDFWavelet Ceiling Cell CellAutoOverwrite CellBaseline CellBoundingBox CellBracketOptions CellChangeTimes CellContents CellContext CellDingbat CellDynamicExpression CellEditDuplicate CellElementsBoundingBox CellElementSpacings CellEpilog CellEvaluationDuplicate CellEvaluationFunction CellEventActions CellFrame CellFrameColor CellFrameLabelMargins CellFrameLabels CellFrameMargins CellGroup CellGroupData CellGrouping CellGroupingRules CellHorizontalScrolling CellID CellLabel CellLabelAutoDelete CellLabelMargins CellLabelPositioning CellMargins CellObject CellOpen CellPrint CellProlog Cells CellSize CellStyle CellTags CellularAutomaton CensoredDistribution Censoring Center CenterDot CentralMoment CentralMomentGeneratingFunction CForm ChampernowneNumber ChanVeseBinarize Character CharacterEncoding CharacterEncodingsPath CharacteristicFunction CharacteristicPolynomial CharacterRange Characters ChartBaseStyle ChartElementData ChartElementDataFunction ChartElementFunction ChartElements ChartLabels ChartLayout ChartLegends ChartStyle Chebyshev1FilterModel Chebyshev2FilterModel ChebyshevDistance ChebyshevT ChebyshevU Check CheckAbort CheckAll Checkbox CheckboxBar CheckboxBox CheckboxBoxOptions ChemicalData ChessboardDistance ChiDistribution ChineseRemainder ChiSquareDistribution ChoiceButtons ChoiceDialog CholeskyDecomposition Chop Circle CircleBox CircleDot CircleMinus CirclePlus CircleTimes CirculantGraph CityData Clear ClearAll ClearAttributes ClearSystemCache ClebschGordan ClickPane Clip ClipboardNotebook ClipFill ClippingStyle ClipPlanes ClipRange Clock ClockGauge ClockwiseContourIntegral Close Closed CloseKernels ClosenessCentrality Closing ClosingAutoSave ClosingEvent ClusteringComponents CMYKColor Coarse Coefficient CoefficientArrays CoefficientDomain CoefficientList CoefficientRules CoifletWavelet Collect Colon ColonForm ColorCombine ColorConvert ColorData ColorDataFunction ColorFunction ColorFunctionScaling Colorize ColorNegate ColorOutput ColorProfileData ColorQuantize ColorReplace ColorRules ColorSelectorSettings ColorSeparate ColorSetter ColorSetterBox ColorSetterBoxOptions ColorSlider ColorSpace Column ColumnAlignments ColumnBackgrounds ColumnForm ColumnLines ColumnsEqual ColumnSpacings ColumnWidths CommonDefaultFormatTypes Commonest CommonestFilter CommonUnits CommunityBoundaryStyle CommunityGraphPlot CommunityLabels CommunityRegionStyle CompatibleUnitQ CompilationOptions CompilationTarget Compile Compiled CompiledFunction Complement CompleteGraph CompleteGraphQ CompleteKaryTree CompletionsListPacket Complex Complexes ComplexExpand ComplexInfinity ComplexityFunction ComponentMeasurements ComponentwiseContextMenu Compose ComposeList ComposeSeries Composition CompoundExpression CompoundPoissonDistribution CompoundPoissonProcess CompoundRenewalProcess Compress CompressedData Condition ConditionalExpression Conditioned Cone ConeBox ConfidenceLevel ConfidenceRange ConfidenceTransform ConfigurationPath Congruent Conjugate ConjugateTranspose Conjunction Connect ConnectedComponents ConnectedGraphQ ConnesWindow ConoverTest ConsoleMessage ConsoleMessagePacket ConsolePrint Constant ConstantArray Constants ConstrainedMax ConstrainedMin ContentPadding ContentsBoundingBox ContentSelectable ContentSize Context ContextMenu Contexts ContextToFilename ContextToFileName Continuation Continue ContinuedFraction ContinuedFractionK ContinuousAction ContinuousMarkovProcess ContinuousTimeModelQ ContinuousWaveletData ContinuousWaveletTransform ContourDetect ContourGraphics ContourIntegral ContourLabels ContourLines ContourPlot ContourPlot3D Contours ContourShading ContourSmoothing ContourStyle ContraharmonicMean Control ControlActive ControlAlignment ControllabilityGramian ControllabilityMatrix ControllableDecomposition ControllableModelQ ControllerDuration ControllerInformation ControllerInformationData ControllerLinking ControllerManipulate ControllerMethod ControllerPath ControllerState ControlPlacement ControlsRendering ControlType Convergents ConversionOptions ConversionRules ConvertToBitmapPacket ConvertToPostScript ConvertToPostScriptPacket Convolve ConwayGroupCo1 ConwayGroupCo2 ConwayGroupCo3 CoordinateChartData CoordinatesToolOptions CoordinateTransform CoordinateTransformData CoprimeQ Coproduct CopulaDistribution Copyable CopyDirectory CopyFile CopyTag CopyToClipboard CornerFilter CornerNeighbors Correlation CorrelationDistance CorrelationFunction CorrelationTest Cos Cosh CoshIntegral CosineDistance CosineWindow CosIntegral Cot Coth Count CounterAssignments CounterBox CounterBoxOptions CounterClockwiseContourIntegral CounterEvaluator CounterFunction CounterIncrements CounterStyle CounterStyleMenuListing CountRoots CountryData Covariance CovarianceEstimatorFunction CovarianceFunction CoxianDistribution CoxIngersollRossProcess CoxModel CoxModelFit CramerVonMisesTest CreateArchive CreateDialog CreateDirectory CreateDocument CreateIntermediateDirectories CreatePalette CreatePalettePacket CreateScheduledTask CreateTemporary CreateWindow CriticalityFailureImportance CriticalitySuccessImportance CriticalSection Cross CrossingDetect CrossMatrix Csc Csch CubeRoot Cubics Cuboid CuboidBox Cumulant CumulantGeneratingFunction Cup CupCap Curl CurlyDoubleQuote CurlyQuote CurrentImage CurrentlySpeakingPacket CurrentValue CurvatureFlowFilter CurveClosed Cyan CycleGraph CycleIndexPolynomial Cycles CyclicGroup Cyclotomic Cylinder CylinderBox CylindricalDecomposition D DagumDistribution DamerauLevenshteinDistance DampingFactor Darker Dashed Dashing DataCompression DataDistribution DataRange DataReversed Date DateDelimiters DateDifference DateFunction DateList DateListLogPlot DateListPlot DatePattern DatePlus DateRange DateString DateTicksFormat DaubechiesWavelet DavisDistribution DawsonF DayCount DayCountConvention DayMatchQ DayName DayPlus DayRange DayRound DeBruijnGraph Debug DebugTag Decimal DeclareKnownSymbols DeclarePackage Decompose Decrement DedekindEta Default DefaultAxesStyle DefaultBaseStyle DefaultBoxStyle DefaultButton DefaultColor DefaultControlPlacement DefaultDuplicateCellStyle DefaultDuration DefaultElement DefaultFaceGridsStyle DefaultFieldHintStyle DefaultFont DefaultFontProperties DefaultFormatType DefaultFormatTypeForStyle DefaultFrameStyle DefaultFrameTicksStyle DefaultGridLinesStyle DefaultInlineFormatType DefaultInputFormatType DefaultLabelStyle DefaultMenuStyle DefaultNaturalLanguage DefaultNewCellStyle DefaultNewInlineCellStyle DefaultNotebook DefaultOptions DefaultOutputFormatType DefaultStyle DefaultStyleDefinitions DefaultTextFormatType DefaultTextInlineFormatType DefaultTicksStyle DefaultTooltipStyle DefaultValues Defer DefineExternal DefineInputStreamMethod DefineOutputStreamMethod Definition Degree DegreeCentrality DegreeGraphDistribution DegreeLexicographic DegreeReverseLexicographic Deinitialization Del Deletable Delete DeleteBorderComponents DeleteCases DeleteContents DeleteDirectory DeleteDuplicates DeleteFile DeleteSmallComponents DeleteWithContents DeletionWarning Delimiter DelimiterFlashTime DelimiterMatching Delimiters Denominator DensityGraphics DensityHistogram DensityPlot DependentVariables Deploy Deployed Depth DepthFirstScan Derivative DerivativeFilter DescriptorStateSpace DesignMatrix Det DGaussianWavelet DiacriticalPositioning Diagonal DiagonalMatrix Dialog DialogIndent DialogInput DialogLevel DialogNotebook DialogProlog DialogReturn DialogSymbols Diamond DiamondMatrix DiceDissimilarity DictionaryLookup DifferenceDelta DifferenceOrder DifferenceRoot DifferenceRootReduce Differences DifferentialD DifferentialRoot DifferentialRootReduce DifferentiatorFilter DigitBlock DigitBlockMinimum DigitCharacter DigitCount DigitQ DihedralGroup Dilation Dimensions DiracComb DiracDelta DirectedEdge DirectedEdges DirectedGraph DirectedGraphQ DirectedInfinity Direction Directive Directory DirectoryName DirectoryQ DirectoryStack DirichletCharacter DirichletConvolve DirichletDistribution DirichletL DirichletTransform DirichletWindow DisableConsolePrintPacket DiscreteChirpZTransform DiscreteConvolve DiscreteDelta DiscreteHadamardTransform DiscreteIndicator DiscreteLQEstimatorGains DiscreteLQRegulatorGains DiscreteLyapunovSolve DiscreteMarkovProcess DiscretePlot DiscretePlot3D DiscreteRatio DiscreteRiccatiSolve DiscreteShift DiscreteTimeModelQ DiscreteUniformDistribution DiscreteVariables DiscreteWaveletData DiscreteWaveletPacketTransform DiscreteWaveletTransform Discriminant Disjunction Disk DiskBox DiskMatrix Dispatch DispersionEstimatorFunction Display DisplayAllSteps DisplayEndPacket DisplayFlushImagePacket DisplayForm DisplayFunction DisplayPacket DisplayRules DisplaySetSizePacket DisplayString DisplayTemporary DisplayWith DisplayWithRef DisplayWithVariable DistanceFunction DistanceTransform Distribute Distributed DistributedContexts DistributeDefinitions DistributionChart DistributionDomain DistributionFitTest DistributionParameterAssumptions DistributionParameterQ Dithering Div Divergence Divide DivideBy Dividers Divisible Divisors DivisorSigma DivisorSum DMSList DMSString Do DockedCells DocumentNotebook DominantColors DOSTextFormat Dot DotDashed DotEqual Dotted DoubleBracketingBar DoubleContourIntegral DoubleDownArrow DoubleLeftArrow DoubleLeftRightArrow DoubleLeftTee DoubleLongLeftArrow DoubleLongLeftRightArrow DoubleLongRightArrow DoubleRightArrow DoubleRightTee DoubleUpArrow DoubleUpDownArrow DoubleVerticalBar DoublyInfinite Down DownArrow DownArrowBar DownArrowUpArrow DownLeftRightVector DownLeftTeeVector DownLeftVector DownLeftVectorBar DownRightTeeVector DownRightVector DownRightVectorBar Downsample DownTee DownTeeArrow DownValues DragAndDrop DrawEdges DrawFrontFaces DrawHighlighted Drop DSolve Dt DualLinearProgramming DualSystemsModel DumpGet DumpSave DuplicateFreeQ Dynamic DynamicBox DynamicBoxOptions DynamicEvaluationTimeout DynamicLocation DynamicModule DynamicModuleBox DynamicModuleBoxOptions DynamicModuleParent DynamicModuleValues DynamicName DynamicNamespace DynamicReference DynamicSetting DynamicUpdating DynamicWrapper DynamicWrapperBox DynamicWrapperBoxOptions E EccentricityCentrality EdgeAdd EdgeBetweennessCentrality EdgeCapacity EdgeCapForm EdgeColor EdgeConnectivity EdgeCost EdgeCount EdgeCoverQ EdgeDashing EdgeDelete EdgeDetect EdgeForm EdgeIndex EdgeJoinForm EdgeLabeling EdgeLabels EdgeLabelStyle EdgeList EdgeOpacity EdgeQ EdgeRenderingFunction EdgeRules EdgeShapeFunction EdgeStyle EdgeThickness EdgeWeight Editable EditButtonSettings EditCellTagsSettings EditDistance EffectiveInterest Eigensystem Eigenvalues EigenvectorCentrality Eigenvectors Element ElementData Eliminate EliminationOrder EllipticE EllipticExp EllipticExpPrime EllipticF EllipticFilterModel EllipticK EllipticLog EllipticNomeQ EllipticPi EllipticReducedHalfPeriods EllipticTheta EllipticThetaPrime EmitSound EmphasizeSyntaxErrors EmpiricalDistribution Empty EmptyGraphQ EnableConsolePrintPacket Enabled Encode End EndAdd EndDialogPacket EndFrontEndInteractionPacket EndOfFile EndOfLine EndOfString EndPackage EngineeringForm Enter EnterExpressionPacket EnterTextPacket Entropy EntropyFilter Environment Epilog Equal EqualColumns EqualRows EqualTilde EquatedTo Equilibrium EquirippleFilterKernel Equivalent Erf Erfc Erfi ErlangB ErlangC ErlangDistribution Erosion ErrorBox ErrorBoxOptions ErrorNorm ErrorPacket ErrorsDialogSettings EstimatedDistribution EstimatedProcess EstimatorGains EstimatorRegulator EuclideanDistance EulerE EulerGamma EulerianGraphQ EulerPhi Evaluatable Evaluate Evaluated EvaluatePacket EvaluationCell EvaluationCompletionAction EvaluationElements EvaluationMode EvaluationMonitor EvaluationNotebook EvaluationObject EvaluationOrder Evaluator EvaluatorNames EvenQ EventData EventEvaluator EventHandler EventHandlerTag EventLabels ExactBlackmanWindow ExactNumberQ ExactRootIsolation ExampleData Except ExcludedForms ExcludePods Exclusions ExclusionsStyle Exists Exit ExitDialog Exp Expand ExpandAll ExpandDenominator ExpandFileName ExpandNumerator Expectation ExpectationE ExpectedValue ExpGammaDistribution ExpIntegralE ExpIntegralEi Exponent ExponentFunction ExponentialDistribution ExponentialFamily ExponentialGeneratingFunction ExponentialMovingAverage ExponentialPowerDistribution ExponentPosition ExponentStep Export ExportAutoReplacements ExportPacket ExportString Expression ExpressionCell ExpressionPacket ExpToTrig ExtendedGCD Extension ExtentElementFunction ExtentMarkers ExtentSize ExternalCall ExternalDataCharacterEncoding Extract ExtractArchive ExtremeValueDistribution FaceForm FaceGrids FaceGridsStyle Factor FactorComplete Factorial Factorial2 FactorialMoment FactorialMomentGeneratingFunction FactorialPower FactorInteger FactorList FactorSquareFree FactorSquareFreeList FactorTerms FactorTermsList Fail FailureDistribution False FARIMAProcess FEDisableConsolePrintPacket FeedbackSector FeedbackSectorStyle FeedbackType FEEnableConsolePrintPacket Fibonacci FieldHint FieldHintStyle FieldMasked FieldSize File FileBaseName FileByteCount FileDate FileExistsQ FileExtension FileFormat FileHash FileInformation FileName FileNameDepth FileNameDialogSettings FileNameDrop FileNameJoin FileNames FileNameSetter FileNameSplit FileNameTake FilePrint FileType FilledCurve FilledCurveBox Filling FillingStyle FillingTransform FilterRules FinancialBond FinancialData FinancialDerivative FinancialIndicator Find FindArgMax FindArgMin FindClique FindClusters FindCurvePath FindDistributionParameters FindDivisions FindEdgeCover FindEdgeCut FindEulerianCycle FindFaces FindFile FindFit FindGeneratingFunction FindGeoLocation FindGeometricTransform FindGraphCommunities FindGraphIsomorphism FindGraphPartition FindHamiltonianCycle FindIndependentEdgeSet FindIndependentVertexSet FindInstance FindIntegerNullVector FindKClan FindKClique FindKClub FindKPlex FindLibrary FindLinearRecurrence FindList FindMaximum FindMaximumFlow FindMaxValue FindMinimum FindMinimumCostFlow FindMinimumCut FindMinValue FindPermutation FindPostmanTour FindProcessParameters FindRoot FindSequenceFunction FindSettings FindShortestPath FindShortestTour FindThreshold FindVertexCover FindVertexCut Fine FinishDynamic FiniteAbelianGroupCount FiniteGroupCount FiniteGroupData First FirstPassageTimeDistribution FischerGroupFi22 FischerGroupFi23 FischerGroupFi24Prime FisherHypergeometricDistribution FisherRatioTest FisherZDistribution Fit FitAll FittedModel FixedPoint FixedPointList FlashSelection Flat Flatten FlattenAt FlatTopWindow FlipView Floor FlushPrintOutputPacket Fold FoldList Font FontColor FontFamily FontForm FontName FontOpacity FontPostScriptName FontProperties FontReencoding FontSize FontSlant FontSubstitutions FontTracking FontVariations FontWeight For ForAll Format FormatRules FormatType FormatTypeAutoConvert FormatValues FormBox FormBoxOptions FortranForm Forward ForwardBackward Fourier FourierCoefficient FourierCosCoefficient FourierCosSeries FourierCosTransform FourierDCT FourierDCTFilter FourierDCTMatrix FourierDST FourierDSTMatrix FourierMatrix FourierParameters FourierSequenceTransform FourierSeries FourierSinCoefficient FourierSinSeries FourierSinTransform FourierTransform FourierTrigSeries FractionalBrownianMotionProcess FractionalPart FractionBox FractionBoxOptions FractionLine Frame FrameBox FrameBoxOptions Framed FrameInset FrameLabel Frameless FrameMargins FrameStyle FrameTicks FrameTicksStyle FRatioDistribution FrechetDistribution FreeQ FrequencySamplingFilterKernel FresnelC FresnelS Friday FrobeniusNumber FrobeniusSolve FromCharacterCode FromCoefficientRules FromContinuedFraction FromDate FromDigits FromDMS Front FrontEndDynamicExpression FrontEndEventActions FrontEndExecute FrontEndObject FrontEndResource FrontEndResourceString FrontEndStackSize FrontEndToken FrontEndTokenExecute FrontEndValueCache FrontEndVersion FrontFaceColor FrontFaceOpacity Full FullAxes FullDefinition FullForm FullGraphics FullOptions FullSimplify Function FunctionExpand FunctionInterpolation FunctionSpace FussellVeselyImportance GaborFilter GaborMatrix GaborWavelet GainMargins GainPhaseMargins Gamma GammaDistribution GammaRegularized GapPenalty Gather GatherBy GaugeFaceElementFunction GaugeFaceStyle GaugeFrameElementFunction GaugeFrameSize GaugeFrameStyle GaugeLabels GaugeMarkers GaugeStyle GaussianFilter GaussianIntegers GaussianMatrix GaussianWindow GCD GegenbauerC General GeneralizedLinearModelFit GenerateConditions GeneratedCell GeneratedParameters GeneratingFunction Generic GenericCylindricalDecomposition GenomeData GenomeLookup GeodesicClosing GeodesicDilation GeodesicErosion GeodesicOpening GeoDestination GeodesyData GeoDirection GeoDistance GeoGridPosition GeometricBrownianMotionProcess GeometricDistribution GeometricMean GeometricMeanFilter GeometricTransformation GeometricTransformation3DBox GeometricTransformation3DBoxOptions GeometricTransformationBox GeometricTransformationBoxOptions GeoPosition GeoPositionENU GeoPositionXYZ GeoProjectionData GestureHandler GestureHandlerTag Get GetBoundingBoxSizePacket GetContext GetEnvironment GetFileName GetFrontEndOptionsDataPacket GetLinebreakInformationPacket GetMenusPacket GetPageBreakInformationPacket Glaisher GlobalClusteringCoefficient GlobalPreferences GlobalSession Glow GoldenRatio GompertzMakehamDistribution GoodmanKruskalGamma GoodmanKruskalGammaTest Goto Grad Gradient GradientFilter GradientOrientationFilter Graph GraphAssortativity GraphCenter GraphComplement GraphData GraphDensity GraphDiameter GraphDifference GraphDisjointUnion GraphDistance GraphDistanceMatrix GraphElementData GraphEmbedding GraphHighlight GraphHighlightStyle GraphHub Graphics Graphics3D Graphics3DBox Graphics3DBoxOptions GraphicsArray GraphicsBaseline GraphicsBox GraphicsBoxOptions GraphicsColor GraphicsColumn GraphicsComplex GraphicsComplex3DBox GraphicsComplex3DBoxOptions GraphicsComplexBox GraphicsComplexBoxOptions GraphicsContents GraphicsData GraphicsGrid GraphicsGridBox GraphicsGroup GraphicsGroup3DBox GraphicsGroup3DBoxOptions GraphicsGroupBox GraphicsGroupBoxOptions GraphicsGrouping GraphicsHighlightColor GraphicsRow GraphicsSpacing GraphicsStyle GraphIntersection GraphLayout GraphLinkEfficiency GraphPeriphery GraphPlot GraphPlot3D GraphPower GraphPropertyDistribution GraphQ GraphRadius GraphReciprocity GraphRoot GraphStyle GraphUnion Gray GrayLevel GreatCircleDistance Greater GreaterEqual GreaterEqualLess GreaterFullEqual GreaterGreater GreaterLess GreaterSlantEqual GreaterTilde Green Grid GridBaseline GridBox GridBoxAlignment GridBoxBackground GridBoxDividers GridBoxFrame GridBoxItemSize GridBoxItemStyle GridBoxOptions GridBoxSpacings GridCreationSettings GridDefaultElement GridElementStyleOptions GridFrame GridFrameMargins GridGraph GridLines GridLinesStyle GroebnerBasis GroupActionBase GroupCentralizer GroupElementFromWord GroupElementPosition GroupElementQ GroupElements GroupElementToWord GroupGenerators GroupMultiplicationTable GroupOrbits GroupOrder GroupPageBreakWithin GroupSetwiseStabilizer GroupStabilizer GroupStabilizerChain Gudermannian GumbelDistribution HaarWavelet HadamardMatrix HalfNormalDistribution HamiltonianGraphQ HammingDistance HammingWindow HankelH1 HankelH2 HankelMatrix HannPoissonWindow HannWindow HaradaNortonGroupHN HararyGraph HarmonicMean HarmonicMeanFilter HarmonicNumber Hash HashTable Haversine HazardFunction Head HeadCompose Heads HeavisideLambda HeavisidePi HeavisideTheta HeldGroupHe HeldPart HelpBrowserLookup HelpBrowserNotebook HelpBrowserSettings HermiteDecomposition HermiteH HermitianMatrixQ HessenbergDecomposition Hessian HexadecimalCharacter Hexahedron HexahedronBox HexahedronBoxOptions HiddenSurface HighlightGraph HighlightImage HighpassFilter HigmanSimsGroupHS HilbertFilter HilbertMatrix Histogram Histogram3D HistogramDistribution HistogramList HistogramTransform HistogramTransformInterpolation HitMissTransform HITSCentrality HodgeDual HoeffdingD HoeffdingDTest Hold HoldAll HoldAllComplete HoldComplete HoldFirst HoldForm HoldPattern HoldRest HolidayCalendar HomeDirectory HomePage Horizontal HorizontalForm HorizontalGauge HorizontalScrollPosition HornerForm HotellingTSquareDistribution HoytDistribution HTMLSave Hue HumpDownHump HumpEqual HurwitzLerchPhi HurwitzZeta HyperbolicDistribution HypercubeGraph HyperexponentialDistribution Hyperfactorial Hypergeometric0F1 Hypergeometric0F1Regularized Hypergeometric1F1 Hypergeometric1F1Regularized Hypergeometric2F1 Hypergeometric2F1Regularized HypergeometricDistribution HypergeometricPFQ HypergeometricPFQRegularized HypergeometricU Hyperlink HyperlinkCreationSettings Hyphenation HyphenationOptions HypoexponentialDistribution HypothesisTestData I Identity IdentityMatrix If IgnoreCase Im Image Image3D Image3DSlices ImageAccumulate ImageAdd ImageAdjust ImageAlign ImageApply ImageAspectRatio ImageAssemble ImageCache ImageCacheValid ImageCapture ImageChannels ImageClip ImageColorSpace ImageCompose ImageConvolve ImageCooccurrence ImageCorners ImageCorrelate ImageCorrespondingPoints ImageCrop ImageData ImageDataPacket ImageDeconvolve ImageDemosaic ImageDifference ImageDimensions ImageDistance ImageEffect ImageFeatureTrack ImageFileApply ImageFileFilter ImageFileScan ImageFilter ImageForestingComponents ImageForwardTransformation ImageHistogram ImageKeypoints ImageLevels ImageLines ImageMargins ImageMarkers ImageMeasurements ImageMultiply ImageOffset ImagePad ImagePadding ImagePartition ImagePeriodogram ImagePerspectiveTransformation ImageQ ImageRangeCache ImageReflect ImageRegion ImageResize ImageResolution ImageRotate ImageRotated ImageScaled ImageScan ImageSize ImageSizeAction ImageSizeCache ImageSizeMultipliers ImageSizeRaw ImageSubtract ImageTake ImageTransformation ImageTrim ImageType ImageValue ImageValuePositions Implies Import ImportAutoReplacements ImportString ImprovementImportance In IncidenceGraph IncidenceList IncidenceMatrix IncludeConstantBasis IncludeFileExtension IncludePods IncludeSingularTerm Increment Indent IndentingNewlineSpacings IndentMaxFraction IndependenceTest IndependentEdgeSetQ IndependentUnit IndependentVertexSetQ Indeterminate IndexCreationOptions Indexed IndexGraph IndexTag Inequality InexactNumberQ InexactNumbers Infinity Infix Information Inherited InheritScope Initialization InitializationCell InitializationCellEvaluation InitializationCellWarning InlineCounterAssignments InlineCounterIncrements InlineRules Inner Inpaint Input InputAliases InputAssumptions InputAutoReplacements InputField InputFieldBox InputFieldBoxOptions InputForm InputGrouping InputNamePacket InputNotebook InputPacket InputSettings InputStream InputString InputStringPacket InputToBoxFormPacket Insert InsertionPointObject InsertResults Inset Inset3DBox Inset3DBoxOptions InsetBox InsetBoxOptions Install InstallService InString Integer IntegerDigits IntegerExponent IntegerLength IntegerPart IntegerPartitions IntegerQ Integers IntegerString Integral Integrate Interactive InteractiveTradingChart Interlaced Interleaving InternallyBalancedDecomposition InterpolatingFunction InterpolatingPolynomial Interpolation InterpolationOrder InterpolationPoints InterpolationPrecision Interpretation InterpretationBox InterpretationBoxOptions InterpretationFunction InterpretTemplate InterquartileRange Interrupt InterruptSettings Intersection Interval IntervalIntersection IntervalMemberQ IntervalUnion Inverse InverseBetaRegularized InverseCDF InverseChiSquareDistribution InverseContinuousWaveletTransform InverseDistanceTransform InverseEllipticNomeQ InverseErf InverseErfc InverseFourier InverseFourierCosTransform InverseFourierSequenceTransform InverseFourierSinTransform InverseFourierTransform InverseFunction InverseFunctions InverseGammaDistribution InverseGammaRegularized InverseGaussianDistribution InverseGudermannian InverseHaversine InverseJacobiCD InverseJacobiCN InverseJacobiCS InverseJacobiDC InverseJacobiDN InverseJacobiDS InverseJacobiNC InverseJacobiND InverseJacobiNS InverseJacobiSC InverseJacobiSD InverseJacobiSN InverseLaplaceTransform InversePermutation InverseRadon InverseSeries InverseSurvivalFunction InverseWaveletTransform InverseWeierstrassP InverseZTransform Invisible InvisibleApplication InvisibleTimes IrreduciblePolynomialQ IsolatingInterval IsomorphicGraphQ IsotopeData Italic Item ItemBox ItemBoxOptions ItemSize ItemStyle ItoProcess JaccardDissimilarity JacobiAmplitude Jacobian JacobiCD JacobiCN JacobiCS JacobiDC JacobiDN JacobiDS JacobiNC JacobiND JacobiNS JacobiP JacobiSC JacobiSD JacobiSN JacobiSymbol JacobiZeta JankoGroupJ1 JankoGroupJ2 JankoGroupJ3 JankoGroupJ4 JarqueBeraALMTest JohnsonDistribution Join Joined JoinedCurve JoinedCurveBox JoinForm JordanDecomposition JordanModelDecomposition K KagiChart KaiserBesselWindow KaiserWindow KalmanEstimator KalmanFilter KarhunenLoeveDecomposition KaryTree KatzCentrality KCoreComponents KDistribution KelvinBei KelvinBer KelvinKei KelvinKer KendallTau KendallTauTest KernelExecute KernelMixtureDistribution KernelObject Kernels Ket Khinchin KirchhoffGraph KirchhoffMatrix KleinInvariantJ KnightTourGraph KnotData KnownUnitQ KolmogorovSmirnovTest KroneckerDelta KroneckerModelDecomposition KroneckerProduct KroneckerSymbol KuiperTest KumaraswamyDistribution Kurtosis KuwaharaFilter Label Labeled LabeledSlider LabelingFunction LabelStyle LaguerreL LambdaComponents LambertW LanczosWindow LandauDistribution Language LanguageCategory LaplaceDistribution LaplaceTransform Laplacian LaplacianFilter LaplacianGaussianFilter Large Larger Last Latitude LatitudeLongitude LatticeData LatticeReduce Launch LaunchKernels LayeredGraphPlot LayerSizeFunction LayoutInformation LCM LeafCount LeapYearQ LeastSquares LeastSquaresFilterKernel Left LeftArrow LeftArrowBar LeftArrowRightArrow LeftDownTeeVector LeftDownVector LeftDownVectorBar LeftRightArrow LeftRightVector LeftTee LeftTeeArrow LeftTeeVector LeftTriangle LeftTriangleBar LeftTriangleEqual LeftUpDownVector LeftUpTeeVector LeftUpVector LeftUpVectorBar LeftVector LeftVectorBar LegendAppearance Legended LegendFunction LegendLabel LegendLayout LegendMargins LegendMarkers LegendMarkerSize LegendreP LegendreQ LegendreType Length LengthWhile LerchPhi Less LessEqual LessEqualGreater LessFullEqual LessGreater LessLess LessSlantEqual LessTilde LetterCharacter LetterQ Level LeveneTest LeviCivitaTensor LevyDistribution Lexicographic LibraryFunction LibraryFunctionError LibraryFunctionInformation LibraryFunctionLoad LibraryFunctionUnload LibraryLoad LibraryUnload LicenseID LiftingFilterData LiftingWaveletTransform LightBlue LightBrown LightCyan Lighter LightGray LightGreen Lighting LightingAngle LightMagenta LightOrange LightPink LightPurple LightRed LightSources LightYellow Likelihood Limit LimitsPositioning LimitsPositioningTokens LindleyDistribution Line Line3DBox LinearFilter LinearFractionalTransform LinearModelFit LinearOffsetFunction LinearProgramming LinearRecurrence LinearSolve LinearSolveFunction LineBox LineBreak LinebreakAdjustments LineBreakChart LineBreakWithin LineColor LineForm LineGraph LineIndent LineIndentMaxFraction LineIntegralConvolutionPlot LineIntegralConvolutionScale LineLegend LineOpacity LineSpacing LineWrapParts LinkActivate LinkClose LinkConnect LinkConnectedQ LinkCreate LinkError LinkFlush LinkFunction LinkHost LinkInterrupt LinkLaunch LinkMode LinkObject LinkOpen LinkOptions LinkPatterns LinkProtocol LinkRead LinkReadHeld LinkReadyQ Links LinkWrite LinkWriteHeld LiouvilleLambda List Listable ListAnimate ListContourPlot ListContourPlot3D ListConvolve ListCorrelate ListCurvePathPlot ListDeconvolve ListDensityPlot Listen ListFourierSequenceTransform ListInterpolation ListLineIntegralConvolutionPlot ListLinePlot ListLogLinearPlot ListLogLogPlot ListLogPlot ListPicker ListPickerBox ListPickerBoxBackground ListPickerBoxOptions ListPlay ListPlot ListPlot3D ListPointPlot3D ListPolarPlot ListQ ListStreamDensityPlot ListStreamPlot ListSurfacePlot3D ListVectorDensityPlot ListVectorPlot ListVectorPlot3D ListZTransform Literal LiteralSearch LocalClusteringCoefficient LocalizeVariables LocationEquivalenceTest LocationTest Locator LocatorAutoCreate LocatorBox LocatorBoxOptions LocatorCentering LocatorPane LocatorPaneBox LocatorPaneBoxOptions LocatorRegion Locked Log Log10 Log2 LogBarnesG LogGamma LogGammaDistribution LogicalExpand LogIntegral LogisticDistribution LogitModelFit LogLikelihood LogLinearPlot LogLogisticDistribution LogLogPlot LogMultinormalDistribution LogNormalDistribution LogPlot LogRankTest LogSeriesDistribution LongEqual Longest LongestAscendingSequence LongestCommonSequence LongestCommonSequencePositions LongestCommonSubsequence LongestCommonSubsequencePositions LongestMatch LongForm Longitude LongLeftArrow LongLeftRightArrow LongRightArrow Loopback LoopFreeGraphQ LowerCaseQ LowerLeftArrow LowerRightArrow LowerTriangularize LowpassFilter LQEstimatorGains LQGRegulator LQOutputRegulatorGains LQRegulatorGains LUBackSubstitution LucasL LuccioSamiComponents LUDecomposition LyapunovSolve LyonsGroupLy MachineID MachineName MachineNumberQ MachinePrecision MacintoshSystemPageSetup Magenta Magnification Magnify MainSolve MaintainDynamicCaches Majority MakeBoxes MakeExpression MakeRules MangoldtLambda ManhattanDistance Manipulate Manipulator MannWhitneyTest MantissaExponent Manual Map MapAll MapAt MapIndexed MAProcess MapThread MarcumQ MardiaCombinedTest MardiaKurtosisTest MardiaSkewnessTest MarginalDistribution MarkovProcessProperties Masking MatchingDissimilarity MatchLocalNameQ MatchLocalNames MatchQ Material MathematicaNotation MathieuC MathieuCharacteristicA MathieuCharacteristicB MathieuCharacteristicExponent MathieuCPrime MathieuGroupM11 MathieuGroupM12 MathieuGroupM22 MathieuGroupM23 MathieuGroupM24 MathieuS MathieuSPrime MathMLForm MathMLText Matrices MatrixExp MatrixForm MatrixFunction MatrixLog MatrixPlot MatrixPower MatrixQ MatrixRank Max MaxBend MaxDetect MaxExtraBandwidths MaxExtraConditions MaxFeatures MaxFilter Maximize MaxIterations MaxMemoryUsed MaxMixtureKernels MaxPlotPoints MaxPoints MaxRecursion MaxStableDistribution MaxStepFraction MaxSteps MaxStepSize MaxValue MaxwellDistribution McLaughlinGroupMcL Mean MeanClusteringCoefficient MeanDegreeConnectivity MeanDeviation MeanFilter MeanGraphDistance MeanNeighborDegree MeanShift MeanShiftFilter Median MedianDeviation MedianFilter Medium MeijerG MeixnerDistribution MemberQ MemoryConstrained MemoryInUse Menu MenuAppearance MenuCommandKey MenuEvaluator MenuItem MenuPacket MenuSortingValue MenuStyle MenuView MergeDifferences Mesh MeshFunctions MeshRange MeshShading MeshStyle Message MessageDialog MessageList MessageName MessageOptions MessagePacket Messages MessagesNotebook MetaCharacters MetaInformation Method MethodOptions MexicanHatWavelet MeyerWavelet Min MinDetect MinFilter MinimalPolynomial MinimalStateSpaceModel Minimize Minors MinRecursion MinSize MinStableDistribution Minus MinusPlus MinValue Missing MissingDataMethod MittagLefflerE MixedRadix MixedRadixQuantity MixtureDistribution Mod Modal Mode Modular ModularLambda Module Modulus MoebiusMu Moment Momentary MomentConvert MomentEvaluate MomentGeneratingFunction Monday Monitor MonomialList MonomialOrder MonsterGroupM MorletWavelet MorphologicalBinarize MorphologicalBranchPoints MorphologicalComponents MorphologicalEulerNumber MorphologicalGraph MorphologicalPerimeter MorphologicalTransform Most MouseAnnotation MouseAppearance MouseAppearanceTag MouseButtons Mouseover MousePointerNote MousePosition MovingAverage MovingMedian MoyalDistribution MultiedgeStyle MultilaunchWarning MultiLetterItalics MultiLetterStyle MultilineFunction Multinomial MultinomialDistribution MultinormalDistribution MultiplicativeOrder Multiplicity Multiselection MultivariateHypergeometricDistribution MultivariatePoissonDistribution MultivariateTDistribution N NakagamiDistribution NameQ Names NamespaceBox Nand NArgMax NArgMin NBernoulliB NCache NDSolve NDSolveValue Nearest NearestFunction NeedCurrentFrontEndPackagePacket NeedCurrentFrontEndSymbolsPacket NeedlemanWunschSimilarity Needs Negative NegativeBinomialDistribution NegativeMultinomialDistribution NeighborhoodGraph Nest NestedGreaterGreater NestedLessLess NestedScriptRules NestList NestWhile NestWhileList NevilleThetaC NevilleThetaD NevilleThetaN NevilleThetaS NewPrimitiveStyle NExpectation Next NextPrime NHoldAll NHoldFirst NHoldRest NicholsGridLines NicholsPlot NIntegrate NMaximize NMaxValue NMinimize NMinValue NominalVariables NonAssociative NoncentralBetaDistribution NoncentralChiSquareDistribution NoncentralFRatioDistribution NoncentralStudentTDistribution NonCommutativeMultiply NonConstants None NonlinearModelFit NonlocalMeansFilter NonNegative NonPositive Nor NorlundB Norm Normal NormalDistribution NormalGrouping Normalize NormalizedSquaredEuclideanDistance NormalsFunction NormFunction Not NotCongruent NotCupCap NotDoubleVerticalBar Notebook NotebookApply NotebookAutoSave NotebookClose NotebookConvertSettings NotebookCreate NotebookCreateReturnObject NotebookDefault NotebookDelete NotebookDirectory NotebookDynamicExpression NotebookEvaluate NotebookEventActions NotebookFileName NotebookFind NotebookFindReturnObject NotebookGet NotebookGetLayoutInformationPacket NotebookGetMisspellingsPacket NotebookInformation NotebookInterfaceObject NotebookLocate NotebookObject NotebookOpen NotebookOpenReturnObject NotebookPath NotebookPrint NotebookPut NotebookPutReturnObject NotebookRead NotebookResetGeneratedCells Notebooks NotebookSave NotebookSaveAs NotebookSelection NotebookSetupLayoutInformationPacket NotebooksMenu NotebookWrite NotElement NotEqualTilde NotExists NotGreater NotGreaterEqual NotGreaterFullEqual NotGreaterGreater NotGreaterLess NotGreaterSlantEqual NotGreaterTilde NotHumpDownHump NotHumpEqual NotLeftTriangle NotLeftTriangleBar NotLeftTriangleEqual NotLess NotLessEqual NotLessFullEqual NotLessGreater NotLessLess NotLessSlantEqual NotLessTilde NotNestedGreaterGreater NotNestedLessLess NotPrecedes NotPrecedesEqual NotPrecedesSlantEqual NotPrecedesTilde NotReverseElement NotRightTriangle NotRightTriangleBar NotRightTriangleEqual NotSquareSubset NotSquareSubsetEqual NotSquareSuperset NotSquareSupersetEqual NotSubset NotSubsetEqual NotSucceeds NotSucceedsEqual NotSucceedsSlantEqual NotSucceedsTilde NotSuperset NotSupersetEqual NotTilde NotTildeEqual NotTildeFullEqual NotTildeTilde NotVerticalBar NProbability NProduct NProductFactors NRoots NSolve NSum NSumTerms Null NullRecords NullSpace NullWords Number NumberFieldClassNumber NumberFieldDiscriminant NumberFieldFundamentalUnits NumberFieldIntegralBasis NumberFieldNormRepresentatives NumberFieldRegulator NumberFieldRootsOfUnity NumberFieldSignature NumberForm NumberFormat NumberMarks NumberMultiplier NumberPadding NumberPoint NumberQ NumberSeparator NumberSigns NumberString Numerator NumericFunction NumericQ NuttallWindow NValues NyquistGridLines NyquistPlot O ObservabilityGramian ObservabilityMatrix ObservableDecomposition ObservableModelQ OddQ Off Offset OLEData On ONanGroupON OneIdentity Opacity Open OpenAppend Opener OpenerBox OpenerBoxOptions OpenerView OpenFunctionInspectorPacket Opening OpenRead OpenSpecialOptions OpenTemporary OpenWrite Operate OperatingSystem OptimumFlowData Optional OptionInspectorSettings OptionQ Options OptionsPacket OptionsPattern OptionValue OptionValueBox OptionValueBoxOptions Or Orange Order OrderDistribution OrderedQ Ordering Orderless OrnsteinUhlenbeckProcess Orthogonalize Out Outer OutputAutoOverwrite OutputControllabilityMatrix OutputControllableModelQ OutputForm OutputFormData OutputGrouping OutputMathEditExpression OutputNamePacket OutputResponse OutputSizeLimit OutputStream Over OverBar OverDot Overflow OverHat Overlaps Overlay OverlayBox OverlayBoxOptions Overscript OverscriptBox OverscriptBoxOptions OverTilde OverVector OwenT OwnValues PackingMethod PaddedForm Padding PadeApproximant PadLeft PadRight PageBreakAbove PageBreakBelow PageBreakWithin PageFooterLines PageFooters PageHeaderLines PageHeaders PageHeight PageRankCentrality PageWidth PairedBarChart PairedHistogram PairedSmoothHistogram PairedTTest PairedZTest PaletteNotebook PalettePath Pane PaneBox PaneBoxOptions Panel PanelBox PanelBoxOptions Paneled PaneSelector PaneSelectorBox PaneSelectorBoxOptions PaperWidth ParabolicCylinderD ParagraphIndent ParagraphSpacing ParallelArray ParallelCombine ParallelDo ParallelEvaluate Parallelization Parallelize ParallelMap ParallelNeeds ParallelProduct ParallelSubmit ParallelSum ParallelTable ParallelTry Parameter ParameterEstimator ParameterMixtureDistribution ParameterVariables ParametricFunction ParametricNDSolve ParametricNDSolveValue ParametricPlot ParametricPlot3D ParentConnect ParentDirectory ParentForm Parenthesize ParentList ParetoDistribution Part PartialCorrelationFunction PartialD ParticleData Partition PartitionsP PartitionsQ ParzenWindow PascalDistribution PassEventsDown PassEventsUp Paste PasteBoxFormInlineCells PasteButton Path PathGraph PathGraphQ Pattern PatternSequence PatternTest PauliMatrix PaulWavelet Pause PausedTime PDF PearsonChiSquareTest PearsonCorrelationTest PearsonDistribution PerformanceGoal PeriodicInterpolation Periodogram PeriodogramArray PermutationCycles PermutationCyclesQ PermutationGroup PermutationLength PermutationList PermutationListQ PermutationMax PermutationMin PermutationOrder PermutationPower PermutationProduct PermutationReplace Permutations PermutationSupport Permute PeronaMalikFilter Perpendicular PERTDistribution PetersenGraph PhaseMargins Pi Pick PIDData PIDDerivativeFilter PIDFeedforward PIDTune Piecewise PiecewiseExpand PieChart PieChart3D PillaiTrace PillaiTraceTest Pink Pivoting PixelConstrained PixelValue PixelValuePositions Placed Placeholder PlaceholderReplace Plain PlanarGraphQ Play PlayRange Plot Plot3D Plot3Matrix PlotDivision PlotJoined PlotLabel PlotLayout PlotLegends PlotMarkers PlotPoints PlotRange PlotRangeClipping PlotRangePadding PlotRegion PlotStyle Plus PlusMinus Pochhammer PodStates PodWidth Point Point3DBox PointBox PointFigureChart PointForm PointLegend PointSize PoissonConsulDistribution PoissonDistribution PoissonProcess PoissonWindow PolarAxes PolarAxesOrigin PolarGridLines PolarPlot PolarTicks PoleZeroMarkers PolyaAeppliDistribution PolyGamma Polygon Polygon3DBox Polygon3DBoxOptions PolygonBox PolygonBoxOptions PolygonHoleScale PolygonIntersections PolygonScale PolyhedronData PolyLog PolynomialExtendedGCD PolynomialForm PolynomialGCD PolynomialLCM PolynomialMod PolynomialQ PolynomialQuotient PolynomialQuotientRemainder PolynomialReduce PolynomialRemainder Polynomials PopupMenu PopupMenuBox PopupMenuBoxOptions PopupView PopupWindow Position Positive PositiveDefiniteMatrixQ PossibleZeroQ Postfix PostScript Power PowerDistribution PowerExpand PowerMod PowerModList PowerSpectralDensity PowersRepresentations PowerSymmetricPolynomial Precedence PrecedenceForm Precedes PrecedesEqual PrecedesSlantEqual PrecedesTilde Precision PrecisionGoal PreDecrement PredictionRoot PreemptProtect PreferencesPath Prefix PreIncrement Prepend PrependTo PreserveImageOptions Previous PriceGraphDistribution PrimaryPlaceholder Prime PrimeNu PrimeOmega PrimePi PrimePowerQ PrimeQ Primes PrimeZetaP PrimitiveRoot PrincipalComponents PrincipalValue Print PrintAction PrintForm PrintingCopies PrintingOptions PrintingPageRange PrintingStartingPageNumber PrintingStyleEnvironment PrintPrecision PrintTemporary Prism PrismBox PrismBoxOptions PrivateCellOptions PrivateEvaluationOptions PrivateFontOptions PrivateFrontEndOptions PrivateNotebookOptions PrivatePaths Probability ProbabilityDistribution ProbabilityPlot ProbabilityPr ProbabilityScalePlot ProbitModelFit ProcessEstimator ProcessParameterAssumptions ProcessParameterQ ProcessStateDomain ProcessTimeDomain Product ProductDistribution ProductLog ProgressIndicator ProgressIndicatorBox ProgressIndicatorBoxOptions Projection Prolog PromptForm Properties Property PropertyList PropertyValue Proportion Proportional Protect Protected ProteinData Pruning PseudoInverse Purple Put PutAppend Pyramid PyramidBox PyramidBoxOptions QBinomial QFactorial QGamma QHypergeometricPFQ QPochhammer QPolyGamma QRDecomposition QuadraticIrrationalQ Quantile QuantilePlot Quantity QuantityForm QuantityMagnitude QuantityQ QuantityUnit Quartics QuartileDeviation Quartiles QuartileSkewness QueueingNetworkProcess QueueingProcess QueueProperties Quiet Quit Quotient QuotientRemainder RadialityCentrality RadicalBox RadicalBoxOptions RadioButton RadioButtonBar RadioButtonBox RadioButtonBoxOptions Radon RamanujanTau RamanujanTauL RamanujanTauTheta RamanujanTauZ Random RandomChoice RandomComplex RandomFunction RandomGraph RandomImage RandomInteger RandomPermutation RandomPrime RandomReal RandomSample RandomSeed RandomVariate RandomWalkProcess Range RangeFilter RangeSpecification RankedMax RankedMin Raster Raster3D Raster3DBox Raster3DBoxOptions RasterArray RasterBox RasterBoxOptions Rasterize RasterSize Rational RationalFunctions Rationalize Rationals Ratios Raw RawArray RawBoxes RawData RawMedium RayleighDistribution Re Read ReadList ReadProtected Real RealBlockDiagonalForm RealDigits RealExponent Reals Reap Record RecordLists RecordSeparators Rectangle RectangleBox RectangleBoxOptions RectangleChart RectangleChart3D RecurrenceFilter RecurrenceTable RecurringDigitsForm Red Reduce RefBox ReferenceLineStyle ReferenceMarkers ReferenceMarkerStyle Refine ReflectionMatrix ReflectionTransform Refresh RefreshRate RegionBinarize RegionFunction RegionPlot RegionPlot3D RegularExpression Regularization Reinstall Release ReleaseHold ReliabilityDistribution ReliefImage ReliefPlot Remove RemoveAlphaChannel RemoveAsynchronousTask Removed RemoveInputStreamMethod RemoveOutputStreamMethod RemoveProperty RemoveScheduledTask RenameDirectory RenameFile RenderAll RenderingOptions RenewalProcess RenkoChart Repeated RepeatedNull RepeatedString Replace ReplaceAll ReplaceHeldPart ReplaceImageValue ReplaceList ReplacePart ReplacePixelValue ReplaceRepeated Resampling Rescale RescalingTransform ResetDirectory ResetMenusPacket ResetScheduledTask Residue Resolve Rest Resultant ResumePacket Return ReturnExpressionPacket ReturnInputFormPacket ReturnPacket ReturnTextPacket Reverse ReverseBiorthogonalSplineWavelet ReverseElement ReverseEquilibrium ReverseGraph ReverseUpEquilibrium RevolutionAxis RevolutionPlot3D RGBColor RiccatiSolve RiceDistribution RidgeFilter RiemannR RiemannSiegelTheta RiemannSiegelZ Riffle Right RightArrow RightArrowBar RightArrowLeftArrow RightCosetRepresentative RightDownTeeVector RightDownVector RightDownVectorBar RightTee RightTeeArrow RightTeeVector RightTriangle RightTriangleBar RightTriangleEqual RightUpDownVector RightUpTeeVector RightUpVector RightUpVectorBar RightVector RightVectorBar RiskAchievementImportance RiskReductionImportance RogersTanimotoDissimilarity Root RootApproximant RootIntervals RootLocusPlot RootMeanSquare RootOfUnityQ RootReduce Roots RootSum Rotate RotateLabel RotateLeft RotateRight RotationAction RotationBox RotationBoxOptions RotationMatrix RotationTransform Round RoundImplies RoundingRadius Row RowAlignments RowBackgrounds RowBox RowHeights RowLines RowMinHeight RowReduce RowsEqual RowSpacings RSolve RudvalisGroupRu Rule RuleCondition RuleDelayed RuleForm RulerUnits Run RunScheduledTask RunThrough RuntimeAttributes RuntimeOptions RussellRaoDissimilarity SameQ SameTest SampleDepth SampledSoundFunction SampledSoundList SampleRate SamplingPeriod SARIMAProcess SARMAProcess SatisfiabilityCount SatisfiabilityInstances SatisfiableQ Saturday Save Saveable SaveAutoDelete SaveDefinitions SawtoothWave Scale Scaled ScaleDivisions ScaledMousePosition ScaleOrigin ScalePadding ScaleRanges ScaleRangeStyle ScalingFunctions ScalingMatrix ScalingTransform Scan ScheduledTaskActiveQ ScheduledTaskData ScheduledTaskObject ScheduledTasks SchurDecomposition ScientificForm ScreenRectangle ScreenStyleEnvironment ScriptBaselineShifts ScriptLevel ScriptMinSize ScriptRules ScriptSizeMultipliers Scrollbars ScrollingOptions ScrollPosition Sec Sech SechDistribution SectionGrouping SectorChart SectorChart3D SectorOrigin SectorSpacing SeedRandom Select Selectable SelectComponents SelectedCells SelectedNotebook Selection SelectionAnimate SelectionCell SelectionCellCreateCell SelectionCellDefaultStyle SelectionCellParentStyle SelectionCreateCell SelectionDebuggerTag SelectionDuplicateCell SelectionEvaluate SelectionEvaluateCreateCell SelectionMove SelectionPlaceholder SelectionSetStyle SelectWithContents SelfLoops SelfLoopStyle SemialgebraicComponentInstances SendMail Sequence SequenceAlignment SequenceForm SequenceHold SequenceLimit Series SeriesCoefficient SeriesData SessionTime Set SetAccuracy SetAlphaChannel SetAttributes Setbacks SetBoxFormNamesPacket SetDelayed SetDirectory SetEnvironment SetEvaluationNotebook SetFileDate SetFileLoadingContext SetNotebookStatusLine SetOptions SetOptionsPacket SetPrecision SetProperty SetSelectedNotebook SetSharedFunction SetSharedVariable SetSpeechParametersPacket SetStreamPosition SetSystemOptions Setter SetterBar SetterBox SetterBoxOptions Setting SetValue Shading Shallow ShannonWavelet ShapiroWilkTest Share Sharpen ShearingMatrix ShearingTransform ShenCastanMatrix Short ShortDownArrow Shortest ShortestMatch ShortestPathFunction ShortLeftArrow ShortRightArrow ShortUpArrow Show ShowAutoStyles ShowCellBracket ShowCellLabel ShowCellTags ShowClosedCellArea ShowContents ShowControls ShowCursorTracker ShowGroupOpenCloseIcon ShowGroupOpener ShowInvisibleCharacters ShowPageBreaks ShowPredictiveInterface ShowSelection ShowShortBoxForm ShowSpecialCharacters ShowStringCharacters ShowSyntaxStyles ShrinkingDelay ShrinkWrapBoundingBox SiegelTheta SiegelTukeyTest Sign Signature SignedRankTest SignificanceLevel SignPadding SignTest SimilarityRules SimpleGraph SimpleGraphQ Simplify Sin Sinc SinghMaddalaDistribution SingleEvaluation SingleLetterItalics SingleLetterStyle SingularValueDecomposition SingularValueList SingularValuePlot SingularValues Sinh SinhIntegral SinIntegral SixJSymbol Skeleton SkeletonTransform SkellamDistribution Skewness SkewNormalDistribution Skip SliceDistribution Slider Slider2D Slider2DBox Slider2DBoxOptions SliderBox SliderBoxOptions SlideView Slot SlotSequence Small SmallCircle Smaller SmithDelayCompensator SmithWatermanSimilarity SmoothDensityHistogram SmoothHistogram SmoothHistogram3D SmoothKernelDistribution SocialMediaData Socket SokalSneathDissimilarity Solve SolveAlways SolveDelayed Sort SortBy Sound SoundAndGraphics SoundNote SoundVolume Sow Space SpaceForm Spacer Spacings Span SpanAdjustments SpanCharacterRounding SpanFromAbove SpanFromBoth SpanFromLeft SpanLineThickness SpanMaxSize SpanMinSize SpanningCharacters SpanSymmetric SparseArray SpatialGraphDistribution Speak SpeakTextPacket SpearmanRankTest SpearmanRho Spectrogram SpectrogramArray Specularity SpellingCorrection SpellingDictionaries SpellingDictionariesPath SpellingOptions SpellingSuggestionsPacket Sphere SphereBox SphericalBesselJ SphericalBesselY SphericalHankelH1 SphericalHankelH2 SphericalHarmonicY SphericalPlot3D SphericalRegion SpheroidalEigenvalue SpheroidalJoiningFactor SpheroidalPS SpheroidalPSPrime SpheroidalQS SpheroidalQSPrime SpheroidalRadialFactor SpheroidalS1 SpheroidalS1Prime SpheroidalS2 SpheroidalS2Prime Splice SplicedDistribution SplineClosed SplineDegree SplineKnots SplineWeights Split SplitBy SpokenString Sqrt SqrtBox SqrtBoxOptions Square SquaredEuclideanDistance SquareFreeQ SquareIntersection SquaresR SquareSubset SquareSubsetEqual SquareSuperset SquareSupersetEqual SquareUnion SquareWave StabilityMargins StabilityMarginsStyle StableDistribution Stack StackBegin StackComplete StackInhibit StandardDeviation StandardDeviationFilter StandardForm Standardize StandbyDistribution Star StarGraph StartAsynchronousTask StartingStepSize StartOfLine StartOfString StartScheduledTask StartupSound StateDimensions StateFeedbackGains StateOutputEstimator StateResponse StateSpaceModel StateSpaceRealization StateSpaceTransform StationaryDistribution StationaryWaveletPacketTransform StationaryWaveletTransform StatusArea StatusCentrality StepMonitor StieltjesGamma StirlingS1 StirlingS2 StopAsynchronousTask StopScheduledTask StrataVariables StratonovichProcess StreamColorFunction StreamColorFunctionScaling StreamDensityPlot StreamPlot StreamPoints StreamPosition Streams StreamScale StreamStyle String StringBreak StringByteCount StringCases StringCount StringDrop StringExpression StringForm StringFormat StringFreeQ StringInsert StringJoin StringLength StringMatchQ StringPosition StringQ StringReplace StringReplaceList StringReplacePart StringReverse StringRotateLeft StringRotateRight StringSkeleton StringSplit StringTake StringToStream StringTrim StripBoxes StripOnInput StripWrapperBoxes StrokeForm StructuralImportance StructuredArray StructuredSelection StruveH StruveL Stub StudentTDistribution Style StyleBox StyleBoxAutoDelete StyleBoxOptions StyleData StyleDefinitions StyleForm StyleKeyMapping StyleMenuListing StyleNameDialogSettings StyleNames StylePrint StyleSheetPath Subfactorial Subgraph SubMinus SubPlus SubresultantPolynomialRemainders SubresultantPolynomials Subresultants Subscript SubscriptBox SubscriptBoxOptions Subscripted Subset SubsetEqual Subsets SubStar Subsuperscript SubsuperscriptBox SubsuperscriptBoxOptions Subtract SubtractFrom SubValues Succeeds SucceedsEqual SucceedsSlantEqual SucceedsTilde SuchThat Sum SumConvergence Sunday SuperDagger SuperMinus SuperPlus Superscript SuperscriptBox SuperscriptBoxOptions Superset SupersetEqual SuperStar Surd SurdForm SurfaceColor SurfaceGraphics SurvivalDistribution SurvivalFunction SurvivalModel SurvivalModelFit SuspendPacket SuzukiDistribution SuzukiGroupSuz SwatchLegend Switch Symbol SymbolName SymletWavelet Symmetric SymmetricGroup SymmetricMatrixQ SymmetricPolynomial SymmetricReduction Symmetrize SymmetrizedArray SymmetrizedArrayRules SymmetrizedDependentComponents SymmetrizedIndependentComponents SymmetrizedReplacePart SynchronousInitialization SynchronousUpdating Syntax SyntaxForm SyntaxInformation SyntaxLength SyntaxPacket SyntaxQ SystemDialogInput SystemException SystemHelpPath SystemInformation SystemInformationData SystemOpen SystemOptions SystemsModelDelay SystemsModelDelayApproximate SystemsModelDelete SystemsModelDimensions SystemsModelExtract SystemsModelFeedbackConnect SystemsModelLabels SystemsModelOrder SystemsModelParallelConnect SystemsModelSeriesConnect SystemsModelStateFeedbackConnect SystemStub Tab TabFilling Table TableAlignments TableDepth TableDirections TableForm TableHeadings TableSpacing TableView TableViewBox TabSpacings TabView TabViewBox TabViewBoxOptions TagBox TagBoxNote TagBoxOptions TaggingRules TagSet TagSetDelayed TagStyle TagUnset Take TakeWhile Tally Tan Tanh TargetFunctions TargetUnits TautologyQ TelegraphProcess TemplateBox TemplateBoxOptions TemplateSlotSequence TemporalData Temporary TemporaryVariable TensorContract TensorDimensions TensorExpand TensorProduct TensorQ TensorRank TensorReduce TensorSymmetry TensorTranspose TensorWedge Tetrahedron TetrahedronBox TetrahedronBoxOptions TeXForm TeXSave Text Text3DBox Text3DBoxOptions TextAlignment TextBand TextBoundingBox TextBox TextCell TextClipboardType TextData TextForm TextJustification TextLine TextPacket TextParagraph TextRecognize TextRendering TextStyle Texture TextureCoordinateFunction TextureCoordinateScaling Therefore ThermometerGauge Thick Thickness Thin Thinning ThisLink ThompsonGroupTh Thread ThreeJSymbol Threshold Through Throw Thumbnail Thursday Ticks TicksStyle Tilde TildeEqual TildeFullEqual TildeTilde TimeConstrained TimeConstraint Times TimesBy TimeSeriesForecast TimeSeriesInvertibility TimeUsed TimeValue TimeZone Timing Tiny TitleGrouping TitsGroupT ToBoxes ToCharacterCode ToColor ToContinuousTimeModel ToDate ToDiscreteTimeModel ToeplitzMatrix ToExpression ToFileName Together Toggle ToggleFalse Toggler TogglerBar TogglerBox TogglerBoxOptions ToHeldExpression ToInvertibleTimeSeries TokenWords Tolerance ToLowerCase ToNumberField TooBig Tooltip TooltipBox TooltipBoxOptions TooltipDelay TooltipStyle Top TopHatTransform TopologicalSort ToRadicals ToRules ToString Total TotalHeight TotalVariationFilter TotalWidth TouchscreenAutoZoom TouchscreenControlPlacement ToUpperCase Tr Trace TraceAbove TraceAction TraceBackward TraceDepth TraceDialog TraceForward TraceInternal TraceLevel TraceOff TraceOn TraceOriginal TracePrint TraceScan TrackedSymbols TradingChart TraditionalForm TraditionalFunctionNotation TraditionalNotation TraditionalOrder TransferFunctionCancel TransferFunctionExpand TransferFunctionFactor TransferFunctionModel TransferFunctionPoles TransferFunctionTransform TransferFunctionZeros TransformationFunction TransformationFunctions TransformationMatrix TransformedDistribution TransformedField Translate TranslationTransform TransparentColor Transpose TreeForm TreeGraph TreeGraphQ TreePlot TrendStyle TriangleWave TriangularDistribution Trig TrigExpand TrigFactor TrigFactorList Trigger TrigReduce TrigToExp TrimmedMean True TrueQ TruncatedDistribution TsallisQExponentialDistribution TsallisQGaussianDistribution TTest Tube TubeBezierCurveBox TubeBezierCurveBoxOptions TubeBox TubeBSplineCurveBox TubeBSplineCurveBoxOptions Tuesday TukeyLambdaDistribution TukeyWindow Tuples TuranGraph TuringMachine Transparent UnateQ Uncompress Undefined UnderBar Underflow Underlined Underoverscript UnderoverscriptBox UnderoverscriptBoxOptions Underscript UnderscriptBox UnderscriptBoxOptions UndirectedEdge UndirectedGraph UndirectedGraphQ UndocumentedTestFEParserPacket UndocumentedTestGetSelectionPacket Unequal Unevaluated UniformDistribution UniformGraphDistribution UniformSumDistribution Uninstall Union UnionPlus Unique UnitBox UnitConvert UnitDimensions Unitize UnitRootTest UnitSimplify UnitStep UnitTriangle UnitVector Unprotect UnsameQ UnsavedVariables Unset UnsetShared UntrackedVariables Up UpArrow UpArrowBar UpArrowDownArrow Update UpdateDynamicObjects UpdateDynamicObjectsSynchronous UpdateInterval UpDownArrow UpEquilibrium UpperCaseQ UpperLeftArrow UpperRightArrow UpperTriangularize Upsample UpSet UpSetDelayed UpTee UpTeeArrow UpValues URL URLFetch URLFetchAsynchronous URLSave URLSaveAsynchronous UseGraphicsRange Using UsingFrontEnd V2Get ValidationLength Value ValueBox ValueBoxOptions ValueForm ValueQ ValuesData Variables Variance VarianceEquivalenceTest VarianceEstimatorFunction VarianceGammaDistribution VarianceTest VectorAngle VectorColorFunction VectorColorFunctionScaling VectorDensityPlot VectorGlyphData VectorPlot VectorPlot3D VectorPoints VectorQ Vectors VectorScale VectorStyle Vee Verbatim Verbose VerboseConvertToPostScriptPacket VerifyConvergence VerifySolutions VerifyTestAssumptions Version VersionNumber VertexAdd VertexCapacity VertexColors VertexComponent VertexConnectivity VertexCoordinateRules VertexCoordinates VertexCorrelationSimilarity VertexCosineSimilarity VertexCount VertexCoverQ VertexDataCoordinates VertexDegree VertexDelete VertexDiceSimilarity VertexEccentricity VertexInComponent VertexInDegree VertexIndex VertexJaccardSimilarity VertexLabeling VertexLabels VertexLabelStyle VertexList VertexNormals VertexOutComponent VertexOutDegree VertexQ VertexRenderingFunction VertexReplace VertexShape VertexShapeFunction VertexSize VertexStyle VertexTextureCoordinates VertexWeight Vertical VerticalBar VerticalForm VerticalGauge VerticalSeparator VerticalSlider VerticalTilde ViewAngle ViewCenter ViewMatrix ViewPoint ViewPointSelectorSettings ViewPort ViewRange ViewVector ViewVertical VirtualGroupData Visible VisibleCell VoigtDistribution VonMisesDistribution WaitAll WaitAsynchronousTask WaitNext WaitUntil WakebyDistribution WalleniusHypergeometricDistribution WaringYuleDistribution WatershedComponents WatsonUSquareTest WattsStrogatzGraphDistribution WaveletBestBasis WaveletFilterCoefficients WaveletImagePlot WaveletListPlot WaveletMapIndexed WaveletMatrixPlot WaveletPhi WaveletPsi WaveletScale WaveletScalogram WaveletThreshold WeaklyConnectedComponents WeaklyConnectedGraphQ WeakStationarity WeatherData WeberE Wedge Wednesday WeibullDistribution WeierstrassHalfPeriods WeierstrassInvariants WeierstrassP WeierstrassPPrime WeierstrassSigma WeierstrassZeta WeightedAdjacencyGraph WeightedAdjacencyMatrix WeightedData WeightedGraphQ Weights WelchWindow WheelGraph WhenEvent Which While White Whitespace WhitespaceCharacter WhittakerM WhittakerW WienerFilter WienerProcess WignerD WignerSemicircleDistribution WilksW WilksWTest WindowClickSelect WindowElements WindowFloating WindowFrame WindowFrameElements WindowMargins WindowMovable WindowOpacity WindowSelected WindowSize WindowStatusArea WindowTitle WindowToolbars WindowWidth With WolframAlpha WolframAlphaDate WolframAlphaQuantity WolframAlphaResult Word WordBoundary WordCharacter WordData WordSearch WordSeparators WorkingPrecision Write WriteString Wronskian XMLElement XMLObject Xnor Xor Yellow YuleDissimilarity ZernikeR ZeroSymmetric ZeroTest ZeroWidthTimes Zeta ZetaZero ZipfDistribution ZTest ZTransform $Aborted $ActivationGroupID $ActivationKey $ActivationUserRegistered $AddOnsDirectory $AssertFunction $Assumptions $AsynchronousTask $BaseDirectory $BatchInput $BatchOutput $BoxForms $ByteOrdering $Canceled $CharacterEncoding $CharacterEncodings $CommandLine $CompilationTarget $ConditionHold $ConfiguredKernels $Context $ContextPath $ControlActiveSetting $CreationDate $CurrentLink $DateStringFormat $DefaultFont $DefaultFrontEnd $DefaultImagingDevice $DefaultPath $Display $DisplayFunction $DistributedContexts $DynamicEvaluation $Echo $Epilog $ExportFormats $Failed $FinancialDataSource $FormatType $FrontEnd $FrontEndSession $GeoLocation $HistoryLength $HomeDirectory $HTTPCookies $IgnoreEOF $ImagingDevices $ImportFormats $InitialDirectory $Input $InputFileName $InputStreamMethods $Inspector $InstallationDate $InstallationDirectory $InterfaceEnvironment $IterationLimit $KernelCount $KernelID $Language $LaunchDirectory $LibraryPath $LicenseExpirationDate $LicenseID $LicenseProcesses $LicenseServer $LicenseSubprocesses $LicenseType $Line $Linked $LinkSupported $LoadedFiles $MachineAddresses $MachineDomain $MachineDomains $MachineEpsilon $MachineID $MachineName $MachinePrecision $MachineType $MaxExtraPrecision $MaxLicenseProcesses $MaxLicenseSubprocesses $MaxMachineNumber $MaxNumber $MaxPiecewiseCases $MaxPrecision $MaxRootDegree $MessageGroups $MessageList $MessagePrePrint $Messages $MinMachineNumber $MinNumber $MinorReleaseNumber $MinPrecision $ModuleNumber $NetworkLicense $NewMessage $NewSymbol $Notebooks $NumberMarks $Off $OperatingSystem $Output $OutputForms $OutputSizeLimit $OutputStreamMethods $Packages $ParentLink $ParentProcessID $PasswordFile $PatchLevelID $Path $PathnameSeparator $PerformanceGoal $PipeSupported $Post $Pre $PreferencesDirectory $PrePrint $PreRead $PrintForms $PrintLiteral $ProcessID $ProcessorCount $ProcessorType $ProductInformation $ProgramName $RandomState $RecursionLimit $ReleaseNumber $RootDirectory $ScheduledTask $ScriptCommandLine $SessionID $SetParentLink $SharedFunctions $SharedVariables $SoundDisplay $SoundDisplayFunction $SuppressInputFormHeads $SynchronousEvaluation $SyntaxHandler $System $SystemCharacterEncoding $SystemID $SystemWordLength $TemporaryDirectory $TemporaryPrefix $TextStyle $TimedOut $TimeUnit $TimeZone $TopDirectory $TraceOff $TraceOn $TracePattern $TracePostAction $TracePreAction $Urgent $UserAddOnsDirectory $UserBaseDirectory $UserDocumentsDirectory $UserName $Version $VersionNumber", -c:[{cN:"comment",b:/\(\*/,e:/\*\)/},e.ASM,e.QSM,e.CNM,{cN:"list",b:/\{/,e:/\}/,i:/:/}]}});hljs.registerLanguage("fsharp",function(e){var t={b:"<",e:">",c:[e.inherit(e.TM,{b:/'[a-zA-Z0-9_]+/})]};return{aliases:["fs"],k:"yield! return! let! do!abstract and as assert base begin class default delegate do done downcast downto elif else end exception extern false finally for fun function global if in inherit inline interface internal lazy let match member module mutable namespace new null of open or override private public rec return sig static struct then to true try type upcast use val void when while with yield",c:[{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},{cN:"string",b:'"""',e:'"""'},e.C("\\(\\*","\\*\\)"),{cN:"class",bK:"type",e:"\\(|=|$",eE:!0,c:[e.UTM,t]},{cN:"annotation",b:"\\[<",e:">\\]",r:10},{cN:"attribute",b:"\\B('[A-Za-z])\\b",c:[e.BE]},e.CLCM,e.inherit(e.QSM,{i:null}),e.CNM]}});hljs.registerLanguage("verilog",function(e){return{aliases:["v"],cI:!0,k:{keyword:"always and assign begin buf bufif0 bufif1 case casex casez cmos deassign default defparam disable edge else end endcase endfunction endmodule endprimitive endspecify endtable endtask event for force forever fork function if ifnone initial inout input join macromodule module nand negedge nmos nor not notif0 notif1 or output parameter pmos posedge primitive pulldown pullup rcmos release repeat rnmos rpmos rtran rtranif0 rtranif1 specify specparam table task timescale tran tranif0 tranif1 wait while xnor xor",typename:"highz0 highz1 integer large medium pull0 pull1 real realtime reg scalared signed small strong0 strong1 supply0 supply0 supply1 supply1 time tri tri0 tri1 triand trior trireg vectored wand weak0 weak1 wire wor"},c:[e.CBCM,e.CLCM,e.QSM,{cN:"number",b:"\\b(\\d+'(b|h|o|d|B|H|O|D))?[0-9xzXZ]+",c:[e.BE],r:0},{cN:"typename",b:"\\.\\w+",r:0},{cN:"value",b:"#\\((?!parameter).+\\)"},{cN:"keyword",b:"\\+|-|\\*|/|%|<|>|=|#|`|\\!|&|\\||@|:|\\^|~|\\{|\\}",r:0}]}});hljs.registerLanguage("dos",function(e){var r=e.C(/@?rem\b/,/$/,{r:10}),t={cN:"label",b:"^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)",r:0};return{aliases:["bat","cmd"],cI:!0,k:{flow:"if else goto for in do call exit not exist errorlevel defined",operator:"equ neq lss leq gtr geq",keyword:"shift cd dir echo setlocal endlocal set pause copy",stream:"prn nul lpt3 lpt2 lpt1 con com4 com3 com2 com1 aux",winutils:"ping net ipconfig taskkill xcopy ren del",built_in:"append assoc at attrib break cacls cd chcp chdir chkdsk chkntfs cls cmd color comp compact convert date dir diskcomp diskcopy doskey erase fs find findstr format ftype graftabl help keyb label md mkdir mode more move path pause print popd pushd promt rd recover rem rename replace restore rmdir shiftsort start subst time title tree type ver verify vol"},c:[{cN:"envvar",b:/%%[^ ]|%[^ ]+?%|![^ ]+?!/},{cN:"function",b:t.b,e:"goto:eof",c:[e.inherit(e.TM,{b:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),r]},{cN:"number",b:"\\b\\d+",r:0},r]}});hljs.registerLanguage("gherkin",function(e){return{aliases:["feature"],k:"Feature Background Ability Business Need Scenario Scenarios Scenario Outline Scenario Template Examples Given And Then But When",c:[{cN:"keyword",b:"\\*"},e.C("@[^@\r\n ]+","$"),{cN:"string",b:"\\|",e:"\\$"},{cN:"variable",b:"<",e:">"},e.HCM,{cN:"string",b:'"""',e:'"""'},e.QSM]}});hljs.registerLanguage("xml",function(t){var e="[A-Za-z0-9\\._:-]+",s={b:/<\?(php)?(?!\w)/,e:/\?>/,sL:"php",subLanguageMode:"continuous"},c={eW:!0,i:/]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xsl","plist"],cI:!0,c:[{cN:"doctype",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},t.C("",{r:10}),{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"|$)",e:">",k:{title:"style"},c:[c],starts:{e:"",rE:!0,sL:"css"}},{cN:"tag",b:"|$)",e:">",k:{title:"script"},c:[c],starts:{e:"",rE:!0,sL:""}},s,{cN:"pi",b:/<\?\w+/,e:/\?>/,r:10},{cN:"tag",b:"",c:[{cN:"title",b:/[^ \/><\n\t]+/,r:0},c]}]}});hljs.registerLanguage("autohotkey",function(e){var r={cN:"escape",b:"`[\\s\\S]"},c=e.C(";","$",{r:0}),n=[{cN:"built_in",b:"A_[a-zA-Z0-9]+"},{cN:"built_in",bK:"ComSpec Clipboard ClipboardAll ErrorLevel"}];return{cI:!0,k:{keyword:"Break Continue Else Gosub If Loop Return While",literal:"A true false NOT AND OR"},c:n.concat([r,e.inherit(e.QSM,{c:[r]}),c,{cN:"number",b:e.NR,r:0},{cN:"var_expand",b:"%",e:"%",i:"\\n",c:[r]},{cN:"label",c:[r],v:[{b:'^[^\\n";]+::(?!=)'},{b:'^[^\\n";]+:(?!=)',r:0}]},{b:",\\s*,",r:10}])}});hljs.registerLanguage("r",function(e){var r="([a-zA-Z]|\\.[a-zA-Z.])[a-zA-Z0-9._]*";return{c:[e.HCM,{b:r,l:r,k:{keyword:"function if in break next repeat else for return switch while try tryCatch stop warning require library attach detach source setMethod setGeneric setGroupGeneric setClass ...",literal:"NULL NA TRUE FALSE T F Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10"},r:0},{cN:"number",b:"0[xX][0-9a-fA-F]+[Li]?\\b",r:0},{cN:"number",b:"\\d+(?:[eE][+\\-]?\\d*)?L\\b",r:0},{cN:"number",b:"\\d+\\.(?!\\d)(?:i\\b)?",r:0},{cN:"number",b:"\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b",r:0},{cN:"number",b:"\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b",r:0},{b:"`",e:"`",r:0},{cN:"string",c:[e.BE],v:[{b:'"',e:'"'},{b:"'",e:"'"}]}]}});hljs.registerLanguage("cs",function(e){var r="abstract as base bool break byte case catch char checked const continue decimal dynamic default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long null when object operator out override params private protected public readonly ref sbyte sealed short sizeof stackalloc static string struct switch this true try typeof uint ulong unchecked unsafe ushort using virtual volatile void while async protected public private internal ascending descending from get group into join let orderby partial select set value var where yield",t=e.IR+"(<"+e.IR+">)?";return{aliases:["csharp"],k:r,i:/::/,c:[e.C("///","$",{rB:!0,c:[{cN:"xmlDocTag",v:[{b:"///",r:0},{b:""},{b:""}]}]}),e.CLCM,e.CBCM,{cN:"preprocessor",b:"#",e:"$",k:"if else elif endif define undef warning error line region endregion pragma checksum"},{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},e.ASM,e.QSM,e.CNM,{bK:"class namespace interface",e:/[{;=]/,i:/[^\s:]/,c:[e.TM,e.CLCM,e.CBCM]},{bK:"new return throw await",r:0},{cN:"function",b:"("+t+"\\s+)+"+e.IR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:r,c:[{b:e.IR+"\\s*\\(",rB:!0,c:[e.TM],r:0},{cN:"params",b:/\(/,e:/\)/,k:r,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]}]}});hljs.registerLanguage("nsis",function(e){var t={cN:"symbol",b:"\\$(ADMINTOOLS|APPDATA|CDBURN_AREA|CMDLINE|COMMONFILES32|COMMONFILES64|COMMONFILES|COOKIES|DESKTOP|DOCUMENTS|EXEDIR|EXEFILE|EXEPATH|FAVORITES|FONTS|HISTORY|HWNDPARENT|INSTDIR|INTERNET_CACHE|LANGUAGE|LOCALAPPDATA|MUSIC|NETHOOD|OUTDIR|PICTURES|PLUGINSDIR|PRINTHOOD|PROFILE|PROGRAMFILES32|PROGRAMFILES64|PROGRAMFILES|QUICKLAUNCH|RECENT|RESOURCES_LOCALIZED|RESOURCES|SENDTO|SMPROGRAMS|SMSTARTUP|STARTMENU|SYSDIR|TEMP|TEMPLATES|VIDEOS|WINDIR)"},n={cN:"constant",b:"\\$+{[a-zA-Z0-9_]+}"},i={cN:"variable",b:"\\$+[a-zA-Z0-9_]+",i:"\\(\\){}"},r={cN:"constant",b:"\\$+\\([a-zA-Z0-9_]+\\)"},o={cN:"params",b:"(ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HKCR|HKCU|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM|HKPD|HKU|IDABORT|IDCANCEL|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SYSTEM|TEMPORARY)"},l={cN:"constant",b:"\\!(addincludedir|addplugindir|appendfile|cd|define|delfile|echo|else|endif|error|execute|finalize|getdllversionsystem|ifdef|ifmacrodef|ifmacrondef|ifndef|if|include|insertmacro|macroend|macro|makensis|packhdr|searchparse|searchreplace|tempfile|undef|verbose|warning)"};return{cI:!1,k:{keyword:"Abort AddBrandingImage AddSize AllowRootDirInstall AllowSkipFiles AutoCloseWindow BGFont BGGradient BrandingText BringToFront Call CallInstDLL Caption ChangeUI CheckBitmap ClearErrors CompletedText ComponentText CopyFiles CRCCheck CreateDirectory CreateFont CreateShortCut Delete DeleteINISec DeleteINIStr DeleteRegKey DeleteRegValue DetailPrint DetailsButtonText DirText DirVar DirVerify EnableWindow EnumRegKey EnumRegValue Exch Exec ExecShell ExecWait ExpandEnvStrings File FileBufSize FileClose FileErrorText FileOpen FileRead FileReadByte FileReadUTF16LE FileReadWord FileSeek FileWrite FileWriteByte FileWriteUTF16LE FileWriteWord FindClose FindFirst FindNext FindWindow FlushINI FunctionEnd GetCurInstType GetCurrentAddress GetDlgItem GetDLLVersion GetDLLVersionLocal GetErrorLevel GetFileTime GetFileTimeLocal GetFullPathName GetFunctionAddress GetInstDirError GetLabelAddress GetTempFileName Goto HideWindow Icon IfAbort IfErrors IfFileExists IfRebootFlag IfSilent InitPluginsDir InstallButtonText InstallColors InstallDir InstallDirRegKey InstProgressFlags InstType InstTypeGetText InstTypeSetText IntCmp IntCmpU IntFmt IntOp IsWindow LangString LicenseBkColor LicenseData LicenseForceSelection LicenseLangString LicenseText LoadLanguageFile LockWindow LogSet LogText ManifestDPIAware ManifestSupportedOS MessageBox MiscButtonText Name Nop OutFile Page PageCallbacks PageExEnd Pop Push Quit ReadEnvStr ReadINIStr ReadRegDWORD ReadRegStr Reboot RegDLL Rename RequestExecutionLevel ReserveFile Return RMDir SearchPath SectionEnd SectionGetFlags SectionGetInstTypes SectionGetSize SectionGetText SectionGroupEnd SectionIn SectionSetFlags SectionSetInstTypes SectionSetSize SectionSetText SendMessage SetAutoClose SetBrandingImage SetCompress SetCompressor SetCompressorDictSize SetCtlColors SetCurInstType SetDatablockOptimize SetDateSave SetDetailsPrint SetDetailsView SetErrorLevel SetErrors SetFileAttributes SetFont SetOutPath SetOverwrite SetPluginUnload SetRebootFlag SetRegView SetShellVarContext SetSilent ShowInstDetails ShowUninstDetails ShowWindow SilentInstall SilentUnInstall Sleep SpaceTexts StrCmp StrCmpS StrCpy StrLen SubCaption SubSectionEnd Unicode UninstallButtonText UninstallCaption UninstallIcon UninstallSubCaption UninstallText UninstPage UnRegDLL Var VIAddVersionKey VIFileVersion VIProductVersion WindowIcon WriteINIStr WriteRegBin WriteRegDWORD WriteRegExpandStr WriteRegStr WriteUninstaller XPStyle",literal:"admin all auto both colored current false force hide highest lastused leave listonly none normal notset off on open print show silent silentlog smooth textonly true user "},c:[e.HCM,e.CBCM,{cN:"string",b:'"',e:'"',i:"\\n",c:[{cN:"symbol",b:"\\$(\\\\(n|r|t)|\\$)"},t,n,i,r]},e.C(";","$",{r:0}),{cN:"function",bK:"Function PageEx Section SectionGroup SubSection",e:"$"},l,n,i,r,o,e.NM,{cN:"literal",b:e.IR+"::"+e.IR}]}});hljs.registerLanguage("less",function(e){var r="[\\w-]+",t="("+r+"|@{"+r+"})",a=[],c=[],n=function(e){return{cN:"string",b:"~?"+e+".*?"+e}},i=function(e,r,t){return{cN:e,b:r,r:t}},s=function(r,t,a){return e.inherit({cN:r,b:t+"\\(",e:"\\(",rB:!0,eE:!0,r:0},a)},b={b:"\\(",e:"\\)",c:c,r:0};c.push(e.CLCM,e.CBCM,n("'"),n('"'),e.CSSNM,i("hexcolor","#[0-9A-Fa-f]+\\b"),s("function","(url|data-uri)",{starts:{cN:"string",e:"[\\)\\n]",eE:!0}}),s("function",r),b,i("variable","@@?"+r,10),i("variable","@{"+r+"}"),i("built_in","~?`[^`]*?`"),{cN:"attribute",b:r+"\\s*:",e:":",rB:!0,eE:!0});var o=c.concat({b:"{",e:"}",c:a}),u={bK:"when",eW:!0,c:[{bK:"and not"}].concat(c)},C={cN:"attribute",b:t,e:":",eE:!0,c:[e.CLCM,e.CBCM],i:/\S/,starts:{e:"[;}]",rE:!0,c:c,i:"[<=$]"}},l={cN:"at_rule",b:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{e:"[;{}]",rE:!0,c:c,r:0}},d={cN:"variable",v:[{b:"@"+r+"\\s*:",r:15},{b:"@"+r}],starts:{e:"[;}]",rE:!0,c:o}},p={v:[{b:"[\\.#:&\\[]",e:"[;{}]"},{b:t+"[^;]*{",e:"{"}],rB:!0,rE:!0,i:"[<='$\"]",c:[e.CLCM,e.CBCM,u,i("keyword","all\\b"),i("variable","@{"+r+"}"),i("tag",t+"%?",0),i("id","#"+t),i("class","\\."+t,0),i("keyword","&",0),s("pseudo",":not"),s("keyword",":extend"),i("pseudo","::?"+t),{cN:"attr_selector",b:"\\[",e:"\\]"},{b:"\\(",e:"\\)",c:o},{b:"!important"}]};return a.push(e.CLCM,e.CBCM,l,d,p,C),{cI:!0,i:"[=>'/<($\"]",c:a}});hljs.registerLanguage("pf",function(t){var o={cN:"variable",b:/\$[\w\d#@][\w\d_]*/},e={cN:"variable",b://};return{aliases:["pf.conf"],l:/[a-z0-9_<>-]+/,k:{built_in:"block match pass load anchor|5 antispoof|10 set table",keyword:"in out log quick on rdomain inet inet6 proto from port os to routeallow-opts divert-packet divert-reply divert-to flags group icmp-typeicmp6-type label once probability recieved-on rtable prio queuetos tag tagged user keep fragment for os dropaf-to|10 binat-to|10 nat-to|10 rdr-to|10 bitmask least-stats random round-robinsource-hash static-portdup-to reply-to route-toparent bandwidth default min max qlimitblock-policy debug fingerprints hostid limit loginterface optimizationreassemble ruleset-optimization basic none profile skip state-defaultsstate-policy timeoutconst counters persistno modulate synproxy state|5 floating if-bound no-sync pflow|10 sloppysource-track global rule max-src-nodes max-src-states max-src-connmax-src-conn-rate overload flushscrub|5 max-mss min-ttl no-df|10 random-id",literal:"all any no-route self urpf-failed egress|5 unknown"},c:[t.HCM,t.NM,t.QSM,o,e]}});hljs.registerLanguage("lasso",function(e){var r="[a-zA-Z_][a-zA-Z0-9_.]*",a="<\\?(lasso(script)?|=)",t="\\]|\\?>",s={literal:"true false none minimal full all void and or not bw nbw ew new cn ncn lt lte gt gte eq neq rx nrx ft",built_in:"array date decimal duration integer map pair string tag xml null boolean bytes keyword list locale queue set stack staticarray local var variable global data self inherited",keyword:"error_code error_msg error_pop error_push error_reset cache database_names database_schemanames database_tablenames define_tag define_type email_batch encode_set html_comment handle handle_error header if inline iterate ljax_target link link_currentaction link_currentgroup link_currentrecord link_detail link_firstgroup link_firstrecord link_lastgroup link_lastrecord link_nextgroup link_nextrecord link_prevgroup link_prevrecord log loop namespace_using output_none portal private protect records referer referrer repeating resultset rows search_args search_arguments select sort_args sort_arguments thread_atomic value_list while abort case else if_empty if_false if_null if_true loop_abort loop_continue loop_count params params_up return return_value run_children soap_definetag soap_lastrequest soap_lastresponse tag_name ascending average by define descending do equals frozen group handle_failure import in into join let match max min on order parent protected provide public require returnhome skip split_thread sum take thread to trait type where with yield yieldhome"},n=e.C("",{r:0}),o={cN:"preprocessor",b:"\\[noprocess\\]",starts:{cN:"markup",e:"\\[/noprocess\\]",rE:!0,c:[n]}},i={cN:"preprocessor",b:"\\[/noprocess|"+a},l={cN:"variable",b:"'"+r+"'"},c=[e.CLCM,{cN:"javadoc",b:"/\\*\\*!",e:"\\*/",c:[e.PWM]},e.CBCM,e.inherit(e.CNM,{b:e.CNR+"|(-?infinity|nan)\\b"}),e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null}),{cN:"string",b:"`",e:"`"},{cN:"variable",v:[{b:"[#$]"+r},{b:"#",e:"\\d+",i:"\\W"}]},{cN:"tag",b:"::\\s*",e:r,i:"\\W"},{cN:"attribute",v:[{b:"-"+e.UIR,r:0},{b:"(\\.\\.\\.)"}]},{cN:"subst",v:[{b:"->\\s*",c:[l]},{b:":=|/(?!\\w)=?|[-+*%=<>&|!?\\\\]+",r:0}]},{cN:"built_in",b:"\\.\\.?\\s*",r:0,c:[l]},{cN:"class",bK:"define",rE:!0,e:"\\(|=>",c:[e.inherit(e.TM,{b:e.UIR+"(=(?!>))?"})]}];return{aliases:["ls","lassoscript"],cI:!0,l:r+"|&[lg]t;",k:s,c:[{cN:"preprocessor",b:t,r:0,starts:{cN:"markup",e:"\\[|"+a,rE:!0,r:0,c:[n]}},o,i,{cN:"preprocessor",b:"\\[no_square_brackets",starts:{e:"\\[/no_square_brackets\\]",l:r+"|&[lg]t;",k:s,c:[{cN:"preprocessor",b:t,r:0,starts:{cN:"markup",e:"\\[noprocess\\]|"+a,rE:!0,c:[n]}},o,i].concat(c)}},{cN:"preprocessor",b:"\\[",r:0},{cN:"shebang",b:"^#!.+lasso9\\b",r:10}].concat(c)}});hljs.registerLanguage("prolog",function(c){var r={cN:"atom",b:/[a-z][A-Za-z0-9_]*/,r:0},b={cN:"name",v:[{b:/[A-Z][a-zA-Z0-9_]*/},{b:/_[A-Za-z0-9_]*/}],r:0},a={b:/\(/,e:/\)/,r:0},e={b:/\[/,e:/\]/},n={cN:"comment",b:/%/,e:/$/,c:[c.PWM]},t={cN:"string",b:/`/,e:/`/,c:[c.BE]},g={cN:"string",b:/0\'(\\\'|.)/},N={cN:"string",b:/0\'\\s/},o={b:/:-/},s=[r,b,a,o,e,n,c.CBCM,c.QSM,c.ASM,t,g,N,c.CNM];return a.c=s,e.c=s,{c:s.concat([{b:/\.$/}])}});hljs.registerLanguage("oxygene",function(e){var r="abstract add and array as asc aspect assembly async begin break block by case class concat const copy constructor continue create default delegate desc distinct div do downto dynamic each else empty end ensure enum equals event except exit extension external false final finalize finalizer finally flags for forward from function future global group has if implementation implements implies in index inherited inline interface into invariants is iterator join locked locking loop matching method mod module namespace nested new nil not notify nullable of old on operator or order out override parallel params partial pinned private procedure property protected public queryable raise read readonly record reintroduce remove repeat require result reverse sealed select self sequence set shl shr skip static step soft take then to true try tuple type union unit unsafe until uses using var virtual raises volatile where while with write xor yield await mapped deprecated stdcall cdecl pascal register safecall overload library platform reference packed strict published autoreleasepool selector strong weak unretained",t=e.C("{","}",{r:0}),a=e.C("\\(\\*","\\*\\)",{r:10}),n={cN:"string",b:"'",e:"'",c:[{b:"''"}]},o={cN:"string",b:"(#\\d+)+"},i={cN:"function",bK:"function constructor destructor procedure method",e:"[:;]",k:"function constructor|10 destructor|10 procedure|10 method|10",c:[e.TM,{cN:"params",b:"\\(",e:"\\)",k:r,c:[n,o]},t,a]};return{cI:!0,k:r,i:'("|\\$[G-Zg-z]|\\/\\*||->)',c:[t,a,e.CLCM,n,o,e.NM,i,{cN:"class",b:"=\\bclass\\b",e:"end;",k:r,c:[n,o,t,a,e.CLCM,i]}]}});hljs.registerLanguage("applescript",function(e){var t=e.inherit(e.QSM,{i:""}),r={cN:"params",b:"\\(",e:"\\)",c:["self",e.CNM,t]},o=e.C("--","$"),n=e.C("\\(\\*","\\*\\)",{c:["self",o]}),a=[o,n,e.HCM];return{aliases:["osascript"],k:{keyword:"about above after against and around as at back before beginning behind below beneath beside between but by considering contain contains continue copy div does eighth else end equal equals error every exit fifth first for fourth from front get given global if ignoring in into is it its last local me middle mod my ninth not of on onto or over prop property put ref reference repeat returning script second set seventh since sixth some tell tenth that the|0 then third through thru timeout times to transaction try until where while whose with without",constant:"AppleScript false linefeed return pi quote result space tab true",type:"alias application boolean class constant date file integer list number real record string text",command:"activate beep count delay launch log offset read round run say summarize write",property:"character characters contents day frontmost id item length month name paragraph paragraphs rest reverse running time version weekday word words year"},c:[t,e.CNM,{cN:"type",b:"\\bPOSIX file\\b"},{cN:"command",b:"\\b(clipboard info|the clipboard|info for|list (disks|folder)|mount volume|path to|(close|open for) access|(get|set) eof|current date|do shell script|get volume settings|random number|set volume|system attribute|system info|time to GMT|(load|run|store) script|scripting components|ASCII (character|number)|localized string|choose (application|color|file|file name|folder|from list|remote application|URL)|display (alert|dialog))\\b|^\\s*return\\b"},{cN:"constant",b:"\\b(text item delimiters|current application|missing value)\\b"},{cN:"keyword",b:"\\b(apart from|aside from|instead of|out of|greater than|isn't|(doesn't|does not) (equal|come before|come after|contain)|(greater|less) than( or equal)?|(starts?|ends|begins?) with|contained by|comes (before|after)|a (ref|reference))\\b"},{cN:"property",b:"\\b(POSIX path|(date|time) string|quoted form)\\b"},{cN:"function_start",bK:"on",i:"[${=;\\n]",c:[e.UTM,r]}].concat(a),i:"//|->|=>"}});hljs.registerLanguage("makefile",function(e){var a={cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]};return{aliases:["mk","mak"],c:[e.HCM,{b:/^\w+\s*\W*=/,rB:!0,r:0,starts:{cN:"constant",e:/\s*\W*=/,eE:!0,starts:{e:/$/,r:0,c:[a]}}},{cN:"title",b:/^[\w]+:\s*$/},{cN:"phony",b:/^\.PHONY:/,e:/$/,k:".PHONY",l:/[\.\w]+/},{b:/^\t+/,e:/$/,r:0,c:[e.QSM,a]}]}});hljs.registerLanguage("dust",function(e){var a="if eq ne lt lte gt gte select default math sep";return{aliases:["dst"],cI:!0,sL:"xml",subLanguageMode:"continuous",c:[{cN:"expression",b:"{",e:"}",r:0,c:[{cN:"begin-block",b:"#[a-zA-Z- .]+",k:a},{cN:"string",b:'"',e:'"'},{cN:"end-block",b:"\\/[a-zA-Z- .]+",k:a},{cN:"variable",b:"[a-zA-Z-.]+",k:a,r:0}]}]}});hljs.registerLanguage("clojure-repl",function(e){return{c:[{cN:"prompt",b:/^([\w.-]+|\s*#_)=>/,starts:{e:/$/,sL:"clojure",subLanguageMode:"continuous"}}]}});hljs.registerLanguage("dart",function(e){var t={cN:"subst",b:"\\$\\{",e:"}",k:"true false null this is new super"},r={cN:"string",v:[{b:"r'''",e:"'''"},{b:'r"""',e:'"""'},{b:"r'",e:"'",i:"\\n"},{b:'r"',e:'"',i:"\\n"},{b:"'''",e:"'''",c:[e.BE,t]},{b:'"""',e:'"""',c:[e.BE,t]},{b:"'",e:"'",i:"\\n",c:[e.BE,t]},{b:'"',e:'"',i:"\\n",c:[e.BE,t]}]};t.c=[e.CNM,r];var n={keyword:"assert break case catch class const continue default do else enum extends false final finally for if in is new null rethrow return super switch this throw true try var void while with",literal:"abstract as dynamic export external factory get implements import library operator part set static typedef",built_in:"print Comparable DateTime Duration Function Iterable Iterator List Map Match Null Object Pattern RegExp Set Stopwatch String StringBuffer StringSink Symbol Type Uri bool double int num document window querySelector querySelectorAll Element ElementList"};return{k:n,c:[r,{cN:"dartdoc",b:"/\\*\\*",e:"\\*/",sL:"markdown",subLanguageMode:"continuous"},{cN:"dartdoc",b:"///",e:"$",sL:"markdown",subLanguageMode:"continuous"},e.CLCM,e.CBCM,{cN:"class",bK:"class interface",e:"{",eE:!0,c:[{bK:"extends implements"},e.UTM]},e.CNM,{cN:"annotation",b:"@[A-Za-z]+"},{b:"=>"}]}}); \ No newline at end of file diff --git a/site/js/jquery-1.10.2.min.js b/site/js/jquery-1.10.2.min.js deleted file mode 100644 index f4c12ca..0000000 --- a/site/js/jquery-1.10.2.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license -//@ sourceMappingURL=jquery-1.10.2.min.map -*/ -(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="
",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
a",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="
t
",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="
",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t -}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/\s*$/g,At={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X
","
"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?""!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle); -u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x(" + + If you have an error it will look like this: ```shell @@ -197,4 +200,27 @@ and trying to figure out what it is doing. > **Source:** -> :fa-book: **Think Python** by Allen B. Downey - 2012 \ No newline at end of file +> :fa-book: **Think Python** by Allen B. Downey - 2012 + + +## Reserved Words +The following list shows the Python keywords. These are reserved words and you cannot use them as constants or variables or any other identifier names. All the Python keywords contain lowercase letters only. + + +[]() | []() | []() +------|------|------ +**and** | **exec**| **not** +**as**| **finally**| **or** +**assert**| **for** | **pass** +**break**| **from**| **print** +**class**| **global**| **raise** +**continue**| **if**| **return** +**def**| **import**| **try** +**del**| **in**| **while** +**elif**| **is**| **with** +**else**| **lambda**| **yield** +**except**| + + +> **Source:** +> :fa-link: https://www.tutorialspoint.com diff --git a/docs/images/logo.png b/docs/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..2cc391cd2be54b019222a45e16a5e782d1d64a00 GIT binary patch literal 37478 zcmXtf1yEG~_cq-v4FZC6cXvu7-6hi9UDBx_AkBir(%{nF5=(dIA}P5v@A`g!|1$%# zGjR8F@5$#p=iE3=bwz9patt^)IP4Efav$N~5E5XYN6}DVzbD)=pm1~MZ55(o273UI19EanjDeOn1yKE?TGV28N*x>si%heVZ?o<{s zp*8qROX;kg>#q6Ev2rr$6He==t63O)iZ%=gsHJZfntW8u_1uxu)AQ9`SXqZa??35( zRv3tT^L1W#^Fe&<>v8B)is1*q)EO%anSu0RM7T**sdM3B{IJU}Bug4(aSSXJIjyxd zIAc%t;IjCqeV|XanswpO(azxU2(;n1Ba|knKBkYFVaYb-!z(R~4 z_z#1$z^PG2X-o_vo<^ik*Tfj){?VVJRUfeiQj5x24Bj;&pGM85H*Szm_td6^Ut!)gWxlwd~GGSy-FaVWn z7p*NV!`It=i-FsgiPCZgCMI%ncFn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S z@Lp9s==CdQ`E;32q=u*aUG=Dxz@(}%KtWfxBR9@w0%1Z6s4%tkIGpiw&FiMr@4FXyBGu&U`Y-7n{)bxv;Hvn*0q3dDW>$E_ zd)CQgWvC0N{O|q*F+-)?`-fH%l~cX7p_?YHHGXj?ndJ~ZsDQG;!t0lMfoH;Y7`VtycC0Sl%ZL=TJ{}_a?;>+JxyZ#D4)9&+i!B)zkJ*9XS4U4 z5f8}_o3u?I3eD~L!iG4mwmD^t;o*=R2gF|6XI|!i(mUn1V)p38 zI@2e|h^6^bLBvFz_FhpZEKEIDC#?EXj_~G)=Y%0o?AxYK4#XDYaO>Vma|-nXXm3Yf ze7jM$`j@)Kj44Av(u`jJO{QjFJ)si0jlxzLkWpdRPjbd&c|mMJ(W}em^#V^jm$Y=Y zyzpDm%7V(Oea7LlQZsG=?dZ5V4VSgLFcHN+x>xf_83IK93Qon8c&&^~-tv)K1^Shl zsk;t3-cOofWh5jU9HPYRosU}64Xx~W`wcHTNN+nO`&g{7<7sutw0Q*Hrtw7|r*1wg z#+|SHtJhLIAWj)Onn&n9s_(abnVrw*;p_Jv*HFr4!-F2F+*~;~11(G$%Q1O&p=9m+ z>R{@lEqt%5n|hYl0y9coUcAz;|x(idU#e8yM=-vayD9?!6h7jZb1^!7pVjNdCtO4vW!SFvq}a2s09|ExmIYE6**|5!)2~a*iujUt&AE1T8t|tdn8)dyxTUPOuWlwqN!=Hpj!$ zB16+(5rsY!F~pyEQn-?X{Ka3Qwk@JLf!tEbTxUeq?g(%RwWjSJM(iHa@!1oThF&h) Q9sw?0Eq%>$^@kz<1BXr_r~m)} literal 0 HcmV?d00001 diff --git a/mkdocs.yml b/mkdocs.yml index 267a42f..bfccefc 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -25,7 +25,7 @@ markdown_extensions: # Options extra: -# logo: 'images/logo.svg' +#logo: 'images/logo.PNG' palette: primary: 'blue grey' accent: 'light blue' diff --git a/site/beginner/Start_Coding_With_Python/index.html b/site/beginner/Start_Coding_With_Python/index.html index 1ea0bdc..81628d2 100644 --- a/site/beginner/Start_Coding_With_Python/index.html +++ b/site/beginner/Start_Coding_With_Python/index.html @@ -393,6 +393,13 @@ +
  • + + Reserved Words + + +
  • + @@ -559,6 +566,13 @@ +
  • + + Reserved Words + + +
  • + @@ -689,6 +703,8 @@

    What You Should See

    On Windows in PowerShell you should see this: win_powershell_ex1.

    You may see different names, before the python ex1.py command, but the important part is that you type the command and see the output is the same as mine.

    + +

    If you have an error it will look like this:

    $ python ex/ex1.py
       File "ex/ex1.py", line 3
    @@ -747,6 +763,78 @@ 

    Semantic Errors

    Source:
    Think Python by Allen B. Downey - 2012

    +

    Reserved Words

    +

    The following list shows the Python keywords. These are reserved words and you cannot use them as constants or variables or any other identifier names. All the Python keywords contain lowercase letters only.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    andexecnot
    asfinallyor
    assertforpass
    breakfromprint
    classglobalraise
    continueifreturn
    defimporttry
    delinwhile
    elifiswith
    elselambdayield
    except
    +
    +

    Source:
    + https://www.tutorialspoint.com

    +
    diff --git a/site/images/logo.png b/site/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..2cc391cd2be54b019222a45e16a5e782d1d64a00 GIT binary patch literal 37478 zcmXtf1yEG~_cq-v4FZC6cXvu7-6hi9UDBx_AkBir(%{nF5=(dIA}P5v@A`g!|1$%# zGjR8F@5$#p=iE3=bwz9patt^)IP4Efav$N~5E5XYN6}DVzbD)=pm1~MZ55(o273UI19EanjDeOn1yKE?TGV28N*x>si%heVZ?o<{s zp*8qROX;kg>#q6Ev2rr$6He==t63O)iZ%=gsHJZfntW8u_1uxu)AQ9`SXqZa??35( zRv3tT^L1W#^Fe&<>v8B)is1*q)EO%anSu0RM7T**sdM3B{IJU}Bug4(aSSXJIjyxd zIAc%t;IjCqeV|XanswpO(azxU2(;n1Ba|knKBkYFVaYb-!z(R~4 z_z#1$z^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/search_index.json @@ -107,7 +107,7 @@ }, { "location": "/beginner/Start_Coding_With_Python/", - "text": "What Is a Program?\n\n\nA program is a sequence of instructions that specifies how to perform a computation.\nThe computation might be something mathematical, such as solving a system of equat\nions or finding the roots of a polynomial, but it can also be a symbolic computation,\nsuch as searching and replacing text in a document or (strangely enough) compiling a\nprogram.\nThe details look different in different languages, but a few basic instructions appear in\njust about every language:\n\n\ninput: \n\n\n\n\nGet data from the keyboard, a file, or some other device.\n\n\n\n\noutput:\n\n\n\n\nDisplay data on the screen or send data to a file or other device.\n\n\n\n\nmath:\n\n\n\n\nPerform basic mathematical operations like addition and\n multiplication.\n\n\n\n\nconditional execution:\n\n\n\n\nCheck for certain conditions and execute the appropriate code.\n\n\n\n\nrepetition:\n\n\n\n\nPerform some action repeatedly, usually with some variation.\n\n\n\n\nBelieve it or not, that\u2019s pretty much all there is to it. Every program you\u2019ve ever used, no\nmatter how complicated, is made up of instructions that look pretty much like these. So\nyou can think of programming as the process of breaking a large, complex task into\nsmaller and smaller subtasks until the subtasks are simple enough to be performed with\none of these basic instructions.\nThat may be a little vague, but we will come back to this topic when we talk about\nalgorithms.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nRun Python Scripts\n\n\nIf you can't execute or run a Python script, then programming is pointless. When you run a Python script, the interpreter converts a Python program into something that that the computer can understand. Executing a Python program can be done in two ways: calling the Python interpreter with a shebang line, and using the interactive Python shell.\n\n\nRun a Python Script as a File\n\n\nGenerally programmers write stand alone scripts, that are independent to live environments. Then they save it with a \".py\" extension, which indicates to the operating system and programmer that the file is actually a Python program. After the interpreter is invoked, it reads and interprets the file. The way Python scripts are run on Windows versus Unix based operating systems is very different. We'll show you the difference, and how to run a Python script on Windows and Unix platforms.\n\n\nRun a Python script under Windows with the Command Prompt\n\n\nWindows users must pass the path of the program as an argument to the Python interpreter. Such as follows:\n\n\nC:\\Python27\\python.exe C:\\Users\\Username\\Desktop\\my_python_script.py\n\n\n\n\nNote that you must use the full path of the Python interpreter. If you want to simply type python.exe C:\\Users\\Username\\Desktop\\my_python_script.py you must add python.exe to your PATH environmental variable.\nNote that Windows comes with two Python executables - python.exe and pythonw.exe. If you want a terminal to pop-up when you run your script, use python.exe However if you don't want any terminal pop-up, use pythonw.exe. pythonw.exe is typically used for GUI programs, where you only want to display your program, not the terminal.\n\n\nRun a Python Script Under Mac, Linux, BSD, Unix, etc\n\n\nOn platforms like Mac, BSD or Linux (Unix) you can put a \"shebang\" line as first line of the program which indicates the location of the Python interpreter on the hard drive. It's in the following format:\n\n\n#!/path/to/interpreter\n\n\n\n\nA common shebang line used for the Python interpreter is as follows:\n\n\n#!/usr/bin/env python\n\n\n\n\nYou must then make the script executable, using the following command:\n\n\nchmod +x my_python_script.py\n\n\n\n\nUnlike Windows, the Python interpreter is typically already in the $PATH environmental variable, so adding it is un-necessary.\n\n\nYou can then run a program by invoking the Python interpreter manually as follows:\n\n\npython firstprogram.py\n\n\n\n\nPython Execution with the Shell (Live Interpreter)\n\n\nAssuming that you already have Python installed and running well (if you're getting an error, see this post), open the terminal or console and type 'python' and hit the 'Enter' key. You will then be directed immediately to the Python live interpreter. Your screen will display a message something like:\n\n\nuser@hostname:~ python\nPython 3.3.0 (default, Nov 23 2012, 10:26:01) \n[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin\nType \nhelp\n, \ncopyright\n, \ncredits\n or \nlicense\n for more information.\n\n\n\n\n\n\nThe Python programmer should keep in mind one thing: that while working with the live interpreter, everything is read and interpreted in real-time. For example loops iterate immediately, unless they are part of function. So it requires some mental planning. Using the Python shell is typically used to execute code interactively. If you want to run a Python script from the interpreter, you must either import it or call the Python executable.\n\n\n\n\nSource:\n \n\n\n http://pythoncentral.io/execute-python-script-file-shell/\n\n\n\n\nA Good First Program\n\n\nType the following text into a single file named \nex1.py\n. Python works best with files ending in \n.py\n.\n\n\nprint \nHello World!\n\nprint \nHello Again\n\nprint \nI like typing this.\n\nprint \nThis is fun.\n\nprint 'Yay! Printing.'\nprint \nI'd much rather you 'not'.\n\nprint 'I \nsaid\n do not touch this.'\n\n\n\n\nYour Atom text editor should look something like this on all platforms:\n\n\n\n\nDon't worry if your editor doesn't look exactly the same, it should be close though. You may have a slightly different window header, maybe slightly different colors, and the left side of your Atom window won't say \"zedshaw\" but will instead show the directory you used for saving your files. All of those differences are fine.\n\n\nWhen you create this file, keep in mind these points:\n\n\n\n\nI did not type the line numbers on the left. Those are printed in the book so I can talk about specific lines by saying, \"See line 5...\" You do not type line numbers into Python scripts.\n\n\nI have the print at the beginning of the line and it looks exactly the same as what I have in ex1.py. Exactly means exactly, not kind of sort of the same. Every single character has to match for it to work. Color doesn't matter, only the characters you type.\n\n\n\n\nIn Terminal run the file by typing:\n\n\npython ex1.py\n\n\n\n\nIf you did it right then you should see the same output as I in the What You Should See section of this exercise. If not, you have done something wrong. No, the computer is not wrong.\n\n\nWhat You Should See\n\n\nOn Mac OS X in the Terminal you should see this:\n\n\nOn Windows in PowerShell you should see this:\n\n\n\nYou may see different names, before the python ex1.py command, but the important part is that you type the command and see the output is the same as mine.\n\n\nIf you have an error it will look like this:\n\n\n$ python ex/ex1.py\n File \nex/ex1.py\n, line 3\n print \nI like typing this.\n ^\nSyntaxError: EOL while scanning string literal\n\n\n\n\nIt's important that you can read these error messages because you will be making many of these mistakes. Even I make many of these mistakes. Let's look at this line by line.\n\n\n\n\nWe ran our command in the Terminal to run the ex1.py script.\n\n\nPython tells us that the file ex1.py has an error on line 3.\n\n\nIt prints this line of code for us to see it.\n\n\nThen it puts a ^ (caret) character to point at where the problem is. Notice the missing \" (double-quote) character?\n\n\nFinally, it prints out a \"SyntaxError\" and tells us something about what might be the error. Usually these are very cryptic, but if you copy that text into a search engine, you will find someone else who's had that error and you can probably figure out how to fix it.\n\n\n\n\n\n\nSource:\n \n\n\n \nLEARN PYTHON THE HARD WAY\n by Zed A. Shaw - 2013\n\n\n\n\nDebugging and Errors\n\n\nWhat Is Debugging?\n\n\nProgramming is error-prone. For whimsical reasons, programming errors are called\n\nbugs\n and the process of tracking them down is called \ndebugging\n.\nThree kinds of errors can occur in a program: syntax errors, runtime errors, and se\nmantic errors. It is useful to distinguish between them in order to track them down more\nquickly.\n\n\nError Types :\n\n\nSyntax Errors\n\n\nPython can only execute a program if the syntax is correct; otherwise, the interpreter\ndisplays an error message. Syntax refers to the structure of a program and the rules\nabout that structure.For example, parentheses have to come in matching pairs, so\n(1 + 2) is legal, but 8) is a \nsyntax error\n.\nIn English readers can tolerate most syntax errors, which is why we can read the poetry\nof e. e. cummings without spewing error messages. Python is not so forgiving. If there\nis a single syntax error anywhere in your program, Python will display an error message\nand quit, and you will not be able to run your program. During the first few weeks of\nyour programming career, you will probably spend a lot of time tracking down syntax\nerrors. As you gain experience, you will make fewer errors and find them faster.\n\n\nRuntime Errors\n\n\nThe second type of error is a runtime error, so called because the error does not appear\nuntil after the program has started running. These errors are also called exceptions\nbecause they usually indicate that something exceptional (and bad) has happened.\nRuntime errors are rare in the simple programs you will see in the first few chapters, so\nit might be a while before you encounter one.\n\n\nSemantic Errors\n\n\nThe third type of error is the semantic error. If there is a semantic error in your program,\nit will run successfully in the sense that the computer will not generate any error mess\nages, but it will not do the right thing. It will do something else. Specifically, it will do\nwhat you told it to do.\nThe problem is that the program you wrote is not the program you wanted to write. The\nmeaning of the program (its semantics) is wrong. Identifying semantic errors can be\ntricky because it requires you to work backward by looking at the output of the program\nand trying to figure out what it is doing.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012", + "text": "What Is a Program?\n\n\nA program is a sequence of instructions that specifies how to perform a computation.\nThe computation might be something mathematical, such as solving a system of equat\nions or finding the roots of a polynomial, but it can also be a symbolic computation,\nsuch as searching and replacing text in a document or (strangely enough) compiling a\nprogram.\nThe details look different in different languages, but a few basic instructions appear in\njust about every language:\n\n\ninput: \n\n\n\n\nGet data from the keyboard, a file, or some other device.\n\n\n\n\noutput:\n\n\n\n\nDisplay data on the screen or send data to a file or other device.\n\n\n\n\nmath:\n\n\n\n\nPerform basic mathematical operations like addition and\n multiplication.\n\n\n\n\nconditional execution:\n\n\n\n\nCheck for certain conditions and execute the appropriate code.\n\n\n\n\nrepetition:\n\n\n\n\nPerform some action repeatedly, usually with some variation.\n\n\n\n\nBelieve it or not, that\u2019s pretty much all there is to it. Every program you\u2019ve ever used, no\nmatter how complicated, is made up of instructions that look pretty much like these. So\nyou can think of programming as the process of breaking a large, complex task into\nsmaller and smaller subtasks until the subtasks are simple enough to be performed with\none of these basic instructions.\nThat may be a little vague, but we will come back to this topic when we talk about\nalgorithms.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nRun Python Scripts\n\n\nIf you can't execute or run a Python script, then programming is pointless. When you run a Python script, the interpreter converts a Python program into something that that the computer can understand. Executing a Python program can be done in two ways: calling the Python interpreter with a shebang line, and using the interactive Python shell.\n\n\nRun a Python Script as a File\n\n\nGenerally programmers write stand alone scripts, that are independent to live environments. Then they save it with a \".py\" extension, which indicates to the operating system and programmer that the file is actually a Python program. After the interpreter is invoked, it reads and interprets the file. The way Python scripts are run on Windows versus Unix based operating systems is very different. We'll show you the difference, and how to run a Python script on Windows and Unix platforms.\n\n\nRun a Python script under Windows with the Command Prompt\n\n\nWindows users must pass the path of the program as an argument to the Python interpreter. Such as follows:\n\n\nC:\\Python27\\python.exe C:\\Users\\Username\\Desktop\\my_python_script.py\n\n\n\n\nNote that you must use the full path of the Python interpreter. If you want to simply type python.exe C:\\Users\\Username\\Desktop\\my_python_script.py you must add python.exe to your PATH environmental variable.\nNote that Windows comes with two Python executables - python.exe and pythonw.exe. If you want a terminal to pop-up when you run your script, use python.exe However if you don't want any terminal pop-up, use pythonw.exe. pythonw.exe is typically used for GUI programs, where you only want to display your program, not the terminal.\n\n\nRun a Python Script Under Mac, Linux, BSD, Unix, etc\n\n\nOn platforms like Mac, BSD or Linux (Unix) you can put a \"shebang\" line as first line of the program which indicates the location of the Python interpreter on the hard drive. It's in the following format:\n\n\n#!/path/to/interpreter\n\n\n\n\nA common shebang line used for the Python interpreter is as follows:\n\n\n#!/usr/bin/env python\n\n\n\n\nYou must then make the script executable, using the following command:\n\n\nchmod +x my_python_script.py\n\n\n\n\nUnlike Windows, the Python interpreter is typically already in the $PATH environmental variable, so adding it is un-necessary.\n\n\nYou can then run a program by invoking the Python interpreter manually as follows:\n\n\npython firstprogram.py\n\n\n\n\nPython Execution with the Shell (Live Interpreter)\n\n\nAssuming that you already have Python installed and running well (if you're getting an error, see this post), open the terminal or console and type 'python' and hit the 'Enter' key. You will then be directed immediately to the Python live interpreter. Your screen will display a message something like:\n\n\nuser@hostname:~ python\nPython 3.3.0 (default, Nov 23 2012, 10:26:01) \n[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin\nType \nhelp\n, \ncopyright\n, \ncredits\n or \nlicense\n for more information.\n\n\n\n\n\n\nThe Python programmer should keep in mind one thing: that while working with the live interpreter, everything is read and interpreted in real-time. For example loops iterate immediately, unless they are part of function. So it requires some mental planning. Using the Python shell is typically used to execute code interactively. If you want to run a Python script from the interpreter, you must either import it or call the Python executable.\n\n\n\n\nSource:\n \n\n\n http://pythoncentral.io/execute-python-script-file-shell/\n\n\n\n\nA Good First Program\n\n\nType the following text into a single file named \nex1.py\n. Python works best with files ending in \n.py\n.\n\n\nprint \nHello World!\n\nprint \nHello Again\n\nprint \nI like typing this.\n\nprint \nThis is fun.\n\nprint 'Yay! Printing.'\nprint \nI'd much rather you 'not'.\n\nprint 'I \nsaid\n do not touch this.'\n\n\n\n\nYour Atom text editor should look something like this on all platforms:\n\n\n\n\nDon't worry if your editor doesn't look exactly the same, it should be close though. You may have a slightly different window header, maybe slightly different colors, and the left side of your Atom window won't say \"zedshaw\" but will instead show the directory you used for saving your files. All of those differences are fine.\n\n\nWhen you create this file, keep in mind these points:\n\n\n\n\nI did not type the line numbers on the left. Those are printed in the book so I can talk about specific lines by saying, \"See line 5...\" You do not type line numbers into Python scripts.\n\n\nI have the print at the beginning of the line and it looks exactly the same as what I have in ex1.py. Exactly means exactly, not kind of sort of the same. Every single character has to match for it to work. Color doesn't matter, only the characters you type.\n\n\n\n\nIn Terminal run the file by typing:\n\n\npython ex1.py\n\n\n\n\nIf you did it right then you should see the same output as I in the What You Should See section of this exercise. If not, you have done something wrong. No, the computer is not wrong.\n\n\nWhat You Should See\n\n\nOn Mac OS X in the Terminal you should see this:\n\n\nOn Windows in PowerShell you should see this:\n\n\n\nYou may see different names, before the python ex1.py command, but the important part is that you type the command and see the output is the same as mine.\n\n\n\n\n\nIf you have an error it will look like this:\n\n\n$ python ex/ex1.py\n File \nex/ex1.py\n, line 3\n print \nI like typing this.\n ^\nSyntaxError: EOL while scanning string literal\n\n\n\n\nIt's important that you can read these error messages because you will be making many of these mistakes. Even I make many of these mistakes. Let's look at this line by line.\n\n\n\n\nWe ran our command in the Terminal to run the ex1.py script.\n\n\nPython tells us that the file ex1.py has an error on line 3.\n\n\nIt prints this line of code for us to see it.\n\n\nThen it puts a ^ (caret) character to point at where the problem is. Notice the missing \" (double-quote) character?\n\n\nFinally, it prints out a \"SyntaxError\" and tells us something about what might be the error. Usually these are very cryptic, but if you copy that text into a search engine, you will find someone else who's had that error and you can probably figure out how to fix it.\n\n\n\n\n\n\nSource:\n \n\n\n \nLEARN PYTHON THE HARD WAY\n by Zed A. Shaw - 2013\n\n\n\n\nDebugging and Errors\n\n\nWhat Is Debugging?\n\n\nProgramming is error-prone. For whimsical reasons, programming errors are called\n\nbugs\n and the process of tracking them down is called \ndebugging\n.\nThree kinds of errors can occur in a program: syntax errors, runtime errors, and se\nmantic errors. It is useful to distinguish between them in order to track them down more\nquickly.\n\n\nError Types :\n\n\nSyntax Errors\n\n\nPython can only execute a program if the syntax is correct; otherwise, the interpreter\ndisplays an error message. Syntax refers to the structure of a program and the rules\nabout that structure.For example, parentheses have to come in matching pairs, so\n(1 + 2) is legal, but 8) is a \nsyntax error\n.\nIn English readers can tolerate most syntax errors, which is why we can read the poetry\nof e. e. cummings without spewing error messages. Python is not so forgiving. If there\nis a single syntax error anywhere in your program, Python will display an error message\nand quit, and you will not be able to run your program. During the first few weeks of\nyour programming career, you will probably spend a lot of time tracking down syntax\nerrors. As you gain experience, you will make fewer errors and find them faster.\n\n\nRuntime Errors\n\n\nThe second type of error is a runtime error, so called because the error does not appear\nuntil after the program has started running. These errors are also called exceptions\nbecause they usually indicate that something exceptional (and bad) has happened.\nRuntime errors are rare in the simple programs you will see in the first few chapters, so\nit might be a while before you encounter one.\n\n\nSemantic Errors\n\n\nThe third type of error is the semantic error. If there is a semantic error in your program,\nit will run successfully in the sense that the computer will not generate any error mess\nages, but it will not do the right thing. It will do something else. Specifically, it will do\nwhat you told it to do.\nThe problem is that the program you wrote is not the program you wanted to write. The\nmeaning of the program (its semantics) is wrong. Identifying semantic errors can be\ntricky because it requires you to work backward by looking at the output of the program\nand trying to figure out what it is doing.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nReserved Words\n\n\nThe following list shows the Python keywords. These are reserved words and you cannot use them as constants or variables or any other identifier names. All the Python keywords contain lowercase letters only.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nand\n\n\nexec\n\n\nnot\n\n\n\n\n\n\nas\n\n\nfinally\n\n\nor\n\n\n\n\n\n\nassert\n\n\nfor\n\n\npass\n\n\n\n\n\n\nbreak\n\n\nfrom\n\n\nprint\n\n\n\n\n\n\nclass\n\n\nglobal\n\n\nraise\n\n\n\n\n\n\ncontinue\n\n\nif\n\n\nreturn\n\n\n\n\n\n\ndef\n\n\nimport\n\n\ntry\n\n\n\n\n\n\ndel\n\n\nin\n\n\nwhile\n\n\n\n\n\n\nelif\n\n\nis\n\n\nwith\n\n\n\n\n\n\nelse\n\n\nlambda\n\n\nyield\n\n\n\n\n\n\nexcept\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nSource:\n \n\n\n https://www.tutorialspoint.com", "title": "Start Coding With Python" }, { @@ -147,7 +147,7 @@ }, { "location": "/beginner/Start_Coding_With_Python/#what-you-should-see", - "text": "On Mac OS X in the Terminal you should see this: \nOn Windows in PowerShell you should see this: You may see different names, before the python ex1.py command, but the important part is that you type the command and see the output is the same as mine. If you have an error it will look like this: $ python ex/ex1.py\n File ex/ex1.py , line 3\n print I like typing this.\n ^\nSyntaxError: EOL while scanning string literal It's important that you can read these error messages because you will be making many of these mistakes. Even I make many of these mistakes. Let's look at this line by line. We ran our command in the Terminal to run the ex1.py script. Python tells us that the file ex1.py has an error on line 3. It prints this line of code for us to see it. Then it puts a ^ (caret) character to point at where the problem is. Notice the missing \" (double-quote) character? Finally, it prints out a \"SyntaxError\" and tells us something about what might be the error. Usually these are very cryptic, but if you copy that text into a search engine, you will find someone else who's had that error and you can probably figure out how to fix it. Source: LEARN PYTHON THE HARD WAY by Zed A. Shaw - 2013", + "text": "On Mac OS X in the Terminal you should see this: \nOn Windows in PowerShell you should see this: You may see different names, before the python ex1.py command, but the important part is that you type the command and see the output is the same as mine. If you have an error it will look like this: $ python ex/ex1.py\n File ex/ex1.py , line 3\n print I like typing this.\n ^\nSyntaxError: EOL while scanning string literal It's important that you can read these error messages because you will be making many of these mistakes. Even I make many of these mistakes. Let's look at this line by line. We ran our command in the Terminal to run the ex1.py script. Python tells us that the file ex1.py has an error on line 3. It prints this line of code for us to see it. Then it puts a ^ (caret) character to point at where the problem is. Notice the missing \" (double-quote) character? Finally, it prints out a \"SyntaxError\" and tells us something about what might be the error. Usually these are very cryptic, but if you copy that text into a search engine, you will find someone else who's had that error and you can probably figure out how to fix it. Source: LEARN PYTHON THE HARD WAY by Zed A. Shaw - 2013", "title": "What You Should See" }, { @@ -180,6 +180,11 @@ "text": "The third type of error is the semantic error. If there is a semantic error in your program,\nit will run successfully in the sense that the computer will not generate any error mess\nages, but it will not do the right thing. It will do something else. Specifically, it will do\nwhat you told it to do.\nThe problem is that the program you wrote is not the program you wanted to write. The\nmeaning of the program (its semantics) is wrong. Identifying semantic errors can be\ntricky because it requires you to work backward by looking at the output of the program\nand trying to figure out what it is doing. Source: Think Python by Allen B. Downey - 2012", "title": "Semantic Errors" }, + { + "location": "/beginner/Start_Coding_With_Python/#reserved-words", + "text": "The following list shows the Python keywords. These are reserved words and you cannot use them as constants or variables or any other identifier names. All the Python keywords contain lowercase letters only. and exec not as finally or assert for pass break from print class global raise continue if return def import try del in while elif is with else lambda yield except Source: https://www.tutorialspoint.com", + "title": "Reserved Words" + }, { "location": "/About/", "text": "I'll write later", diff --git a/site/sitemap.xml b/site/sitemap.xml index d8f6524..d40aef7 100644 --- a/site/sitemap.xml +++ b/site/sitemap.xml @@ -4,7 +4,7 @@ / - 2017-08-19 + 2017-08-20 daily @@ -13,19 +13,19 @@ /beginner/Python_Programming_Lanuage/ - 2017-08-19 + 2017-08-20 daily /beginner/Python_Installation/ - 2017-08-19 + 2017-08-20 daily /beginner/Start_Coding_With_Python/ - 2017-08-19 + 2017-08-20 daily @@ -34,7 +34,7 @@ /About/ - 2017-08-19 + 2017-08-20 daily From bb0fe56f58f313e899116b56fe18e644b83a977d Mon Sep 17 00:00:00 2001 From: ent1c3d Date: Sun, 20 Aug 2017 23:52:32 +0400 Subject: [PATCH 14/39] started writing about datatypes and variables --- docs/beginner/Datatype_And_Variables.md | 226 ++++++++++++++++++++++++ docs/images/a1box.png | Bin 0 -> 5749 bytes docs/images/a1tag.png | Bin 0 -> 4781 bytes docs/images/a2box.png | Bin 0 -> 6966 bytes docs/images/a2tag.png | Bin 0 -> 6074 bytes docs/images/ab2tag.png | Bin 0 -> 10285 bytes docs/images/b2box.png | Bin 0 -> 6926 bytes 7 files changed, 226 insertions(+) create mode 100644 docs/beginner/Datatype_And_Variables.md create mode 100644 docs/images/a1box.png create mode 100644 docs/images/a1tag.png create mode 100644 docs/images/a2box.png create mode 100644 docs/images/a2tag.png create mode 100644 docs/images/ab2tag.png create mode 100644 docs/images/b2box.png diff --git a/docs/beginner/Datatype_And_Variables.md b/docs/beginner/Datatype_And_Variables.md new file mode 100644 index 0000000..cf53b02 --- /dev/null +++ b/docs/beginner/Datatype_And_Variables.md @@ -0,0 +1,226 @@ +# Datatype & Variables + +Variables are named locations which are used to store references to the object stored in memory. The names we choose for variables and functions are commonly known as Identifiers. In python Identifiers must obey the following rules. + + 1. All identifiers must start with letter or underscore ( _ ) , you + can’t use digits. For e.g my_var is valid identifier while 1digit + is not. + 2. Identifiers can contain letters, digits and underscores ( _ ). + 3. They can be of any length. + 4. Identifier can’t be a keyword (keywords are reserved words that + Python uses for special purpose).Following are Keywords in python 3. + + []() | []() | []() +------|------|------ +**and** | **exec**| **not** +**as**| **finally**| **or** +**assert**| **for** | **pass** +**break**| **from**| **print** +**class**| **global**| **raise** +**continue**| **if**| **return** +**def**| **import**| **try** +**del**| **in**| **while** +**elif**| **is**| **with** +**else**| **lambda**| **yield** +**except**| + + +## Assigning Values to Variables + +Values are basic things that programs works with. For e.g 1 , 11 , 3.14 , "hello" are all values. In programming terminology they are also commonly known as literals. Literals can be of different type for e.g 1 , 11 are of type int , 3.14 is float and "hello" is string . Remember in python everything is object even basic data types like int, float, string, we will elaborate more on this in later chapters. + +In python you don’t need to declare types of variable ahead of time. Interpreter automatically detects the type of the variable by the data it contains. To assign value to a variable equal sign ( = ) is used. = is also known as assignment operator. + +Following are some examples of variable declaration: + +```python +x = 100 # x is integer +pi = 3.14 # pi is float +empname = "python is great" # empname is string + +a = b = c = 100 # this statement assign 100 to c, b and a. +``` +> **Note:** +In the above code x stores reference to the 100 ( which is an int object ) , x don’t store 100 itself. + +In Python comments are preceded by a pound sign ( # ). Comments are not programming statements that python interpreter executes while running the program. Comments are used by programmers to remind themselves how the program works. They are also used to write program documentation. + + +```python +#display hello world +print("hello world") +``` + +### Simultaneous Assignments +Python allow simultaneous assignment syntax like this: + +```python +var1, var2, ..., varn = exp1, exp2, ..., expn +``` +this statements tells the python to evaluate all the expression on the right and assign them to the corresponding variables on the left. Simultaneous Assignments is helpful to swap values of two variables. For e.g +```python +>>> x = 1 +>>> y = 2 + +>>> y, x = x, y # assign y value to x and x value to y +``` + +## Python Data Types +Python has 5 standard data types namely. +a) [Numbers](http://thepythonguru.com/python-numbers/) +b) [String](http://thepythonguru.com/python-strings/) +c) [List](http://thepythonguru.com/python-lists/) +d) [Tuple](http://thepythonguru.com/python-tuples/) +e) [Dictionary](http://thepythonguru.com/python-dictionaries/) +f) Boolean – In Python True and False are boolean literals. But the following values are also considered as false. + +**[] – empty list , () – empty tuple , {} – empty dictionary** + + +## Receiving input from Console +input() function is used to receive input from the console. + +Syntax: input([prompt]) -> string + +input() function accepts an optional string argument called prompt and returns a string. +```python +>>> name = input("Enter your name: ") +>>> Enter your name: tim +>>> name +'tim' +``` +Note that input() returns string even if you enter a number, to convert it to an integer you can use int() or eval() . + +```python +>> age = int(input("Enter your age: ")) +Enter your age: 22 +>>> age +22 +>>> type(age) + +``` + + + + + + +> **Source:** +> :fa-link: http://thepythonguru.com + + + +## Understanding Python variables and Memory Management + +Have you ever noticed any difference between variables in Python and C? For example, when you do an assignment like the following in C, it actually creates a block of memory space so that it can hold the value for that variable + +```c +int a = 1; +``` + +You can think of it as putting the value assigned in a box with the variable name as shown below. +![a1box.](../images/a1box.PNG) + +And for all the variables you create a new box is created with the variable name to hold the value. If you change the value of the variable the box will be updated with the new value. That means doing + +```c +a = 2; +``` +will result in + +![a2box.](../images/a2box.PNG) + + +Assigning one variable to another makes a copy of the value and put that value in the new box. +```c +int b = a; +``` +![b2box.](../images/b2box.PNG) ![a2box.](../images/a2box.PNG) + +But in Python variables work more like tags unlike the boxes you have seen before. When you do an assignment in Python, it tags the value with the variable name. +```python +a = 1 +``` +![a1tag.](../images/a1tag.PNG) + +and if you change the value of the varaible, it just changes the tag to the new value in memory. You dont need to do the housekeeping job of freeing the memory here. Python's Automatic Garbage Collection does it for you. When a value is without names/tags it is automatically removed from memory. + +```python +a = 2 +``` +![a2tag.](../images/a2tag.PNG) + +Assigning one variable to another makes a new tag bound to the same value as show below. + +```python +b = a +``` +![ab2tag.](../images/ab2tag.PNG) +Other languages have 'variables'. Python has 'names'. + +## A bit about Python's memory management + +As you have seen before, a value will have only one copy in memory and all the variables having this value will refer to this memory location. For example when you have variables a, b, c having a value 10, it doesn't mean that there will be 3 copy of 10s in memory. There will be only one 10 and all the variables a, b, c will point to this value. Once a variable is updated, say you are doing a += 1 a new value 11 will be allocated in memory and a will be pointing to this. + +Let's check this behaviour with Python Interpreter. Start the Python Shell and try the following for yourselves. + +```python +>>> a = 10 +>>> b = 10 +>>> c = 10 +>>> id(a), id(b), id(c) +(140621897573616, 140621897573616, 140621897573616) +>>> a += 1 +>>> id(a) +140621897573592 +``` + +id() will return an objects memory address (object's identity). As you have noticed, when you assign the same integer value to the variables, we see the same ids. But this assumption does not hold true all the time. See the following for example + +```python +>>> x = 500 +>>> y = 500 +>>> id(x) +4338740848 +>>> id(y) +4338741040 +``` +What happened here? Even after assigning the same integer values to different variable names, we are getting two different ids here. These are actually the effects of CPython optimization we are observing here. CPython implementation keeps an array of integer objects for all integers between -5 and 256. So when we create an integer in that range, they simply back reference to the existing object. You may refer the following [links](http://stackoverflow.com/questions/306313/is-operator-behaves-unexpectedly-with-integers) for more information. + +Let's take a look at strings now. + + +```python +>>> s1 = 'hello' +>>> s2 = 'hello' +>>> id(s1), id(s2) +(4454725888, 4454725888) +>>> s1 == s2 +True +>>> s1 is s2 +True +>>> s3 = 'hello, world!' +>>> s4 = 'hello, world!' +>>> id(s3), id(s4) +(4454721608, 4454721664) +>>> s3 == s4 +True +>>> s3 is s4 +False +``` + + + +Looks interesting, isn't it? When the string was a simple and shorter one the variable names where referring to the same object in memory. But when they became bigger, this was not the case. This is called interning, and Python does interning (to some extent) of shorter string literals (as in s1 and s2) which are created at compile time. But in general, Python string literals creates a new string object each time (as in s3 and s4). Interning is runtime dependant and is always a trade-off between memory use and the cost of checking if you are creating the same string. There's a built-in intern() function to forcefully apply interning. Read more about interning from the following links. + +[Stack Overflow: Does Python intern Strings?](http://stackoverflow.com/questions/17679861/does-python-intern-strings) +[Stack Overflow: Python String Interning](http://stackoverflow.com/questions/15541404/python-string-interning) +[Internals of Python String Interning](http://guilload.com/python-string-interning/) + + + + + + +> **Source:** +> :fa-link: http://foobarnbaz.com/2012/07/08/understanding-python-variables/ \ No newline at end of file diff --git a/docs/images/a1box.png b/docs/images/a1box.png new file mode 100644 index 0000000000000000000000000000000000000000..5c5e890dc676b02256299cd22af3cb8bb3d78eee GIT binary patch literal 5749 zcmV-*7K-VKP)Dr~Nz>_cGT@;UJ843bkftF9V_UM3Em;=wTe9Ak?n7_gE8X3_yXWg4 zdw1{qt(Sv#7|D0<;q2Mpe&6r=ecw4}MGz6Lt3%VYH{N(d6vam#d1NK8ORq1O&YwSj z^ytyW#l@DEmKDDAb%Rte7(8<1$nfwmA!KoJapeba9U!GB%DeBr`~LgyBjReobR8ho z)z#JB-X07FMNy=bt`o^y$;{^Yd$GcxwWwOP4OSx3>=u54&8hQ>RX~wYB+tzO}{) ztBlmh$VgjT+tsUA8Dqg<@X(<{SFT)Hn-ON!kn;I_$B!TH@9$R>B^(Z)IB}w@t4mRo zH5-fRYQgl%E3YVuq9{s7M@L6T$K2f98dr9!fYkW-_<;ilBuUakTQC^BF4C!$M#}H^ zA2@J84|8Kdh9_s1oVT=L5_U+rBe){R>pMO53Sw%&~2i>L!AyrjX zjIsLq`X`=vV*mdAJkO^$bGzN^-Ulze^wNtjzWDOXFI%nFY;7D4$2wB5XV0G3Uw=J! z8;{02+dZ!0}>*r{1$+lMbB6 zyUF9Nuk_S$9Dki56^+VgPX6}f;e*j|&@K>{g)1IqKmb70ZHEAI9H9V&=yMiPHa8NO z9rj%T6+vU5F=T{uR@QpF4W12~JT(o~-uh~9gU4Ghh}N};R5&!#e)NrwV?U=_#7c=M zmJw1AkN_a+6FP_(b5R8SBS#3&fvA5?fB=9ToF55J4|QE)pfXe$s0v^*26!&(D6GPuem4(99J|jsWyc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89~+qI8{;|RunP{G=&*|pn_#z#l;?_M_cHe%Ee%y+iaQ(j zJUO#?zBl;TpMAHserpl&A?1lFawIT5=pP#hj1Tz7`U7JF3*kAdNbPpPVHX`X(PK|YWPKPy(>4J_@j`AGkIaOsR z&yL)7_a`6z+&7Agqj(zN2US(J+XSagbT~wZU3A$+i%1LKDoIG{ z?WZ7R!nGtw5du0!l;;RXx-R(KHQS&0s~_<^U1Frt{EAIajQhu87Uv%ymZ960Qv z(=IygqQfD&>>|})FIvo|(sZQE&Gn@rH8CAhH3R@^*woeG>DdMTx$peMUFj`aot0l& zj7H_4ZzwP}VEF7nXl}}Cp-#K#bcjy7=yF)>Hi6@~6r@b6$pmE*Ql)_voDOLQQasO1 z%`El~O@Hwl|Ga(2ZKdeg<=9!UxG*2HI0L?@5^>l>r$cl(EKY~$c37+yA)|khWQ!^b zsi}~jd+-Ir$wNA zZltDXBUgu~Kl_Cj_T2eknd4czNTnQ%X_J9b(_sVSgELb;i^#j3aifbltZ|I`X3zBo z{`jtkKl$W0%OAjXgH-yFo=z+-%sK6%%V}{ttZt{}%HV{{v-R0;{4ifxU;gVKS60_9N$39$Xx0^Jr&oiz00000NkvXXu0mjf#C8cB literal 0 HcmV?d00001 diff --git a/docs/images/a1tag.png b/docs/images/a1tag.png new file mode 100644 index 0000000000000000000000000000000000000000..fdd7b9fb3ebb3fe1c36a7ce74949a89f4ac1199a GIT binary patch literal 4781 zcmV;e5>oAnP)>P>_q<1S*PL6mhKE>CDvnSnXJAyKXz$$2xVk zPIY@(wVkR@cUG-#s}|cwcXisLBDWAg5Q0FsOG3B>!aXD;gv*HG}YDBm6eq$m5RgR z%xIDq3A?Ya@6Me&!^6WWm8z+!sj{-Nr>E!Xrg|~3<#Ks(aj{S+1OSLcqKb-&hK7b` znQ)vl9IZ*I+MwyR4U8L%8)?yjMFY$Y_r*1R#sM9TPu^vFc?gEd3i-e#pvkh ztW3T@v5Sg|T3cKD`}+X^VzIcmxL6{Q%;NkD5&O=aJ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C;P-y4`ype|ho~m^MhIR3{F5t9N|VpyP}N-lW%< z417~tzcGK#voF8SOi*OrYe=O~CwAMId+50zy`F2%&L1}VKWzMor`?prTL1t607*qo IM6N<$f~GHWT>t<8 literal 0 HcmV?d00001 diff --git a/docs/images/a2tag.png b/docs/images/a2tag.png new file mode 100644 index 0000000000000000000000000000000000000000..daf80e23a7800e899efe17e02c2311e26d5dcc46 GIT binary patch literal 6074 zcmW+)1y~ea8y#c`VWm@2K%@of_&{pu?yjXfmR{haq&q|qP&x!@kdp5176Iul>3_ce z&NFkLnSFNdoqON+yyu)qRb`nMSTC^v0C*uME2R$hhTy4-`3$^XQ(};V9lE)Kj1=(n z-;vu|lng$3?joz_4glDM|D7nnrz|q?A%=&Xk~GHLGeTn07oQAk(*S@}Movmx(|d8n z(Dpsy97)>%{MBRXjCUG!$ZdFR7ftsYMxL{c?8AwdC0_I|BpO;zrF{ zJM1G8{?cI6c?glX_5x{Q!guRThVy`!UNTu|Chpp`y_@wPtFx_D_cr&VrVw#Fi2pEN zbPq8xacpcXC5{X&9%h(?Xbvtg?u`mI4Gj(S5ESu*Pe^l7WA&FWU%I)w+uPgw`TD|R zHCgH!8gy7vSq#ey3VPu0{t*%JKp>vPvauB-o$n&vMmEM5tBh5?dND2nmyef&e7);R!?C*Vor+<%gEG_Uv^A zFE8(nf16NDZtjGQLK+(vAKzo6+`5av_E?Uyv-1bD#Iiv(VVf3Qz<(9 zFo{=*vJ3B;^KOGdWVOHAxEJdrrv&j@f7^ZEU8$KXEz#! zg@vzPy`mvxrlO*9-yTJtZ4QjnB*F67ja%lYr!`NnEjXh|-)3`~1^d%`@+i#soc|#v zB7zRB^{%@dEjM*-xe+hoLrTiZG;Ana^Z(x6i3Qy2F6gn5lnpmANrF2jFOLQ7!a96w z(xz$C5vvTVcUtk?9;FI{@q}`5b6dR2z$WFO#t`uc@iQ#=>G@VcEP4XlG(& zW#!=TbahR1hSw|@a_Fe2IBPDY6shElW(n4ml_|`AEh}qw+Zyc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-@d&B7Rrb+-TBPLM|ewdgXfilDv?uv_baf5HfOg&Va{QkmUgPy`$M O09i>TiApi!p#K5M#TSSG literal 0 HcmV?d00001 diff --git a/docs/images/b2box.png b/docs/images/b2box.png new file mode 100644 index 0000000000000000000000000000000000000000..e0ad3033ca29c89634e5e9a0a2197e45096aae2c GIT binary patch literal 6926 zcmV+p8}a0cP)!4v@f_0K2sb3Djoe zT9P8WVFOhQTci?pD_dLZB$$MNm*C(FEPNqj#j-3*mJc14JcmZoXgp{4^zrtOp6Tg1 zH8UC++sP}J)YJ3y`t`5B@Av(_?{&8k#u%=%=JWab`}-XZhuiIDS(afKmSri5(r7el zwOX&&mz9;xojbR>y82qq3SB=)VT?OFJ9~S3?RI-86q5HB6cl(op7?nqR8msX)YPDskxZ+@hFKHr`_d(NLfpE#3gVUq2u zrKRP*`|eY#)i*6teSLlH?d{{^<8k{rjw>oE^85Xn4^>`XzHQq!gTZhUB6aZK!LF{Z zKp^09xvW;}#KeTle!rh#7=j?QTCG;AH5!c-6%{6vsk*v4mDLm$7J9wjdGqEy z{P4pBLEKbG?b);E)TvY5-Q9hCeFFmnN(xWa%x3elWy@MyTMG*dSL8 zH5$!|6)S3MYwPOj?!5EPHEY(8Bsn@d+R@RmckkXaXU_EY_D&lUJ32b*>+5T4Yn40g zcKeNr)RRv>IWRDwRMm?YFMjQ{*Ve6D7uU0{uCA`G?xBYs0)Tz{_WkHbKl<#m&l1T< zsZqPTyW@}w1OhC}=2x;`3-4=hZ{NLpxBSs!v3&d6-|p(_N`xt{ZQQu=(@#I$v15l` zuTRshr>AFhbTp2tveNh03sNt<@IoLEkhbgV>mPso@f|yMWd7$r{_&4rd+jx&(U``p z;@k~mJT*0SgCTYN`0>-HPs`S{dGqE)ixy?844-`R$?e;>r|A$^geWK|;5hCEL+X`R zUXdnUSXj7q>sBcv$zhyVUww7es#U4J9U2;vxxb*GAQTG4G1v8ul-KKRZ*K+5qHZO4ussWgP!?e_V65=?tCaADG~Fvec5*Jv~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6k**yxyT&|w{PSO>?f18&zCMInPuZP3wroywr24LX{X zmOYap754&#G)T#2l^asyE-x=&0FX7*z=&(o1Aq6!Unxs;vxQV*W0`={J`@3NaLhL7 z_g&R$D1%OI(9;GTZPd{^tqRFY$tVuMq)_HTe>z=WK}L!sCftGZgRV?O=4>IA*t{Os zn03%$9grx`X&VxRkX}n0^|V1p8w~0KJ*}oyN&PF2ROOuX3L=)O6l{n;)9>7{<%#v1 z9?k8fuEpDQF&16pHivc4VI3H=4LPiXuJJ1*0S3L=sHcsQpA<#rm#So>Fvh(X$7>tg z9)0HJoO7ek=l^ZzxscO79ElP`W41w$dqS(BjC!?EuQnRgMm=rNstE$kgsLQ@FvbHT zQv_{#_MiSstIPd=tNVPAN>bH>q>XiyjE)kcF_MUm-|nz|ai zIPCiBV?S87>Yf?S=lVq|6Lq4YNuxn6SzLiZZP2Ne_iByW-8~n^mfwDFwj%S!MrvAh z;;;?`10I8pHX76gdQE{reST=%V4C~X^I40`n+>UH)QNS_=bd`$`Jd+?GLyFd2L`Wg UtaeJtg#Z8m07*qoM6N<$f}Yn49smFU literal 0 HcmV?d00001 From 94944d7f0a8ae8431ee8ab2ff71d5a98927b4c6b Mon Sep 17 00:00:00 2001 From: ent1c3d Date: Mon, 21 Aug 2017 00:14:18 +0400 Subject: [PATCH 15/39] bit more about Assignment --- docs/beginner/Datatype_And_Variables.md | 268 +++++++++++++++++++++++- 1 file changed, 267 insertions(+), 1 deletion(-) diff --git a/docs/beginner/Datatype_And_Variables.md b/docs/beginner/Datatype_And_Variables.md index cf53b02..288c927 100644 --- a/docs/beginner/Datatype_And_Variables.md +++ b/docs/beginner/Datatype_And_Variables.md @@ -223,4 +223,270 @@ Looks interesting, isn't it? When the string was a simple and shorter one the va > **Source:** -> :fa-link: http://foobarnbaz.com/2012/07/08/understanding-python-variables/ \ No newline at end of file +> :fa-link: http://foobarnbaz.com/2012/07/08/understanding-python-variables/ + + + + + +## Assignment statements in Python are more interesting than you might think + + + +In this article, we will take a deep look at three kinds of assignment statements in Python and discuss what’s going on under the hood. + + +```python +>>> my_string = "Hello World" # right hand side is a simple expression +>>> another_string = my_string # right hand side is another variable +>>> another_string = another_string + "!" # right hand side is an operation +``` + + +What we find may surprise you. + +**What happens when the right hand side is a simple expression?** + +```python +>>> my_string = "Hello World" +``` +In simple terms, this creates a string “Hello World” in memory and assigns the name my_string to it. If you are using CPython[1], then we can even check the memory address explicitly by using the built in function id . + +```python +>>> my_string = “Hello World” +>>> id(my_string) +140400709562064 +``` +That big number 140400709562064 denotes where the data lives in the memory. It will be very useful for us in this entire discussion. +What happens if we create another string with the same value? +```python +>>> another_string = “Hello World” +``` + +Does it reuse the previous “Hello World” stored in memory or does it create an independent copy? Let’s check this by querying the id function again. +```python +>>> id(another_string) +140400709562208 +``` +This outputs a different id, so this must be an independent copy. We conclude that: + +> **Note:** +Assignment statements where the right hand side is a simple expression creates independent copies every time. + +While for everyday programming, this is the rule we should remember, there are actually some weird exceptions to this rule. Here’s an example. + +```python +>>> my_string = “hello” +>>> id(my_string) +140400709562016 +>>> another_string = “hello” +>>> id(another_string) +140400709562016 +``` + + +In this case, two consecutive assignment statements did not create independent copies. Why? +It gets interesting now. +For optimizing memory, Python treats a special set of objects differently. The string “hello” belongs to this privileged set and has a different behavior. The exact set depends on the implementation like CPython, PyPy, Jython or IronPython. For CPython, the special rule applies to: + + - Strings without whitespaces and less than 20 characters and + - Integers from -5 to +255. + +These objects are always reused or interned. The rationale behind doing this is as follows: + + 1. Since programmers use these objects frequently, interning existing + objects saves memory. + 2. Since immutable objects like tuples and strings cannot be modified, + there is no risk in interning the same object. + +However, Python does not do this for all immutable objects because there is a runtime cost involved for this feature. For interning an object, it must first search for the object in memory, and searching takes time. This is why the special treatment only applies for small integers and strings, because finding them is not that costly. + +**What happens when the right hand side is an existing Python variable?** +Let’s move on to the second type of assignment statement where the right hand side is an existing Python variable. + +```python +>>> another_string = my_string +``` + +In this case, nothing is created in memory. After the assignment, both variables refer to the already existing object. It’s basically like giving the object an additional nickname or alias. Let’s confirm this by using the id function. + +```python +>>> my_string = “Hello World” +>>> id(my_string) +140400709562160 +>>> another_string = my_string +>>> id(another_string) +140400709562160 +``` + +The natural question at this stage is : what if, instead of just giving the existing object an alias, we wanted to create an independent copy? +For mutable objects, this is possible. You can either use the copy module of Python (which works on all objects) or you may use copy methods specific to the class. For a list, you have several possibilities for creating copies, all of which have different runtime. + +```python +>>> my_list = [1, 2, 3] +>>> copy_of_my_list = my_list.copy() # fastest, works only on latest Python versions +>>> copy_of_my_list = my_list[:] # same runtime as List.copy() +>>> copy_of_my_list = list(my_list) # slightly slower +>>> import copy +>>> copy_of_my_list = copy.copy(my_list) # slowest +``` + +How can you copy an immutable object? Well…you can’t! At least not in a straightforward way. If you try to use the copy module or the slicing notation, you will get back the same object and not an independent copy. Here’s proof. + +```python +# Standard ways of copying lists do not apply for tuples + +>>> my_tuple = (1, 2, 3) +>>> id(my_tuple) +140371873244816 +>>> another_tuple = my_tuple[:] +>>> id(another_tuple) +140371873244816 + +# The copy module also doesn’t help + +>>> import copy +>>> another_tuple = copy.copy(my_tuple) +>>> id(another_tuple) +140371873244816 +``` +More importantly, there is no reason for explicitly copying an immutable object anyway. We will see why in a moment when we discuss the third kind of assignment statement. +**What happpens when the right hand side is an operation?** + +In this case, what happens depends on the result of the operation. We will discuss two simple cases: + + 1. adding an element to an immutable object (like a tuple) and + 2. adding an element to a mutable object (like a list). + +Let’s start with the case of the tuple. + +```python +>>> another_tuple += (4,) +``` +When you add a new element to a tuple using another_tuple += (4,), this creates a new object in memory. The immutability of tuples is key to understanding this. Since tuples are immutable, any operation that leads to a changed tuple would result in an independent copy. +This is the reason why you don’t need to explicitly copy immutable objects : it happens automatically under the hood. Here’s an example. + +```python +>>> my_tuple = (1, 2, 3) +>>> another_tuple = my_tuple # both variables point to the same object +>>> another_tuple += (4,) # this statement creates a new independent object +>>> print(another_tuple) +(1, 2, 3, 4) +>>> print(my_tuple) # the old one remains unharmed +(1, 2, 3) +``` + +The situation is much different for mutable objects and much more confusing. Let’s try the same example, but now for lists. +```python +>>> my_list = [1, 2, 3] +>>> another_list = my_list # both variables point to the same object +>>> another_list += [4,] # this statement modifies the object in place +>>> print(another_list) +[1, 2, 3, 4] +>>> print(my_list) # the original list is modified +[1, 2, 3, 4] +``` + +Mutable objects can be modified in place. Some operations modify the list in place and some operations don’t. In this case, the statement another_list += [4,] calls another_list.__iadd__([4,]) and __iadd__ modifies the existing object in place. +To make things doubly confusing, we would have completely different results if we used a slightly different notation. + +```python +>>> my_list = [1, 2, 3] +>>> another_list = my_list # both variables point to the same object +>>> another_list = another_list + [4,] # this creates an independent copy +>>> print(another_list) +[1, 2, 3, 4] +>>> print(my_list) # the original list is unharmed +[1, 2, 3] +``` + +Woah! What’s going on? What changed? +It turns out that when we change the third line, Python now internally calls a different function another_list.__add__([4,]) instead of __iadd__. This function returns a new copy instead of modifying the list in place. +To prevent this confusion, it is always better to create a true copy of the list if you wish to prevent modification to the original. +Let’s remember the list copy methods from before. They were List.copy(), [:], list() and copy.copy(). This is what we should use. + + +```python +>>> my_list = [1, 2, 3] +>>> another_list = my_list.copy() # this creates an independent copy +>>> another_list += [4,] # this statement modifies the independent copy +>>> print(another_list) +[1, 2, 3, 4] +>>> print(my_list) # the original list is unharmed +[1, 2, 3] +``` + +There’s one last gotcha that can happen when copying lists. +Suppose we have a list that has a nested list inside it. We copy this list using List.copy() and then modify the nested list. Unfortunately, this will modify the original list again! + +```python +>>> my_list = [[1, 2, 3], 4, 5] +>>> another_list = my_list.copy() +>>> another_list[0] += [6,] +>>> print(another_list) +[[1, 2, 3, 6], 4, 5] +>>> print(my_list) +[[1, 2, 3, 6], 4, 5] +``` + +Why did that happen? Didn’t we just copy the original list? +The truth is : we actually don’t have a completely independent copy in this case. The copy() function generates a shallow copy. To see what it does, let’s look at the ids of all the elements in my_list and the ids of all the elements in the copied list. + +```python +# for my_list + +>>> my_list = [[1, 2, 3], 4, 5] +>>> id(my_list) +140371873277424 +>>> print([id(x) for x in my_list]) +[140371873599288, 13820176, 13820152] + +# for another_list obtained by my_list.copy() + +>>> id(another_list) +140371873317016 +>>> print([id(x) for x in another_list]) +[140371873599288, 13820176, 13820152] +``` + +We see the ids of my_list and another_list are indeed different, indicating another_list is a copy. But the ids of the elements contained in another_list have the same ids as the elements in my_list . So the elements have not been copied! +This is the property of shallow copy. It creates a new copy of the object but reuses the attributes and elements of the old copy. Thus, when you modify the elements of the new copy, you are modifying the elements of the old copy too. +To solve this problem, we need to copy an object along with all its attributes and elements. This can be achieved by copy.deepcopy. + + +```python +>>> my_list = [[1, 2, 3], 4, 5] +>>> another_list = copy.deepcopy(my_list) +>>> another_list[0] += [6,] +>>> another_list +[[1, 2, 3, 6], 4, 5] +>>> my_list +[[1, 2, 3], 4, 5] +``` + +Deep copy is a quite time intensive operation and can take 1o times longer to complete compared to a shallow copy. But in some situations, it is unavoidable. + +### Conclusion +This brings me to the end of this discussion. To summarize, we have talked about the different scenarios which can arise in an assignment statement in Python. We found that: + + - When the right hand side is a simple expression, a new copy is + created every time. There are some exceptions to this rule, which + depend on the implementation + - When the right hand side is an existing Python variable, then an + alias is created for the existing copy. + - When the right hand side is an operation, then the outcome depends on + the operation. In a simple case involving a tuple, we saw that an + independent copy was created. In the same case with lists, we saw + that the list was modified in place in one case (when we used + __iadd__) and a new copy was generated in another case (when we used __add__). + - List item + - Mutable objects can be copied but immutable objects cannot be copied + in a straightforward way. There is also no need to copy immutable + objects. + - To copy a mutable object along with all its attributes and elements, + we need to use deep copy. + + +> **Source:** +> :fa-link: https://medium.com/broken-window/many-names-one-memory-address-122f78734cb6 + From c2421d696c975a1ce954d417469efaede0385cd7 Mon Sep 17 00:00:00 2001 From: ent1c3d Date: Mon, 21 Aug 2017 09:21:53 +0400 Subject: [PATCH 16/39] new chapter about datatypes, variables and assignment --- README.md | 3 +- docs/index.md | 3 +- mkdocs.yml | 2 + site/404.html | 12 + site/About/index.html | 16 +- .../Datatype_And_Variables/index.html | 1061 +++++++++++++++++ site/beginner/Python_Installation/index.html | 12 + .../Python_Programming_Lanuage/index.html | 12 + .../Start_Coding_With_Python/index.html | 87 +- site/images/a1box.png | Bin 0 -> 5749 bytes site/images/a1tag.png | Bin 0 -> 4781 bytes site/images/a2box.png | Bin 0 -> 6966 bytes site/images/a2tag.png | Bin 0 -> 6074 bytes site/images/ab2tag.png | Bin 0 -> 10285 bytes site/images/b2box.png | Bin 0 -> 6926 bytes site/index.html | 15 +- site/mkdocs/search_index.json | 66 +- site/sitemap.xml | 16 +- 18 files changed, 1254 insertions(+), 51 deletions(-) create mode 100644 site/beginner/Datatype_And_Variables/index.html create mode 100644 site/images/a1box.png create mode 100644 site/images/a1tag.png create mode 100644 site/images/a2box.png create mode 100644 site/images/a2tag.png create mode 100644 site/images/ab2tag.png create mode 100644 site/images/b2box.png diff --git a/README.md b/README.md index e695515..8df6438 100644 --- a/README.md +++ b/README.md @@ -19,4 +19,5 @@ So, You can start study from here: - Beginner - [The Python Programming Language, Implementation and Adventages](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Python_Programming_Lanuage) - [Python Installation](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Python_Installation) - - [Start Coding With Python](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Start_Coding_With_Python) \ No newline at end of file + - [Start Coding With Python](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Start_Coding_With_Python) + - [Datatype And Variables](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Datatype_And_Variables) \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 786d1ec..8707cb5 100644 --- a/docs/index.md +++ b/docs/index.md @@ -14,4 +14,5 @@ Of course, it needs plenty of time to organize best resources based on the topic - Beginner - [The Python Programming Language, Implementation and Adventages](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Python_Programming_Lanuage) - [Python Installation](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Python_Installation) - - [Start Coding With Python](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Start_Coding_With_Python) \ No newline at end of file + - [Start Coding With Python](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Start_Coding_With_Python) + - [Datatype And Variables](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Datatype_And_Variables) \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index bfccefc..c0cd861 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -16,12 +16,14 @@ pages: - The Python Programming Language, Implementation and Adventages : beginner/Python_Programming_Lanuage.md - Python Installation : beginner/Python_Installation.md - Start Coding With Python : beginner/Start_Coding_With_Python.md + - Datatype And Variables : beginner/Datatype_And_Variables.md - About: About.md # Documentation and theme theme: material markdown_extensions: - fontawesome_markdown + - codehilite # Options extra: diff --git a/site/404.html b/site/404.html index 49ffd90..b79c779 100644 --- a/site/404.html +++ b/site/404.html @@ -247,6 +247,18 @@ + + + + + +
  • + + Datatype And Variables + +
  • + + diff --git a/site/About/index.html b/site/About/index.html index d4ca8a5..daaa65e 100644 --- a/site/About/index.html +++ b/site/About/index.html @@ -249,6 +249,18 @@ + + + + + +
  • + + Datatype And Variables + +
  • + + @@ -322,7 +334,7 @@

    I'll write later

    diff --git a/site/beginner/Datatype_And_Variables/index.html b/site/beginner/Datatype_And_Variables/index.html new file mode 100644 index 0000000..0888036 --- /dev/null +++ b/site/beginner/Datatype_And_Variables/index.html @@ -0,0 +1,1061 @@ + + + + + + + + + + + + + + + + + + + + + + + Datatype And Variables - Python Synopsis + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + + +
    +
    + + +
    +
    +
    + +
    +
    +
    + + + + + +
    +
    + + + +

    Datatype & Variables

    +

    Variables are named locations which are used to store references to the object stored in memory. The names we choose for variables and functions are commonly known as Identifiers. In python Identifiers must obey the following rules.

    +
      +
    1. All identifiers must start with letter or underscore ( _ ) , you + can’t use digits. For e.g my_var is valid identifier while 1digit + is not.
    2. +
    3. Identifiers can contain letters, digits and underscores ( _ ).
    4. +
    5. They can be of any length.
    6. +
    7. +

      Identifier can’t be a keyword (keywords are reserved words that + Python uses for special purpose).Following are Keywords in python 3.

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      andexecnot
      asfinallyor
      assertforpass
      breakfromprint
      classglobalraise
      continueifreturn
      defimporttry
      delinwhile
      elifiswith
      elselambdayield
      except
      +
    8. +
    +

    Assigning Values to Variables

    +

    Values are basic things that programs works with. For e.g 1 , 11 , 3.14 , "hello" are all values. In programming terminology they are also commonly known as literals. Literals can be of different type for e.g 1 , 11 are of type int , 3.14 is float and "hello" is string . Remember in python everything is object even basic data types like int, float, string, we will elaborate more on this in later chapters.

    +

    In python you don’t need to declare types of variable ahead of time. Interpreter automatically detects the type of the variable by the data it contains. To assign value to a variable equal sign ( = ) is used. = is also known as assignment operator.

    +

    Following are some examples of variable declaration:

    +
    x = 100                       # x is integer
    +pi = 3.14                     # pi is float
    +empname = "python is great"   # empname is string
    +
    +a = b = c = 100 # this statement assign 100 to c, b and a.
    +
    + + +
    +

    Note: +In the above code x stores reference to the 100 ( which is an int object ) , x don’t store 100 itself.

    +
    +

    In Python comments are preceded by a pound sign ( # ). Comments are not programming statements that python interpreter executes while running the program. Comments are used by programmers to remind themselves how the program works. They are also used to write program documentation.

    +
    #display hello world
    +print("hello world")
    +
    + + +

    Simultaneous Assignments

    +

    Python allow simultaneous assignment syntax like this:

    +
    var1, var2, ..., varn = exp1, exp2, ..., expn
    +
    + + +

    this statements tells the python to evaluate all the expression on the right and assign them to the corresponding variables on the left. Simultaneous Assignments is helpful to swap values of two variables. For e.g

    +
    >>> x = 1
    +>>> y = 2
    +
    +>>> y, x = x, y # assign y value to x and x value to y
    +
    + + +

    Python Data Types

    +

    Python has 5 standard data types namely. +a) Numbers +b) String +c) List +d) Tuple +e) Dictionary +f) Boolean – In Python True and False are boolean literals. But the following values are also considered as false.

    +

    [] – empty list , () – empty tuple , {} – empty dictionary

    +

    Receiving input from Console

    +

    input() function is used to receive input from the console.

    +

    Syntax: input([prompt]) -> string

    +

    input() function accepts an optional string argument called prompt and returns a string.

    +
    >>> name = input("Enter your name: ")
    +>>> Enter your name: tim
    +>>> name
    +'tim'
    +
    + + +

    Note that input() returns string even if you enter a number, to convert it to an integer you can use int() or eval() .

    +
    >> age = int(input("Enter your age: "))
    +Enter your age: 22
    +>>> age
    +22
    +>>> type(age)
    +<class 'int'>
    +
    + + +
    +

    Source:
    + http://thepythonguru.com

    +
    +

    Understanding Python variables and Memory Management

    +

    Have you ever noticed any difference between variables in Python and C? For example, when you do an assignment like the following in C, it actually creates a block of memory space so that it can hold the value for that variable

    +
    int a = 1;
    +
    + + +

    You can think of it as putting the value assigned in a box with the variable name as shown below. +a1box.

    +

    And for all the variables you create a new box is created with the variable name to hold the value. If you change the value of the variable the box will be updated with the new value. That means doing

    +
    a = 2;
    +
    + + +

    will result in

    +

    a2box.

    +

    Assigning one variable to another makes a copy of the value and put that value in the new box.

    +
    int b = a;
    +
    + + +

    b2box. a2box.

    +

    But in Python variables work more like tags unlike the boxes you have seen before. When you do an assignment in Python, it tags the value with the variable name.

    +
    a = 1
    +
    + + +

    a1tag.

    +

    and if you change the value of the varaible, it just changes the tag to the new value in memory. You dont need to do the housekeeping job of freeing the memory here. Python's Automatic Garbage Collection does it for you. When a value is without names/tags it is automatically removed from memory.

    +
    a = 2
    +
    + + +

    a2tag.

    +

    Assigning one variable to another makes a new tag bound to the same value as show below.

    +
    b = a
    +
    + + +

    ab2tag. +Other languages have 'variables'. Python has 'names'.

    +

    A bit about Python's memory management

    +

    As you have seen before, a value will have only one copy in memory and all the variables having this value will refer to this memory location. For example when you have variables a, b, c having a value 10, it doesn't mean that there will be 3 copy of 10s in memory. There will be only one 10 and all the variables a, b, c will point to this value. Once a variable is updated, say you are doing a += 1 a new value 11 will be allocated in memory and a will be pointing to this.

    +

    Let's check this behaviour with Python Interpreter. Start the Python Shell and try the following for yourselves.

    +
    >>> a = 10
    +>>> b = 10
    +>>> c = 10
    +>>> id(a), id(b), id(c)
    +(140621897573616, 140621897573616, 140621897573616)
    +>>> a += 1
    +>>> id(a)
    +140621897573592
    +
    + + +

    id() will return an objects memory address (object's identity). As you have noticed, when you assign the same integer value to the variables, we see the same ids. But this assumption does not hold true all the time. See the following for example

    +
    >>> x = 500
    +>>> y = 500
    +>>> id(x)
    +4338740848
    +>>> id(y)
    +4338741040
    +
    + + +

    What happened here? Even after assigning the same integer values to different variable names, we are getting two different ids here. These are actually the effects of CPython optimization we are observing here. CPython implementation keeps an array of integer objects for all integers between -5 and 256. So when we create an integer in that range, they simply back reference to the existing object. You may refer the following links for more information.

    +

    Let's take a look at strings now.

    +
    >>> s1 = 'hello'
    +>>> s2 = 'hello'
    +>>> id(s1), id(s2)
    +(4454725888, 4454725888)
    +>>> s1 == s2
    +True
    +>>> s1 is s2
    +True
    +>>> s3 = 'hello, world!'
    +>>> s4 = 'hello, world!'
    +>>> id(s3), id(s4)
    +(4454721608, 4454721664)
    +>>> s3 == s4
    +True
    +>>> s3 is s4
    +False
    +
    + + +

    Looks interesting, isn't it? When the string was a simple and shorter one the variable names where referring to the same object in memory. But when they became bigger, this was not the case. This is called interning, and Python does interning (to some extent) of shorter string literals (as in s1 and s2) which are created at compile time. But in general, Python string literals creates a new string object each time (as in s3 and s4). Interning is runtime dependant and is always a trade-off between memory use and the cost of checking if you are creating the same string. There's a built-in intern() function to forcefully apply interning. Read more about interning from the following links.

    +

    Stack Overflow: Does Python intern Strings? +Stack Overflow: Python String Interning +Internals of Python String Interning

    +
    +

    Source:
    + http://foobarnbaz.com/2012/07/08/understanding-python-variables/

    +
    +

    Assignment statements in Python are more interesting than you might think

    +

    In this article, we will take a deep look at three kinds of assignment statements in Python and discuss what’s going on under the hood.

    +
    >>> my_string = "Hello World"                # right hand side is a simple expression
    +>>> another_string = my_string               # right hand side is another variable
    +>>> another_string = another_string + "!"    # right hand side is an operation
    +
    + + +

    What we find may surprise you.

    +

    What happens when the right hand side is a simple expression?

    +
    >>> my_string = "Hello World"
    +
    + + +

    In simple terms, this creates a string “Hello World” in memory and assigns the name my_string to it. If you are using CPython[1], then we can even check the memory address explicitly by using the built in function id .

    +
    >>> my_string = Hello World 
    +>>> id(my_string)
    +140400709562064
    +
    + + +

    That big number 140400709562064 denotes where the data lives in the memory. It will be very useful for us in this entire discussion. +What happens if we create another string with the same value?

    +
    >>> another_string = Hello World
    +
    + + +

    Does it reuse the previous “Hello World” stored in memory or does it create an independent copy? Let’s check this by querying the id function again.

    +
    >>> id(another_string)
    +140400709562208
    +
    + + +

    This outputs a different id, so this must be an independent copy. We conclude that:

    +
    +

    Note: +Assignment statements where the right hand side is a simple expression creates independent copies every time.

    +
    +

    While for everyday programming, this is the rule we should remember, there are actually some weird exceptions to this rule. Here’s an example.

    +
    >>> my_string = hello
    +>>> id(my_string)
    +140400709562016
    +>>> another_string = hello
    +>>> id(another_string)
    +140400709562016
    +
    + + +

    In this case, two consecutive assignment statements did not create independent copies. Why? +It gets interesting now. +For optimizing memory, Python treats a special set of objects differently. The string “hello” belongs to this privileged set and has a different behavior. The exact set depends on the implementation like CPython, PyPy, Jython or IronPython. For CPython, the special rule applies to:

    +
      +
    • Strings without whitespaces and less than 20 characters and
    • +
    • Integers from -5 to +255.
    • +
    +

    These objects are always reused or interned. The rationale behind doing this is as follows:

    +
      +
    1. Since programmers use these objects frequently, interning existing + objects saves memory.
    2. +
    3. Since immutable objects like tuples and strings cannot be modified, + there is no risk in interning the same object.
    4. +
    +

    However, Python does not do this for all immutable objects because there is a runtime cost involved for this feature. For interning an object, it must first search for the object in memory, and searching takes time. This is why the special treatment only applies for small integers and strings, because finding them is not that costly.

    +

    What happens when the right hand side is an existing Python variable? +Let’s move on to the second type of assignment statement where the right hand side is an existing Python variable.

    +
    >>> another_string = my_string
    +
    + + +

    In this case, nothing is created in memory. After the assignment, both variables refer to the already existing object. It’s basically like giving the object an additional nickname or alias. Let’s confirm this by using the id function.

    +
    >>> my_string = Hello World
    +>>> id(my_string)
    +140400709562160
    +>>> another_string = my_string
    +>>> id(another_string)
    +140400709562160
    +
    + + +

    The natural question at this stage is : what if, instead of just giving the existing object an alias, we wanted to create an independent copy? +For mutable objects, this is possible. You can either use the copy module of Python (which works on all objects) or you may use copy methods specific to the class. For a list, you have several possibilities for creating copies, all of which have different runtime.

    +
    >>> my_list = [1, 2, 3]
    +>>> copy_of_my_list = my_list.copy()       # fastest, works only on latest Python versions
    +>>> copy_of_my_list = my_list[:]           # same runtime as List.copy()
    +>>> copy_of_my_list = list(my_list)        # slightly slower
    +>>> import copy
    +>>> copy_of_my_list = copy.copy(my_list)   # slowest
    +
    + + +

    How can you copy an immutable object? Well…you can’t! At least not in a straightforward way. If you try to use the copy module or the slicing notation, you will get back the same object and not an independent copy. Here’s proof.

    +
    # Standard ways of copying lists do not apply for tuples
    +
    +>>> my_tuple = (1, 2, 3)
    +>>> id(my_tuple)
    +140371873244816
    +>>> another_tuple = my_tuple[:]
    +>>> id(another_tuple)
    +140371873244816
    +
    +# The copy module also doesn’t help
    +
    +>>> import copy 
    +>>> another_tuple = copy.copy(my_tuple)
    +>>> id(another_tuple)
    +140371873244816
    +
    + + +

    More importantly, there is no reason for explicitly copying an immutable object anyway. We will see why in a moment when we discuss the third kind of assignment statement. +What happpens when the right hand side is an operation?

    +

    In this case, what happens depends on the result of the operation. We will discuss two simple cases:

    +
      +
    1. adding an element to an immutable object (like a tuple) and
    2. +
    3. adding an element to a mutable object (like a list).
    4. +
    +

    Let’s start with the case of the tuple.

    +
    >>> another_tuple +=  (4,)
    +
    + + +

    When you add a new element to a tuple using another_tuple += (4,), this creates a new object in memory. The immutability of tuples is key to understanding this. Since tuples are immutable, any operation that leads to a changed tuple would result in an independent copy. +This is the reason why you don’t need to explicitly copy immutable objects : it happens automatically under the hood. Here’s an example.

    +
    >>> my_tuple = (1, 2, 3)
    +>>> another_tuple = my_tuple     # both variables point to the same object
    +>>> another_tuple += (4,)        # this statement creates a new independent object
    +>>> print(another_tuple) 
    +(1, 2, 3, 4)
    +>>> print(my_tuple)              # the old one remains unharmed
    +(1, 2, 3)
    +
    + + +

    The situation is much different for mutable objects and much more confusing. Let’s try the same example, but now for lists.

    +
    >>> my_list = [1, 2, 3]
    +>>> another_list = my_list     # both variables point to the same object
    +>>> another_list += [4,]       # this statement modifies the object in place
    +>>> print(another_list)
    +[1, 2, 3, 4]
    +>>> print(my_list)             # the original list is modified
    +[1, 2, 3, 4]
    +
    + + +

    Mutable objects can be modified in place. Some operations modify the list in place and some operations don’t. In this case, the statement another_list += [4,] calls another_list.iadd([4,]) and iadd modifies the existing object in place. +To make things doubly confusing, we would have completely different results if we used a slightly different notation.

    +
    >>> my_list = [1, 2, 3]
    +>>> another_list = my_list              # both variables point to the same object
    +>>> another_list = another_list + [4,]  # this creates an independent copy
    +>>> print(another_list)
    +[1, 2, 3, 4]
    +>>> print(my_list)                      # the original list is unharmed
    +[1, 2, 3]  
    +
    + + +

    Woah! What’s going on? What changed? +It turns out that when we change the third line, Python now internally calls a different function another_list.add([4,]) instead of iadd. This function returns a new copy instead of modifying the list in place. +To prevent this confusion, it is always better to create a true copy of the list if you wish to prevent modification to the original. +Let’s remember the list copy methods from before. They were List.copy(), [:], list() and copy.copy(). This is what we should use.

    +
    >>> my_list = [1, 2, 3]
    +>>> another_list = my_list.copy()   # this creates an independent copy
    +>>> another_list += [4,]            # this statement modifies the independent copy
    +>>> print(another_list)
    +[1, 2, 3, 4]
    +>>> print(my_list)                  # the original list is unharmed
    +[1, 2, 3]   
    +
    + + +

    There’s one last gotcha that can happen when copying lists. +Suppose we have a list that has a nested list inside it. We copy this list using List.copy() and then modify the nested list. Unfortunately, this will modify the original list again!

    +
    >>> my_list = [[1, 2, 3], 4, 5]
    +>>> another_list = my_list.copy()
    +>>> another_list[0] += [6,]
    +>>> print(another_list)
    +[[1, 2, 3, 6], 4, 5]
    +>>> print(my_list)
    +[[1, 2, 3, 6], 4, 5] 
    +
    + + +

    Why did that happen? Didn’t we just copy the original list? +The truth is : we actually don’t have a completely independent copy in this case. The copy() function generates a shallow copy. To see what it does, let’s look at the ids of all the elements in my_list and the ids of all the elements in the copied list.

    +
    # for my_list
    +
    +>>> my_list = [[1, 2, 3], 4, 5]
    +>>> id(my_list)
    +140371873277424
    +>>> print([id(x) for x in my_list])
    +[140371873599288, 13820176, 13820152]
    +
    +# for another_list obtained by my_list.copy()
    +
    +>>> id(another_list)
    +140371873317016
    +>>> print([id(x) for x in another_list])
    +[140371873599288, 13820176, 13820152]
    +
    + + +

    We see the ids of my_list and another_list are indeed different, indicating another_list is a copy. But the ids of the elements contained in another_list have the same ids as the elements in my_list . So the elements have not been copied! +This is the property of shallow copy. It creates a new copy of the object but reuses the attributes and elements of the old copy. Thus, when you modify the elements of the new copy, you are modifying the elements of the old copy too. +To solve this problem, we need to copy an object along with all its attributes and elements. This can be achieved by copy.deepcopy.

    +
    >>> my_list = [[1, 2, 3], 4, 5]
    +>>> another_list = copy.deepcopy(my_list)
    +>>> another_list[0] += [6,]
    +>>> another_list
    +[[1, 2, 3, 6], 4, 5]
    +>>> my_list
    +[[1, 2, 3], 4, 5]
    +
    + + +

    Deep copy is a quite time intensive operation and can take 1o times longer to complete compared to a shallow copy. But in some situations, it is unavoidable.

    +

    Conclusion

    +

    This brings me to the end of this discussion. To summarize, we have talked about the different scenarios which can arise in an assignment statement in Python. We found that:

    +
      +
    • When the right hand side is a simple expression, a new copy is + created every time. There are some exceptions to this rule, which + depend on the implementation
    • +
    • When the right hand side is an existing Python variable, then an + alias is created for the existing copy.
    • +
    • When the right hand side is an operation, then the outcome depends on + the operation. In a simple case involving a tuple, we saw that an + independent copy was created. In the same case with lists, we saw + that the list was modified in place in one case (when we used + iadd) and a new copy was generated in another case (when we used add).
    • +
    • List item
    • +
    • Mutable objects can be copied but immutable objects cannot be copied + in a straightforward way. There is also no need to copy immutable + objects.
    • +
    • To copy a mutable object along with all its attributes and elements, + we need to use deep copy.
    • +
    +
    +

    Source:
    + https://medium.com/broken-window/many-names-one-memory-address-122f78734cb6

    +
    + + + + + + + +
    +
    +
    +
    + + + + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/site/beginner/Python_Installation/index.html b/site/beginner/Python_Installation/index.html index 2a3e73d..d5193ce 100644 --- a/site/beginner/Python_Installation/index.html +++ b/site/beginner/Python_Installation/index.html @@ -314,6 +314,18 @@ + + + + + +
  • + + Datatype And Variables + +
  • + + diff --git a/site/beginner/Python_Programming_Lanuage/index.html b/site/beginner/Python_Programming_Lanuage/index.html index d75c1f2..dd9048b 100644 --- a/site/beginner/Python_Programming_Lanuage/index.html +++ b/site/beginner/Python_Programming_Lanuage/index.html @@ -379,6 +379,18 @@ + + + + + +
  • + + Datatype And Variables + +
  • + + diff --git a/site/beginner/Start_Coding_With_Python/index.html b/site/beginner/Start_Coding_With_Python/index.html index 81628d2..a216a08 100644 --- a/site/beginner/Start_Coding_With_Python/index.html +++ b/site/beginner/Start_Coding_With_Python/index.html @@ -409,6 +409,18 @@ + + + + + +
  • + + Datatype And Variables + +
  • + + @@ -636,37 +648,43 @@

    Run a Python Script as a File

    Generally programmers write stand alone scripts, that are independent to live environments. Then they save it with a ".py" extension, which indicates to the operating system and programmer that the file is actually a Python program. After the interpreter is invoked, it reads and interprets the file. The way Python scripts are run on Windows versus Unix based operating systems is very different. We'll show you the difference, and how to run a Python script on Windows and Unix platforms.

    Run a Python script under Windows with the Command Prompt

    Windows users must pass the path of the program as an argument to the Python interpreter. Such as follows:

    -
    C:\Python27\python.exe C:\Users\Username\Desktop\my_python_script.py
    -
    +
    C:\Python27\python.exe C:\Users\Username\Desktop\my_python_script.py
    +
    +

    Note that you must use the full path of the Python interpreter. If you want to simply type python.exe C:\Users\Username\Desktop\my_python_script.py you must add python.exe to your PATH environmental variable. Note that Windows comes with two Python executables - python.exe and pythonw.exe. If you want a terminal to pop-up when you run your script, use python.exe However if you don't want any terminal pop-up, use pythonw.exe. pythonw.exe is typically used for GUI programs, where you only want to display your program, not the terminal.

    Run a Python Script Under Mac, Linux, BSD, Unix, etc

    On platforms like Mac, BSD or Linux (Unix) you can put a "shebang" line as first line of the program which indicates the location of the Python interpreter on the hard drive. It's in the following format:

    -
    #!/path/to/interpreter
    -
    +
    #!/path/to/interpreter
    +
    +

    A common shebang line used for the Python interpreter is as follows:

    -
    #!/usr/bin/env python
    -
    +
    #!/usr/bin/env python
    +
    +

    You must then make the script executable, using the following command:

    -
    chmod +x my_python_script.py
    -
    +
    chmod +x my_python_script.py
    +
    +

    Unlike Windows, the Python interpreter is typically already in the $PATH environmental variable, so adding it is un-necessary.

    You can then run a program by invoking the Python interpreter manually as follows:

    -
    python firstprogram.py
    -
    +
    python firstprogram.py
    +
    +

    Python Execution with the Shell (Live Interpreter)

    Assuming that you already have Python installed and running well (if you're getting an error, see this post), open the terminal or console and type 'python' and hit the 'Enter' key. You will then be directed immediately to the Python live interpreter. Your screen will display a message something like:

    -
    user@hostname:~ python
    -Python 3.3.0 (default, Nov 23 2012, 10:26:01) 
    -[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
    -Type "help", "copyright", "credits" or "license" for more information.
    +
    user@hostname:~ python
    +Python 3.3.0 (default, Nov 23 2012, 10:26:01) 
    +[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
    +Type "help", "copyright", "credits" or "license" for more information.
     >>>
    -
    +
    +

    The Python programmer should keep in mind one thing: that while working with the live interpreter, everything is read and interpreted in real-time. For example loops iterate immediately, unless they are part of function. So it requires some mental planning. Using the Python shell is typically used to execute code interactively. If you want to run a Python script from the interpreter, you must either import it or call the Python executable.

    @@ -675,14 +693,15 @@

    Python Execution with

    A Good First Program

    Type the following text into a single file named ex1.py. Python works best with files ending in .py.

    -
    print "Hello World!"
    -print "Hello Again"
    -print "I like typing this."
    -print "This is fun."
    -print 'Yay! Printing.'
    -print "I'd much rather you 'not'."
    -print 'I "said" do not touch this.'
    -
    +
    print "Hello World!"
    +print "Hello Again"
    +print "I like typing this."
    +print "This is fun."
    +print 'Yay! Printing.'
    +print "I'd much rather you 'not'."
    +print 'I "said" do not touch this.'
    +
    +

    Your Atom text editor should look something like this on all platforms:

    ex1.py.

    @@ -693,8 +712,9 @@

    A Good First Program

  • I have the print at the beginning of the line and it looks exactly the same as what I have in ex1.py. Exactly means exactly, not kind of sort of the same. Every single character has to match for it to work. Color doesn't matter, only the characters you type.
  • In Terminal run the file by typing:

    -
    python ex1.py
    -
    +
    python ex1.py
    +
    +

    If you did it right then you should see the same output as I in the What You Should See section of this exercise. If not, you have done something wrong. No, the computer is not wrong.

    What You Should See

    @@ -706,12 +726,13 @@

    What You Should See

    If you have an error it will look like this:

    -
    $ python ex/ex1.py
    -  File "ex/ex1.py", line 3
    -    print "I like typing this.
    -                             ^
    -SyntaxError: EOL while scanning string literal
    -
    +
    $ python ex/ex1.py
    +  File "ex/ex1.py", line 3
    +    print "I like typing this.
    +                             ^
    +SyntaxError: EOL while scanning string literal
    +
    +

    It's important that you can read these error messages because you will be making many of these mistakes. Even I make many of these mistakes. Let's look at this line by line.

      @@ -868,13 +889,13 @@

      Reserved Words

      -
    1. + Datatype And Variables + +
    2. \ No newline at end of file diff --git a/docs/beginner/Datatype_And_Variables.md b/docs/beginner/Datatype_And_Variables.md index 510a1f4..efddd14 100644 --- a/docs/beginner/Datatype_And_Variables.md +++ b/docs/beginner/Datatype_And_Variables.md @@ -66,12 +66,12 @@ this statements tells the python to evaluate all the expression on the right and ``` ## Python Data Types -Python has 5 standard data types namely. -a) [Numbers](http://thepythonguru.com/python-numbers/) -b) [String](http://thepythonguru.com/python-strings/) -c) [List](http://thepythonguru.com/python-lists/) -d) [Tuple](http://thepythonguru.com/python-tuples/) -e) [Dictionary](http://thepythonguru.com/python-dictionaries/) +Python has 5 standard data types namely. +a) [Numbers](http://thepythonguru.com/python-numbers/) +b) [String](http://thepythonguru.com/python-strings/) +c) [List](http://thepythonguru.com/python-lists/) +d) [Tuple](http://thepythonguru.com/python-tuples/) +e) [Dictionary](http://thepythonguru.com/python-dictionaries/) f) Boolean – In Python True and False are boolean literals. But the following values are also considered as false. **[] – empty list , () – empty tuple , {} – empty dictionary** diff --git a/mkdocs.yml b/mkdocs.yml index f68d1ae..2545650 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -16,6 +16,7 @@ pages: - The Python Programming Language, Implementation and Adventages : beginner/Python_Programming_Lanuage.md - Python Installation : beginner/Python_Installation.md - Start Coding With Python : beginner/Start_Coding_With_Python.md + - Data Types in Python 3 : beginner/Data_Types_In_Python_3.md - Datatype And Variables : beginner/Datatype_And_Variables.md - Advanced: - Python Metaclasses : advanced/Python_Metaclasses.md From e45bb7afb8fae7666c845c156bee89e902556d6e Mon Sep 17 00:00:00 2001 From: ent1c3d Date: Sat, 26 Aug 2017 19:42:23 +0400 Subject: [PATCH 21/39] dive into python - chapter 2 as pdf --- docs/beginner/Data_Types_In_Python_3.md | 9 ++++++++- files/dive into python 3 - datatypes.pdf | Bin 0 -> 246412 bytes 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 files/dive into python 3 - datatypes.pdf diff --git a/docs/beginner/Data_Types_In_Python_3.md b/docs/beginner/Data_Types_In_Python_3.md index 622b3d7..4eefef2 100644 --- a/docs/beginner/Data_Types_In_Python_3.md +++ b/docs/beginner/Data_Types_In_Python_3.md @@ -232,4 +232,11 @@ You can learn about each of the data types above in more detail by reading the f Once you have a solid grasp of data types available to you in Python, you can learn how to [convert data types](https://www.digitalocean.com/community/tutorials/how-to-convert-data-types-in-python-3). - \ No newline at end of file +> **Source:** +> :fa-link: https://www.digitalocean.com/community/tutorials/understanding-data-types-in-python-3 + + +---------------- + +

      გურამ დოჩანაშვილი - სამოსელი პირველი

      გურამ დოჩანაშვილი - სამოსელი პირველი - Free ebook download as PDF File (.pdf), Text File (.txt) or read book online for free.

      + \ No newline at end of file diff --git a/files/dive into python 3 - datatypes.pdf b/files/dive into python 3 - datatypes.pdf new file mode 100644 index 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(;bFM#1gLHN(_dIrqj9-RV1Lh&B|u6B4Bq3!`1evcf&!}i#E zApS;ZGr*82pr{G^0OENM41q%v(gxssLcImvha%)H07DYW7XZT%(lZ{mhn|r@j1%x6 z42ebTp-I3Vd*&I>GK6@bfD#~l9}0*e0vdt=*dE$IA%T@nFjpufl2A^0$sQQq*WTR@L`V0uL*fYSCKwvKhmY_uLjDB= z3Amb|4*=UUrx+v#qzLUE3xMtQHGnU)ryWo|gmjMq{6WC`fCZswLS6+hLi-tph2se2 z1`N18d)5uW_V`R#5bNF32MUC(2ynw<_WDP_L)=3z;A+A>{o|H+faL+MI-mDIS!2^)S-Y1aD;jqhQp!u@GpQ7 z&L0@_9{B=bz?IrPJ^(`y@)0l&poIA1T_!?15f3BuNr0b+CX`or7(V#_>%0Kp53^_P z0gMngU~vJFPw*^I-Z+AJ28iMI_-_EVM_&S=O}Iwjf@=I(!QJD-Ge6;60SKWT20Yz8 ze2ItcnLiLxCDaQ*`t6Z*c!@|zyLib-D09G_ANXyp-D3tYLiq=LSR|oN!Nc~f5ilnS z`3R0TX$WW+(BvL^1}F9KsUN$?f&c~);rt;$ Date: Sat, 26 Aug 2017 20:40:59 +0400 Subject: [PATCH 22/39] python data types --- README.md | 1 + docs/beginner/Data_Types_In_Python_3.md | 192 ++- docs/index.md | 1 + site/404.html | 12 + site/About/index.html | 12 + site/advanced/Python_Metaclasses/index.html | 12 + .../Data_Types_In_Python_3/index.html | 1218 +++++++++++++++++ .../Datatype_And_Variables/index.html | 28 +- site/beginner/Python_Installation/index.html | 12 + .../Python_Programming_Lanuage/index.html | 12 + .../Start_Coding_With_Python/index.html | 16 +- site/index.html | 13 + site/mkdocs/search_index.json | 531 ++++--- site/sitemap.xml | 20 +- 14 files changed, 1848 insertions(+), 232 deletions(-) create mode 100644 site/beginner/Data_Types_In_Python_3/index.html diff --git a/README.md b/README.md index 602d098..412de79 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ So, You can start study from here: - [The Python Programming Language, Implementation and Adventages](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Python_Programming_Lanuage) - [Python Installation](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Python_Installation) - [Start Coding With Python](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Start_Coding_With_Python) + - [Data Types In Python 3](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Data_Types_In_Python_3) - [Datatype And Variables](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Datatype_And_Variables) - ... - Intermediate diff --git a/docs/beginner/Data_Types_In_Python_3.md b/docs/beginner/Data_Types_In_Python_3.md index 4eefef2..77d5c50 100644 --- a/docs/beginner/Data_Types_In_Python_3.md +++ b/docs/beginner/Data_Types_In_Python_3.md @@ -238,5 +238,193 @@ Once you have a solid grasp of data types available to you in Python, you can le ---------------- -

      გურამ დოჩანაშვილი - სამოსელი პირველი

      გურამ დოჩანაშვილი - სამოსელი პირველი - Free ebook download as PDF File (.pdf), Text File (.txt) or read book online for free.

      - \ No newline at end of file +## Native Datatypes By Dive Into Python 3 + + + +> **Source:** +> :fa-book: **Dive into Python 3** by Mark Pilgrim + + +## Standard Data Types By Tutorialspoint + +The data stored in memory can be of many types. For example, a person's age is stored as a numeric value and his or her address is stored as alphanumeric characters. Python has various standard data types that are used to define the operations possible on them and the storage method for each of them. + +Python has five standard data types : + +- Numbers + +- String + +- List + +- Tuple + +- Dictionary + +## Python Numbers +Number data types store numeric values. Number objects are created when you assign a value to them. For example − +```python +var1 = 1 +var2 = 10 +``` +You can also delete the reference to a number object by using the del statement. The syntax of the del statement is − + +```python +del var1[,var2[,var3[....,varN]]]] +``` +You can delete a single object or multiple objects by using the del statement. + +For example − +```python +del var +del var_a, var_b +``` + +Python supports three different numerical types − +- int (signed integers) + +- float (floating point real values) + +- complex (complex numbers) + +All integers in Python3 are represented as long integers. Hence, there is no separate number type as long. + +int | float | complex +------|------|------ +**10** | **0.0**| **3.14j** +**100**| **15.20**| **45.j** +**-786**| **-21.9** | **9.322e-36j** + +A complex number consists of an ordered pair of real floating-point numbers denoted by x + yj, where x and y are real numbers and j is the imaginary unit. + +### Python Strings +Strings in Python are identified as a contiguous set of characters represented in the quotation marks. Python allows either pair of single or double quotes. Subsets of strings can be taken using the slice operator ([ ] and [:] ) with indexes starting at 0 in the beginning of the string and working their way from -1 to the end. + +The plus (+) sign is the string concatenation operator and the asterisk (*) is the repetition operator. For example − +```python +#!/usr/bin/python3 + +str = 'Hello World!' + +print (str) # Prints complete string +print (str[0]) # Prints first character of the string +print (str[2:5]) # Prints characters starting from 3rd to 5th +print (str[2:]) # Prints string starting from 3rd character +print (str * 2) # Prints string two times +print (str + "TEST") # Prints concatenated string +``` + +This will produce the following result − + +```python +Hello World! +H +llo +llo World! +Hello World!Hello World! +Hello World!TEST +``` +### Python Lists +Lists are the most versatile of Python's compound data types. A list contains items separated by commas and enclosed within square brackets ([]). To some extent, lists are similar to arrays in C. One of the differences between them is that all the items belonging to a list can be of different data type. + +The values stored in a list can be accessed using the slice operator ([ ] and [:]) with indexes starting at 0 in the beginning of the list and working their way to end -1. The plus (+) sign is the list concatenation operator, and the asterisk (*) is the repetition operator. For example − +```python +#!/usr/bin/python3 + +list = [ 'abcd', 786 , 2.23, 'john', 70.2 ] +tinylist = [123, 'john'] + +print (list) # Prints complete list +print (list[0]) # Prints first element of the list +print (list[1:3]) # Prints elements starting from 2nd till 3rd +print (list[2:]) # Prints elements starting from 3rd element +print (tinylist * 2) # Prints list two times +print (list + tinylist) # Prints concatenated lists +``` +This produces the following result − +```python +['abcd', 786, 2.23, 'john', 70.200000000000003] +abcd +[786, 2.23] +[2.23, 'john', 70.200000000000003] +[123, 'john', 123, 'john'] +['abcd', 786, 2.23, 'john', 70.200000000000003, 123, 'john'] +``` + +### Python Tuples +A tuple is another sequence data type that is similar to the list. A tuple consists of a number of values separated by commas. Unlike lists, however, tuples are enclosed within parenthesis. + +The main difference between lists and tuples are − Lists are enclosed in brackets ( [ ] ) and their elements and size can be changed, while tuples are enclosed in parentheses ( ( ) ) and cannot be updated. Tuples can be thought of as read-only lists. For example − + +```python +#!/usr/bin/python3 + +tuple = ( 'abcd', 786 , 2.23, 'john', 70.2 ) +tinytuple = (123, 'john') + +print (tuple) # Prints complete tuple +print (tuple[0]) # Prints first element of the tuple +print (tuple[1:3]) # Prints elements starting from 2nd till 3rd +print (tuple[2:]) # Prints elements starting from 3rd element +print (tinytuple * 2) # Prints tuple two times +print (tuple + tinytuple) # Prints concatenated tuple +``` + +This produces the following result − + +```python +('abcd', 786, 2.23, 'john', 70.200000000000003) +abcd +(786, 2.23) +(2.23, 'john', 70.200000000000003) +(123, 'john', 123, 'john') +('abcd', 786, 2.23, 'john', 70.200000000000003, 123, 'john') +``` +The following code is invalid with tuple, because we attempted to update a tuple, which is not allowed. Similar case is possible with lists − + +```python +#!/usr/bin/python3 + +tuple = ( 'abcd', 786 , 2.23, 'john', 70.2 ) +list = [ 'abcd', 786 , 2.23, 'john', 70.2 ] +tuple[2] = 1000 # Invalid syntax with tuple +list[2] = 1000 # Valid syntax with list +``` + + +### Python Dictionary + +Python's dictionaries are kind of hash-table type. They work like associative arrays or hashes found in Perl and consist of key-value pairs. A dictionary key can be almost any Python type, but are usually numbers or strings. Values, on the other hand, can be any arbitrary Python object. + +Dictionaries are enclosed by curly braces ({ }) and values can be assigned and accessed using square braces ([]). For example − +```python +#!/usr/bin/python3 + +dict = {} +dict['one'] = "This is one" +dict[2] = "This is two" + +tinydict = {'name': 'john','code':6734, 'dept': 'sales'} + + +print (dict['one']) # Prints value for 'one' key +print (dict[2]) # Prints value for 2 key +print (tinydict) # Prints complete dictionary +print (tinydict.keys()) # Prints all the keys +print (tinydict.values()) # Prints all the values +``` + +This produces the following result − +```python +This is one +This is two +{'name': 'john', 'dept': 'sales', 'code': 6734} +dict_keys(['name', 'dept', 'code']) +dict_values(['john', 'sales', 6734]) +``` +Dictionaries have no concept of order among the elements. It is incorrect to say that the elements are "out of order"; they are simply unordered. + + +> **Source:** +> :fa-link: https://www.tutorialspoint.com/python3/python_variable_types.htm \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index a42c9ca..786591d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -15,6 +15,7 @@ Of course, it needs plenty of time to organize best resources based on the topic - [The Python Programming Language, Implementation and Adventages](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Python_Programming_Lanuage) - [Python Installation](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Python_Installation) - [Start Coding With Python](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Start_Coding_With_Python) + - [Data Types In Python 3](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Data_Types_In_Python_3) - [Datatype And Variables](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Datatype_And_Variables) - ... - Intermediate diff --git a/site/404.html b/site/404.html index ed0b2d1..2dabd80 100644 --- a/site/404.html +++ b/site/404.html @@ -252,6 +252,18 @@ +
    3. + + Data Types in Python 3 + +
    4. + + + + + + +
    5. Datatype And Variables diff --git a/site/About/index.html b/site/About/index.html index b5427b0..b682238 100644 --- a/site/About/index.html +++ b/site/About/index.html @@ -254,6 +254,18 @@ +
    6. + + Data Types in Python 3 + +
    7. + + + + + + +
    8. Datatype And Variables diff --git a/site/advanced/Python_Metaclasses/index.html b/site/advanced/Python_Metaclasses/index.html index 8651666..33b926e 100644 --- a/site/advanced/Python_Metaclasses/index.html +++ b/site/advanced/Python_Metaclasses/index.html @@ -258,6 +258,18 @@ +
    9. + + Data Types in Python 3 + +
    10. + + + + + + +
    11. Datatype And Variables diff --git a/site/beginner/Data_Types_In_Python_3/index.html b/site/beginner/Data_Types_In_Python_3/index.html new file mode 100644 index 0000000..3879db0 --- /dev/null +++ b/site/beginner/Data_Types_In_Python_3/index.html @@ -0,0 +1,1218 @@ + + + + + + + + + + + + + + + + + + + + + + + Data Types in Python 3 - Python Synopsis + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
      + +
      + + +
      +
      + + +
      +
      +
      + +
      +
      +
      + + + + + +
      +
      + + + +

      Data Types in Python 3

      +

      Understanding Data Types in Python 3

      +

      Introduction

      +

      In Python, like in all programming languages, data types are used to classify one particular type of data. This is important because the specific data type you use will determine what values you can assign to it and what you can do to it (including what operations you can perform on it).

      +

      In this tutorial, we will go over the important data types native to Python. This is not an exhaustive investigation of data types, but will help you become familiar with what options you have available to you in Python.

      +

      Background

      +

      One way to think about data types is to consider the different types of data that we use in the real world. An example of data in the real world are numbers: we may use whole numbers (0, 1, 2, …), integers (…, -1, 0, 1, …), and irrational numbers (π), for example.

      +

      Usually, in math, we can combine numbers from different types, and get some kind of an answer. We may want to add 5 to π, for example:

      +

      5 + π

      +

      We can either keep the equation as the answer to account for the irrational number, or round π to a number with a brief number of decimal places, and then add the numbers together:

      +

      5 + π = 5 + 3.14 = 8.14

      +

      But, if we start to try to evaluate numbers with another data type, such as words, things start to make less sense. How would we solve for the following equation?

      +

      sky + 8

      +

      For computers, each data type can be thought of as being quite different, like words and numbers, so we will have to be careful about how we use them to assign values and how we manipulate them through operations.

      +

      Numbers

      +

      Any number you enter in Python will be interpreted as a number; you are not required to declare what kind of data type you are entering. Python will consider any number written without decimals as an integer (as in 138) and any number written with decimals as a float (as in 138.0).

      +

      Integers

      +

      Like in math, integers in computer programming are whole numbers that can be positive, negative, or 0 (…, -1, 0, 1, …). An integer can also be known as an int. As with other programming languages, you should not use commas in numbers of four digits or more, so when you write 1,000 in your program, write it as 1000.

      +

      We can print out an integer in a simple way like this:

      +
      print(-25)
      +
      +#Output : -25
      +
      + + +

      Or, we can declare a variable, which in this case is essentially a symbol of the number we are using or manipulating, like so:

      +
      my_int = -25
      +print(my_int)
      +
      +#Output : -25
      +
      + + +

      We can do math with integers in Python, too:

      +
      int_ans = 116 - 68
      +print(int_ans)
      +
      +#Output : 48
      +
      + + +

      Integers can be used in many ways within Python programs, and as you continue to learn more about the language you will have a lot of opportunities to work with integers and understand more about this data type.

      +

      Floating-Point Numbers

      +

      A floating-point number or a float is a real number, meaning that it can be either a rational or an irrational number. Because of this, floating-point numbers can be numbers that can contain a fractional part, such as 9.0 or -116.42. Simply speaking, for the purposes of thinking of a float in a Python program, it is a number that contains a decimal point.

      +

      Like we did with the integer, we can print out a floating-point number in a simple way like this:

      +
      print(17.3)
      +
      +#Output : 17.3
      +
      + + +

      We can also declare a variable that stands in for a float, like so:

      +
      my_flt = 17.3
      +print(my_flt)
      +
      +#Output : 17.3
      +
      + + +

      And, just like with integers, we can do math with floats in Python, too:

      +
      flt_ans = 564.0 + 365.24
      +print(flt_ans)
      +
      +#Output : 929.24
      +
      + + +

      With integers and floating-point numbers, it is important to keep in mind that 3 ≠ 3.0, as 3 refers to an integer while 3.0 refers to a float.

      +

      Booleans

      +

      The Boolean data type can be one of two values, either True or False. Booleans are used to represent the truth values that are associated with the logic branch of mathematics, which informs algorithms in computer science.

      +

      Whenever you see the data type Boolean, it will start with a capitalized B because it is named for the mathematician George Boole. The values True and False will also always be with a capital T and F respectively, as they are special values in Python.

      +

      Many operations in math give us answers that evaluate to either True or False:

      +
      *   **greater than**
      +    *   500 > 100 `True`
      +    *   1 > 5 `False`
      +*   **less than**
      +    *   200 < 400 `True`
      +    *   4 < 2 `False`
      +*   **equal**
      +    *   5 = 5 `True`
      +    *   500 = 400 `False`
      +
      + + +

      Like with numbers, we can store a Boolean value in a variable:

      +
      my_bool = 5 > 8
      +
      + + +

      We can then print the Boolean value with a call to the print() function:

      +
      print(my_bool)
      +
      + + +

      Since 5 is not greater than 8, we will receive the following #Output : :

      +
      #Output : False
      +
      + + +

      As you write more programs in Python, you will become more familiar with how Booleans work and how different functions and operations evaluating to either True or False can change the course of the program.

      +

      Strings

      +

      A string is a sequence of one or more characters (letters, numbers, symbols) that can be either a constant or a variable. Strings exist within either single quotes ' or double quotes " in Python, so to create a string, enclose a sequence of characters in quotes:

      +
      'This is a string in single quotes.'
      +
      +"This is a string in double quotes."
      +
      + + +

      You can choose to use either single quotes or double quotes, but whichever you decide on you should be consistent within a program.

      +

      The simple program “Hello, World!” demonstrates how a string can be used in computer programming, as the characters that make up the phrase Hello, World! are a string.

      +
      print("Hello, World!")
      +
      + + +

      As with other data types, we can store strings in variables:

      +
      hw = "Hello, World!"
      +
      + + +

      And print out the string by calling the variable:

      +
      print(hw)
      +
      +#Ouput : Hello, World!
      +
      + + +

      Like numbers, there are many operations that we can perform on strings within our programs in order to manipulate them to achieve the results we are seeking. Strings are important for communicating information to the user, and for the user to communicate information back to the program.

      +

      Lists

      +

      A list is a mutable, or changeable, ordered sequence of elements. Each element or value that is inside of a list is called an item. Just as strings are defined as characters between quotes, lists are defined by having values between square brackets [ ].

      +

      A list of integers looks like this:

      +
      [-3, -2, -1, 0, 1, 2, 3]
      +
      + + +

      A list of floats looks like this:

      +
      [3.14, 9.23, 111.11, 312.12, 1.05]
      +
      + + +

      A list of strings:

      +
      ['shark', 'cuttlefish', 'squid', 'mantis shrimp']
      +
      + + +

      If we define our string list as sea_creatures:

      +
      sea_creatures = ['shark', 'cuttlefish', 'squid', 'mantis shrimp']
      +
      + + +

      We can print them out by calling the variable:

      +
      print(sea_creatures)
      +
      + + +

      And we see that the #Output : looks exactly like the list that we created:

      +
      #Output : ['shark', 'cuttlefish', 'squid', 'mantis shrimp']
      +
      + + +

      Lists are a very flexible data type because they are mutable in that they can have values added, removed, and changed. There is a data type that is similar to lists but that can’t be changed, and that is called a tuple.

      +

      Tuples

      +

      A tuple is used for grouping data. It is an immutable, or unchangeable, ordered sequence of elements.

      +

      Tuples are very similar to lists, but they use parentheses ( ) instead of square brackets and because they are immutable their values cannot be modified.

      +

      A tuple looks like this:

      +
      ('blue coral', 'staghorn coral', 'pillar coral')
      +
      + + +

      We can store a tuple in a variable and print it out:

      +
      coral = ('blue coral', 'staghorn coral', 'pillar coral')
      +print(coral)
      +
      +Ouput('blue coral', 'staghorn coral', 'pillar coral')
      +
      + + +

      Like in the other data types, Python prints out the tuple just as we had typed it, with parentheses containing a sequence of values.

      +

      Dictionaries

      +

      The dictionary is Python’s built-in mapping type. This means that dictionaries map keys to values and these key-value pairs are a useful way to store data in Python. A dictionary is constructed with curly braces on either side { }.

      +

      Typically used to hold data that are related, such as the information contained in an ID, a dictionary looks like this:

      +
      {'name': 'Sammy', 'animal': 'shark', 'color': 'blue', 'location': 'ocean'}
      +
      + + +

      You will notice that in addition to the curly braces, there are also colons throughout the dictionary. The words to the left of the colons are the keys. Keys can be made up of any immutable data type. The keys in the dictionary above are: 'name', 'animal', 'color', 'location'.

      +

      The words to the right of the colons are the values. Values can be comprised of any data type. The values in the dictionary above are: 'Sammy', 'shark', 'blue', 'ocean'.

      +

      Like the other data types, let’s store the dictionary inside a variable, and print it out:

      +
      sammy = {'name': 'Sammy', 'animal': 'shark', 'color': 'blue',  'location': 'ocean'}
      +#Ouput : {'color': 'blue', 'animal': 'shark', 'name': 'Sammy', 'location': 'ocean'}
      +
      + + +

      If we want to isolate Sammy’s color, we can do so by calling sammy['color']. Let’s print that out:

      +
      print(sammy['color'])
      +
      +#Output : blue
      +
      + + +

      As dictionaries offer key-value pairs for storing data, they can be important elements in your Python program.

      +

      Conclusion

      +

      At this point, you should have a better understanding of some of the major data types that are available for you to use in Python. Each of these data types will become important as you develop programming projects in the Python language.

      +

      You can learn about each of the data types above in more detail by reading the following specific tutorials:

      + +

      Once you have a solid grasp of data types available to you in Python, you can learn how to convert data types.

      +
      +

      Source:
      + https://www.digitalocean.com/community/tutorials/understanding-data-types-in-python-3

      +
      +
      +

      Native Datatypes By Dive Into Python 3

      +

      +
      +

      Source:
      + Dive into Python 3 by Mark Pilgrim

      +
      +

      Standard Data Types By Tutorialspoint

      +

      The data stored in memory can be of many types. For example, a person's age is stored as a numeric value and his or her address is stored as alphanumeric characters. Python has various standard data types that are used to define the operations possible on them and the storage method for each of them.

      +

      Python has five standard data types :

      +
        +
      • +

        Numbers

        +
      • +
      • +

        String

        +
      • +
      • +

        List

        +
      • +
      • +

        Tuple

        +
      • +
      • +

        Dictionary

        +
      • +
      +

      Python Numbers

      +

      Number data types store numeric values. Number objects are created when you assign a value to them. For example −

      +
      var1 = 1
      +var2 = 10
      +
      + + +

      You can also delete the reference to a number object by using the del statement. The syntax of the del statement is −

      +
      del var1[,var2[,var3[....,varN]]]]
      +
      + + +

      You can delete a single object or multiple objects by using the del statement.

      +

      For example −

      +
      del var
      +del var_a, var_b
      +
      + + +

      Python supports three different numerical types − +- int (signed integers)

      +
        +
      • +

        float (floating point real values)

        +
      • +
      • +

        complex (complex numbers)

        +
      • +
      +

      All integers in Python3 are represented as long integers. Hence, there is no separate number type as long.

      + + + + + + + + + + + + + + + + + + + + + + + + + +
      intfloatcomplex
      100.03.14j
      10015.2045.j
      -786-21.99.322e-36j
      +

      A complex number consists of an ordered pair of real floating-point numbers denoted by x + yj, where x and y are real numbers and j is the imaginary unit.

      +

      Python Strings

      +

      Strings in Python are identified as a contiguous set of characters represented in the quotation marks. Python allows either pair of single or double quotes. Subsets of strings can be taken using the slice operator ([ ] and [:] ) with indexes starting at 0 in the beginning of the string and working their way from -1 to the end.

      +

      The plus (+) sign is the string concatenation operator and the asterisk (*) is the repetition operator. For example −

      +
      #!/usr/bin/python3
      +
      +str = 'Hello World!'
      +
      +print (str)          # Prints complete string
      +print (str[0])       # Prints first character of the string
      +print (str[2:5])     # Prints characters starting from 3rd to 5th
      +print (str[2:])      # Prints string starting from 3rd character
      +print (str * 2)      # Prints string two times
      +print (str + "TEST") # Prints concatenated string
      +
      + + +

      This will produce the following result −

      +
      Hello World!
      +H
      +llo
      +llo World!
      +Hello World!Hello World!
      +Hello World!TEST
      +
      + + +

      Python Lists

      +

      Lists are the most versatile of Python's compound data types. A list contains items separated by commas and enclosed within square brackets ([]). To some extent, lists are similar to arrays in C. One of the differences between them is that all the items belonging to a list can be of different data type.

      +

      The values stored in a list can be accessed using the slice operator ([ ] and [:]) with indexes starting at 0 in the beginning of the list and working their way to end -1. The plus (+) sign is the list concatenation operator, and the asterisk (*) is the repetition operator. For example −

      +
      #!/usr/bin/python3
      +
      +list = [ 'abcd', 786 , 2.23, 'john', 70.2 ]
      +tinylist = [123, 'john']
      +
      +print (list)          # Prints complete list
      +print (list[0])       # Prints first element of the list
      +print (list[1:3])     # Prints elements starting from 2nd till 3rd 
      +print (list[2:])      # Prints elements starting from 3rd element
      +print (tinylist * 2)  # Prints list two times
      +print (list + tinylist) # Prints concatenated lists
      +
      + + +

      This produces the following result −

      +
      ['abcd', 786, 2.23, 'john', 70.200000000000003]
      +abcd
      +[786, 2.23]
      +[2.23, 'john', 70.200000000000003]
      +[123, 'john', 123, 'john']
      +['abcd', 786, 2.23, 'john', 70.200000000000003, 123, 'john']
      +
      + + +

      Python Tuples

      +

      A tuple is another sequence data type that is similar to the list. A tuple consists of a number of values separated by commas. Unlike lists, however, tuples are enclosed within parenthesis.

      +

      The main difference between lists and tuples are − Lists are enclosed in brackets ( [ ] ) and their elements and size can be changed, while tuples are enclosed in parentheses ( ( ) ) and cannot be updated. Tuples can be thought of as read-only lists. For example −

      +
      #!/usr/bin/python3
      +
      +tuple = ( 'abcd', 786 , 2.23, 'john', 70.2  )
      +tinytuple = (123, 'john')
      +
      +print (tuple)           # Prints complete tuple
      +print (tuple[0])        # Prints first element of the tuple
      +print (tuple[1:3])      # Prints elements starting from 2nd till 3rd 
      +print (tuple[2:])       # Prints elements starting from 3rd element
      +print (tinytuple * 2)   # Prints tuple two times
      +print (tuple + tinytuple) # Prints concatenated tuple
      +
      + + +

      This produces the following result −

      +
      ('abcd', 786, 2.23, 'john', 70.200000000000003)
      +abcd
      +(786, 2.23)
      +(2.23, 'john', 70.200000000000003)
      +(123, 'john', 123, 'john')
      +('abcd', 786, 2.23, 'john', 70.200000000000003, 123, 'john')
      +
      + + +

      The following code is invalid with tuple, because we attempted to update a tuple, which is not allowed. Similar case is possible with lists −

      +
      #!/usr/bin/python3
      +
      +tuple = ( 'abcd', 786 , 2.23, 'john', 70.2  )
      +list = [ 'abcd', 786 , 2.23, 'john', 70.2  ]
      +tuple[2] = 1000    # Invalid syntax with tuple
      +list[2] = 1000     # Valid syntax with list
      +
      + + +

      Python Dictionary

      +

      Python's dictionaries are kind of hash-table type. They work like associative arrays or hashes found in Perl and consist of key-value pairs. A dictionary key can be almost any Python type, but are usually numbers or strings. Values, on the other hand, can be any arbitrary Python object.

      +

      Dictionaries are enclosed by curly braces ({ }) and values can be assigned and accessed using square braces ([]). For example −

      +
      #!/usr/bin/python3
      +
      +dict = {}
      +dict['one'] = "This is one"
      +dict[2]     = "This is two"
      +
      +tinydict = {'name': 'john','code':6734, 'dept': 'sales'}
      +
      +
      +print (dict['one'])       # Prints value for 'one' key
      +print (dict[2])           # Prints value for 2 key
      +print (tinydict)          # Prints complete dictionary
      +print (tinydict.keys())   # Prints all the keys
      +print (tinydict.values()) # Prints all the values
      +
      + + +

      This produces the following result −

      +
      This is one
      +This is two
      +{'name': 'john', 'dept': 'sales', 'code': 6734}
      +dict_keys(['name', 'dept', 'code'])
      +dict_values(['john', 'sales', 6734])
      +
      + + +

      Dictionaries have no concept of order among the elements. It is incorrect to say that the elements are "out of order"; they are simply unordered.

      +
      +

      Source:
      + https://www.tutorialspoint.com/python3/python_variable_types.htm

      +
      + + + + + + + +
      +
      +
      +
      + + + + +
      + + + + + + + + + + + + \ No newline at end of file diff --git a/site/beginner/Datatype_And_Variables/index.html b/site/beginner/Datatype_And_Variables/index.html index a720309..fcffcfa 100644 --- a/site/beginner/Datatype_And_Variables/index.html +++ b/site/beginner/Datatype_And_Variables/index.html @@ -259,6 +259,18 @@ + +
    12. + + Data Types in Python 3 + +
    13. + + + + + + @@ -636,12 +648,12 @@

      Simultaneous Assignments

      Python Data Types

      -

      Python has 5 standard data types namely. -a) Numbers -b) String -c) List -d) Tuple -e) Dictionary +

      Python has 5 standard data types namely.
      +a) Numbers
      +b) String
      +c) List
      +d) Tuple
      +e) Dictionary
      f) Boolean – In Python True and False are boolean literals. But the following values are also considered as false.

      [] – empty list , () – empty tuple , {} – empty dictionary

      Receiving input from Console

      @@ -1019,7 +1031,7 @@

      Conclusion

      diff --git a/site/beginner/Python_Installation/index.html b/site/beginner/Python_Installation/index.html index 4c63884..a7cb6b3 100644 --- a/site/beginner/Python_Installation/index.html +++ b/site/beginner/Python_Installation/index.html @@ -319,6 +319,18 @@ +
    14. + + Data Types in Python 3 + +
    15. + + + + + + +
    16. Datatype And Variables diff --git a/site/beginner/Python_Programming_Lanuage/index.html b/site/beginner/Python_Programming_Lanuage/index.html index e75095c..f9e5cfe 100644 --- a/site/beginner/Python_Programming_Lanuage/index.html +++ b/site/beginner/Python_Programming_Lanuage/index.html @@ -384,6 +384,18 @@ +
    17. + + Data Types in Python 3 + +
    18. + + + + + + +
    19. Datatype And Variables diff --git a/site/beginner/Start_Coding_With_Python/index.html b/site/beginner/Start_Coding_With_Python/index.html index 83e6703..6f23668 100644 --- a/site/beginner/Start_Coding_With_Python/index.html +++ b/site/beginner/Start_Coding_With_Python/index.html @@ -414,6 +414,18 @@ +
    20. + + Data Types in Python 3 + +
    21. + + + + + + +
    22. Datatype And Variables @@ -925,13 +937,13 @@

      Reserved Words

      -
    23. + Data Types in Python 3 + +
    24. + + + + + + +
    25. Datatype And Variables @@ -403,6 +415,7 @@

      Python Study Guide

    26. The Python Programming Language, Implementation and Adventages
    27. Python Installation
    28. Start Coding With Python
    29. +
    30. Data Types In Python 3
    31. Datatype And Variables
    32. ...
    33. diff --git a/site/mkdocs/search_index.json b/site/mkdocs/search_index.json index 5a6e9bd..18a235e 100644 --- a/site/mkdocs/search_index.json +++ b/site/mkdocs/search_index.json @@ -1,358 +1,463 @@ { "docs": [ { - "location": "/", - "text": "Welcome to Python Synopsis!\n\n\nPython Study Guide\n\n\nIn this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate \nbooks, articles, answers from Stackoverflow, online courses, videos from py conferences\n and etc. \n\n\nSo, after all I decided to share \ntop resources\n for everyone about each topic, that you need to know about python, if you want to be senior python \nSoftware Engineer\n. \n\n\nOf course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than \n30-40\n chapters.\n\n\n\n\nBeginner\n\n\nThe Python Programming Language, Implementation and Adventages\n\n\nPython Installation\n\n\nStart Coding With Python\n\n\nDatatype And Variables\n\n\n...\n\n\n\n\n\n\nIntermediate\n\n\n... \n\n\n\n\n\n\nAdvanced\n\n\n...\n\n\nPython Metaclasses\n\n\n...", + "location": "/", + "text": "Welcome to Python Synopsis!\n\n\nPython Study Guide\n\n\nIn this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate \nbooks, articles, answers from Stackoverflow, online courses, videos from py conferences\n and etc. \n\n\nSo, after all I decided to share \ntop resources\n for everyone about each topic, that you need to know about python, if you want to be senior python \nSoftware Engineer\n. \n\n\nOf course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than \n30-40\n chapters.\n\n\n\n\nBeginner\n\n\nThe Python Programming Language, Implementation and Adventages\n\n\nPython Installation\n\n\nStart Coding With Python\n\n\nData Types In Python 3\n\n\nDatatype And Variables\n\n\n...\n\n\n\n\n\n\nIntermediate\n\n\n... \n\n\n\n\n\n\nAdvanced\n\n\n...\n\n\nPython Metaclasses\n\n\n...", "title": "Home" - }, + }, { - "location": "/#welcome-to-python-synopsis", - "text": "", + "location": "/#welcome-to-python-synopsis", + "text": "", "title": "Welcome to Python Synopsis!" - }, + }, { - "location": "/#python-study-guide", - "text": "In this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate books, articles, answers from Stackoverflow, online courses, videos from py conferences and etc. So, after all I decided to share top resources for everyone about each topic, that you need to know about python, if you want to be senior python Software Engineer . Of course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than 30-40 chapters. Beginner The Python Programming Language, Implementation and Adventages Python Installation Start Coding With Python Datatype And Variables ... Intermediate ... Advanced ... Python Metaclasses ...", + "location": "/#python-study-guide", + "text": "In this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate books, articles, answers from Stackoverflow, online courses, videos from py conferences and etc. So, after all I decided to share top resources for everyone about each topic, that you need to know about python, if you want to be senior python Software Engineer . Of course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than 30-40 chapters. Beginner The Python Programming Language, Implementation and Adventages Python Installation Start Coding With Python Data Types In Python 3 Datatype And Variables ... Intermediate ... Advanced ... Python Metaclasses ...", "title": "Python Study Guide" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/", - "text": "The Python Programming Language\n\n\n\n\nThe programming language you will learn is Python. Python is an example of a highlevel\nlanguage; other high-level languages you might have heard of are \nC, C++, Perl,\n\nand \nJava\n.\nThere are also low-level languages, sometimes referred to as \n\u201cmachine languages\u201d\n or\n\n\u201cassembly languages.\u201d\n Loosely speaking, computers can only run programs written in\nlow-level languages. So programs written in a high-level language have to be processed\nbefore they can run. This extra processing takes some time, which is a small disadvantage\nof high-level languages.\n\n\nThe advantages are enormous. First, it is much easier to program in a high-level lan\nguage. Programs written in a high-level language take less time to write, they are shorter\nand easier to read, and they are more likely to be correct. Second, high-level languages\nare portable, meaning that they can run on different kinds of computers with few or no\nmodifications. Low-level programs can run on only one kind of computer and have to\nbe rewritten to run on another.\n\n\nDue to these advantages, almost all programs are written in high-level languages. Lowlevel\nlanguages are used only for a few specialized applications.\n\n\nTwo kinds of programs process high-level languages into low-level languages:\ninterpreters and compilers. An interpreter reads a high-level program and executes it,\nmeaning that it does what the program says. It processes the program a little at a time,\nalternately reading lines and performing computations. Figure 1-1 shows the structure\nof an interpreter.\n\n\n \n\n\nA compiler reads the program and translates it completely before the program starts\nrunning. In this context, the high-level program is called the source code, and the\ntranslated program is called the object code or the executable. Once a program is com\npiled, you can execute it repeatedly without further translation. Figure 1-2 shows the\nstructure of a compiler.\n\n\n\n\nPython is considered an interpreted language because Python programs are executed\nby an interpreter. There are two ways to use the interpreter: \ninteractive\n mode and \nscript mode\n. In interactive mode, you type Python programs and the interpreter displays the\nresult:\n>\n 1 + 1\n2\nThe chevron, \n, is the prompt the interpreter uses to indicate that it is ready. If you\ntype 1 + 1, the interpreter replies 2.\n\n\nAlternatively, you can store code in a file and use the interpreter to execute the contents\nof the file, which is called a script. By convention, Python scripts have names that end\nwith .py.\nTo execute the script, you have to tell the interpreter the name of the file. If you have a\nscript named dinsdale.py and you are working in a UNIX command window, you type\npython dinsdale.py. In other development environments, the details of executing\nscripts are different. You can find instructions for your environment at the Python web\nsite http://python.org.\nWorking in interactive mode is convenient for testing small pieces of code because you\ncan type and execute them immediately. But for anything more than a few lines, you\nshould save your code as a script so you can modify and execute it in the future.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nPython\u2019s View\n\n\nThe brief description in the prior section is fairly standard for scripting languages, and\nit\u2019s usually all that most Python programmers need to know. You type code into text\nfiles, and you run those files through the interpreter. Under the hood, though, a bit\nmore happens when you tell Python to \u201cgo.\u201d Although knowledge of Python internals\nis not strictly required for Python programming, a basic understanding of the runtime\nstructure of Python can help you grasp the bigger picture of program execution.\nWhen you instruct Python to run your script, there are a few steps that Python carries\nout before your code actually starts crunching away. Specifically, it\u2019s first compiled to\nsomething called \u201cbyte code\u201d and then routed to something called a \u201cvirtual machine.\u201d\n\n\nByte code compilation\n\n\nInternally, and almost completely hidden from you, when you execute a program\nPython first compiles your source code (the statements in your file) into a format known\nas byte code. Compilation is simply a translation step, and byte code is a lower-level,\nplatform-independent representation of your source code. Roughly, Python translates\neach of your source statements into a group of byte code instructions by decomposing\nthem into individual steps. This byte code translation is performed to speed\nexecution\u2014byte code can be run much more quickly than the original source code\nstatements in your text file.\nYou\u2019ll notice that the prior paragraph said that this is almost completely hidden from\nyou. If the Python process has write access on your machine, it will store the byte code\nof your programs in files that end with a .pyc extension (\u201c.pyc\u201d means compiled \u201c.py\u201d\nsource). You will see these files show up on your computer after you\u2019ve run a few\nprograms alongside the corresponding source code files (that is, in the same\ndirectories).\nPython saves byte code like this as a startup speed optimization. The next time you run\nyour program, Python will load the .pyc files and skip the compilation step, as long as\nyou haven\u2019t changed your source code since the byte code was last saved. Python automatically\nchecks the timestamps of source and byte code files to know when it must\nrecompile\u2014if you resave your source code, byte code is automatically re-created the\nnext time your program is run.\nIf Python cannot write the byte code files to your machine, your program still works\u2014\nthe byte code is generated in memory and simply discarded on program exit.* However,\nbecause .pyc files speed startup time, you\u2019ll want to make sure they are written for larger\nprograms. Byte code files are also one way to ship Python programs\u2014Python is happy\nto run a program if all it can find are .pyc files, even if the original .py source files are\nabsent.\n\n\nThe Python Virtual Machine (PVM)\n\n\nOnce your program has been compiled to byte code (or the byte code has been loaded\nfrom existing .pyc files), it is shipped off for execution to something generally known\nas the Python Virtual Machine (PVM, for the more acronym-inclined among you). The\nPVM sounds more impressive than it is; really, it\u2019s not a separate program, and it need\nnot be installed by itself. In fact, the PVM is just a big loop that iterates through your\nbyte code instructions, one by one, to carry out their operations. The PVM is the runtime\nengine of Python; it\u2019s always present as part of the Python system, and it\u2019s the\ncomponent that truly runs your scripts. Technically, it\u2019s just the last step of what is\ncalled the \u201cPython interpreter.\u201d\n\n\n\n\nFigure illustrates the runtime structure described here. Keep in mind that all of this\ncomplexity is deliberately hidden from Python programmers. Byte code compilation is\nautomatic, and the PVM is just part of the Python system that you have installed on\nyour machine. Again, programmers simply code and run files of statements.\n\n\nPerformance implications\n\n\nReaders with a background in fully compiled languages such as C and C++ might notice\na few differences in the Python model. For one thing, there is usually no build or \u201cmake\u201d\nstep in Python work: code runs immediately after it is written. For another, Python byte\ncode is not binary machine code (e.g., instructions for an Intel chip). Byte code is a\nPython-specific representation.\n\n\nThis is why some Python code may not run as fast as C or C++ code, as described in\nChapter 1\u2014the PVM loop, not the CPU chip, still must interpret the byte code, and\nbyte code instructions require more work than CPU instructions. On the other hand,\nunlike in classic interpreters, there is still an internal compile step\u2014Python does not\nneed to reanalyze and reparse each source statement repeatedly. The net effect is that\npure Python code runs at speeds somewhere between those of a traditional compiled\nlanguage and a traditional interpreted language. See Chapter 1 for more on Python\nperformance tradeoffs.\n\n\n\n\nSource:\n \n\n\n \nLearning Python, Fourth Edition\n by Mark Lutz - 2009\n\n\n\n\nPython Implementation Alternatives\n\n\nReally, as this book is being written, there are three primary implementations of the\nPython language\u2014CPython, Jython, and IronPython\u2014along with a handful of secondary\nimplementations such as Stackless Python. In brief, CPython is the standard implementation;\nall the others have very specific purposes and roles. All implement the\nsame Python language but execute programs in different ways.\n\n\nCPython\n\n\nThe original, and standard, implementation of Python is usually called CPython, when\nyou want to contrast it with the other two. Its name comes from the fact that it is coded\nin portable ANSI C language code. This is the Python that you fetch from http://www\n.python.org, get with the ActivePython distribution, and have automatically on most\nLinux and Mac OS X machines. If you\u2019ve found a preinstalled version of Python on\nyour machine, it\u2019s probably CPython, unless your company is using Python in very\nspecialized ways.\nUnless you want to script Java or .NET applications with Python, you probably want\nto use the standard CPython system. Because it is the reference implementation of the\nlanguage, it tends to run the fastest, be the most complete, and be more robust than\nthe alternative systems. Figure 1-3 reflects CPython\u2019s runtime architecture.\n\n\nJython\n\n\nThe Jython system (originally known as JPython) is an alternative implementation of\nthe Python language, targeted for integration with the Java programming language.\nJython consists of Java classes that compile Python source code to Java byte code and\nthen route the resulting byte code to the Java Virtual Machine (JVM). Programmers\nstill code Python statements in .py text files as usual; the Jython system essentially just\nreplaces the rightmost two bubbles in Figure 1-3 with Java-based equivalents.\nJython\u2019s goal is to allow Python code to script Java applications, much as CPython\nallows Python to script C and C++ components. Its integration with Java is remarkably\nseamless. Because Python code is translated to Java byte code, it looks and feels like a\ntrue Java program at runtime. Jython scripts can serve as web applets and servlets, build\nJava-based GUIs, and so on. Moreover, Jython includes integration support that allows\nPython code to import and use Java classes as though they were coded in Python.\nBecause Jython is slower and less robust than CPython, though, it is usually seen as a\ntool of interest primarily to Java developers looking for a scripting language to be a\nfrontend to Java code.\n\n\nIronPython\n\n\nA third implementation of Python, and newer than both CPython and Jython,\nIronPython is designed to allow Python programs to integrate with applications coded\nto work with Microsoft\u2019s .NET Framework for Windows, as well as the Mono open\nsource equivalent for Linux. .NET and its C# programming language runtime system\nare designed to be a language-neutral object communication layer, in the spirit of Microsoft\u2019s\nearlier COM model. IronPython allows Python programs to act as both client\nand server components, accessible from other .NET languages.\nBy implementation, IronPython is very much like Jython (and, in fact, was developed\nby the same creator)\u2014it replaces the last two bubbles in Figure 1-3 with equivalents\nfor execution in the .NET environment. Also, like Jython, IronPython has a special\nfocus\u2014it is primarily of interest to developers integrating Python with .NET components.\nBecause it is being developed by Microsoft, though, IronPython might also be\nable to leverage some important optimization tools for better performance.\nIronPython\u2019s scope is still evolving as I write this; for more details, consult the Python\nonline resources or search the Web.\n\n\n\n\nSource:\n \n\n\n \nLearning Python, Fourth Edition\n by Mark Lutz - 2009\n\n\n\n\nPython Programming Language Advantages\n\n\nPython is a dynamic, strongly typed, object oriented, multipurpose programming language, designed to be quick (to learn, to use, and to understand), and to enforce a clean and uniform syntax.\n\n\n\n\nPython is dynamically typed: it means that you don't declare a type (e.g. 'integer') for a variable name, and then assign something of that type (and only that type). Instead, you have variable names, and you bind them to entities whose type stays with the entity itself. a = 5 makes the variable name a to refer to the integer 5. Later, a = \"hello\" makes the variable name a to refer to a string containing \"hello\". Static typed languages would have you declare int a and then a = 5, but assigning a = \"hello\" would have been a compile time error. On one hand, this makes everything more unpredictable (you don't know what a refers to). On the other hand, it makes very easy to achieve some results a static typed languages makes very difficult.\n\n\nPython is strongly typed. It means that if a = \"5\" (the string whose value is '5') will remain a string, and never coerced to a number if the context requires so. Every type conversion in python must be done explicitly. This is different from, for example, Perl or Javascript, where you have weak typing, and can write things like \"hello\" + 5 to get \"hello5\".\n\n\nPython is object oriented, with class-based inheritance. Everything is an object (including classes, functions, modules, etc), in the sense that they can be passed around as arguments, have methods and attributes, and so on. \n\n\nPython is multipurpose: it is not specialised to a specific target of users (like R for statistics, or PHP for web programming). It is extended through modules and libraries, that hook very easily into the C programming language.\n\n\nPython enforces correct indentation of the code by making the indentation part of the syntax. There are no control braces in Python. Blocks of code are identified by the level of indentation. Although a big turn off for many programmers not used to this, it is precious as it gives a very uniform style and results in code that is visually pleasant to read.\n\n\nThe code is compiled into byte code and then executed in a virtual machine. This means that precompiled code is portable between platforms.\n\n\n\n\nPython can be used for any programming task, from GUI programming to web programming with everything else in between. It's quite efficient, as much of its activity is done at the C level. Python is just a layer on top of C. There are libraries for everything you can think of: game programming and openGL, GUI interfaces, web frameworks, semantic web, scientific computing...\n\n\n\n\nSource:\n \n\n\n https://stackoverflow.com/questions/1909512/what-is-python-used-for\n\n\n\n\nAdventages again\n\n\n\n\nEasy Syntax\n\nPython's syntax is easy to learn, so both non-programmers and programmers can start programming right away.\n\n\nReadability\n\nPython's syntax is very clear, so it is easy to understand program code. (Python is often referred to as \"executable pseudo-code\" because its syntax mostly follows the conventions used by programmers to outline their ideas without the formal verbosity of code in most programming languages; in other words syntax of Python is almost identical to the simplified \"pseudo-code\" used by many programmers to prototype and describe their solution to other programmers. Thus Python can be used to prototype and test code which is later to be implemented in other programming languages).[citation needed]\n\n\nHigh-Level Language\n\nPython looks more like a readable, human language than like a low-level language. This gives you the ability to program at a faster rate than a low-level language will allow you.\n\n\nObject oriented programming\n\nObject-oriented programming allows you to create data structures that can be re-used, which reduces the amount of repetitive work that you'll need to do. Programming languages usually define objects with namespaces, like class or def, and objects can edit themselves by using keyword, like this or self. Most modern programming languages are object-oriented (such as Java, C++, and C#) or have support for OOP features (such as Perl version 5 and later). Additionally object-oriented techniques can be used in the design of almost any non-trivial software and implemented in almost any programming or scripting language. (For example a number of Linux kernel features are \"objects\" which implement their own encapsulation of behavior and data structive via pointers, specifically pointers to functions, in the C programming language).[citation needed] Python's support for object-oriented programming is one of its greatest benefits to new programmers because they will be encountering the same concepts and terminology in their work environment. If you ever decide to switch languages, or use any other for that fact, you'll have a significant chance that you'll be working with object-oriented programming.[1]\n\n\nIt's Free\n\nPython is both free and open-source. The Python Software Foundation distributes pre-made binaries that are freely available for use on all major operating systems called CPython. You can get CPython's source-code, too. Plus, you can modify the source code and distribute as allowed by CPython's license. [2] (Luckily, CPython has a permissive free software license attitude.)\n\n\nCross-platform\n\nPython runs on all major operating systems like Microsoft Windows, Linux, and Mac OS X.\n\n\nWidely Supported\n\nPython has an active support community with many web sites, mailing lists, and USENET \"netnews\" groups that attract a large number of knowledgeable and helpful contributes.\n\n\nIt's Safe\n\nPython doesn't have pointers like other C-based languages, making it much more reliable. Along with that, errors never pass silently unless they're explicitly silenced. This allows you to see and read why the program crashed and where to correct your error.\n\n\nBatteries Included\n\nPython is famous for being the \"batteries are included\" language.[3] There are over 300 standard library modules which contain modules and classes for a wide variety of programming tasks.[citation needed] For example the standard library contains modules for safely creating temporary files (named or anonymous), mapping files into memory (including use of shared and anonymous memory mappings), spawning and controlling sub-processes, compressing and decompressing files (compatible with gzip or PK-zip) and archives files (such as Unix/Linux \"tar\"), accessing indexed \"DBM\" (database) files, interfacing to various graphical user interfaces (such as the TK toolkit and the popular WxWindows multi-platform windowing system), parsing and maintaining CSV (comma-separated values) and \".cfg\" or \".ini\" configuration files (similar in syntax to the venerable WIN.INI files from MS-DOS and MS-Windows), for sending e-mail, fetching and parsing web pages, etc. It's possible, for example, to create a custom web server in Python using less than a dozen lines of code, and one of the standard libraries, of course.\n\n\nExtensible\n\nIn addition to the standard libraries there are extensive collections of freely available add-on modules, libraries, frameworks, and tool-kits. These generally conform to similar standards and conventions; for example almost all of the database adapters (to talk to almost any client-server RDBMS engine such as MySQL, Postgres, Oracle, etc) conform to the Python DBAPI and thus can mostly be accessed using the same code. So it's usually easy to modify a Python program to support any database engine.\n\n\n\n\n\n\nSource:\n \n\n\n https://en.wikiversity.org/wiki/Python_Concepts/Why_learn_Python\n\n\n\n\nWho Uses Python Today ?\n\n\nHere are links to just a few of the organizations that use python:\n\n- \n https://wiki.python.org/moin/OrganizationsUsingPython\n\n\nPython Success Stories :\n\n- \n https://www.python.org/about/success", + "location": "/beginner/Python_Programming_Lanuage/", + "text": "The Python Programming Language\n\n\n\n\nThe programming language you will learn is Python. Python is an example of a highlevel\nlanguage; other high-level languages you might have heard of are \nC, C++, Perl,\n\nand \nJava\n.\nThere are also low-level languages, sometimes referred to as \n\u201cmachine languages\u201d\n or\n\n\u201cassembly languages.\u201d\n Loosely speaking, computers can only run programs written in\nlow-level languages. So programs written in a high-level language have to be processed\nbefore they can run. This extra processing takes some time, which is a small disadvantage\nof high-level languages.\n\n\nThe advantages are enormous. First, it is much easier to program in a high-level lan\nguage. Programs written in a high-level language take less time to write, they are shorter\nand easier to read, and they are more likely to be correct. Second, high-level languages\nare portable, meaning that they can run on different kinds of computers with few or no\nmodifications. Low-level programs can run on only one kind of computer and have to\nbe rewritten to run on another.\n\n\nDue to these advantages, almost all programs are written in high-level languages. Lowlevel\nlanguages are used only for a few specialized applications.\n\n\nTwo kinds of programs process high-level languages into low-level languages:\ninterpreters and compilers. An interpreter reads a high-level program and executes it,\nmeaning that it does what the program says. It processes the program a little at a time,\nalternately reading lines and performing computations. Figure 1-1 shows the structure\nof an interpreter.\n\n\n \n\n\nA compiler reads the program and translates it completely before the program starts\nrunning. In this context, the high-level program is called the source code, and the\ntranslated program is called the object code or the executable. Once a program is com\npiled, you can execute it repeatedly without further translation. Figure 1-2 shows the\nstructure of a compiler.\n\n\n\n\nPython is considered an interpreted language because Python programs are executed\nby an interpreter. There are two ways to use the interpreter: \ninteractive\n mode and \nscript mode\n. In interactive mode, you type Python programs and the interpreter displays the\nresult:\n>\n 1 + 1\n2\nThe chevron, \n, is the prompt the interpreter uses to indicate that it is ready. If you\ntype 1 + 1, the interpreter replies 2.\n\n\nAlternatively, you can store code in a file and use the interpreter to execute the contents\nof the file, which is called a script. By convention, Python scripts have names that end\nwith .py.\nTo execute the script, you have to tell the interpreter the name of the file. If you have a\nscript named dinsdale.py and you are working in a UNIX command window, you type\npython dinsdale.py. In other development environments, the details of executing\nscripts are different. You can find instructions for your environment at the Python web\nsite http://python.org.\nWorking in interactive mode is convenient for testing small pieces of code because you\ncan type and execute them immediately. But for anything more than a few lines, you\nshould save your code as a script so you can modify and execute it in the future.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nPython\u2019s View\n\n\nThe brief description in the prior section is fairly standard for scripting languages, and\nit\u2019s usually all that most Python programmers need to know. You type code into text\nfiles, and you run those files through the interpreter. Under the hood, though, a bit\nmore happens when you tell Python to \u201cgo.\u201d Although knowledge of Python internals\nis not strictly required for Python programming, a basic understanding of the runtime\nstructure of Python can help you grasp the bigger picture of program execution.\nWhen you instruct Python to run your script, there are a few steps that Python carries\nout before your code actually starts crunching away. Specifically, it\u2019s first compiled to\nsomething called \u201cbyte code\u201d and then routed to something called a \u201cvirtual machine.\u201d\n\n\nByte code compilation\n\n\nInternally, and almost completely hidden from you, when you execute a program\nPython first compiles your source code (the statements in your file) into a format known\nas byte code. Compilation is simply a translation step, and byte code is a lower-level,\nplatform-independent representation of your source code. Roughly, Python translates\neach of your source statements into a group of byte code instructions by decomposing\nthem into individual steps. This byte code translation is performed to speed\nexecution\u2014byte code can be run much more quickly than the original source code\nstatements in your text file.\nYou\u2019ll notice that the prior paragraph said that this is almost completely hidden from\nyou. If the Python process has write access on your machine, it will store the byte code\nof your programs in files that end with a .pyc extension (\u201c.pyc\u201d means compiled \u201c.py\u201d\nsource). You will see these files show up on your computer after you\u2019ve run a few\nprograms alongside the corresponding source code files (that is, in the same\ndirectories).\nPython saves byte code like this as a startup speed optimization. The next time you run\nyour program, Python will load the .pyc files and skip the compilation step, as long as\nyou haven\u2019t changed your source code since the byte code was last saved. Python automatically\nchecks the timestamps of source and byte code files to know when it must\nrecompile\u2014if you resave your source code, byte code is automatically re-created the\nnext time your program is run.\nIf Python cannot write the byte code files to your machine, your program still works\u2014\nthe byte code is generated in memory and simply discarded on program exit.* However,\nbecause .pyc files speed startup time, you\u2019ll want to make sure they are written for larger\nprograms. Byte code files are also one way to ship Python programs\u2014Python is happy\nto run a program if all it can find are .pyc files, even if the original .py source files are\nabsent.\n\n\nThe Python Virtual Machine (PVM)\n\n\nOnce your program has been compiled to byte code (or the byte code has been loaded\nfrom existing .pyc files), it is shipped off for execution to something generally known\nas the Python Virtual Machine (PVM, for the more acronym-inclined among you). The\nPVM sounds more impressive than it is; really, it\u2019s not a separate program, and it need\nnot be installed by itself. In fact, the PVM is just a big loop that iterates through your\nbyte code instructions, one by one, to carry out their operations. The PVM is the runtime\nengine of Python; it\u2019s always present as part of the Python system, and it\u2019s the\ncomponent that truly runs your scripts. Technically, it\u2019s just the last step of what is\ncalled the \u201cPython interpreter.\u201d\n\n\n\n\nFigure illustrates the runtime structure described here. Keep in mind that all of this\ncomplexity is deliberately hidden from Python programmers. Byte code compilation is\nautomatic, and the PVM is just part of the Python system that you have installed on\nyour machine. Again, programmers simply code and run files of statements.\n\n\nPerformance implications\n\n\nReaders with a background in fully compiled languages such as C and C++ might notice\na few differences in the Python model. For one thing, there is usually no build or \u201cmake\u201d\nstep in Python work: code runs immediately after it is written. For another, Python byte\ncode is not binary machine code (e.g., instructions for an Intel chip). Byte code is a\nPython-specific representation.\n\n\nThis is why some Python code may not run as fast as C or C++ code, as described in\nChapter 1\u2014the PVM loop, not the CPU chip, still must interpret the byte code, and\nbyte code instructions require more work than CPU instructions. On the other hand,\nunlike in classic interpreters, there is still an internal compile step\u2014Python does not\nneed to reanalyze and reparse each source statement repeatedly. The net effect is that\npure Python code runs at speeds somewhere between those of a traditional compiled\nlanguage and a traditional interpreted language. See Chapter 1 for more on Python\nperformance tradeoffs.\n\n\n\n\nSource:\n \n\n\n \nLearning Python, Fourth Edition\n by Mark Lutz - 2009\n\n\n\n\nPython Implementation Alternatives\n\n\nReally, as this book is being written, there are three primary implementations of the\nPython language\u2014CPython, Jython, and IronPython\u2014along with a handful of secondary\nimplementations such as Stackless Python. In brief, CPython is the standard implementation;\nall the others have very specific purposes and roles. All implement the\nsame Python language but execute programs in different ways.\n\n\nCPython\n\n\nThe original, and standard, implementation of Python is usually called CPython, when\nyou want to contrast it with the other two. Its name comes from the fact that it is coded\nin portable ANSI C language code. This is the Python that you fetch from http://www\n.python.org, get with the ActivePython distribution, and have automatically on most\nLinux and Mac OS X machines. If you\u2019ve found a preinstalled version of Python on\nyour machine, it\u2019s probably CPython, unless your company is using Python in very\nspecialized ways.\nUnless you want to script Java or .NET applications with Python, you probably want\nto use the standard CPython system. Because it is the reference implementation of the\nlanguage, it tends to run the fastest, be the most complete, and be more robust than\nthe alternative systems. Figure 1-3 reflects CPython\u2019s runtime architecture.\n\n\nJython\n\n\nThe Jython system (originally known as JPython) is an alternative implementation of\nthe Python language, targeted for integration with the Java programming language.\nJython consists of Java classes that compile Python source code to Java byte code and\nthen route the resulting byte code to the Java Virtual Machine (JVM). Programmers\nstill code Python statements in .py text files as usual; the Jython system essentially just\nreplaces the rightmost two bubbles in Figure 1-3 with Java-based equivalents.\nJython\u2019s goal is to allow Python code to script Java applications, much as CPython\nallows Python to script C and C++ components. Its integration with Java is remarkably\nseamless. Because Python code is translated to Java byte code, it looks and feels like a\ntrue Java program at runtime. Jython scripts can serve as web applets and servlets, build\nJava-based GUIs, and so on. Moreover, Jython includes integration support that allows\nPython code to import and use Java classes as though they were coded in Python.\nBecause Jython is slower and less robust than CPython, though, it is usually seen as a\ntool of interest primarily to Java developers looking for a scripting language to be a\nfrontend to Java code.\n\n\nIronPython\n\n\nA third implementation of Python, and newer than both CPython and Jython,\nIronPython is designed to allow Python programs to integrate with applications coded\nto work with Microsoft\u2019s .NET Framework for Windows, as well as the Mono open\nsource equivalent for Linux. .NET and its C# programming language runtime system\nare designed to be a language-neutral object communication layer, in the spirit of Microsoft\u2019s\nearlier COM model. IronPython allows Python programs to act as both client\nand server components, accessible from other .NET languages.\nBy implementation, IronPython is very much like Jython (and, in fact, was developed\nby the same creator)\u2014it replaces the last two bubbles in Figure 1-3 with equivalents\nfor execution in the .NET environment. Also, like Jython, IronPython has a special\nfocus\u2014it is primarily of interest to developers integrating Python with .NET components.\nBecause it is being developed by Microsoft, though, IronPython might also be\nable to leverage some important optimization tools for better performance.\nIronPython\u2019s scope is still evolving as I write this; for more details, consult the Python\nonline resources or search the Web.\n\n\n\n\nSource:\n \n\n\n \nLearning Python, Fourth Edition\n by Mark Lutz - 2009\n\n\n\n\nPython Programming Language Advantages\n\n\nPython is a dynamic, strongly typed, object oriented, multipurpose programming language, designed to be quick (to learn, to use, and to understand), and to enforce a clean and uniform syntax.\n\n\n\n\nPython is dynamically typed: it means that you don't declare a type (e.g. 'integer') for a variable name, and then assign something of that type (and only that type). Instead, you have variable names, and you bind them to entities whose type stays with the entity itself. a = 5 makes the variable name a to refer to the integer 5. Later, a = \"hello\" makes the variable name a to refer to a string containing \"hello\". Static typed languages would have you declare int a and then a = 5, but assigning a = \"hello\" would have been a compile time error. On one hand, this makes everything more unpredictable (you don't know what a refers to). On the other hand, it makes very easy to achieve some results a static typed languages makes very difficult.\n\n\nPython is strongly typed. It means that if a = \"5\" (the string whose value is '5') will remain a string, and never coerced to a number if the context requires so. Every type conversion in python must be done explicitly. This is different from, for example, Perl or Javascript, where you have weak typing, and can write things like \"hello\" + 5 to get \"hello5\".\n\n\nPython is object oriented, with class-based inheritance. Everything is an object (including classes, functions, modules, etc), in the sense that they can be passed around as arguments, have methods and attributes, and so on. \n\n\nPython is multipurpose: it is not specialised to a specific target of users (like R for statistics, or PHP for web programming). It is extended through modules and libraries, that hook very easily into the C programming language.\n\n\nPython enforces correct indentation of the code by making the indentation part of the syntax. There are no control braces in Python. Blocks of code are identified by the level of indentation. Although a big turn off for many programmers not used to this, it is precious as it gives a very uniform style and results in code that is visually pleasant to read.\n\n\nThe code is compiled into byte code and then executed in a virtual machine. This means that precompiled code is portable between platforms.\n\n\n\n\nPython can be used for any programming task, from GUI programming to web programming with everything else in between. It's quite efficient, as much of its activity is done at the C level. Python is just a layer on top of C. There are libraries for everything you can think of: game programming and openGL, GUI interfaces, web frameworks, semantic web, scientific computing...\n\n\n\n\nSource:\n \n\n\n https://stackoverflow.com/questions/1909512/what-is-python-used-for\n\n\n\n\nAdventages again\n\n\n\n\nEasy Syntax\n\nPython's syntax is easy to learn, so both non-programmers and programmers can start programming right away.\n\n\nReadability\n\nPython's syntax is very clear, so it is easy to understand program code. (Python is often referred to as \"executable pseudo-code\" because its syntax mostly follows the conventions used by programmers to outline their ideas without the formal verbosity of code in most programming languages; in other words syntax of Python is almost identical to the simplified \"pseudo-code\" used by many programmers to prototype and describe their solution to other programmers. Thus Python can be used to prototype and test code which is later to be implemented in other programming languages).[citation needed]\n\n\nHigh-Level Language\n\nPython looks more like a readable, human language than like a low-level language. This gives you the ability to program at a faster rate than a low-level language will allow you.\n\n\nObject oriented programming\n\nObject-oriented programming allows you to create data structures that can be re-used, which reduces the amount of repetitive work that you'll need to do. Programming languages usually define objects with namespaces, like class or def, and objects can edit themselves by using keyword, like this or self. Most modern programming languages are object-oriented (such as Java, C++, and C#) or have support for OOP features (such as Perl version 5 and later). Additionally object-oriented techniques can be used in the design of almost any non-trivial software and implemented in almost any programming or scripting language. (For example a number of Linux kernel features are \"objects\" which implement their own encapsulation of behavior and data structive via pointers, specifically pointers to functions, in the C programming language).[citation needed] Python's support for object-oriented programming is one of its greatest benefits to new programmers because they will be encountering the same concepts and terminology in their work environment. If you ever decide to switch languages, or use any other for that fact, you'll have a significant chance that you'll be working with object-oriented programming.[1]\n\n\nIt's Free\n\nPython is both free and open-source. The Python Software Foundation distributes pre-made binaries that are freely available for use on all major operating systems called CPython. You can get CPython's source-code, too. Plus, you can modify the source code and distribute as allowed by CPython's license. [2] (Luckily, CPython has a permissive free software license attitude.)\n\n\nCross-platform\n\nPython runs on all major operating systems like Microsoft Windows, Linux, and Mac OS X.\n\n\nWidely Supported\n\nPython has an active support community with many web sites, mailing lists, and USENET \"netnews\" groups that attract a large number of knowledgeable and helpful contributes.\n\n\nIt's Safe\n\nPython doesn't have pointers like other C-based languages, making it much more reliable. Along with that, errors never pass silently unless they're explicitly silenced. This allows you to see and read why the program crashed and where to correct your error.\n\n\nBatteries Included\n\nPython is famous for being the \"batteries are included\" language.[3] There are over 300 standard library modules which contain modules and classes for a wide variety of programming tasks.[citation needed] For example the standard library contains modules for safely creating temporary files (named or anonymous), mapping files into memory (including use of shared and anonymous memory mappings), spawning and controlling sub-processes, compressing and decompressing files (compatible with gzip or PK-zip) and archives files (such as Unix/Linux \"tar\"), accessing indexed \"DBM\" (database) files, interfacing to various graphical user interfaces (such as the TK toolkit and the popular WxWindows multi-platform windowing system), parsing and maintaining CSV (comma-separated values) and \".cfg\" or \".ini\" configuration files (similar in syntax to the venerable WIN.INI files from MS-DOS and MS-Windows), for sending e-mail, fetching and parsing web pages, etc. It's possible, for example, to create a custom web server in Python using less than a dozen lines of code, and one of the standard libraries, of course.\n\n\nExtensible\n\nIn addition to the standard libraries there are extensive collections of freely available add-on modules, libraries, frameworks, and tool-kits. These generally conform to similar standards and conventions; for example almost all of the database adapters (to talk to almost any client-server RDBMS engine such as MySQL, Postgres, Oracle, etc) conform to the Python DBAPI and thus can mostly be accessed using the same code. So it's usually easy to modify a Python program to support any database engine.\n\n\n\n\n\n\nSource:\n \n\n\n https://en.wikiversity.org/wiki/Python_Concepts/Why_learn_Python\n\n\n\n\nWho Uses Python Today ?\n\n\nHere are links to just a few of the organizations that use python:\n\n- \n https://wiki.python.org/moin/OrganizationsUsingPython\n\n\nPython Success Stories :\n\n- \n https://www.python.org/about/success", "title": "The Python Programming Language, Implementation and Adventages" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#the-python-programming-language", - "text": "The programming language you will learn is Python. Python is an example of a highlevel\nlanguage; other high-level languages you might have heard of are C, C++, Perl, \nand Java .\nThere are also low-level languages, sometimes referred to as \u201cmachine languages\u201d or \u201cassembly languages.\u201d Loosely speaking, computers can only run programs written in\nlow-level languages. So programs written in a high-level language have to be processed\nbefore they can run. This extra processing takes some time, which is a small disadvantage\nof high-level languages. The advantages are enormous. First, it is much easier to program in a high-level lan\nguage. Programs written in a high-level language take less time to write, they are shorter\nand easier to read, and they are more likely to be correct. Second, high-level languages\nare portable, meaning that they can run on different kinds of computers with few or no\nmodifications. Low-level programs can run on only one kind of computer and have to\nbe rewritten to run on another. Due to these advantages, almost all programs are written in high-level languages. Lowlevel\nlanguages are used only for a few specialized applications. Two kinds of programs process high-level languages into low-level languages:\ninterpreters and compilers. An interpreter reads a high-level program and executes it,\nmeaning that it does what the program says. It processes the program a little at a time,\nalternately reading lines and performing computations. Figure 1-1 shows the structure\nof an interpreter. A compiler reads the program and translates it completely before the program starts\nrunning. In this context, the high-level program is called the source code, and the\ntranslated program is called the object code or the executable. Once a program is com\npiled, you can execute it repeatedly without further translation. Figure 1-2 shows the\nstructure of a compiler. Python is considered an interpreted language because Python programs are executed\nby an interpreter. There are two ways to use the interpreter: interactive mode and script mode . In interactive mode, you type Python programs and the interpreter displays the\nresult:\n> 1 + 1\n2\nThe chevron, , is the prompt the interpreter uses to indicate that it is ready. If you\ntype 1 + 1, the interpreter replies 2. Alternatively, you can store code in a file and use the interpreter to execute the contents\nof the file, which is called a script. By convention, Python scripts have names that end\nwith .py.\nTo execute the script, you have to tell the interpreter the name of the file. If you have a\nscript named dinsdale.py and you are working in a UNIX command window, you type\npython dinsdale.py. In other development environments, the details of executing\nscripts are different. You can find instructions for your environment at the Python web\nsite http://python.org.\nWorking in interactive mode is convenient for testing small pieces of code because you\ncan type and execute them immediately. But for anything more than a few lines, you\nshould save your code as a script so you can modify and execute it in the future. Source: Think Python by Allen B. Downey - 2012", + "location": "/beginner/Python_Programming_Lanuage/#the-python-programming-language", + "text": "The programming language you will learn is Python. Python is an example of a highlevel\nlanguage; other high-level languages you might have heard of are C, C++, Perl, \nand Java .\nThere are also low-level languages, sometimes referred to as \u201cmachine languages\u201d or \u201cassembly languages.\u201d Loosely speaking, computers can only run programs written in\nlow-level languages. So programs written in a high-level language have to be processed\nbefore they can run. This extra processing takes some time, which is a small disadvantage\nof high-level languages. The advantages are enormous. First, it is much easier to program in a high-level lan\nguage. Programs written in a high-level language take less time to write, they are shorter\nand easier to read, and they are more likely to be correct. Second, high-level languages\nare portable, meaning that they can run on different kinds of computers with few or no\nmodifications. Low-level programs can run on only one kind of computer and have to\nbe rewritten to run on another. Due to these advantages, almost all programs are written in high-level languages. Lowlevel\nlanguages are used only for a few specialized applications. Two kinds of programs process high-level languages into low-level languages:\ninterpreters and compilers. An interpreter reads a high-level program and executes it,\nmeaning that it does what the program says. It processes the program a little at a time,\nalternately reading lines and performing computations. Figure 1-1 shows the structure\nof an interpreter. A compiler reads the program and translates it completely before the program starts\nrunning. In this context, the high-level program is called the source code, and the\ntranslated program is called the object code or the executable. Once a program is com\npiled, you can execute it repeatedly without further translation. Figure 1-2 shows the\nstructure of a compiler. Python is considered an interpreted language because Python programs are executed\nby an interpreter. There are two ways to use the interpreter: interactive mode and script mode . In interactive mode, you type Python programs and the interpreter displays the\nresult:\n> 1 + 1\n2\nThe chevron, , is the prompt the interpreter uses to indicate that it is ready. If you\ntype 1 + 1, the interpreter replies 2. Alternatively, you can store code in a file and use the interpreter to execute the contents\nof the file, which is called a script. By convention, Python scripts have names that end\nwith .py.\nTo execute the script, you have to tell the interpreter the name of the file. If you have a\nscript named dinsdale.py and you are working in a UNIX command window, you type\npython dinsdale.py. In other development environments, the details of executing\nscripts are different. You can find instructions for your environment at the Python web\nsite http://python.org.\nWorking in interactive mode is convenient for testing small pieces of code because you\ncan type and execute them immediately. But for anything more than a few lines, you\nshould save your code as a script so you can modify and execute it in the future. Source: Think Python by Allen B. Downey - 2012", "title": "The Python Programming Language" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#pythons-view", - "text": "The brief description in the prior section is fairly standard for scripting languages, and\nit\u2019s usually all that most Python programmers need to know. You type code into text\nfiles, and you run those files through the interpreter. Under the hood, though, a bit\nmore happens when you tell Python to \u201cgo.\u201d Although knowledge of Python internals\nis not strictly required for Python programming, a basic understanding of the runtime\nstructure of Python can help you grasp the bigger picture of program execution.\nWhen you instruct Python to run your script, there are a few steps that Python carries\nout before your code actually starts crunching away. Specifically, it\u2019s first compiled to\nsomething called \u201cbyte code\u201d and then routed to something called a \u201cvirtual machine.\u201d", + "location": "/beginner/Python_Programming_Lanuage/#pythons-view", + "text": "The brief description in the prior section is fairly standard for scripting languages, and\nit\u2019s usually all that most Python programmers need to know. You type code into text\nfiles, and you run those files through the interpreter. Under the hood, though, a bit\nmore happens when you tell Python to \u201cgo.\u201d Although knowledge of Python internals\nis not strictly required for Python programming, a basic understanding of the runtime\nstructure of Python can help you grasp the bigger picture of program execution.\nWhen you instruct Python to run your script, there are a few steps that Python carries\nout before your code actually starts crunching away. Specifically, it\u2019s first compiled to\nsomething called \u201cbyte code\u201d and then routed to something called a \u201cvirtual machine.\u201d", "title": "Python\u2019s View" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#byte-code-compilation", - "text": "Internally, and almost completely hidden from you, when you execute a program\nPython first compiles your source code (the statements in your file) into a format known\nas byte code. Compilation is simply a translation step, and byte code is a lower-level,\nplatform-independent representation of your source code. Roughly, Python translates\neach of your source statements into a group of byte code instructions by decomposing\nthem into individual steps. This byte code translation is performed to speed\nexecution\u2014byte code can be run much more quickly than the original source code\nstatements in your text file.\nYou\u2019ll notice that the prior paragraph said that this is almost completely hidden from\nyou. If the Python process has write access on your machine, it will store the byte code\nof your programs in files that end with a .pyc extension (\u201c.pyc\u201d means compiled \u201c.py\u201d\nsource). You will see these files show up on your computer after you\u2019ve run a few\nprograms alongside the corresponding source code files (that is, in the same\ndirectories).\nPython saves byte code like this as a startup speed optimization. The next time you run\nyour program, Python will load the .pyc files and skip the compilation step, as long as\nyou haven\u2019t changed your source code since the byte code was last saved. Python automatically\nchecks the timestamps of source and byte code files to know when it must\nrecompile\u2014if you resave your source code, byte code is automatically re-created the\nnext time your program is run.\nIf Python cannot write the byte code files to your machine, your program still works\u2014\nthe byte code is generated in memory and simply discarded on program exit.* However,\nbecause .pyc files speed startup time, you\u2019ll want to make sure they are written for larger\nprograms. Byte code files are also one way to ship Python programs\u2014Python is happy\nto run a program if all it can find are .pyc files, even if the original .py source files are\nabsent.", + "location": "/beginner/Python_Programming_Lanuage/#byte-code-compilation", + "text": "Internally, and almost completely hidden from you, when you execute a program\nPython first compiles your source code (the statements in your file) into a format known\nas byte code. Compilation is simply a translation step, and byte code is a lower-level,\nplatform-independent representation of your source code. Roughly, Python translates\neach of your source statements into a group of byte code instructions by decomposing\nthem into individual steps. This byte code translation is performed to speed\nexecution\u2014byte code can be run much more quickly than the original source code\nstatements in your text file.\nYou\u2019ll notice that the prior paragraph said that this is almost completely hidden from\nyou. If the Python process has write access on your machine, it will store the byte code\nof your programs in files that end with a .pyc extension (\u201c.pyc\u201d means compiled \u201c.py\u201d\nsource). You will see these files show up on your computer after you\u2019ve run a few\nprograms alongside the corresponding source code files (that is, in the same\ndirectories).\nPython saves byte code like this as a startup speed optimization. The next time you run\nyour program, Python will load the .pyc files and skip the compilation step, as long as\nyou haven\u2019t changed your source code since the byte code was last saved. Python automatically\nchecks the timestamps of source and byte code files to know when it must\nrecompile\u2014if you resave your source code, byte code is automatically re-created the\nnext time your program is run.\nIf Python cannot write the byte code files to your machine, your program still works\u2014\nthe byte code is generated in memory and simply discarded on program exit.* However,\nbecause .pyc files speed startup time, you\u2019ll want to make sure they are written for larger\nprograms. Byte code files are also one way to ship Python programs\u2014Python is happy\nto run a program if all it can find are .pyc files, even if the original .py source files are\nabsent.", "title": "Byte code compilation" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#the-python-virtual-machine-pvm", - "text": "Once your program has been compiled to byte code (or the byte code has been loaded\nfrom existing .pyc files), it is shipped off for execution to something generally known\nas the Python Virtual Machine (PVM, for the more acronym-inclined among you). The\nPVM sounds more impressive than it is; really, it\u2019s not a separate program, and it need\nnot be installed by itself. In fact, the PVM is just a big loop that iterates through your\nbyte code instructions, one by one, to carry out their operations. The PVM is the runtime\nengine of Python; it\u2019s always present as part of the Python system, and it\u2019s the\ncomponent that truly runs your scripts. Technically, it\u2019s just the last step of what is\ncalled the \u201cPython interpreter.\u201d Figure illustrates the runtime structure described here. Keep in mind that all of this\ncomplexity is deliberately hidden from Python programmers. Byte code compilation is\nautomatic, and the PVM is just part of the Python system that you have installed on\nyour machine. Again, programmers simply code and run files of statements.", + "location": "/beginner/Python_Programming_Lanuage/#the-python-virtual-machine-pvm", + "text": "Once your program has been compiled to byte code (or the byte code has been loaded\nfrom existing .pyc files), it is shipped off for execution to something generally known\nas the Python Virtual Machine (PVM, for the more acronym-inclined among you). The\nPVM sounds more impressive than it is; really, it\u2019s not a separate program, and it need\nnot be installed by itself. In fact, the PVM is just a big loop that iterates through your\nbyte code instructions, one by one, to carry out their operations. The PVM is the runtime\nengine of Python; it\u2019s always present as part of the Python system, and it\u2019s the\ncomponent that truly runs your scripts. Technically, it\u2019s just the last step of what is\ncalled the \u201cPython interpreter.\u201d Figure illustrates the runtime structure described here. Keep in mind that all of this\ncomplexity is deliberately hidden from Python programmers. Byte code compilation is\nautomatic, and the PVM is just part of the Python system that you have installed on\nyour machine. Again, programmers simply code and run files of statements.", "title": "The Python Virtual Machine (PVM)" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#performance-implications", - "text": "Readers with a background in fully compiled languages such as C and C++ might notice\na few differences in the Python model. For one thing, there is usually no build or \u201cmake\u201d\nstep in Python work: code runs immediately after it is written. For another, Python byte\ncode is not binary machine code (e.g., instructions for an Intel chip). Byte code is a\nPython-specific representation. This is why some Python code may not run as fast as C or C++ code, as described in\nChapter 1\u2014the PVM loop, not the CPU chip, still must interpret the byte code, and\nbyte code instructions require more work than CPU instructions. On the other hand,\nunlike in classic interpreters, there is still an internal compile step\u2014Python does not\nneed to reanalyze and reparse each source statement repeatedly. The net effect is that\npure Python code runs at speeds somewhere between those of a traditional compiled\nlanguage and a traditional interpreted language. See Chapter 1 for more on Python\nperformance tradeoffs. Source: Learning Python, Fourth Edition by Mark Lutz - 2009", + "location": "/beginner/Python_Programming_Lanuage/#performance-implications", + "text": "Readers with a background in fully compiled languages such as C and C++ might notice\na few differences in the Python model. For one thing, there is usually no build or \u201cmake\u201d\nstep in Python work: code runs immediately after it is written. For another, Python byte\ncode is not binary machine code (e.g., instructions for an Intel chip). Byte code is a\nPython-specific representation. This is why some Python code may not run as fast as C or C++ code, as described in\nChapter 1\u2014the PVM loop, not the CPU chip, still must interpret the byte code, and\nbyte code instructions require more work than CPU instructions. On the other hand,\nunlike in classic interpreters, there is still an internal compile step\u2014Python does not\nneed to reanalyze and reparse each source statement repeatedly. The net effect is that\npure Python code runs at speeds somewhere between those of a traditional compiled\nlanguage and a traditional interpreted language. See Chapter 1 for more on Python\nperformance tradeoffs. Source: Learning Python, Fourth Edition by Mark Lutz - 2009", "title": "Performance implications" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#python-implementation-alternatives", - "text": "Really, as this book is being written, there are three primary implementations of the\nPython language\u2014CPython, Jython, and IronPython\u2014along with a handful of secondary\nimplementations such as Stackless Python. In brief, CPython is the standard implementation;\nall the others have very specific purposes and roles. All implement the\nsame Python language but execute programs in different ways.", + "location": "/beginner/Python_Programming_Lanuage/#python-implementation-alternatives", + "text": "Really, as this book is being written, there are three primary implementations of the\nPython language\u2014CPython, Jython, and IronPython\u2014along with a handful of secondary\nimplementations such as Stackless Python. In brief, CPython is the standard implementation;\nall the others have very specific purposes and roles. All implement the\nsame Python language but execute programs in different ways.", "title": "Python Implementation Alternatives" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#cpython", - "text": "The original, and standard, implementation of Python is usually called CPython, when\nyou want to contrast it with the other two. Its name comes from the fact that it is coded\nin portable ANSI C language code. This is the Python that you fetch from http://www\n.python.org, get with the ActivePython distribution, and have automatically on most\nLinux and Mac OS X machines. If you\u2019ve found a preinstalled version of Python on\nyour machine, it\u2019s probably CPython, unless your company is using Python in very\nspecialized ways.\nUnless you want to script Java or .NET applications with Python, you probably want\nto use the standard CPython system. Because it is the reference implementation of the\nlanguage, it tends to run the fastest, be the most complete, and be more robust than\nthe alternative systems. Figure 1-3 reflects CPython\u2019s runtime architecture.", + "location": "/beginner/Python_Programming_Lanuage/#cpython", + "text": "The original, and standard, implementation of Python is usually called CPython, when\nyou want to contrast it with the other two. Its name comes from the fact that it is coded\nin portable ANSI C language code. This is the Python that you fetch from http://www\n.python.org, get with the ActivePython distribution, and have automatically on most\nLinux and Mac OS X machines. If you\u2019ve found a preinstalled version of Python on\nyour machine, it\u2019s probably CPython, unless your company is using Python in very\nspecialized ways.\nUnless you want to script Java or .NET applications with Python, you probably want\nto use the standard CPython system. Because it is the reference implementation of the\nlanguage, it tends to run the fastest, be the most complete, and be more robust than\nthe alternative systems. Figure 1-3 reflects CPython\u2019s runtime architecture.", "title": "CPython" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#jython", - "text": "The Jython system (originally known as JPython) is an alternative implementation of\nthe Python language, targeted for integration with the Java programming language.\nJython consists of Java classes that compile Python source code to Java byte code and\nthen route the resulting byte code to the Java Virtual Machine (JVM). Programmers\nstill code Python statements in .py text files as usual; the Jython system essentially just\nreplaces the rightmost two bubbles in Figure 1-3 with Java-based equivalents.\nJython\u2019s goal is to allow Python code to script Java applications, much as CPython\nallows Python to script C and C++ components. Its integration with Java is remarkably\nseamless. Because Python code is translated to Java byte code, it looks and feels like a\ntrue Java program at runtime. Jython scripts can serve as web applets and servlets, build\nJava-based GUIs, and so on. Moreover, Jython includes integration support that allows\nPython code to import and use Java classes as though they were coded in Python.\nBecause Jython is slower and less robust than CPython, though, it is usually seen as a\ntool of interest primarily to Java developers looking for a scripting language to be a\nfrontend to Java code.", + "location": "/beginner/Python_Programming_Lanuage/#jython", + "text": "The Jython system (originally known as JPython) is an alternative implementation of\nthe Python language, targeted for integration with the Java programming language.\nJython consists of Java classes that compile Python source code to Java byte code and\nthen route the resulting byte code to the Java Virtual Machine (JVM). Programmers\nstill code Python statements in .py text files as usual; the Jython system essentially just\nreplaces the rightmost two bubbles in Figure 1-3 with Java-based equivalents.\nJython\u2019s goal is to allow Python code to script Java applications, much as CPython\nallows Python to script C and C++ components. Its integration with Java is remarkably\nseamless. Because Python code is translated to Java byte code, it looks and feels like a\ntrue Java program at runtime. Jython scripts can serve as web applets and servlets, build\nJava-based GUIs, and so on. Moreover, Jython includes integration support that allows\nPython code to import and use Java classes as though they were coded in Python.\nBecause Jython is slower and less robust than CPython, though, it is usually seen as a\ntool of interest primarily to Java developers looking for a scripting language to be a\nfrontend to Java code.", "title": "Jython" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#ironpython", - "text": "A third implementation of Python, and newer than both CPython and Jython,\nIronPython is designed to allow Python programs to integrate with applications coded\nto work with Microsoft\u2019s .NET Framework for Windows, as well as the Mono open\nsource equivalent for Linux. .NET and its C# programming language runtime system\nare designed to be a language-neutral object communication layer, in the spirit of Microsoft\u2019s\nearlier COM model. IronPython allows Python programs to act as both client\nand server components, accessible from other .NET languages.\nBy implementation, IronPython is very much like Jython (and, in fact, was developed\nby the same creator)\u2014it replaces the last two bubbles in Figure 1-3 with equivalents\nfor execution in the .NET environment. Also, like Jython, IronPython has a special\nfocus\u2014it is primarily of interest to developers integrating Python with .NET components.\nBecause it is being developed by Microsoft, though, IronPython might also be\nable to leverage some important optimization tools for better performance.\nIronPython\u2019s scope is still evolving as I write this; for more details, consult the Python\nonline resources or search the Web. Source: Learning Python, Fourth Edition by Mark Lutz - 2009", + "location": "/beginner/Python_Programming_Lanuage/#ironpython", + "text": "A third implementation of Python, and newer than both CPython and Jython,\nIronPython is designed to allow Python programs to integrate with applications coded\nto work with Microsoft\u2019s .NET Framework for Windows, as well as the Mono open\nsource equivalent for Linux. .NET and its C# programming language runtime system\nare designed to be a language-neutral object communication layer, in the spirit of Microsoft\u2019s\nearlier COM model. IronPython allows Python programs to act as both client\nand server components, accessible from other .NET languages.\nBy implementation, IronPython is very much like Jython (and, in fact, was developed\nby the same creator)\u2014it replaces the last two bubbles in Figure 1-3 with equivalents\nfor execution in the .NET environment. Also, like Jython, IronPython has a special\nfocus\u2014it is primarily of interest to developers integrating Python with .NET components.\nBecause it is being developed by Microsoft, though, IronPython might also be\nable to leverage some important optimization tools for better performance.\nIronPython\u2019s scope is still evolving as I write this; for more details, consult the Python\nonline resources or search the Web. Source: Learning Python, Fourth Edition by Mark Lutz - 2009", "title": "IronPython" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#python-programming-language-advantages", - "text": "Python is a dynamic, strongly typed, object oriented, multipurpose programming language, designed to be quick (to learn, to use, and to understand), and to enforce a clean and uniform syntax. Python is dynamically typed: it means that you don't declare a type (e.g. 'integer') for a variable name, and then assign something of that type (and only that type). Instead, you have variable names, and you bind them to entities whose type stays with the entity itself. a = 5 makes the variable name a to refer to the integer 5. Later, a = \"hello\" makes the variable name a to refer to a string containing \"hello\". Static typed languages would have you declare int a and then a = 5, but assigning a = \"hello\" would have been a compile time error. On one hand, this makes everything more unpredictable (you don't know what a refers to). On the other hand, it makes very easy to achieve some results a static typed languages makes very difficult. Python is strongly typed. It means that if a = \"5\" (the string whose value is '5') will remain a string, and never coerced to a number if the context requires so. Every type conversion in python must be done explicitly. This is different from, for example, Perl or Javascript, where you have weak typing, and can write things like \"hello\" + 5 to get \"hello5\". Python is object oriented, with class-based inheritance. Everything is an object (including classes, functions, modules, etc), in the sense that they can be passed around as arguments, have methods and attributes, and so on. Python is multipurpose: it is not specialised to a specific target of users (like R for statistics, or PHP for web programming). It is extended through modules and libraries, that hook very easily into the C programming language. Python enforces correct indentation of the code by making the indentation part of the syntax. There are no control braces in Python. Blocks of code are identified by the level of indentation. Although a big turn off for many programmers not used to this, it is precious as it gives a very uniform style and results in code that is visually pleasant to read. The code is compiled into byte code and then executed in a virtual machine. This means that precompiled code is portable between platforms. Python can be used for any programming task, from GUI programming to web programming with everything else in between. It's quite efficient, as much of its activity is done at the C level. Python is just a layer on top of C. There are libraries for everything you can think of: game programming and openGL, GUI interfaces, web frameworks, semantic web, scientific computing... Source: https://stackoverflow.com/questions/1909512/what-is-python-used-for", + "location": "/beginner/Python_Programming_Lanuage/#python-programming-language-advantages", + "text": "Python is a dynamic, strongly typed, object oriented, multipurpose programming language, designed to be quick (to learn, to use, and to understand), and to enforce a clean and uniform syntax. Python is dynamically typed: it means that you don't declare a type (e.g. 'integer') for a variable name, and then assign something of that type (and only that type). Instead, you have variable names, and you bind them to entities whose type stays with the entity itself. a = 5 makes the variable name a to refer to the integer 5. Later, a = \"hello\" makes the variable name a to refer to a string containing \"hello\". Static typed languages would have you declare int a and then a = 5, but assigning a = \"hello\" would have been a compile time error. On one hand, this makes everything more unpredictable (you don't know what a refers to). On the other hand, it makes very easy to achieve some results a static typed languages makes very difficult. Python is strongly typed. It means that if a = \"5\" (the string whose value is '5') will remain a string, and never coerced to a number if the context requires so. Every type conversion in python must be done explicitly. This is different from, for example, Perl or Javascript, where you have weak typing, and can write things like \"hello\" + 5 to get \"hello5\". Python is object oriented, with class-based inheritance. Everything is an object (including classes, functions, modules, etc), in the sense that they can be passed around as arguments, have methods and attributes, and so on. Python is multipurpose: it is not specialised to a specific target of users (like R for statistics, or PHP for web programming). It is extended through modules and libraries, that hook very easily into the C programming language. Python enforces correct indentation of the code by making the indentation part of the syntax. There are no control braces in Python. Blocks of code are identified by the level of indentation. Although a big turn off for many programmers not used to this, it is precious as it gives a very uniform style and results in code that is visually pleasant to read. The code is compiled into byte code and then executed in a virtual machine. This means that precompiled code is portable between platforms. Python can be used for any programming task, from GUI programming to web programming with everything else in between. It's quite efficient, as much of its activity is done at the C level. Python is just a layer on top of C. There are libraries for everything you can think of: game programming and openGL, GUI interfaces, web frameworks, semantic web, scientific computing... Source: https://stackoverflow.com/questions/1909512/what-is-python-used-for", "title": "Python Programming Language Advantages" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#adventages-again", - "text": "Easy Syntax \nPython's syntax is easy to learn, so both non-programmers and programmers can start programming right away. Readability \nPython's syntax is very clear, so it is easy to understand program code. (Python is often referred to as \"executable pseudo-code\" because its syntax mostly follows the conventions used by programmers to outline their ideas without the formal verbosity of code in most programming languages; in other words syntax of Python is almost identical to the simplified \"pseudo-code\" used by many programmers to prototype and describe their solution to other programmers. Thus Python can be used to prototype and test code which is later to be implemented in other programming languages).[citation needed] High-Level Language \nPython looks more like a readable, human language than like a low-level language. This gives you the ability to program at a faster rate than a low-level language will allow you. Object oriented programming \nObject-oriented programming allows you to create data structures that can be re-used, which reduces the amount of repetitive work that you'll need to do. Programming languages usually define objects with namespaces, like class or def, and objects can edit themselves by using keyword, like this or self. Most modern programming languages are object-oriented (such as Java, C++, and C#) or have support for OOP features (such as Perl version 5 and later). Additionally object-oriented techniques can be used in the design of almost any non-trivial software and implemented in almost any programming or scripting language. (For example a number of Linux kernel features are \"objects\" which implement their own encapsulation of behavior and data structive via pointers, specifically pointers to functions, in the C programming language).[citation needed] Python's support for object-oriented programming is one of its greatest benefits to new programmers because they will be encountering the same concepts and terminology in their work environment. If you ever decide to switch languages, or use any other for that fact, you'll have a significant chance that you'll be working with object-oriented programming.[1] It's Free \nPython is both free and open-source. The Python Software Foundation distributes pre-made binaries that are freely available for use on all major operating systems called CPython. You can get CPython's source-code, too. Plus, you can modify the source code and distribute as allowed by CPython's license. [2] (Luckily, CPython has a permissive free software license attitude.) Cross-platform \nPython runs on all major operating systems like Microsoft Windows, Linux, and Mac OS X. Widely Supported \nPython has an active support community with many web sites, mailing lists, and USENET \"netnews\" groups that attract a large number of knowledgeable and helpful contributes. It's Safe \nPython doesn't have pointers like other C-based languages, making it much more reliable. Along with that, errors never pass silently unless they're explicitly silenced. This allows you to see and read why the program crashed and where to correct your error. Batteries Included \nPython is famous for being the \"batteries are included\" language.[3] There are over 300 standard library modules which contain modules and classes for a wide variety of programming tasks.[citation needed] For example the standard library contains modules for safely creating temporary files (named or anonymous), mapping files into memory (including use of shared and anonymous memory mappings), spawning and controlling sub-processes, compressing and decompressing files (compatible with gzip or PK-zip) and archives files (such as Unix/Linux \"tar\"), accessing indexed \"DBM\" (database) files, interfacing to various graphical user interfaces (such as the TK toolkit and the popular WxWindows multi-platform windowing system), parsing and maintaining CSV (comma-separated values) and \".cfg\" or \".ini\" configuration files (similar in syntax to the venerable WIN.INI files from MS-DOS and MS-Windows), for sending e-mail, fetching and parsing web pages, etc. It's possible, for example, to create a custom web server in Python using less than a dozen lines of code, and one of the standard libraries, of course. Extensible \nIn addition to the standard libraries there are extensive collections of freely available add-on modules, libraries, frameworks, and tool-kits. These generally conform to similar standards and conventions; for example almost all of the database adapters (to talk to almost any client-server RDBMS engine such as MySQL, Postgres, Oracle, etc) conform to the Python DBAPI and thus can mostly be accessed using the same code. So it's usually easy to modify a Python program to support any database engine. Source: https://en.wikiversity.org/wiki/Python_Concepts/Why_learn_Python", + "location": "/beginner/Python_Programming_Lanuage/#adventages-again", + "text": "Easy Syntax \nPython's syntax is easy to learn, so both non-programmers and programmers can start programming right away. Readability \nPython's syntax is very clear, so it is easy to understand program code. (Python is often referred to as \"executable pseudo-code\" because its syntax mostly follows the conventions used by programmers to outline their ideas without the formal verbosity of code in most programming languages; in other words syntax of Python is almost identical to the simplified \"pseudo-code\" used by many programmers to prototype and describe their solution to other programmers. Thus Python can be used to prototype and test code which is later to be implemented in other programming languages).[citation needed] High-Level Language \nPython looks more like a readable, human language than like a low-level language. This gives you the ability to program at a faster rate than a low-level language will allow you. Object oriented programming \nObject-oriented programming allows you to create data structures that can be re-used, which reduces the amount of repetitive work that you'll need to do. Programming languages usually define objects with namespaces, like class or def, and objects can edit themselves by using keyword, like this or self. Most modern programming languages are object-oriented (such as Java, C++, and C#) or have support for OOP features (such as Perl version 5 and later). Additionally object-oriented techniques can be used in the design of almost any non-trivial software and implemented in almost any programming or scripting language. (For example a number of Linux kernel features are \"objects\" which implement their own encapsulation of behavior and data structive via pointers, specifically pointers to functions, in the C programming language).[citation needed] Python's support for object-oriented programming is one of its greatest benefits to new programmers because they will be encountering the same concepts and terminology in their work environment. If you ever decide to switch languages, or use any other for that fact, you'll have a significant chance that you'll be working with object-oriented programming.[1] It's Free \nPython is both free and open-source. The Python Software Foundation distributes pre-made binaries that are freely available for use on all major operating systems called CPython. You can get CPython's source-code, too. Plus, you can modify the source code and distribute as allowed by CPython's license. [2] (Luckily, CPython has a permissive free software license attitude.) Cross-platform \nPython runs on all major operating systems like Microsoft Windows, Linux, and Mac OS X. Widely Supported \nPython has an active support community with many web sites, mailing lists, and USENET \"netnews\" groups that attract a large number of knowledgeable and helpful contributes. It's Safe \nPython doesn't have pointers like other C-based languages, making it much more reliable. Along with that, errors never pass silently unless they're explicitly silenced. This allows you to see and read why the program crashed and where to correct your error. Batteries Included \nPython is famous for being the \"batteries are included\" language.[3] There are over 300 standard library modules which contain modules and classes for a wide variety of programming tasks.[citation needed] For example the standard library contains modules for safely creating temporary files (named or anonymous), mapping files into memory (including use of shared and anonymous memory mappings), spawning and controlling sub-processes, compressing and decompressing files (compatible with gzip or PK-zip) and archives files (such as Unix/Linux \"tar\"), accessing indexed \"DBM\" (database) files, interfacing to various graphical user interfaces (such as the TK toolkit and the popular WxWindows multi-platform windowing system), parsing and maintaining CSV (comma-separated values) and \".cfg\" or \".ini\" configuration files (similar in syntax to the venerable WIN.INI files from MS-DOS and MS-Windows), for sending e-mail, fetching and parsing web pages, etc. It's possible, for example, to create a custom web server in Python using less than a dozen lines of code, and one of the standard libraries, of course. Extensible \nIn addition to the standard libraries there are extensive collections of freely available add-on modules, libraries, frameworks, and tool-kits. These generally conform to similar standards and conventions; for example almost all of the database adapters (to talk to almost any client-server RDBMS engine such as MySQL, Postgres, Oracle, etc) conform to the Python DBAPI and thus can mostly be accessed using the same code. So it's usually easy to modify a Python program to support any database engine. Source: https://en.wikiversity.org/wiki/Python_Concepts/Why_learn_Python", "title": "Adventages again" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#who-uses-python-today", - "text": "Here are links to just a few of the organizations that use python: \n- https://wiki.python.org/moin/OrganizationsUsingPython Python Success Stories : \n- https://www.python.org/about/success", + "location": "/beginner/Python_Programming_Lanuage/#who-uses-python-today", + "text": "Here are links to just a few of the organizations that use python: \n- https://wiki.python.org/moin/OrganizationsUsingPython Python Success Stories : \n- https://www.python.org/about/success", "title": "Who Uses Python Today ?" - }, + }, { - "location": "/beginner/Python_Installation/", - "text": "Python Download and Installation Instructions\n\n\nInstall Python on Windows\n\n\n\n\nInstall Python on Ubuntu\n\n\n\n\nInstall Python on Mac", + "location": "/beginner/Python_Installation/", + "text": "Python Download and Installation Instructions\n\n\nInstall Python on Windows\n\n\n\n\nInstall Python on Ubuntu\n\n\n\n\nInstall Python on Mac", "title": "Python Installation" - }, + }, { - "location": "/beginner/Python_Installation/#python-download-and-installation-instructions", - "text": "", + "location": "/beginner/Python_Installation/#python-download-and-installation-instructions", + "text": "", "title": "Python Download and Installation Instructions" - }, + }, { - "location": "/beginner/Python_Installation/#install-python-on-windows", - "text": "", + "location": "/beginner/Python_Installation/#install-python-on-windows", + "text": "", "title": "Install Python on Windows" - }, + }, { - "location": "/beginner/Python_Installation/#install-python-on-ubuntu", - "text": "", + "location": "/beginner/Python_Installation/#install-python-on-ubuntu", + "text": "", "title": "Install Python on Ubuntu" - }, + }, { - "location": "/beginner/Python_Installation/#install-python-on-mac", - "text": "", + "location": "/beginner/Python_Installation/#install-python-on-mac", + "text": "", "title": "Install Python on Mac" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/", - "text": "What Is a Program?\n\n\nA program is a sequence of instructions that specifies how to perform a computation.\nThe computation might be something mathematical, such as solving a system of equat\nions or finding the roots of a polynomial, but it can also be a symbolic computation,\nsuch as searching and replacing text in a document or (strangely enough) compiling a\nprogram.\nThe details look different in different languages, but a few basic instructions appear in\njust about every language:\n\n\ninput: \n\n\n\n\nGet data from the keyboard, a file, or some other device.\n\n\n\n\noutput:\n\n\n\n\nDisplay data on the screen or send data to a file or other device.\n\n\n\n\nmath:\n\n\n\n\nPerform basic mathematical operations like addition and\n multiplication.\n\n\n\n\nconditional execution:\n\n\n\n\nCheck for certain conditions and execute the appropriate code.\n\n\n\n\nrepetition:\n\n\n\n\nPerform some action repeatedly, usually with some variation.\n\n\n\n\nBelieve it or not, that\u2019s pretty much all there is to it. Every program you\u2019ve ever used, no\nmatter how complicated, is made up of instructions that look pretty much like these. So\nyou can think of programming as the process of breaking a large, complex task into\nsmaller and smaller subtasks until the subtasks are simple enough to be performed with\none of these basic instructions.\nThat may be a little vague, but we will come back to this topic when we talk about\nalgorithms.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nRun Python Scripts\n\n\nIf you can't execute or run a Python script, then programming is pointless. When you run a Python script, the interpreter converts a Python program into something that that the computer can understand. Executing a Python program can be done in two ways: calling the Python interpreter with a shebang line, and using the interactive Python shell.\n\n\nRun a Python Script as a File\n\n\nGenerally programmers write stand alone scripts, that are independent to live environments. Then they save it with a \".py\" extension, which indicates to the operating system and programmer that the file is actually a Python program. After the interpreter is invoked, it reads and interprets the file. The way Python scripts are run on Windows versus Unix based operating systems is very different. We'll show you the difference, and how to run a Python script on Windows and Unix platforms.\n\n\nRun a Python script under Windows with the Command Prompt\n\n\nWindows users must pass the path of the program as an argument to the Python interpreter. Such as follows:\n\n\nC:\n\\P\nython27\n\\p\nython.exe C:\n\\U\nsers\n\\U\nsername\n\\D\nesktop\n\\m\ny_python_script.py\n\n\n\n\n\nNote that you must use the full path of the Python interpreter. If you want to simply type python.exe C:\\Users\\Username\\Desktop\\my_python_script.py you must add python.exe to your PATH environmental variable.\nNote that Windows comes with two Python executables - python.exe and pythonw.exe. If you want a terminal to pop-up when you run your script, use python.exe However if you don't want any terminal pop-up, use pythonw.exe. pythonw.exe is typically used for GUI programs, where you only want to display your program, not the terminal.\n\n\nRun a Python Script Under Mac, Linux, BSD, Unix, etc\n\n\nOn platforms like Mac, BSD or Linux (Unix) you can put a \"shebang\" line as first line of the program which indicates the location of the Python interpreter on the hard drive. It's in the following format:\n\n\n#!/path/to/interpreter\n\n\n\n\n\n\nA common shebang line used for the Python interpreter is as follows:\n\n\n#!/usr/bin/env python\n\n\n\n\n\n\nYou must then make the script executable, using the following command:\n\n\nchmod +x my_python_script.py\n\n\n\n\n\nUnlike Windows, the Python interpreter is typically already in the $PATH environmental variable, so adding it is un-necessary.\n\n\nYou can then run a program by invoking the Python interpreter manually as follows:\n\n\npython firstprogram.py\n\n\n\n\n\nPython Execution with the Shell (Live Interpreter)\n\n\nAssuming that you already have Python installed and running well (if you're getting an error, see this post), open the terminal or console and type 'python' and hit the 'Enter' key. You will then be directed immediately to the Python live interpreter. Your screen will display a message something like:\n\n\nuser@hostname:~ python\nPython \n3\n.3.0 \n(\ndefault, Nov \n23\n \n2012\n, \n10\n:26:01\n)\n \n\n[\nGCC \n4\n.2.1 Compatible Apple Clang \n4\n.1 \n((\ntags/Apple/clang-421.11.66\n))]\n on darwin\nType \nhelp\n, \ncopyright\n, \ncredits\n or \nlicense\n \nfor\n more information.\n\n\n\n\n\n\n\nThe Python programmer should keep in mind one thing: that while working with the live interpreter, everything is read and interpreted in real-time. For example loops iterate immediately, unless they are part of function. So it requires some mental planning. Using the Python shell is typically used to execute code interactively. If you want to run a Python script from the interpreter, you must either import it or call the Python executable.\n\n\n\n\nSource:\n \n\n\n http://pythoncentral.io/execute-python-script-file-shell/\n\n\n\n\nA Good First Program\n\n\nType the following text into a single file named \nex1.py\n. Python works best with files ending in \n.py\n.\n\n\nprint\n \nHello World!\n\n\nprint\n \nHello Again\n\n\nprint\n \nI like typing this.\n\n\nprint\n \nThis is fun.\n\n\nprint\n \nYay! Printing.\n\n\nprint\n \nI\nd much rather you \nnot\n.\n\n\nprint\n \nI \nsaid\n do not touch this.\n\n\n\n\n\n\nYour Atom text editor should look something like this on all platforms:\n\n\n\n\nDon't worry if your editor doesn't look exactly the same, it should be close though. You may have a slightly different window header, maybe slightly different colors, and the left side of your Atom window won't say \"zedshaw\" but will instead show the directory you used for saving your files. All of those differences are fine.\n\n\nWhen you create this file, keep in mind these points:\n\n\n\n\nI did not type the line numbers on the left. Those are printed in the book so I can talk about specific lines by saying, \"See line 5...\" You do not type line numbers into Python scripts.\n\n\nI have the print at the beginning of the line and it looks exactly the same as what I have in ex1.py. Exactly means exactly, not kind of sort of the same. Every single character has to match for it to work. Color doesn't matter, only the characters you type.\n\n\n\n\nIn Terminal run the file by typing:\n\n\npython ex1.py\n\n\n\n\n\nIf you did it right then you should see the same output as I in the What You Should See section of this exercise. If not, you have done something wrong. No, the computer is not wrong.\n\n\nWhat You Should See\n\n\nOn Mac OS X in the Terminal you should see this:\n\n\nOn Windows in PowerShell you should see this:\n\n\n\nYou may see different names, before the python ex1.py command, but the important part is that you type the command and see the output is the same as mine.\n\n\n\n\n\nIf you have an error it will look like this:\n\n\n$ python ex/ex1.py\n File \nex/ex1.py\n, line \n3\n\n print \nI like typing this.\n\n\n ^\n\n\nSyntaxError: EOL while scanning string literal\n\n\n\n\n\n\nIt's important that you can read these error messages because you will be making many of these mistakes. Even I make many of these mistakes. Let's look at this line by line.\n\n\n\n\nWe ran our command in the Terminal to run the ex1.py script.\n\n\nPython tells us that the file ex1.py has an error on line 3.\n\n\nIt prints this line of code for us to see it.\n\n\nThen it puts a ^ (caret) character to point at where the problem is. Notice the missing \" (double-quote) character?\n\n\nFinally, it prints out a \"SyntaxError\" and tells us something about what might be the error. Usually these are very cryptic, but if you copy that text into a search engine, you will find someone else who's had that error and you can probably figure out how to fix it.\n\n\n\n\n\n\nSource:\n \n\n\n \nLEARN PYTHON THE HARD WAY\n by Zed A. Shaw - 2013\n\n\n\n\nDebugging and Errors\n\n\nWhat Is Debugging?\n\n\nProgramming is error-prone. For whimsical reasons, programming errors are called\n\nbugs\n and the process of tracking them down is called \ndebugging\n.\nThree kinds of errors can occur in a program: syntax errors, runtime errors, and se\nmantic errors. It is useful to distinguish between them in order to track them down more\nquickly.\n\n\nError Types :\n\n\nSyntax Errors\n\n\nPython can only execute a program if the syntax is correct; otherwise, the interpreter\ndisplays an error message. Syntax refers to the structure of a program and the rules\nabout that structure.For example, parentheses have to come in matching pairs, so\n(1 + 2) is legal, but 8) is a \nsyntax error\n.\nIn English readers can tolerate most syntax errors, which is why we can read the poetry\nof e. e. cummings without spewing error messages. Python is not so forgiving. If there\nis a single syntax error anywhere in your program, Python will display an error message\nand quit, and you will not be able to run your program. During the first few weeks of\nyour programming career, you will probably spend a lot of time tracking down syntax\nerrors. As you gain experience, you will make fewer errors and find them faster.\n\n\nRuntime Errors\n\n\nThe second type of error is a runtime error, so called because the error does not appear\nuntil after the program has started running. These errors are also called exceptions\nbecause they usually indicate that something exceptional (and bad) has happened.\nRuntime errors are rare in the simple programs you will see in the first few chapters, so\nit might be a while before you encounter one.\n\n\nSemantic Errors\n\n\nThe third type of error is the semantic error. If there is a semantic error in your program,\nit will run successfully in the sense that the computer will not generate any error mess\nages, but it will not do the right thing. It will do something else. Specifically, it will do\nwhat you told it to do.\nThe problem is that the program you wrote is not the program you wanted to write. The\nmeaning of the program (its semantics) is wrong. Identifying semantic errors can be\ntricky because it requires you to work backward by looking at the output of the program\nand trying to figure out what it is doing.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nReserved Words\n\n\nThe following list shows the Python keywords. These are reserved words and you cannot use them as constants or variables or any other identifier names. All the Python keywords contain lowercase letters only.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nand\n\n\nexec\n\n\nnot\n\n\n\n\n\n\nas\n\n\nfinally\n\n\nor\n\n\n\n\n\n\nassert\n\n\nfor\n\n\npass\n\n\n\n\n\n\nbreak\n\n\nfrom\n\n\nprint\n\n\n\n\n\n\nclass\n\n\nglobal\n\n\nraise\n\n\n\n\n\n\ncontinue\n\n\nif\n\n\nreturn\n\n\n\n\n\n\ndef\n\n\nimport\n\n\ntry\n\n\n\n\n\n\ndel\n\n\nin\n\n\nwhile\n\n\n\n\n\n\nelif\n\n\nis\n\n\nwith\n\n\n\n\n\n\nelse\n\n\nlambda\n\n\nyield\n\n\n\n\n\n\nexcept\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nSource:\n \n\n\n https://www.tutorialspoint.com", + "location": "/beginner/Start_Coding_With_Python/", + "text": "What Is a Program?\n\n\nA program is a sequence of instructions that specifies how to perform a computation.\nThe computation might be something mathematical, such as solving a system of equat\nions or finding the roots of a polynomial, but it can also be a symbolic computation,\nsuch as searching and replacing text in a document or (strangely enough) compiling a\nprogram.\nThe details look different in different languages, but a few basic instructions appear in\njust about every language:\n\n\ninput: \n\n\n\n\nGet data from the keyboard, a file, or some other device.\n\n\n\n\noutput:\n\n\n\n\nDisplay data on the screen or send data to a file or other device.\n\n\n\n\nmath:\n\n\n\n\nPerform basic mathematical operations like addition and\n multiplication.\n\n\n\n\nconditional execution:\n\n\n\n\nCheck for certain conditions and execute the appropriate code.\n\n\n\n\nrepetition:\n\n\n\n\nPerform some action repeatedly, usually with some variation.\n\n\n\n\nBelieve it or not, that\u2019s pretty much all there is to it. Every program you\u2019ve ever used, no\nmatter how complicated, is made up of instructions that look pretty much like these. So\nyou can think of programming as the process of breaking a large, complex task into\nsmaller and smaller subtasks until the subtasks are simple enough to be performed with\none of these basic instructions.\nThat may be a little vague, but we will come back to this topic when we talk about\nalgorithms.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nRun Python Scripts\n\n\nIf you can't execute or run a Python script, then programming is pointless. When you run a Python script, the interpreter converts a Python program into something that that the computer can understand. Executing a Python program can be done in two ways: calling the Python interpreter with a shebang line, and using the interactive Python shell.\n\n\nRun a Python Script as a File\n\n\nGenerally programmers write stand alone scripts, that are independent to live environments. Then they save it with a \".py\" extension, which indicates to the operating system and programmer that the file is actually a Python program. After the interpreter is invoked, it reads and interprets the file. The way Python scripts are run on Windows versus Unix based operating systems is very different. We'll show you the difference, and how to run a Python script on Windows and Unix platforms.\n\n\nRun a Python script under Windows with the Command Prompt\n\n\nWindows users must pass the path of the program as an argument to the Python interpreter. Such as follows:\n\n\nC:\n\\P\nython27\n\\p\nython.exe C:\n\\U\nsers\n\\U\nsername\n\\D\nesktop\n\\m\ny_python_script.py\n\n\n\n\n\nNote that you must use the full path of the Python interpreter. If you want to simply type python.exe C:\\Users\\Username\\Desktop\\my_python_script.py you must add python.exe to your PATH environmental variable.\nNote that Windows comes with two Python executables - python.exe and pythonw.exe. If you want a terminal to pop-up when you run your script, use python.exe However if you don't want any terminal pop-up, use pythonw.exe. pythonw.exe is typically used for GUI programs, where you only want to display your program, not the terminal.\n\n\nRun a Python Script Under Mac, Linux, BSD, Unix, etc\n\n\nOn platforms like Mac, BSD or Linux (Unix) you can put a \"shebang\" line as first line of the program which indicates the location of the Python interpreter on the hard drive. It's in the following format:\n\n\n#!/path/to/interpreter\n\n\n\n\n\n\nA common shebang line used for the Python interpreter is as follows:\n\n\n#!/usr/bin/env python\n\n\n\n\n\n\nYou must then make the script executable, using the following command:\n\n\nchmod +x my_python_script.py\n\n\n\n\n\nUnlike Windows, the Python interpreter is typically already in the $PATH environmental variable, so adding it is un-necessary.\n\n\nYou can then run a program by invoking the Python interpreter manually as follows:\n\n\npython firstprogram.py\n\n\n\n\n\nPython Execution with the Shell (Live Interpreter)\n\n\nAssuming that you already have Python installed and running well (if you're getting an error, see this post), open the terminal or console and type 'python' and hit the 'Enter' key. You will then be directed immediately to the Python live interpreter. Your screen will display a message something like:\n\n\nuser@hostname:~ python\nPython \n3\n.3.0 \n(\ndefault, Nov \n23\n \n2012\n, \n10\n:26:01\n)\n \n\n[\nGCC \n4\n.2.1 Compatible Apple Clang \n4\n.1 \n((\ntags/Apple/clang-421.11.66\n))]\n on darwin\nType \nhelp\n, \ncopyright\n, \ncredits\n or \nlicense\n \nfor\n more information.\n\n\n\n\n\n\n\nThe Python programmer should keep in mind one thing: that while working with the live interpreter, everything is read and interpreted in real-time. For example loops iterate immediately, unless they are part of function. So it requires some mental planning. Using the Python shell is typically used to execute code interactively. If you want to run a Python script from the interpreter, you must either import it or call the Python executable.\n\n\n\n\nSource:\n \n\n\n http://pythoncentral.io/execute-python-script-file-shell/\n\n\n\n\nA Good First Program\n\n\nType the following text into a single file named \nex1.py\n. Python works best with files ending in \n.py\n.\n\n\nprint\n \nHello World!\n\n\nprint\n \nHello Again\n\n\nprint\n \nI like typing this.\n\n\nprint\n \nThis is fun.\n\n\nprint\n \nYay! Printing.\n\n\nprint\n \nI\nd much rather you \nnot\n.\n\n\nprint\n \nI \nsaid\n do not touch this.\n\n\n\n\n\n\nYour Atom text editor should look something like this on all platforms:\n\n\n\n\nDon't worry if your editor doesn't look exactly the same, it should be close though. You may have a slightly different window header, maybe slightly different colors, and the left side of your Atom window won't say \"zedshaw\" but will instead show the directory you used for saving your files. All of those differences are fine.\n\n\nWhen you create this file, keep in mind these points:\n\n\n\n\nI did not type the line numbers on the left. Those are printed in the book so I can talk about specific lines by saying, \"See line 5...\" You do not type line numbers into Python scripts.\n\n\nI have the print at the beginning of the line and it looks exactly the same as what I have in ex1.py. Exactly means exactly, not kind of sort of the same. Every single character has to match for it to work. Color doesn't matter, only the characters you type.\n\n\n\n\nIn Terminal run the file by typing:\n\n\npython ex1.py\n\n\n\n\n\nIf you did it right then you should see the same output as I in the What You Should See section of this exercise. If not, you have done something wrong. No, the computer is not wrong.\n\n\nWhat You Should See\n\n\nOn Mac OS X in the Terminal you should see this:\n\n\nOn Windows in PowerShell you should see this:\n\n\n\nYou may see different names, before the python ex1.py command, but the important part is that you type the command and see the output is the same as mine.\n\n\n\n\n\nIf you have an error it will look like this:\n\n\n$ python ex/ex1.py\n File \nex/ex1.py\n, line \n3\n\n print \nI like typing this.\n\n\n ^\n\n\nSyntaxError: EOL while scanning string literal\n\n\n\n\n\n\nIt's important that you can read these error messages because you will be making many of these mistakes. Even I make many of these mistakes. Let's look at this line by line.\n\n\n\n\nWe ran our command in the Terminal to run the ex1.py script.\n\n\nPython tells us that the file ex1.py has an error on line 3.\n\n\nIt prints this line of code for us to see it.\n\n\nThen it puts a ^ (caret) character to point at where the problem is. Notice the missing \" (double-quote) character?\n\n\nFinally, it prints out a \"SyntaxError\" and tells us something about what might be the error. Usually these are very cryptic, but if you copy that text into a search engine, you will find someone else who's had that error and you can probably figure out how to fix it.\n\n\n\n\n\n\nSource:\n \n\n\n \nLEARN PYTHON THE HARD WAY\n by Zed A. Shaw - 2013\n\n\n\n\nDebugging and Errors\n\n\nWhat Is Debugging?\n\n\nProgramming is error-prone. For whimsical reasons, programming errors are called\n\nbugs\n and the process of tracking them down is called \ndebugging\n.\nThree kinds of errors can occur in a program: syntax errors, runtime errors, and se\nmantic errors. It is useful to distinguish between them in order to track them down more\nquickly.\n\n\nError Types :\n\n\nSyntax Errors\n\n\nPython can only execute a program if the syntax is correct; otherwise, the interpreter\ndisplays an error message. Syntax refers to the structure of a program and the rules\nabout that structure.For example, parentheses have to come in matching pairs, so\n(1 + 2) is legal, but 8) is a \nsyntax error\n.\nIn English readers can tolerate most syntax errors, which is why we can read the poetry\nof e. e. cummings without spewing error messages. Python is not so forgiving. If there\nis a single syntax error anywhere in your program, Python will display an error message\nand quit, and you will not be able to run your program. During the first few weeks of\nyour programming career, you will probably spend a lot of time tracking down syntax\nerrors. As you gain experience, you will make fewer errors and find them faster.\n\n\nRuntime Errors\n\n\nThe second type of error is a runtime error, so called because the error does not appear\nuntil after the program has started running. These errors are also called exceptions\nbecause they usually indicate that something exceptional (and bad) has happened.\nRuntime errors are rare in the simple programs you will see in the first few chapters, so\nit might be a while before you encounter one.\n\n\nSemantic Errors\n\n\nThe third type of error is the semantic error. If there is a semantic error in your program,\nit will run successfully in the sense that the computer will not generate any error mess\nages, but it will not do the right thing. It will do something else. Specifically, it will do\nwhat you told it to do.\nThe problem is that the program you wrote is not the program you wanted to write. The\nmeaning of the program (its semantics) is wrong. Identifying semantic errors can be\ntricky because it requires you to work backward by looking at the output of the program\nand trying to figure out what it is doing.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nReserved Words\n\n\nThe following list shows the Python keywords. These are reserved words and you cannot use them as constants or variables or any other identifier names. All the Python keywords contain lowercase letters only.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nand\n\n\nexec\n\n\nnot\n\n\n\n\n\n\nas\n\n\nfinally\n\n\nor\n\n\n\n\n\n\nassert\n\n\nfor\n\n\npass\n\n\n\n\n\n\nbreak\n\n\nfrom\n\n\nprint\n\n\n\n\n\n\nclass\n\n\nglobal\n\n\nraise\n\n\n\n\n\n\ncontinue\n\n\nif\n\n\nreturn\n\n\n\n\n\n\ndef\n\n\nimport\n\n\ntry\n\n\n\n\n\n\ndel\n\n\nin\n\n\nwhile\n\n\n\n\n\n\nelif\n\n\nis\n\n\nwith\n\n\n\n\n\n\nelse\n\n\nlambda\n\n\nyield\n\n\n\n\n\n\nexcept\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nSource:\n \n\n\n https://www.tutorialspoint.com", "title": "Start Coding With Python" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#what-is-a-program", - "text": "A program is a sequence of instructions that specifies how to perform a computation.\nThe computation might be something mathematical, such as solving a system of equat\nions or finding the roots of a polynomial, but it can also be a symbolic computation,\nsuch as searching and replacing text in a document or (strangely enough) compiling a\nprogram.\nThe details look different in different languages, but a few basic instructions appear in\njust about every language: input: Get data from the keyboard, a file, or some other device. output: Display data on the screen or send data to a file or other device. math: Perform basic mathematical operations like addition and\n multiplication. conditional execution: Check for certain conditions and execute the appropriate code. repetition: Perform some action repeatedly, usually with some variation. Believe it or not, that\u2019s pretty much all there is to it. Every program you\u2019ve ever used, no\nmatter how complicated, is made up of instructions that look pretty much like these. So\nyou can think of programming as the process of breaking a large, complex task into\nsmaller and smaller subtasks until the subtasks are simple enough to be performed with\none of these basic instructions.\nThat may be a little vague, but we will come back to this topic when we talk about\nalgorithms. Source: Think Python by Allen B. Downey - 2012", + "location": "/beginner/Start_Coding_With_Python/#what-is-a-program", + "text": "A program is a sequence of instructions that specifies how to perform a computation.\nThe computation might be something mathematical, such as solving a system of equat\nions or finding the roots of a polynomial, but it can also be a symbolic computation,\nsuch as searching and replacing text in a document or (strangely enough) compiling a\nprogram.\nThe details look different in different languages, but a few basic instructions appear in\njust about every language: input: Get data from the keyboard, a file, or some other device. output: Display data on the screen or send data to a file or other device. math: Perform basic mathematical operations like addition and\n multiplication. conditional execution: Check for certain conditions and execute the appropriate code. repetition: Perform some action repeatedly, usually with some variation. Believe it or not, that\u2019s pretty much all there is to it. Every program you\u2019ve ever used, no\nmatter how complicated, is made up of instructions that look pretty much like these. So\nyou can think of programming as the process of breaking a large, complex task into\nsmaller and smaller subtasks until the subtasks are simple enough to be performed with\none of these basic instructions.\nThat may be a little vague, but we will come back to this topic when we talk about\nalgorithms. Source: Think Python by Allen B. Downey - 2012", "title": "What Is a Program?" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#run-python-scripts", - "text": "If you can't execute or run a Python script, then programming is pointless. When you run a Python script, the interpreter converts a Python program into something that that the computer can understand. Executing a Python program can be done in two ways: calling the Python interpreter with a shebang line, and using the interactive Python shell.", + "location": "/beginner/Start_Coding_With_Python/#run-python-scripts", + "text": "If you can't execute or run a Python script, then programming is pointless. When you run a Python script, the interpreter converts a Python program into something that that the computer can understand. Executing a Python program can be done in two ways: calling the Python interpreter with a shebang line, and using the interactive Python shell.", "title": "Run Python Scripts" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#run-a-python-script-as-a-file", - "text": "Generally programmers write stand alone scripts, that are independent to live environments. Then they save it with a \".py\" extension, which indicates to the operating system and programmer that the file is actually a Python program. After the interpreter is invoked, it reads and interprets the file. The way Python scripts are run on Windows versus Unix based operating systems is very different. We'll show you the difference, and how to run a Python script on Windows and Unix platforms.", + "location": "/beginner/Start_Coding_With_Python/#run-a-python-script-as-a-file", + "text": "Generally programmers write stand alone scripts, that are independent to live environments. Then they save it with a \".py\" extension, which indicates to the operating system and programmer that the file is actually a Python program. After the interpreter is invoked, it reads and interprets the file. The way Python scripts are run on Windows versus Unix based operating systems is very different. We'll show you the difference, and how to run a Python script on Windows and Unix platforms.", "title": "Run a Python Script as a File" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#run-a-python-script-under-windows-with-the-command-prompt", - "text": "Windows users must pass the path of the program as an argument to the Python interpreter. Such as follows: C: \\P ython27 \\p ython.exe C: \\U sers \\U sername \\D esktop \\m y_python_script.py Note that you must use the full path of the Python interpreter. If you want to simply type python.exe C:\\Users\\Username\\Desktop\\my_python_script.py you must add python.exe to your PATH environmental variable.\nNote that Windows comes with two Python executables - python.exe and pythonw.exe. If you want a terminal to pop-up when you run your script, use python.exe However if you don't want any terminal pop-up, use pythonw.exe. pythonw.exe is typically used for GUI programs, where you only want to display your program, not the terminal.", + "location": "/beginner/Start_Coding_With_Python/#run-a-python-script-under-windows-with-the-command-prompt", + "text": "Windows users must pass the path of the program as an argument to the Python interpreter. Such as follows: C: \\P ython27 \\p ython.exe C: \\U sers \\U sername \\D esktop \\m y_python_script.py Note that you must use the full path of the Python interpreter. If you want to simply type python.exe C:\\Users\\Username\\Desktop\\my_python_script.py you must add python.exe to your PATH environmental variable.\nNote that Windows comes with two Python executables - python.exe and pythonw.exe. If you want a terminal to pop-up when you run your script, use python.exe However if you don't want any terminal pop-up, use pythonw.exe. pythonw.exe is typically used for GUI programs, where you only want to display your program, not the terminal.", "title": "Run a Python script under Windows with the Command Prompt" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#run-a-python-script-under-mac-linux-bsd-unix-etc", - "text": "On platforms like Mac, BSD or Linux (Unix) you can put a \"shebang\" line as first line of the program which indicates the location of the Python interpreter on the hard drive. It's in the following format: #!/path/to/interpreter A common shebang line used for the Python interpreter is as follows: #!/usr/bin/env python You must then make the script executable, using the following command: chmod +x my_python_script.py Unlike Windows, the Python interpreter is typically already in the $PATH environmental variable, so adding it is un-necessary. You can then run a program by invoking the Python interpreter manually as follows: python firstprogram.py", + "location": "/beginner/Start_Coding_With_Python/#run-a-python-script-under-mac-linux-bsd-unix-etc", + "text": "On platforms like Mac, BSD or Linux (Unix) you can put a \"shebang\" line as first line of the program which indicates the location of the Python interpreter on the hard drive. It's in the following format: #!/path/to/interpreter A common shebang line used for the Python interpreter is as follows: #!/usr/bin/env python You must then make the script executable, using the following command: chmod +x my_python_script.py Unlike Windows, the Python interpreter is typically already in the $PATH environmental variable, so adding it is un-necessary. You can then run a program by invoking the Python interpreter manually as follows: python firstprogram.py", "title": "Run a Python Script Under Mac, Linux, BSD, Unix, etc" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#python-execution-with-the-shell-live-interpreter", - "text": "Assuming that you already have Python installed and running well (if you're getting an error, see this post), open the terminal or console and type 'python' and hit the 'Enter' key. You will then be directed immediately to the Python live interpreter. Your screen will display a message something like: user@hostname:~ python\nPython 3 .3.0 ( default, Nov 23 2012 , 10 :26:01 ) [ GCC 4 .2.1 Compatible Apple Clang 4 .1 (( tags/Apple/clang-421.11.66 ))] on darwin\nType help , copyright , credits or license for more information. The Python programmer should keep in mind one thing: that while working with the live interpreter, everything is read and interpreted in real-time. For example loops iterate immediately, unless they are part of function. So it requires some mental planning. Using the Python shell is typically used to execute code interactively. If you want to run a Python script from the interpreter, you must either import it or call the Python executable. Source: http://pythoncentral.io/execute-python-script-file-shell/", + "location": "/beginner/Start_Coding_With_Python/#python-execution-with-the-shell-live-interpreter", + "text": "Assuming that you already have Python installed and running well (if you're getting an error, see this post), open the terminal or console and type 'python' and hit the 'Enter' key. You will then be directed immediately to the Python live interpreter. Your screen will display a message something like: user@hostname:~ python\nPython 3 .3.0 ( default, Nov 23 2012 , 10 :26:01 ) [ GCC 4 .2.1 Compatible Apple Clang 4 .1 (( tags/Apple/clang-421.11.66 ))] on darwin\nType help , copyright , credits or license for more information. The Python programmer should keep in mind one thing: that while working with the live interpreter, everything is read and interpreted in real-time. For example loops iterate immediately, unless they are part of function. So it requires some mental planning. Using the Python shell is typically used to execute code interactively. If you want to run a Python script from the interpreter, you must either import it or call the Python executable. Source: http://pythoncentral.io/execute-python-script-file-shell/", "title": "Python Execution with the Shell (Live Interpreter)" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#a-good-first-program", - "text": "Type the following text into a single file named ex1.py . Python works best with files ending in .py . print Hello World! print Hello Again print I like typing this. print This is fun. print Yay! Printing. print I d much rather you not . print I said do not touch this. Your Atom text editor should look something like this on all platforms: Don't worry if your editor doesn't look exactly the same, it should be close though. You may have a slightly different window header, maybe slightly different colors, and the left side of your Atom window won't say \"zedshaw\" but will instead show the directory you used for saving your files. All of those differences are fine. When you create this file, keep in mind these points: I did not type the line numbers on the left. Those are printed in the book so I can talk about specific lines by saying, \"See line 5...\" You do not type line numbers into Python scripts. I have the print at the beginning of the line and it looks exactly the same as what I have in ex1.py. Exactly means exactly, not kind of sort of the same. Every single character has to match for it to work. Color doesn't matter, only the characters you type. In Terminal run the file by typing: python ex1.py If you did it right then you should see the same output as I in the What You Should See section of this exercise. If not, you have done something wrong. No, the computer is not wrong.", + "location": "/beginner/Start_Coding_With_Python/#a-good-first-program", + "text": "Type the following text into a single file named ex1.py . Python works best with files ending in .py . print Hello World! print Hello Again print I like typing this. print This is fun. print Yay! Printing. print I d much rather you not . print I said do not touch this. Your Atom text editor should look something like this on all platforms: Don't worry if your editor doesn't look exactly the same, it should be close though. You may have a slightly different window header, maybe slightly different colors, and the left side of your Atom window won't say \"zedshaw\" but will instead show the directory you used for saving your files. All of those differences are fine. When you create this file, keep in mind these points: I did not type the line numbers on the left. Those are printed in the book so I can talk about specific lines by saying, \"See line 5...\" You do not type line numbers into Python scripts. I have the print at the beginning of the line and it looks exactly the same as what I have in ex1.py. Exactly means exactly, not kind of sort of the same. Every single character has to match for it to work. Color doesn't matter, only the characters you type. In Terminal run the file by typing: python ex1.py If you did it right then you should see the same output as I in the What You Should See section of this exercise. If not, you have done something wrong. No, the computer is not wrong.", "title": "A Good First Program" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#what-you-should-see", - "text": "On Mac OS X in the Terminal you should see this: \nOn Windows in PowerShell you should see this: You may see different names, before the python ex1.py command, but the important part is that you type the command and see the output is the same as mine. If you have an error it will look like this: $ python ex/ex1.py\n File ex/ex1.py , line 3 \n print I like typing this. ^ SyntaxError: EOL while scanning string literal It's important that you can read these error messages because you will be making many of these mistakes. Even I make many of these mistakes. Let's look at this line by line. We ran our command in the Terminal to run the ex1.py script. Python tells us that the file ex1.py has an error on line 3. It prints this line of code for us to see it. Then it puts a ^ (caret) character to point at where the problem is. Notice the missing \" (double-quote) character? Finally, it prints out a \"SyntaxError\" and tells us something about what might be the error. Usually these are very cryptic, but if you copy that text into a search engine, you will find someone else who's had that error and you can probably figure out how to fix it. Source: LEARN PYTHON THE HARD WAY by Zed A. Shaw - 2013", + "location": "/beginner/Start_Coding_With_Python/#what-you-should-see", + "text": "On Mac OS X in the Terminal you should see this: \nOn Windows in PowerShell you should see this: You may see different names, before the python ex1.py command, but the important part is that you type the command and see the output is the same as mine. If you have an error it will look like this: $ python ex/ex1.py\n File ex/ex1.py , line 3 \n print I like typing this. ^ SyntaxError: EOL while scanning string literal It's important that you can read these error messages because you will be making many of these mistakes. Even I make many of these mistakes. Let's look at this line by line. We ran our command in the Terminal to run the ex1.py script. Python tells us that the file ex1.py has an error on line 3. It prints this line of code for us to see it. Then it puts a ^ (caret) character to point at where the problem is. Notice the missing \" (double-quote) character? Finally, it prints out a \"SyntaxError\" and tells us something about what might be the error. Usually these are very cryptic, but if you copy that text into a search engine, you will find someone else who's had that error and you can probably figure out how to fix it. Source: LEARN PYTHON THE HARD WAY by Zed A. Shaw - 2013", "title": "What You Should See" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#debugging-and-errors", - "text": "", + "location": "/beginner/Start_Coding_With_Python/#debugging-and-errors", + "text": "", "title": "Debugging and Errors" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#what-is-debugging", - "text": "Programming is error-prone. For whimsical reasons, programming errors are called bugs and the process of tracking them down is called debugging .\nThree kinds of errors can occur in a program: syntax errors, runtime errors, and se\nmantic errors. It is useful to distinguish between them in order to track them down more\nquickly.", + "location": "/beginner/Start_Coding_With_Python/#what-is-debugging", + "text": "Programming is error-prone. For whimsical reasons, programming errors are called bugs and the process of tracking them down is called debugging .\nThree kinds of errors can occur in a program: syntax errors, runtime errors, and se\nmantic errors. It is useful to distinguish between them in order to track them down more\nquickly.", "title": "What Is Debugging?" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#error-types", - "text": "", + "location": "/beginner/Start_Coding_With_Python/#error-types", + "text": "", "title": "Error Types :" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#syntax-errors", - "text": "Python can only execute a program if the syntax is correct; otherwise, the interpreter\ndisplays an error message. Syntax refers to the structure of a program and the rules\nabout that structure.For example, parentheses have to come in matching pairs, so\n(1 + 2) is legal, but 8) is a syntax error .\nIn English readers can tolerate most syntax errors, which is why we can read the poetry\nof e. e. cummings without spewing error messages. Python is not so forgiving. If there\nis a single syntax error anywhere in your program, Python will display an error message\nand quit, and you will not be able to run your program. During the first few weeks of\nyour programming career, you will probably spend a lot of time tracking down syntax\nerrors. As you gain experience, you will make fewer errors and find them faster.", + "location": "/beginner/Start_Coding_With_Python/#syntax-errors", + "text": "Python can only execute a program if the syntax is correct; otherwise, the interpreter\ndisplays an error message. Syntax refers to the structure of a program and the rules\nabout that structure.For example, parentheses have to come in matching pairs, so\n(1 + 2) is legal, but 8) is a syntax error .\nIn English readers can tolerate most syntax errors, which is why we can read the poetry\nof e. e. cummings without spewing error messages. Python is not so forgiving. If there\nis a single syntax error anywhere in your program, Python will display an error message\nand quit, and you will not be able to run your program. During the first few weeks of\nyour programming career, you will probably spend a lot of time tracking down syntax\nerrors. As you gain experience, you will make fewer errors and find them faster.", "title": "Syntax Errors" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#runtime-errors", - "text": "The second type of error is a runtime error, so called because the error does not appear\nuntil after the program has started running. These errors are also called exceptions\nbecause they usually indicate that something exceptional (and bad) has happened.\nRuntime errors are rare in the simple programs you will see in the first few chapters, so\nit might be a while before you encounter one.", + "location": "/beginner/Start_Coding_With_Python/#runtime-errors", + "text": "The second type of error is a runtime error, so called because the error does not appear\nuntil after the program has started running. These errors are also called exceptions\nbecause they usually indicate that something exceptional (and bad) has happened.\nRuntime errors are rare in the simple programs you will see in the first few chapters, so\nit might be a while before you encounter one.", "title": "Runtime Errors" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#semantic-errors", - "text": "The third type of error is the semantic error. If there is a semantic error in your program,\nit will run successfully in the sense that the computer will not generate any error mess\nages, but it will not do the right thing. It will do something else. Specifically, it will do\nwhat you told it to do.\nThe problem is that the program you wrote is not the program you wanted to write. The\nmeaning of the program (its semantics) is wrong. Identifying semantic errors can be\ntricky because it requires you to work backward by looking at the output of the program\nand trying to figure out what it is doing. Source: Think Python by Allen B. Downey - 2012", + "location": "/beginner/Start_Coding_With_Python/#semantic-errors", + "text": "The third type of error is the semantic error. If there is a semantic error in your program,\nit will run successfully in the sense that the computer will not generate any error mess\nages, but it will not do the right thing. It will do something else. Specifically, it will do\nwhat you told it to do.\nThe problem is that the program you wrote is not the program you wanted to write. The\nmeaning of the program (its semantics) is wrong. Identifying semantic errors can be\ntricky because it requires you to work backward by looking at the output of the program\nand trying to figure out what it is doing. Source: Think Python by Allen B. Downey - 2012", "title": "Semantic Errors" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#reserved-words", - "text": "The following list shows the Python keywords. These are reserved words and you cannot use them as constants or variables or any other identifier names. All the Python keywords contain lowercase letters only. and exec not as finally or assert for pass break from print class global raise continue if return def import try del in while elif is with else lambda yield except Source: https://www.tutorialspoint.com", + "location": "/beginner/Start_Coding_With_Python/#reserved-words", + "text": "The following list shows the Python keywords. These are reserved words and you cannot use them as constants or variables or any other identifier names. All the Python keywords contain lowercase letters only. and exec not as finally or assert for pass break from print class global raise continue if return def import try del in while elif is with else lambda yield except Source: https://www.tutorialspoint.com", "title": "Reserved Words" - }, - { - "location": "/beginner/Datatype_And_Variables/", - "text": "Datatype \n Variables\n\n\nVariables are named locations which are used to store references to the object stored in memory. The names we choose for variables and functions are commonly known as Identifiers. In python Identifiers must obey the following rules.\n\n\n\n\nAll identifiers must start with letter or underscore ( _ ) , you\n can\u2019t use digits. For e.g my_var is valid identifier while 1digit \n is not.\n\n\nIdentifiers can contain letters, digits and underscores ( _ ). \n\n\nThey can be of any length.\n\n\n\n\nIdentifier can\u2019t be a keyword (keywords are reserved words that\n Python uses for special purpose).Following are Keywords in python 3.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nand\n\n\nexec\n\n\nnot\n\n\n\n\n\n\nas\n\n\nfinally\n\n\nor\n\n\n\n\n\n\nassert\n\n\nfor\n\n\npass\n\n\n\n\n\n\nbreak\n\n\nfrom\n\n\nprint\n\n\n\n\n\n\nclass\n\n\nglobal\n\n\nraise\n\n\n\n\n\n\ncontinue\n\n\nif\n\n\nreturn\n\n\n\n\n\n\ndef\n\n\nimport\n\n\ntry\n\n\n\n\n\n\ndel\n\n\nin\n\n\nwhile\n\n\n\n\n\n\nelif\n\n\nis\n\n\nwith\n\n\n\n\n\n\nelse\n\n\nlambda\n\n\nyield\n\n\n\n\n\n\nexcept\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nAssigning Values to Variables\n\n\nValues are basic things that programs works with. For e.g 1 , 11 , 3.14 , \"hello\" are all values. In programming terminology they are also commonly known as literals. Literals can be of different type for e.g 1 , 11 are of type int , 3.14 is float and \"hello\" is string . Remember in python everything is object even basic data types like int, float, string, we will elaborate more on this in later chapters.\n\n\nIn python you don\u2019t need to declare types of variable ahead of time. Interpreter automatically detects the type of the variable by the data it contains. To assign value to a variable equal sign ( = ) is used. = is also known as assignment operator.\n\n\nFollowing are some examples of variable declaration:\n\n\nx\n \n=\n \n100\n \n# x is integer\n\n\npi\n \n=\n \n3.14\n \n# pi is float\n\n\nempname\n \n=\n \npython is great\n \n# empname is string\n\n\n\na\n \n=\n \nb\n \n=\n \nc\n \n=\n \n100\n \n# this statement assign 100 to c, b and a.\n\n\n\n\n\n\n\n\nNote:\n\nIn the above code x stores reference to the 100 ( which is an int object ) , x don\u2019t store 100 itself.\n\n\n\n\nIn Python comments are preceded by a pound sign ( # ). Comments are not programming statements that python interpreter executes while running the program. Comments are used by programmers to remind themselves how the program works. They are also used to write program documentation.\n\n\n#display hello world\n\n\nprint\n(\nhello world\n)\n\n\n\n\n\n\nSimultaneous Assignments\n\n\nPython allow simultaneous assignment syntax like this:\n\n\nvar1\n,\n \nvar2\n,\n \n...\n,\n \nvarn\n \n=\n \nexp1\n,\n \nexp2\n,\n \n...\n,\n \nexpn\n\n\n\n\n\n\nthis statements tells the python to evaluate all the expression on the right and assign them to the corresponding variables on the left. Simultaneous Assignments is helpful to swap values of two variables. For e.g\n\n\n \nx\n \n=\n \n1\n\n\n \ny\n \n=\n \n2\n\n\n\n \ny\n,\n \nx\n \n=\n \nx\n,\n \ny\n \n# assign y value to x and x value to y\n\n\n\n\n\n\nPython Data Types\n\n\nPython has 5 standard data types namely.\na) \nNumbers\n\nb) \nString\n\nc) \nList\n\nd) \nTuple\n\ne) \nDictionary\n\nf) Boolean \u2013 In Python True and False are boolean literals. But the following values are also considered as false.\n\n\n[] \u2013 empty list , () \u2013 empty tuple , {} \u2013 empty dictionary\n \n\n\nReceiving input from Console\n\n\ninput() function is used to receive input from the console.\n\n\nSyntax: input([prompt]) -\n string\n\n\ninput() function accepts an optional string argument called prompt and returns a string.\n\n\n \nname\n \n=\n \ninput\n(\nEnter your name: \n)\n\n\n \nEnter\n \nyour\n \nname\n:\n \ntim\n\n\n \nname\n\n\ntim\n\n\n\n\n\n\nNote that input() returns string even if you enter a number, to convert it to an integer you can use int() or eval() .\n\n\n \nage\n \n=\n \nint\n(\ninput\n(\nEnter your age: \n))\n\n\nEnter\n \nyour\n \nage\n:\n \n22\n\n\n \nage\n\n\n22\n\n\n \ntype\n(\nage\n)\n\n\nclass\n \nint\n\n\n\n\n\n\n\n\nSource:\n \n\n\n http://thepythonguru.com\n\n\n\n\nUnderstanding Python variables and Memory Management\n\n\nHave you ever noticed any difference between variables in Python and C? For example, when you do an assignment like the following in C, it actually creates a block of memory space so that it can hold the value for that variable\n\n\nint\n \na\n \n=\n \n1\n;\n\n\n\n\n\n\nYou can think of it as putting the value assigned in a box with the variable name as shown below.\n\n\n\nAnd for all the variables you create a new box is created with the variable name to hold the value. If you change the value of the variable the box will be updated with the new value. That means doing\n\n\na\n \n=\n \n2\n;\n\n\n\n\n\n\nwill result in\n\n\n\n\nAssigning one variable to another makes a copy of the value and put that value in the new box.\n\n\nint\n \nb\n \n=\n \na\n;\n\n\n\n\n\n\n \n\n\nBut in Python variables work more like tags unlike the boxes you have seen before. When you do an assignment in Python, it tags the value with the variable name.\n\n\na\n \n=\n \n1\n\n\n\n\n\n\n\n\nand if you change the value of the varaible, it just changes the tag to the new value in memory. You dont need to do the housekeeping job of freeing the memory here. Python's Automatic Garbage Collection does it for you. When a value is without names/tags it is automatically removed from memory.\n\n\na\n \n=\n \n2\n\n\n\n\n\n\n\n\nAssigning one variable to another makes a new tag bound to the same value as show below.\n\n\nb\n \n=\n \na\n\n\n\n\n\n\n\nOther languages have 'variables'. Python has 'names'.\n\n\nA bit about Python's memory management\n\n\nAs you have seen before, a value will have only one copy in memory and all the variables having this value will refer to this memory location. For example when you have variables a, b, c having a value 10, it doesn't mean that there will be 3 copy of 10s in memory. There will be only one 10 and all the variables a, b, c will point to this value. Once a variable is updated, say you are doing a += 1 a new value 11 will be allocated in memory and a will be pointing to this.\n\n\nLet's check this behaviour with Python Interpreter. Start the Python Shell and try the following for yourselves.\n\n\n \na\n \n=\n \n10\n\n\n \nb\n \n=\n \n10\n\n\n \nc\n \n=\n \n10\n\n\n \nid\n(\na\n),\n \nid\n(\nb\n),\n \nid\n(\nc\n)\n\n\n(\n140621897573616\n,\n \n140621897573616\n,\n \n140621897573616\n)\n\n\n \na\n \n+=\n \n1\n\n\n \nid\n(\na\n)\n\n\n140621897573592\n\n\n\n\n\n\nid() will return an objects memory address (object's identity). As you have noticed, when you assign the same integer value to the variables, we see the same ids. But this assumption does not hold true all the time. See the following for example\n\n\n \nx\n \n=\n \n500\n\n\n \ny\n \n=\n \n500\n\n\n \nid\n(\nx\n)\n\n\n4338740848\n\n\n \nid\n(\ny\n)\n\n\n4338741040\n\n\n\n\n\n\nWhat happened here? Even after assigning the same integer values to different variable names, we are getting two different ids here. These are actually the effects of CPython optimization we are observing here. CPython implementation keeps an array of integer objects for all integers between -5 and 256. So when we create an integer in that range, they simply back reference to the existing object. You may refer the following \nlinks\n for more information.\n\n\nLet's take a look at strings now.\n\n\n \ns1\n \n=\n \nhello\n\n\n \ns2\n \n=\n \nhello\n\n\n \nid\n(\ns1\n),\n \nid\n(\ns2\n)\n\n\n(\n4454725888\n,\n \n4454725888\n)\n\n\n \ns1\n \n==\n \ns2\n\n\nTrue\n\n\n \ns1\n \nis\n \ns2\n\n\nTrue\n\n\n \ns3\n \n=\n \nhello, world!\n\n\n \ns4\n \n=\n \nhello, world!\n\n\n \nid\n(\ns3\n),\n \nid\n(\ns4\n)\n\n\n(\n4454721608\n,\n \n4454721664\n)\n\n\n \ns3\n \n==\n \ns4\n\n\nTrue\n\n\n \ns3\n \nis\n \ns4\n\n\nFalse\n\n\n\n\n\n\nLooks interesting, isn't it? When the string was a simple and shorter one the variable names where referring to the same object in memory. But when they became bigger, this was not the case. This is called interning, and Python does interning (to some extent) of shorter string literals (as in s1 and s2) which are created at compile time. But in general, Python string literals creates a new string object each time (as in s3 and s4). Interning is runtime dependant and is always a trade-off between memory use and the cost of checking if you are creating the same string. There's a built-in intern() function to forcefully apply interning. Read more about interning from the following links.\n\n\nStack Overflow: Does Python intern Strings?\n\n\nStack Overflow: Python String Interning\n\n\nInternals of Python String Interning\n\n\n\n\nSource:\n \n\n\n http://foobarnbaz.com/2012/07/08/understanding-python-variables/\n\n\n\n\nAssignment statements in Python are more interesting than you might think\n\n\nIn this article, we will take a deep look at three kinds of assignment statements in Python and discuss what\u2019s going on under the hood.\n\n\n \nmy_string\n \n=\n \nHello World\n \n# right hand side is a simple expression\n\n\n \nanother_string\n \n=\n \nmy_string\n \n# right hand side is another variable\n\n\n \nanother_string\n \n=\n \nanother_string\n \n+\n \n!\n \n# right hand side is an operation\n\n\n\n\n\n\nWhat we find may surprise you.\n\n\nWhat happens when the right hand side is a simple expression?\n\n\n \nmy_string\n \n=\n \nHello World\n\n\n\n\n\n\nIn simple terms, this creates a string \u201cHello World\u201d in memory and assigns the name my_string to it. If you are using CPython[1], then we can even check the memory address explicitly by using the built in function id .\n\n\n \nmy_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n \n\n \nid\n(\nmy_string\n)\n\n\n140400709562064\n\n\n\n\n\n\nThat big number 140400709562064 denotes where the data lives in the memory. It will be very useful for us in this entire discussion.\nWhat happens if we create another string with the same value?\n\n\n \nanother_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n\n\n\n\n\n\nDoes it reuse the previous \u201cHello World\u201d stored in memory or does it create an independent copy? Let\u2019s check this by querying the id function again.\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562208\n\n\n\n\n\n\nThis outputs a different id, so this must be an independent copy. We conclude that:\n\n\n\n\nNote:\n\nAssignment statements where the right hand side is a simple expression creates independent copies every time.\n\n\n\n\nWhile for everyday programming, this is the rule we should remember, there are actually some weird exceptions to this rule. Here\u2019s an example.\n\n\n \nmy_string\n \n=\n \n\u201c\nhello\n\u201d\n\n\n \nid\n(\nmy_string\n)\n\n\n140400709562016\n\n\n \nanother_string\n \n=\n \n\u201c\nhello\n\u201d\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562016\n\n\n\n\n\n\nIn this case, two consecutive assignment statements did not create independent copies. Why?\nIt gets interesting now.\nFor optimizing memory, Python treats a special set of objects differently. The string \u201chello\u201d belongs to this privileged set and has a different behavior. The exact set depends on the implementation like CPython, PyPy, Jython or IronPython. For CPython, the special rule applies to:\n\n\n\n\nStrings without whitespaces and less than 20 characters and\n\n\nIntegers from -5 to +255.\n\n\n\n\nThese objects are always reused or interned. The rationale behind doing this is as follows:\n\n\n\n\nSince programmers use these objects frequently, interning existing\n objects saves memory.\n\n\nSince immutable objects like tuples and strings cannot be modified,\n there is no risk in interning the same object.\n\n\n\n\nHowever, Python does not do this for all immutable objects because there is a runtime cost involved for this feature. For interning an object, it must first search for the object in memory, and searching takes time. This is why the special treatment only applies for small integers and strings, because finding them is not that costly.\n\n\nWhat happens when the right hand side is an existing Python variable?\n\nLet\u2019s move on to the second type of assignment statement where the right hand side is an existing Python variable.\n\n\n \nanother_string\n \n=\n \nmy_string\n\n\n\n\n\n\nIn this case, nothing is created in memory. After the assignment, both variables refer to the already existing object. It\u2019s basically like giving the object an additional nickname or alias. Let\u2019s confirm this by using the id function.\n\n\n \nmy_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n\n\n \nid\n(\nmy_string\n)\n\n\n140400709562160\n\n\n \nanother_string\n \n=\n \nmy_string\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562160\n\n\n\n\n\n\nThe natural question at this stage is : what if, instead of just giving the existing object an alias, we wanted to create an independent copy?\nFor mutable objects, this is possible. You can either use the copy module of Python (which works on all objects) or you may use copy methods specific to the class. For a list, you have several possibilities for creating copies, all of which have different runtime.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \ncopy_of_my_list\n \n=\n \nmy_list\n.\ncopy\n()\n \n# fastest, works only on latest Python versions\n\n\n \ncopy_of_my_list\n \n=\n \nmy_list\n[:]\n \n# same runtime as List.copy()\n\n\n \ncopy_of_my_list\n \n=\n \nlist\n(\nmy_list\n)\n \n# slightly slower\n\n\n \nimport\n \ncopy\n\n\n \ncopy_of_my_list\n \n=\n \ncopy\n.\ncopy\n(\nmy_list\n)\n \n# slowest\n\n\n\n\n\n\nHow can you copy an immutable object? Well\u2026you can\u2019t! At least not in a straightforward way. If you try to use the copy module or the slicing notation, you will get back the same object and not an independent copy. Here\u2019s proof.\n\n\n# Standard ways of copying lists do not apply for tuples\n\n\n\n \nmy_tuple\n \n=\n \n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n \nid\n(\nmy_tuple\n)\n\n\n140371873244816\n\n\n \nanother_tuple\n \n=\n \nmy_tuple\n[:]\n\n\n \nid\n(\nanother_tuple\n)\n\n\n140371873244816\n\n\n\n# The copy module also doesn\u2019t help\n\n\n\n \nimport\n \ncopy\n \n\n \nanother_tuple\n \n=\n \ncopy\n.\ncopy\n(\nmy_tuple\n)\n\n\n \nid\n(\nanother_tuple\n)\n\n\n140371873244816\n\n\n\n\n\n\nMore importantly, there is no reason for explicitly copying an immutable object anyway. We will see why in a moment when we discuss the third kind of assignment statement.\n\nWhat happpens when the right hand side is an operation?\n\n\nIn this case, what happens depends on the result of the operation. We will discuss two simple cases:\n\n\n\n\nadding an element to an immutable object (like a tuple) and\n\n\nadding an element to a mutable object (like a list).\n\n\n\n\nLet\u2019s start with the case of the tuple.\n\n\n \nanother_tuple\n \n+=\n \n(\n4\n,)\n\n\n\n\n\n\nWhen you add a new element to a tuple using another_tuple += (4,), this creates a new object in memory. The immutability of tuples is key to understanding this. Since tuples are immutable, any operation that leads to a changed tuple would result in an independent copy.\nThis is the reason why you don\u2019t need to explicitly copy immutable objects : it happens automatically under the hood. Here\u2019s an example.\n\n\n \nmy_tuple\n \n=\n \n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n \nanother_tuple\n \n=\n \nmy_tuple\n \n# both variables point to the same object\n\n\n \nanother_tuple\n \n+=\n \n(\n4\n,)\n \n# this statement creates a new independent object\n\n\n \nprint\n(\nanother_tuple\n)\n \n\n(\n1\n,\n \n2\n,\n \n3\n,\n \n4\n)\n\n\n \nprint\n(\nmy_tuple\n)\n \n# the old one remains unharmed\n\n\n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n\n\n\n\nThe situation is much different for mutable objects and much more confusing. Let\u2019s try the same example, but now for lists.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n \n# both variables point to the same object\n\n\n \nanother_list\n \n+=\n \n[\n4\n,]\n \n# this statement modifies the object in place\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is modified\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n\n\n\n\nMutable objects can be modified in place. Some operations modify the list in place and some operations don\u2019t. In this case, the statement another_list += [4,] calls another_list.\niadd\n([4,]) and \niadd\n modifies the existing object in place.\nTo make things doubly confusing, we would have completely different results if we used a slightly different notation.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n \n# both variables point to the same object\n\n\n \nanother_list\n \n=\n \nanother_list\n \n+\n \n[\n4\n,]\n \n# this creates an independent copy\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is unharmed\n\n\n[\n1\n,\n \n2\n,\n \n3\n]\n \n\n\n\n\n\nWoah! What\u2019s going on? What changed?\nIt turns out that when we change the third line, Python now internally calls a different function another_list.\nadd\n([4,]) instead of \niadd\n. This function returns a new copy instead of modifying the list in place.\nTo prevent this confusion, it is always better to create a true copy of the list if you wish to prevent modification to the original.\nLet\u2019s remember the list copy methods from before. They were List.copy(), [:], list() and copy.copy(). This is what we should use.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n.\ncopy\n()\n \n# this creates an independent copy\n\n\n \nanother_list\n \n+=\n \n[\n4\n,]\n \n# this statement modifies the independent copy\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is unharmed\n\n\n[\n1\n,\n \n2\n,\n \n3\n]\n \n\n\n\n\n\nThere\u2019s one last gotcha that can happen when copying lists.\nSuppose we have a list that has a nested list inside it. We copy this list using List.copy() and then modify the nested list. Unfortunately, this will modify the original list again!\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n.\ncopy\n()\n\n\n \nanother_list\n[\n0\n]\n \n+=\n \n[\n6\n,]\n\n\n \nprint\n(\nanother_list\n)\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n\n\n \nprint\n(\nmy_list\n)\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n \n\n\n\n\n\nWhy did that happen? Didn\u2019t we just copy the original list?\nThe truth is : we actually don\u2019t have a completely independent copy in this case. The copy() function generates a shallow copy. To see what it does, let\u2019s look at the ids of all the elements in my_list and the ids of all the elements in the copied list.\n\n\n# for my_list\n\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nid\n(\nmy_list\n)\n\n\n140371873277424\n\n\n \nprint\n([\nid\n(\nx\n)\n \nfor\n \nx\n \nin\n \nmy_list\n])\n\n\n[\n140371873599288\n,\n \n13820176\n,\n \n13820152\n]\n\n\n\n# for another_list obtained by my_list.copy()\n\n\n\n \nid\n(\nanother_list\n)\n\n\n140371873317016\n\n\n \nprint\n([\nid\n(\nx\n)\n \nfor\n \nx\n \nin\n \nanother_list\n])\n\n\n[\n140371873599288\n,\n \n13820176\n,\n \n13820152\n]\n\n\n\n\n\n\nWe see the ids of my_list and another_list are indeed different, indicating another_list is a copy. But the ids of the elements contained in another_list have the same ids as the elements in my_list . So the elements have not been copied!\nThis is the property of shallow copy. It creates a new copy of the object but reuses the attributes and elements of the old copy. Thus, when you modify the elements of the new copy, you are modifying the elements of the old copy too.\nTo solve this problem, we need to copy an object along with all its attributes and elements. This can be achieved by copy.deepcopy.\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nanother_list\n \n=\n \ncopy\n.\ndeepcopy\n(\nmy_list\n)\n\n\n \nanother_list\n[\n0\n]\n \n+=\n \n[\n6\n,]\n\n\n \nanother_list\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n\n\n \nmy_list\n\n\n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n\n\n\n\nDeep copy is a quite time intensive operation and can take 1o times longer to complete compared to a shallow copy. But in some situations, it is unavoidable.\n\n\nConclusion\n\n\nThis brings me to the end of this discussion. To summarize, we have talked about the different scenarios which can arise in an assignment statement in Python. We found that:\n\n\n\n\nWhen the right hand side is a simple expression, a new copy is\n created every time. There are some exceptions to this rule, which\n depend on the implementation\n\n\nWhen the right hand side is an existing Python variable, then an\n alias is created for the existing copy.\n\n\nWhen the right hand side is an operation, then the outcome depends on\n the operation. In a simple case involving a tuple, we saw that an\n independent copy was created. In the same case with lists, we saw\n that the list was modified in place in one case (when we used\n \niadd\n) and a new copy was generated in another case (when we used \nadd\n).\n\n\nList item\n\n\nMutable objects can be copied but immutable objects cannot be copied\n in a straightforward way. There is also no need to copy immutable\n objects.\n\n\nTo copy a mutable object along with all its attributes and elements,\n we need to use deep copy.\n\n\n\n\n\n\nSource:\n \n\n\n https://medium.com/broken-window/many-names-one-memory-address-122f78734cb6", + }, + { + "location": "/beginner/Data_Types_In_Python_3/", + "text": "Data Types in Python 3\n\n\nUnderstanding Data Types in Python 3\n\n\nIntroduction\n\n\nIn Python, like in all programming languages, data types are used to classify one particular type of data. This is important because the specific data type you use will determine what values you can assign to it and what you can do to it (including what operations you can perform on it).\n\n\nIn this tutorial, we will go over the important data types native to Python. This is not an exhaustive investigation of data types, but will help you become familiar with what options you have available to you in Python.\n\n\nBackground\n\n\nOne way to think about data types is to consider the different types of data that we use in the real world. An example of data in the real world are numbers: we may use whole numbers (0, 1, 2, \u2026), integers (\u2026, -1, 0, 1, \u2026), and irrational numbers (\u03c0), for example.\n\n\nUsually, in math, we can combine numbers from different types, and get some kind of an answer. We may want to add 5 to \u03c0, for example:\n\n\n5 + \u03c0\n\n\nWe can either keep the equation as the answer to account for the irrational number, or round \u03c0 to a number with a brief number of decimal places, and then add the numbers together:\n\n\n5 + \u03c0 = 5 + 3.14 = 8.14\n\n\nBut, if we start to try to evaluate numbers with another data type, such as words, things start to make less sense. How would we solve for the following equation?\n\n\nsky + 8\n\n\nFor computers, each data type can be thought of as being quite different, like words and numbers, so we will have to be careful about how we use them to assign values and how we manipulate them through operations.\n\n\nNumbers\n\n\nAny \nnumber\n you enter in Python will be interpreted as a number; you are not required to declare what kind of data type you are entering. Python will consider any number written without decimals as an \ninteger\n (as in \n138\n) and any number written with decimals as a \nfloat\n (as in \n138.0\n).\n\n\nIntegers\n\n\nLike in \nmath\n, \nintegers\n in computer programming are whole numbers that can be positive, negative, or 0 (\u2026, \n-1\n, \n0\n, \n1\n, \u2026). An integer can also be known as an \nint\n. As with other programming languages, you should not use commas in numbers of four digits or more, so when you write 1,000 in your program, write it as \n1000\n.\n\n\nWe can print out an integer in a simple way like this:\n\n\nprint\n(\n-\n25\n)\n\n\n\n#Output : -25\n\n\n\n\n\n\nOr, we can declare a \nvariable\n, which in this case is essentially a symbol of the number we are using or manipulating, like so:\n\n\nmy_int\n \n=\n \n-\n25\n\n\nprint\n(\nmy_int\n)\n\n\n\n#Output : -25\n\n\n\n\n\n\nWe can do math with integers in Python, too:\n\n\nint_ans\n \n=\n \n116\n \n-\n \n68\n\n\nprint\n(\nint_ans\n)\n\n\n\n#Output : 48\n\n\n\n\n\n\nIntegers can be used in many ways within Python programs, and as you continue to learn more about the language you will have a lot of opportunities to work with integers and understand more about this data type.\n\n\nFloating-Point Numbers\n\n\nA \nfloating-point number\n or a \nfloat\n is a real number, meaning that it can be either a rational or an irrational number. Because of this, floating-point numbers can be numbers that can contain a fractional part, such as \n9.0\n or \n-116.42\n. Simply speaking, for the purposes of thinking of a \nfloat\n in a Python program, it is a number that contains a decimal point.\n\n\nLike we did with the integer, we can print out a floating-point number in a simple way like this:\n\n\nprint\n(\n17.3\n)\n\n\n\n#Output : 17.3\n\n\n\n\n\n\nWe can also declare a variable that stands in for a float, like so:\n\n\nmy_flt\n \n=\n \n17.3\n\n\nprint\n(\nmy_flt\n)\n\n\n\n#Output : 17.3\n\n\n\n\n\n\nAnd, just like with integers, we can do math with floats in Python, too:\n\n\nflt_ans\n \n=\n \n564.0\n \n+\n \n365.24\n\n\nprint\n(\nflt_ans\n)\n\n\n\n#Output : 929.24\n\n\n\n\n\n\nWith integers and floating-point numbers, it is important to keep in mind that 3 \u2260 3.0, as \n3\n refers to an integer while \n3.0\n refers to a float.\n\n\nBooleans\n\n\nThe \nBoolean\n data type can be one of two values, either \nTrue\n or \nFalse\n. Booleans are used to represent the truth values that are associated with the logic branch of mathematics, which informs algorithms in computer science.\n\n\nWhenever you see the data type Boolean, it will start with a capitalized B because it is named for the mathematician George Boole. The values \nTrue\n and \nFalse\n will also always be with a capital T and F respectively, as they are special values in Python.\n\n\nMany operations in math give us answers that evaluate to either True or False:\n\n\n*\n \n**\ngreater\n \nthan\n**\n\n \n*\n \n500\n \n \n100\n \n`True`\n\n \n*\n \n1\n \n \n5\n \n`False`\n\n\n*\n \n**\nless\n \nthan\n**\n\n \n*\n \n200\n \n \n400\n \n`True`\n\n \n*\n \n4\n \n \n2\n \n`False`\n\n\n*\n \n**\nequal\n**\n\n \n*\n \n5\n \n=\n \n5\n \n`True`\n\n \n*\n \n500\n \n=\n \n400\n \n`False`\n\n\n\n\n\n\nLike with numbers, we can store a Boolean value in a variable:\n\n\nmy_bool\n \n=\n \n5\n \n \n8\n\n\n\n\n\n\nWe can then print the Boolean value with a call to the \nprint()\n function:\n\n\nprint\n(\nmy_bool\n)\n\n\n\n\n\n\nSince 5 is not greater than 8, we will receive the following #Output : :\n\n\n#Output : False\n\n\n\n\n\n\nAs you write more programs in Python, you will become more familiar with how Booleans work and how different functions and operations evaluating to either True or False can change the course of the program.\n\n\nStrings\n\n\nA \nstring\n is a sequence of one or more characters (letters, numbers, symbols) that can be either a constant or a variable. Strings exist within either single quotes \n'\n or double quotes \n\"\n in Python, so to create a string, enclose a sequence of characters in quotes:\n\n\nThis is a string in single quotes.\n\n\n\nThis is a string in double quotes.\n\n\n\n\n\n\nYou can choose to use either single quotes or double quotes, but whichever you decide on you should be consistent within a program.\n\n\nThe simple program \u201c\nHello, World!\n\u201d demonstrates how a string can be used in computer programming, as the characters that make up the phrase \nHello, World!\n are a string.\n\n\nprint\n(\nHello, World!\n)\n\n\n\n\n\n\nAs with other data types, we can store strings in variables:\n\n\nhw\n \n=\n \nHello, World!\n\n\n\n\n\n\nAnd print out the string by calling the variable:\n\n\nprint\n(\nhw\n)\n\n\n\n#Ouput : Hello, World!\n\n\n\n\n\n\nLike numbers, there are many operations that we can perform on strings within our programs in order to manipulate them to achieve the results we are seeking. Strings are important for communicating information to the user, and for the user to communicate information back to the program.\n\n\nLists\n\n\nA \nlist\n is a mutable, or changeable, ordered sequence of elements. Each element or value that is inside of a list is called an \nitem\n. Just as strings are defined as characters between quotes, lists are defined by having values between square brackets \n[ ]\n.\n\n\nA list of integers looks like this:\n\n\n[\n-\n3\n,\n \n-\n2\n,\n \n-\n1\n,\n \n0\n,\n \n1\n,\n \n2\n,\n \n3\n]\n\n\n\n\n\n\nA list of floats looks like this:\n\n\n[\n3.14\n,\n \n9.23\n,\n \n111.11\n,\n \n312.12\n,\n \n1.05\n]\n\n\n\n\n\n\nA list of strings:\n\n\n[\nshark\n,\n \ncuttlefish\n,\n \nsquid\n,\n \nmantis shrimp\n]\n\n\n\n\n\n\nIf we define our string list as \nsea_creatures\n:\n\n\nsea_creatures\n \n=\n \n[\nshark\n,\n \ncuttlefish\n,\n \nsquid\n,\n \nmantis shrimp\n]\n\n\n\n\n\n\nWe can print them out by calling the variable:\n\n\nprint\n(\nsea_creatures\n)\n\n\n\n\n\n\nAnd we see that the #Output : looks exactly like the list that we created:\n\n\n#Output : [\nshark\n, \ncuttlefish\n, \nsquid\n, \nmantis shrimp\n]\n\n\n\n\n\n\nLists are a very flexible data type because they are mutable in that they can have values added, removed, and changed. There is a data type that is similar to lists but that can\u2019t be changed, and that is called a tuple.\n\n\nTuples\n\n\nA \ntuple\n is used for grouping data. It is an immutable, or unchangeable, ordered sequence of elements.\n\n\nTuples are very similar to lists, but they use parentheses \n( )\n instead of square brackets and because they are immutable their values cannot be modified.\n\n\nA tuple looks like this:\n\n\n(\nblue coral\n,\n \nstaghorn coral\n,\n \npillar coral\n)\n\n\n\n\n\n\nWe can store a tuple in a variable and print it out:\n\n\ncoral\n \n=\n \n(\nblue coral\n,\n \nstaghorn coral\n,\n \npillar coral\n)\n\n\nprint\n(\ncoral\n)\n\n\n\nOuput\n(\nblue coral\n,\n \nstaghorn coral\n,\n \npillar coral\n)\n\n\n\n\n\n\nLike in the other data types, Python prints out the tuple just as we had typed it, with parentheses containing a sequence of values.\n\n\nDictionaries\n\n\nThe \ndictionary\n is Python\u2019s built-in \nmapping\n type. This means that dictionaries map \nkeys\n to \nvalues\n and these key-value pairs are a useful way to store data in Python. A dictionary is constructed with curly braces on either side \n{ }\n.\n\n\nTypically used to hold data that are related, such as the information contained in an ID, a dictionary looks like this:\n\n\n{\nname\n:\n \nSammy\n,\n \nanimal\n:\n \nshark\n,\n \ncolor\n:\n \nblue\n,\n \nlocation\n:\n \nocean\n}\n\n\n\n\n\n\nYou will notice that in addition to the curly braces, there are also colons throughout the dictionary. The words to the left of the colons are the keys. Keys can be made up of any immutable data type. The keys in the dictionary above are: \n'name', 'animal', 'color', 'location'\n.\n\n\nThe words to the right of the colons are the values. Values can be comprised of any data type. The values in the dictionary above are: \n'Sammy', 'shark', 'blue', 'ocean'\n.\n\n\nLike the other data types, let\u2019s store the dictionary inside a variable, and print it out:\n\n\nsammy\n \n=\n \n{\nname\n:\n \nSammy\n,\n \nanimal\n:\n \nshark\n,\n \ncolor\n:\n \nblue\n,\n \nlocation\n:\n \nocean\n}\n\n\n#Ouput : {\ncolor\n: \nblue\n, \nanimal\n: \nshark\n, \nname\n: \nSammy\n, \nlocation\n: \nocean\n}\n\n\n\n\n\n\nIf we want to isolate Sammy\u2019s color, we can do so by calling \nsammy['color']\n. Let\u2019s print that out:\n\n\nprint\n(\nsammy\n[\ncolor\n])\n\n\n\n#Output : blue\n\n\n\n\n\n\nAs dictionaries offer key-value pairs for storing data, they can be important elements in your Python program.\n\n\nConclusion\n\n\nAt this point, you should have a better understanding of some of the major data types that are available for you to use in Python. Each of these data types will become important as you develop programming projects in the Python language.\n\n\nYou can learn about each of the data types above in more detail by reading the following specific tutorials:\n\n\n\n\nNumbers\n\n\nBooleans\n\n\nStrings\n\n\nLists\n\n\nTuples\n\n\nDictionaries\n\n\n\n\nOnce you have a solid grasp of data types available to you in Python, you can learn how to \nconvert data types\n.\n\n\n\n\nSource:\n \n\n\n https://www.digitalocean.com/community/tutorials/understanding-data-types-in-python-3\n\n\n\n\n\n\nNative Datatypes By Dive Into Python 3\n\n\n\n\n\n\nSource:\n \n\n\n \nDive into Python 3\n by Mark Pilgrim \n\n\n\n\nStandard Data Types By Tutorialspoint\n\n\nThe data stored in memory can be of many types. For example, a person's age is stored as a numeric value and his or her address is stored as alphanumeric characters. Python has various standard data types that are used to define the operations possible on them and the storage method for each of them.\n\n\nPython has five standard data types : \n\n\n\n\n\n\nNumbers\n\n\n\n\n\n\nString\n\n\n\n\n\n\nList\n\n\n\n\n\n\nTuple\n\n\n\n\n\n\nDictionary\n\n\n\n\n\n\nPython Numbers\n\n\nNumber data types store numeric values. Number objects are created when you assign a value to them. For example \u2212\n\n\nvar1\n \n=\n \n1\n\n\nvar2\n \n=\n \n10\n\n\n\n\n\n\nYou can also delete the reference to a number object by using the del statement. The syntax of the del statement is \u2212\n\n\ndel\n \nvar1\n[,\nvar2\n[,\nvar3\n[\n....\n,\nvarN\n]]]]\n\n\n\n\n\n\nYou can delete a single object or multiple objects by using the del statement.\n\n\nFor example \u2212\n\n\ndel\n \nvar\n\n\ndel\n \nvar_a\n,\n \nvar_b\n\n\n\n\n\n\nPython supports three different numerical types \u2212\n- int (signed integers)\n\n\n\n\n\n\nfloat (floating point real values)\n\n\n\n\n\n\ncomplex (complex numbers)\n\n\n\n\n\n\nAll integers in Python3 are represented as long integers. Hence, there is no separate number type as long.\n\n\n\n\n\n\n\n\nint\n\n\nfloat\n\n\ncomplex\n\n\n\n\n\n\n\n\n\n\n10\n\n\n0.0\n\n\n3.14j\n\n\n\n\n\n\n100\n\n\n15.20\n\n\n45.j\n\n\n\n\n\n\n-786\n\n\n-21.9\n\n\n9.322e-36j\n\n\n\n\n\n\n\n\nA complex number consists of an ordered pair of real floating-point numbers denoted by x + yj, where x and y are real numbers and j is the imaginary unit.\n\n\nPython Strings\n\n\nStrings in Python are identified as a contiguous set of characters represented in the quotation marks. Python allows either pair of single or double quotes. Subsets of strings can be taken using the slice operator ([ ] and [:] ) with indexes starting at 0 in the beginning of the string and working their way from -1 to the end.\n\n\nThe plus (+) sign is the string concatenation operator and the asterisk (*) is the repetition operator. For example \u2212\n\n\n#!/usr/bin/python3\n\n\n\nstr\n \n=\n \nHello World!\n\n\n\nprint\n \n(\nstr\n)\n \n# Prints complete string\n\n\nprint\n \n(\nstr\n[\n0\n])\n \n# Prints first character of the string\n\n\nprint\n \n(\nstr\n[\n2\n:\n5\n])\n \n# Prints characters starting from 3rd to 5th\n\n\nprint\n \n(\nstr\n[\n2\n:])\n \n# Prints string starting from 3rd character\n\n\nprint\n \n(\nstr\n \n*\n \n2\n)\n \n# Prints string two times\n\n\nprint\n \n(\nstr\n \n+\n \nTEST\n)\n \n# Prints concatenated string\n\n\n\n\n\n\nThis will produce the following result \u2212\n\n\nHello\n \nWorld\n!\n\n\nH\n\n\nllo\n\n\nllo\n \nWorld\n!\n\n\nHello\n \nWorld\n!\nHello\n \nWorld\n!\n\n\nHello\n \nWorld\n!\nTEST\n\n\n\n\n\n\nPython Lists\n\n\nLists are the most versatile of Python's compound data types. A list contains items separated by commas and enclosed within square brackets ([]). To some extent, lists are similar to arrays in C. One of the differences between them is that all the items belonging to a list can be of different data type.\n\n\nThe values stored in a list can be accessed using the slice operator ([ ] and [:]) with indexes starting at 0 in the beginning of the list and working their way to end -1. The plus (+) sign is the list concatenation operator, and the asterisk (*) is the repetition operator. For example \u2212\n\n\n#!/usr/bin/python3\n\n\n\nlist\n \n=\n \n[\n \nabcd\n,\n \n786\n \n,\n \n2.23\n,\n \njohn\n,\n \n70.2\n \n]\n\n\ntinylist\n \n=\n \n[\n123\n,\n \njohn\n]\n\n\n\nprint\n \n(\nlist\n)\n \n# Prints complete list\n\n\nprint\n \n(\nlist\n[\n0\n])\n \n# Prints first element of the list\n\n\nprint\n \n(\nlist\n[\n1\n:\n3\n])\n \n# Prints elements starting from 2nd till 3rd \n\n\nprint\n \n(\nlist\n[\n2\n:])\n \n# Prints elements starting from 3rd element\n\n\nprint\n \n(\ntinylist\n \n*\n \n2\n)\n \n# Prints list two times\n\n\nprint\n \n(\nlist\n \n+\n \ntinylist\n)\n \n# Prints concatenated lists\n\n\n\n\n\n\nThis produces the following result \u2212\n\n\n[\nabcd\n,\n \n786\n,\n \n2.23\n,\n \njohn\n,\n \n70.200000000000003\n]\n\n\nabcd\n\n\n[\n786\n,\n \n2.23\n]\n\n\n[\n2.23\n,\n \njohn\n,\n \n70.200000000000003\n]\n\n\n[\n123\n,\n \njohn\n,\n \n123\n,\n \njohn\n]\n\n\n[\nabcd\n,\n \n786\n,\n \n2.23\n,\n \njohn\n,\n \n70.200000000000003\n,\n \n123\n,\n \njohn\n]\n\n\n\n\n\n\nPython Tuples\n\n\nA tuple is another sequence data type that is similar to the list. A tuple consists of a number of values separated by commas. Unlike lists, however, tuples are enclosed within parenthesis.\n\n\nThe main difference between lists and tuples are \u2212 Lists are enclosed in brackets ( [ ] ) and their elements and size can be changed, while tuples are enclosed in parentheses ( ( ) ) and cannot be updated. Tuples can be thought of as read-only lists. For example \u2212\n\n\n#!/usr/bin/python3\n\n\n\ntuple\n \n=\n \n(\n \nabcd\n,\n \n786\n \n,\n \n2.23\n,\n \njohn\n,\n \n70.2\n \n)\n\n\ntinytuple\n \n=\n \n(\n123\n,\n \njohn\n)\n\n\n\nprint\n \n(\ntuple\n)\n \n# Prints complete tuple\n\n\nprint\n \n(\ntuple\n[\n0\n])\n \n# Prints first element of the tuple\n\n\nprint\n \n(\ntuple\n[\n1\n:\n3\n])\n \n# Prints elements starting from 2nd till 3rd \n\n\nprint\n \n(\ntuple\n[\n2\n:])\n \n# Prints elements starting from 3rd element\n\n\nprint\n \n(\ntinytuple\n \n*\n \n2\n)\n \n# Prints tuple two times\n\n\nprint\n \n(\ntuple\n \n+\n \ntinytuple\n)\n \n# Prints concatenated tuple\n\n\n\n\n\n\nThis produces the following result \u2212\n\n\n(\nabcd\n,\n \n786\n,\n \n2.23\n,\n \njohn\n,\n \n70.200000000000003\n)\n\n\nabcd\n\n\n(\n786\n,\n \n2.23\n)\n\n\n(\n2.23\n,\n \njohn\n,\n \n70.200000000000003\n)\n\n\n(\n123\n,\n \njohn\n,\n \n123\n,\n \njohn\n)\n\n\n(\nabcd\n,\n \n786\n,\n \n2.23\n,\n \njohn\n,\n \n70.200000000000003\n,\n \n123\n,\n \njohn\n)\n\n\n\n\n\n\nThe following code is invalid with tuple, because we attempted to update a tuple, which is not allowed. Similar case is possible with lists \u2212\n\n\n#!/usr/bin/python3\n\n\n\ntuple\n \n=\n \n(\n \nabcd\n,\n \n786\n \n,\n \n2.23\n,\n \njohn\n,\n \n70.2\n \n)\n\n\nlist\n \n=\n \n[\n \nabcd\n,\n \n786\n \n,\n \n2.23\n,\n \njohn\n,\n \n70.2\n \n]\n\n\ntuple\n[\n2\n]\n \n=\n \n1000\n \n# Invalid syntax with tuple\n\n\nlist\n[\n2\n]\n \n=\n \n1000\n \n# Valid syntax with list\n\n\n\n\n\n\nPython Dictionary\n\n\nPython's dictionaries are kind of hash-table type. They work like associative arrays or hashes found in Perl and consist of key-value pairs. A dictionary key can be almost any Python type, but are usually numbers or strings. Values, on the other hand, can be any arbitrary Python object.\n\n\nDictionaries are enclosed by curly braces ({ }) and values can be assigned and accessed using square braces ([]). For example \u2212\n\n\n#!/usr/bin/python3\n\n\n\ndict\n \n=\n \n{}\n\n\ndict\n[\none\n]\n \n=\n \nThis is one\n\n\ndict\n[\n2\n]\n \n=\n \nThis is two\n\n\n\ntinydict\n \n=\n \n{\nname\n:\n \njohn\n,\ncode\n:\n6734\n,\n \ndept\n:\n \nsales\n}\n\n\n\n\nprint\n \n(\ndict\n[\none\n])\n \n# Prints value for \none\n key\n\n\nprint\n \n(\ndict\n[\n2\n])\n \n# Prints value for 2 key\n\n\nprint\n \n(\ntinydict\n)\n \n# Prints complete dictionary\n\n\nprint\n \n(\ntinydict\n.\nkeys\n())\n \n# Prints all the keys\n\n\nprint\n \n(\ntinydict\n.\nvalues\n())\n \n# Prints all the values\n\n\n\n\n\n\nThis produces the following result \u2212\n\n\nThis\n \nis\n \none\n\n\nThis\n \nis\n \ntwo\n\n\n{\nname\n:\n \njohn\n,\n \ndept\n:\n \nsales\n,\n \ncode\n:\n \n6734\n}\n\n\ndict_keys\n([\nname\n,\n \ndept\n,\n \ncode\n])\n\n\ndict_values\n([\njohn\n,\n \nsales\n,\n \n6734\n])\n\n\n\n\n\n\nDictionaries have no concept of order among the elements. It is incorrect to say that the elements are \"out of order\"; they are simply unordered.\n\n\n\n\nSource:\n \n\n\n https://www.tutorialspoint.com/python3/python_variable_types.htm", + "title": "Data Types in Python 3" + }, + { + "location": "/beginner/Data_Types_In_Python_3/#data-types-in-python-3", + "text": "", + "title": "Data Types in Python 3" + }, + { + "location": "/beginner/Data_Types_In_Python_3/#understanding-data-types-in-python-3", + "text": "", + "title": "Understanding Data Types in Python 3" + }, + { + "location": "/beginner/Data_Types_In_Python_3/#introduction", + "text": "In Python, like in all programming languages, data types are used to classify one particular type of data. This is important because the specific data type you use will determine what values you can assign to it and what you can do to it (including what operations you can perform on it). In this tutorial, we will go over the important data types native to Python. This is not an exhaustive investigation of data types, but will help you become familiar with what options you have available to you in Python.", + "title": "Introduction" + }, + { + "location": "/beginner/Data_Types_In_Python_3/#background", + "text": "One way to think about data types is to consider the different types of data that we use in the real world. An example of data in the real world are numbers: we may use whole numbers (0, 1, 2, \u2026), integers (\u2026, -1, 0, 1, \u2026), and irrational numbers (\u03c0), for example. Usually, in math, we can combine numbers from different types, and get some kind of an answer. We may want to add 5 to \u03c0, for example: 5 + \u03c0 We can either keep the equation as the answer to account for the irrational number, or round \u03c0 to a number with a brief number of decimal places, and then add the numbers together: 5 + \u03c0 = 5 + 3.14 = 8.14 But, if we start to try to evaluate numbers with another data type, such as words, things start to make less sense. How would we solve for the following equation? sky + 8 For computers, each data type can be thought of as being quite different, like words and numbers, so we will have to be careful about how we use them to assign values and how we manipulate them through operations.", + "title": "Background" + }, + { + "location": "/beginner/Data_Types_In_Python_3/#numbers", + "text": "Any number you enter in Python will be interpreted as a number; you are not required to declare what kind of data type you are entering. Python will consider any number written without decimals as an integer (as in 138 ) and any number written with decimals as a float (as in 138.0 ).", + "title": "Numbers" + }, + { + "location": "/beginner/Data_Types_In_Python_3/#integers", + "text": "Like in math , integers in computer programming are whole numbers that can be positive, negative, or 0 (\u2026, -1 , 0 , 1 , \u2026). An integer can also be known as an int . As with other programming languages, you should not use commas in numbers of four digits or more, so when you write 1,000 in your program, write it as 1000 . We can print out an integer in a simple way like this: print ( - 25 ) #Output : -25 Or, we can declare a variable , which in this case is essentially a symbol of the number we are using or manipulating, like so: my_int = - 25 print ( my_int ) #Output : -25 We can do math with integers in Python, too: int_ans = 116 - 68 print ( int_ans ) #Output : 48 Integers can be used in many ways within Python programs, and as you continue to learn more about the language you will have a lot of opportunities to work with integers and understand more about this data type.", + "title": "Integers" + }, + { + "location": "/beginner/Data_Types_In_Python_3/#floating-point-numbers", + "text": "A floating-point number or a float is a real number, meaning that it can be either a rational or an irrational number. Because of this, floating-point numbers can be numbers that can contain a fractional part, such as 9.0 or -116.42 . Simply speaking, for the purposes of thinking of a float in a Python program, it is a number that contains a decimal point. Like we did with the integer, we can print out a floating-point number in a simple way like this: print ( 17.3 ) #Output : 17.3 We can also declare a variable that stands in for a float, like so: my_flt = 17.3 print ( my_flt ) #Output : 17.3 And, just like with integers, we can do math with floats in Python, too: flt_ans = 564.0 + 365.24 print ( flt_ans ) #Output : 929.24 With integers and floating-point numbers, it is important to keep in mind that 3 \u2260 3.0, as 3 refers to an integer while 3.0 refers to a float.", + "title": "Floating-Point Numbers" + }, + { + "location": "/beginner/Data_Types_In_Python_3/#booleans", + "text": "The Boolean data type can be one of two values, either True or False . Booleans are used to represent the truth values that are associated with the logic branch of mathematics, which informs algorithms in computer science. Whenever you see the data type Boolean, it will start with a capitalized B because it is named for the mathematician George Boole. The values True and False will also always be with a capital T and F respectively, as they are special values in Python. Many operations in math give us answers that evaluate to either True or False: * ** greater than ** \n * 500 100 `True` \n * 1 5 `False` * ** less than ** \n * 200 400 `True` \n * 4 2 `False` * ** equal ** \n * 5 = 5 `True` \n * 500 = 400 `False` Like with numbers, we can store a Boolean value in a variable: my_bool = 5 8 We can then print the Boolean value with a call to the print() function: print ( my_bool ) Since 5 is not greater than 8, we will receive the following #Output : : #Output : False As you write more programs in Python, you will become more familiar with how Booleans work and how different functions and operations evaluating to either True or False can change the course of the program.", + "title": "Booleans" + }, + { + "location": "/beginner/Data_Types_In_Python_3/#strings", + "text": "A string is a sequence of one or more characters (letters, numbers, symbols) that can be either a constant or a variable. Strings exist within either single quotes ' or double quotes \" in Python, so to create a string, enclose a sequence of characters in quotes: This is a string in single quotes. This is a string in double quotes. You can choose to use either single quotes or double quotes, but whichever you decide on you should be consistent within a program. The simple program \u201c Hello, World! \u201d demonstrates how a string can be used in computer programming, as the characters that make up the phrase Hello, World! are a string. print ( Hello, World! ) As with other data types, we can store strings in variables: hw = Hello, World! And print out the string by calling the variable: print ( hw ) #Ouput : Hello, World! Like numbers, there are many operations that we can perform on strings within our programs in order to manipulate them to achieve the results we are seeking. Strings are important for communicating information to the user, and for the user to communicate information back to the program.", + "title": "Strings" + }, + { + "location": "/beginner/Data_Types_In_Python_3/#lists", + "text": "A list is a mutable, or changeable, ordered sequence of elements. Each element or value that is inside of a list is called an item . Just as strings are defined as characters between quotes, lists are defined by having values between square brackets [ ] . A list of integers looks like this: [ - 3 , - 2 , - 1 , 0 , 1 , 2 , 3 ] A list of floats looks like this: [ 3.14 , 9.23 , 111.11 , 312.12 , 1.05 ] A list of strings: [ shark , cuttlefish , squid , mantis shrimp ] If we define our string list as sea_creatures : sea_creatures = [ shark , cuttlefish , squid , mantis shrimp ] We can print them out by calling the variable: print ( sea_creatures ) And we see that the #Output : looks exactly like the list that we created: #Output : [ shark , cuttlefish , squid , mantis shrimp ] Lists are a very flexible data type because they are mutable in that they can have values added, removed, and changed. There is a data type that is similar to lists but that can\u2019t be changed, and that is called a tuple.", + "title": "Lists" + }, + { + "location": "/beginner/Data_Types_In_Python_3/#tuples", + "text": "A tuple is used for grouping data. It is an immutable, or unchangeable, ordered sequence of elements. Tuples are very similar to lists, but they use parentheses ( ) instead of square brackets and because they are immutable their values cannot be modified. A tuple looks like this: ( blue coral , staghorn coral , pillar coral ) We can store a tuple in a variable and print it out: coral = ( blue coral , staghorn coral , pillar coral ) print ( coral ) Ouput ( blue coral , staghorn coral , pillar coral ) Like in the other data types, Python prints out the tuple just as we had typed it, with parentheses containing a sequence of values.", + "title": "Tuples" + }, + { + "location": "/beginner/Data_Types_In_Python_3/#dictionaries", + "text": "The dictionary is Python\u2019s built-in mapping type. This means that dictionaries map keys to values and these key-value pairs are a useful way to store data in Python. A dictionary is constructed with curly braces on either side { } . Typically used to hold data that are related, such as the information contained in an ID, a dictionary looks like this: { name : Sammy , animal : shark , color : blue , location : ocean } You will notice that in addition to the curly braces, there are also colons throughout the dictionary. The words to the left of the colons are the keys. Keys can be made up of any immutable data type. The keys in the dictionary above are: 'name', 'animal', 'color', 'location' . The words to the right of the colons are the values. Values can be comprised of any data type. The values in the dictionary above are: 'Sammy', 'shark', 'blue', 'ocean' . Like the other data types, let\u2019s store the dictionary inside a variable, and print it out: sammy = { name : Sammy , animal : shark , color : blue , location : ocean } #Ouput : { color : blue , animal : shark , name : Sammy , location : ocean } If we want to isolate Sammy\u2019s color, we can do so by calling sammy['color'] . Let\u2019s print that out: print ( sammy [ color ]) #Output : blue As dictionaries offer key-value pairs for storing data, they can be important elements in your Python program.", + "title": "Dictionaries" + }, + { + "location": "/beginner/Data_Types_In_Python_3/#conclusion", + "text": "At this point, you should have a better understanding of some of the major data types that are available for you to use in Python. Each of these data types will become important as you develop programming projects in the Python language. You can learn about each of the data types above in more detail by reading the following specific tutorials: Numbers Booleans Strings Lists Tuples Dictionaries Once you have a solid grasp of data types available to you in Python, you can learn how to convert data types . Source: https://www.digitalocean.com/community/tutorials/understanding-data-types-in-python-3", + "title": "Conclusion" + }, + { + "location": "/beginner/Data_Types_In_Python_3/#native-datatypes-by-dive-into-python-3", + "text": "Source: Dive into Python 3 by Mark Pilgrim", + "title": "Native Datatypes By Dive Into Python 3" + }, + { + "location": "/beginner/Data_Types_In_Python_3/#standard-data-types-by-tutorialspoint", + "text": "The data stored in memory can be of many types. For example, a person's age is stored as a numeric value and his or her address is stored as alphanumeric characters. Python has various standard data types that are used to define the operations possible on them and the storage method for each of them. Python has five standard data types : Numbers String List Tuple Dictionary", + "title": "Standard Data Types By Tutorialspoint" + }, + { + "location": "/beginner/Data_Types_In_Python_3/#python-numbers", + "text": "Number data types store numeric values. Number objects are created when you assign a value to them. For example \u2212 var1 = 1 var2 = 10 You can also delete the reference to a number object by using the del statement. The syntax of the del statement is \u2212 del var1 [, var2 [, var3 [ .... , varN ]]]] You can delete a single object or multiple objects by using the del statement. For example \u2212 del var del var_a , var_b Python supports three different numerical types \u2212\n- int (signed integers) float (floating point real values) complex (complex numbers) All integers in Python3 are represented as long integers. Hence, there is no separate number type as long. int float complex 10 0.0 3.14j 100 15.20 45.j -786 -21.9 9.322e-36j A complex number consists of an ordered pair of real floating-point numbers denoted by x + yj, where x and y are real numbers and j is the imaginary unit.", + "title": "Python Numbers" + }, + { + "location": "/beginner/Data_Types_In_Python_3/#python-strings", + "text": "Strings in Python are identified as a contiguous set of characters represented in the quotation marks. Python allows either pair of single or double quotes. Subsets of strings can be taken using the slice operator ([ ] and [:] ) with indexes starting at 0 in the beginning of the string and working their way from -1 to the end. The plus (+) sign is the string concatenation operator and the asterisk (*) is the repetition operator. For example \u2212 #!/usr/bin/python3 str = Hello World! print ( str ) # Prints complete string print ( str [ 0 ]) # Prints first character of the string print ( str [ 2 : 5 ]) # Prints characters starting from 3rd to 5th print ( str [ 2 :]) # Prints string starting from 3rd character print ( str * 2 ) # Prints string two times print ( str + TEST ) # Prints concatenated string This will produce the following result \u2212 Hello World ! H llo llo World ! Hello World ! Hello World ! Hello World ! TEST", + "title": "Python Strings" + }, + { + "location": "/beginner/Data_Types_In_Python_3/#python-lists", + "text": "Lists are the most versatile of Python's compound data types. A list contains items separated by commas and enclosed within square brackets ([]). To some extent, lists are similar to arrays in C. One of the differences between them is that all the items belonging to a list can be of different data type. The values stored in a list can be accessed using the slice operator ([ ] and [:]) with indexes starting at 0 in the beginning of the list and working their way to end -1. The plus (+) sign is the list concatenation operator, and the asterisk (*) is the repetition operator. For example \u2212 #!/usr/bin/python3 list = [ abcd , 786 , 2.23 , john , 70.2 ] tinylist = [ 123 , john ] print ( list ) # Prints complete list print ( list [ 0 ]) # Prints first element of the list print ( list [ 1 : 3 ]) # Prints elements starting from 2nd till 3rd print ( list [ 2 :]) # Prints elements starting from 3rd element print ( tinylist * 2 ) # Prints list two times print ( list + tinylist ) # Prints concatenated lists This produces the following result \u2212 [ abcd , 786 , 2.23 , john , 70.200000000000003 ] abcd [ 786 , 2.23 ] [ 2.23 , john , 70.200000000000003 ] [ 123 , john , 123 , john ] [ abcd , 786 , 2.23 , john , 70.200000000000003 , 123 , john ]", + "title": "Python Lists" + }, + { + "location": "/beginner/Data_Types_In_Python_3/#python-tuples", + "text": "A tuple is another sequence data type that is similar to the list. A tuple consists of a number of values separated by commas. Unlike lists, however, tuples are enclosed within parenthesis. The main difference between lists and tuples are \u2212 Lists are enclosed in brackets ( [ ] ) and their elements and size can be changed, while tuples are enclosed in parentheses ( ( ) ) and cannot be updated. Tuples can be thought of as read-only lists. For example \u2212 #!/usr/bin/python3 tuple = ( abcd , 786 , 2.23 , john , 70.2 ) tinytuple = ( 123 , john ) print ( tuple ) # Prints complete tuple print ( tuple [ 0 ]) # Prints first element of the tuple print ( tuple [ 1 : 3 ]) # Prints elements starting from 2nd till 3rd print ( tuple [ 2 :]) # Prints elements starting from 3rd element print ( tinytuple * 2 ) # Prints tuple two times print ( tuple + tinytuple ) # Prints concatenated tuple This produces the following result \u2212 ( abcd , 786 , 2.23 , john , 70.200000000000003 ) abcd ( 786 , 2.23 ) ( 2.23 , john , 70.200000000000003 ) ( 123 , john , 123 , john ) ( abcd , 786 , 2.23 , john , 70.200000000000003 , 123 , john ) The following code is invalid with tuple, because we attempted to update a tuple, which is not allowed. Similar case is possible with lists \u2212 #!/usr/bin/python3 tuple = ( abcd , 786 , 2.23 , john , 70.2 ) list = [ abcd , 786 , 2.23 , john , 70.2 ] tuple [ 2 ] = 1000 # Invalid syntax with tuple list [ 2 ] = 1000 # Valid syntax with list", + "title": "Python Tuples" + }, + { + "location": "/beginner/Data_Types_In_Python_3/#python-dictionary", + "text": "Python's dictionaries are kind of hash-table type. They work like associative arrays or hashes found in Perl and consist of key-value pairs. A dictionary key can be almost any Python type, but are usually numbers or strings. Values, on the other hand, can be any arbitrary Python object. Dictionaries are enclosed by curly braces ({ }) and values can be assigned and accessed using square braces ([]). For example \u2212 #!/usr/bin/python3 dict = {} dict [ one ] = This is one dict [ 2 ] = This is two tinydict = { name : john , code : 6734 , dept : sales } print ( dict [ one ]) # Prints value for one key print ( dict [ 2 ]) # Prints value for 2 key print ( tinydict ) # Prints complete dictionary print ( tinydict . keys ()) # Prints all the keys print ( tinydict . values ()) # Prints all the values This produces the following result \u2212 This is one This is two { name : john , dept : sales , code : 6734 } dict_keys ([ name , dept , code ]) dict_values ([ john , sales , 6734 ]) Dictionaries have no concept of order among the elements. It is incorrect to say that the elements are \"out of order\"; they are simply unordered. Source: https://www.tutorialspoint.com/python3/python_variable_types.htm", + "title": "Python Dictionary" + }, + { + "location": "/beginner/Datatype_And_Variables/", + "text": "Datatype \n Variables\n\n\nVariables are named locations which are used to store references to the object stored in memory. The names we choose for variables and functions are commonly known as Identifiers. In python Identifiers must obey the following rules.\n\n\n\n\nAll identifiers must start with letter or underscore ( _ ) , you\n can\u2019t use digits. For e.g my_var is valid identifier while 1digit \n is not.\n\n\nIdentifiers can contain letters, digits and underscores ( _ ). \n\n\nThey can be of any length.\n\n\n\n\nIdentifier can\u2019t be a keyword (keywords are reserved words that\n Python uses for special purpose).Following are Keywords in python 3.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nand\n\n\nexec\n\n\nnot\n\n\n\n\n\n\nas\n\n\nfinally\n\n\nor\n\n\n\n\n\n\nassert\n\n\nfor\n\n\npass\n\n\n\n\n\n\nbreak\n\n\nfrom\n\n\nprint\n\n\n\n\n\n\nclass\n\n\nglobal\n\n\nraise\n\n\n\n\n\n\ncontinue\n\n\nif\n\n\nreturn\n\n\n\n\n\n\ndef\n\n\nimport\n\n\ntry\n\n\n\n\n\n\ndel\n\n\nin\n\n\nwhile\n\n\n\n\n\n\nelif\n\n\nis\n\n\nwith\n\n\n\n\n\n\nelse\n\n\nlambda\n\n\nyield\n\n\n\n\n\n\nexcept\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nAssigning Values to Variables\n\n\nValues are basic things that programs works with. For e.g 1 , 11 , 3.14 , \"hello\" are all values. In programming terminology they are also commonly known as literals. Literals can be of different type for e.g 1 , 11 are of type int , 3.14 is float and \"hello\" is string . Remember in python everything is object even basic data types like int, float, string, we will elaborate more on this in later chapters.\n\n\nIn python you don\u2019t need to declare types of variable ahead of time. Interpreter automatically detects the type of the variable by the data it contains. To assign value to a variable equal sign ( = ) is used. = is also known as assignment operator.\n\n\nFollowing are some examples of variable declaration:\n\n\nx\n \n=\n \n100\n \n# x is integer\n\n\npi\n \n=\n \n3.14\n \n# pi is float\n\n\nempname\n \n=\n \npython is great\n \n# empname is string\n\n\n\na\n \n=\n \nb\n \n=\n \nc\n \n=\n \n100\n \n# this statement assign 100 to c, b and a.\n\n\n\n\n\n\n\n\nNote:\n\nIn the above code x stores reference to the 100 ( which is an int object ) , x don\u2019t store 100 itself.\n\n\n\n\nIn Python comments are preceded by a pound sign ( # ). Comments are not programming statements that python interpreter executes while running the program. Comments are used by programmers to remind themselves how the program works. They are also used to write program documentation.\n\n\n#display hello world\n\n\nprint\n(\nhello world\n)\n\n\n\n\n\n\nSimultaneous Assignments\n\n\nPython allow simultaneous assignment syntax like this:\n\n\nvar1\n,\n \nvar2\n,\n \n...\n,\n \nvarn\n \n=\n \nexp1\n,\n \nexp2\n,\n \n...\n,\n \nexpn\n\n\n\n\n\n\nthis statements tells the python to evaluate all the expression on the right and assign them to the corresponding variables on the left. Simultaneous Assignments is helpful to swap values of two variables. For e.g\n\n\n \nx\n \n=\n \n1\n\n\n \ny\n \n=\n \n2\n\n\n\n \ny\n,\n \nx\n \n=\n \nx\n,\n \ny\n \n# assign y value to x and x value to y\n\n\n\n\n\n\nPython Data Types\n\n\nPython has 5 standard data types namely.\n\na) \nNumbers\n\nb) \nString\n\nc) \nList\n\nd) \nTuple\n\ne) \nDictionary\n\nf) Boolean \u2013 In Python True and False are boolean literals. But the following values are also considered as false.\n\n\n[] \u2013 empty list , () \u2013 empty tuple , {} \u2013 empty dictionary\n \n\n\nReceiving input from Console\n\n\ninput() function is used to receive input from the console.\n\n\nSyntax: input([prompt]) -\n string\n\n\ninput() function accepts an optional string argument called prompt and returns a string.\n\n\n \nname\n \n=\n \ninput\n(\nEnter your name: \n)\n\n\n \nEnter\n \nyour\n \nname\n:\n \ntim\n\n\n \nname\n\n\ntim\n\n\n\n\n\n\nNote that input() returns string even if you enter a number, to convert it to an integer you can use int() or eval() .\n\n\n \nage\n \n=\n \nint\n(\ninput\n(\nEnter your age: \n))\n\n\nEnter\n \nyour\n \nage\n:\n \n22\n\n\n \nage\n\n\n22\n\n\n \ntype\n(\nage\n)\n\n\nclass\n \nint\n\n\n\n\n\n\n\n\nSource:\n \n\n\n http://thepythonguru.com\n\n\n\n\nUnderstanding Python variables and Memory Management\n\n\nHave you ever noticed any difference between variables in Python and C? For example, when you do an assignment like the following in C, it actually creates a block of memory space so that it can hold the value for that variable\n\n\nint\n \na\n \n=\n \n1\n;\n\n\n\n\n\n\nYou can think of it as putting the value assigned in a box with the variable name as shown below.\n\n\n\nAnd for all the variables you create a new box is created with the variable name to hold the value. If you change the value of the variable the box will be updated with the new value. That means doing\n\n\na\n \n=\n \n2\n;\n\n\n\n\n\n\nwill result in\n\n\n\n\nAssigning one variable to another makes a copy of the value and put that value in the new box.\n\n\nint\n \nb\n \n=\n \na\n;\n\n\n\n\n\n\n \n\n\nBut in Python variables work more like tags unlike the boxes you have seen before. When you do an assignment in Python, it tags the value with the variable name.\n\n\na\n \n=\n \n1\n\n\n\n\n\n\n\n\nand if you change the value of the varaible, it just changes the tag to the new value in memory. You dont need to do the housekeeping job of freeing the memory here. Python's Automatic Garbage Collection does it for you. When a value is without names/tags it is automatically removed from memory.\n\n\na\n \n=\n \n2\n\n\n\n\n\n\n\n\nAssigning one variable to another makes a new tag bound to the same value as show below.\n\n\nb\n \n=\n \na\n\n\n\n\n\n\n\nOther languages have 'variables'. Python has 'names'.\n\n\nA bit about Python's memory management\n\n\nAs you have seen before, a value will have only one copy in memory and all the variables having this value will refer to this memory location. For example when you have variables a, b, c having a value 10, it doesn't mean that there will be 3 copy of 10s in memory. There will be only one 10 and all the variables a, b, c will point to this value. Once a variable is updated, say you are doing a += 1 a new value 11 will be allocated in memory and a will be pointing to this.\n\n\nLet's check this behaviour with Python Interpreter. Start the Python Shell and try the following for yourselves.\n\n\n \na\n \n=\n \n10\n\n\n \nb\n \n=\n \n10\n\n\n \nc\n \n=\n \n10\n\n\n \nid\n(\na\n),\n \nid\n(\nb\n),\n \nid\n(\nc\n)\n\n\n(\n140621897573616\n,\n \n140621897573616\n,\n \n140621897573616\n)\n\n\n \na\n \n+=\n \n1\n\n\n \nid\n(\na\n)\n\n\n140621897573592\n\n\n\n\n\n\nid() will return an objects memory address (object's identity). As you have noticed, when you assign the same integer value to the variables, we see the same ids. But this assumption does not hold true all the time. See the following for example\n\n\n \nx\n \n=\n \n500\n\n\n \ny\n \n=\n \n500\n\n\n \nid\n(\nx\n)\n\n\n4338740848\n\n\n \nid\n(\ny\n)\n\n\n4338741040\n\n\n\n\n\n\nWhat happened here? Even after assigning the same integer values to different variable names, we are getting two different ids here. These are actually the effects of CPython optimization we are observing here. CPython implementation keeps an array of integer objects for all integers between -5 and 256. So when we create an integer in that range, they simply back reference to the existing object. You may refer the following \nlinks\n for more information.\n\n\nLet's take a look at strings now.\n\n\n \ns1\n \n=\n \nhello\n\n\n \ns2\n \n=\n \nhello\n\n\n \nid\n(\ns1\n),\n \nid\n(\ns2\n)\n\n\n(\n4454725888\n,\n \n4454725888\n)\n\n\n \ns1\n \n==\n \ns2\n\n\nTrue\n\n\n \ns1\n \nis\n \ns2\n\n\nTrue\n\n\n \ns3\n \n=\n \nhello, world!\n\n\n \ns4\n \n=\n \nhello, world!\n\n\n \nid\n(\ns3\n),\n \nid\n(\ns4\n)\n\n\n(\n4454721608\n,\n \n4454721664\n)\n\n\n \ns3\n \n==\n \ns4\n\n\nTrue\n\n\n \ns3\n \nis\n \ns4\n\n\nFalse\n\n\n\n\n\n\nLooks interesting, isn't it? When the string was a simple and shorter one the variable names where referring to the same object in memory. But when they became bigger, this was not the case. This is called interning, and Python does interning (to some extent) of shorter string literals (as in s1 and s2) which are created at compile time. But in general, Python string literals creates a new string object each time (as in s3 and s4). Interning is runtime dependant and is always a trade-off between memory use and the cost of checking if you are creating the same string. There's a built-in intern() function to forcefully apply interning. Read more about interning from the following links.\n\n\nStack Overflow: Does Python intern Strings?\n\n\nStack Overflow: Python String Interning\n\n\nInternals of Python String Interning\n\n\n\n\nSource:\n \n\n\n http://foobarnbaz.com/2012/07/08/understanding-python-variables/\n\n\n\n\nAssignment statements in Python are more interesting than you might think\n\n\nIn this article, we will take a deep look at three kinds of assignment statements in Python and discuss what\u2019s going on under the hood.\n\n\n \nmy_string\n \n=\n \nHello World\n \n# right hand side is a simple expression\n\n\n \nanother_string\n \n=\n \nmy_string\n \n# right hand side is another variable\n\n\n \nanother_string\n \n=\n \nanother_string\n \n+\n \n!\n \n# right hand side is an operation\n\n\n\n\n\n\nWhat we find may surprise you.\n\n\nWhat happens when the right hand side is a simple expression?\n\n\n \nmy_string\n \n=\n \nHello World\n\n\n\n\n\n\nIn simple terms, this creates a string \u201cHello World\u201d in memory and assigns the name my_string to it. If you are using CPython[1], then we can even check the memory address explicitly by using the built in function id .\n\n\n \nmy_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n \n\n \nid\n(\nmy_string\n)\n\n\n140400709562064\n\n\n\n\n\n\nThat big number 140400709562064 denotes where the data lives in the memory. It will be very useful for us in this entire discussion.\nWhat happens if we create another string with the same value?\n\n\n \nanother_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n\n\n\n\n\n\nDoes it reuse the previous \u201cHello World\u201d stored in memory or does it create an independent copy? Let\u2019s check this by querying the id function again.\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562208\n\n\n\n\n\n\nThis outputs a different id, so this must be an independent copy. We conclude that:\n\n\n\n\nNote:\n\nAssignment statements where the right hand side is a simple expression creates independent copies every time.\n\n\n\n\nWhile for everyday programming, this is the rule we should remember, there are actually some weird exceptions to this rule. Here\u2019s an example.\n\n\n \nmy_string\n \n=\n \n\u201c\nhello\n\u201d\n\n\n \nid\n(\nmy_string\n)\n\n\n140400709562016\n\n\n \nanother_string\n \n=\n \n\u201c\nhello\n\u201d\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562016\n\n\n\n\n\n\nIn this case, two consecutive assignment statements did not create independent copies. Why?\nIt gets interesting now.\nFor optimizing memory, Python treats a special set of objects differently. The string \u201chello\u201d belongs to this privileged set and has a different behavior. The exact set depends on the implementation like CPython, PyPy, Jython or IronPython. For CPython, the special rule applies to:\n\n\n\n\nStrings without whitespaces and less than 20 characters and\n\n\nIntegers from -5 to +255.\n\n\n\n\nThese objects are always reused or interned. The rationale behind doing this is as follows:\n\n\n\n\nSince programmers use these objects frequently, interning existing\n objects saves memory.\n\n\nSince immutable objects like tuples and strings cannot be modified,\n there is no risk in interning the same object.\n\n\n\n\nHowever, Python does not do this for all immutable objects because there is a runtime cost involved for this feature. For interning an object, it must first search for the object in memory, and searching takes time. This is why the special treatment only applies for small integers and strings, because finding them is not that costly.\n\n\nWhat happens when the right hand side is an existing Python variable?\n\nLet\u2019s move on to the second type of assignment statement where the right hand side is an existing Python variable.\n\n\n \nanother_string\n \n=\n \nmy_string\n\n\n\n\n\n\nIn this case, nothing is created in memory. After the assignment, both variables refer to the already existing object. It\u2019s basically like giving the object an additional nickname or alias. Let\u2019s confirm this by using the id function.\n\n\n \nmy_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n\n\n \nid\n(\nmy_string\n)\n\n\n140400709562160\n\n\n \nanother_string\n \n=\n \nmy_string\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562160\n\n\n\n\n\n\nThe natural question at this stage is : what if, instead of just giving the existing object an alias, we wanted to create an independent copy?\nFor mutable objects, this is possible. You can either use the copy module of Python (which works on all objects) or you may use copy methods specific to the class. For a list, you have several possibilities for creating copies, all of which have different runtime.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \ncopy_of_my_list\n \n=\n \nmy_list\n.\ncopy\n()\n \n# fastest, works only on latest Python versions\n\n\n \ncopy_of_my_list\n \n=\n \nmy_list\n[:]\n \n# same runtime as List.copy()\n\n\n \ncopy_of_my_list\n \n=\n \nlist\n(\nmy_list\n)\n \n# slightly slower\n\n\n \nimport\n \ncopy\n\n\n \ncopy_of_my_list\n \n=\n \ncopy\n.\ncopy\n(\nmy_list\n)\n \n# slowest\n\n\n\n\n\n\nHow can you copy an immutable object? Well\u2026you can\u2019t! At least not in a straightforward way. If you try to use the copy module or the slicing notation, you will get back the same object and not an independent copy. Here\u2019s proof.\n\n\n# Standard ways of copying lists do not apply for tuples\n\n\n\n \nmy_tuple\n \n=\n \n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n \nid\n(\nmy_tuple\n)\n\n\n140371873244816\n\n\n \nanother_tuple\n \n=\n \nmy_tuple\n[:]\n\n\n \nid\n(\nanother_tuple\n)\n\n\n140371873244816\n\n\n\n# The copy module also doesn\u2019t help\n\n\n\n \nimport\n \ncopy\n \n\n \nanother_tuple\n \n=\n \ncopy\n.\ncopy\n(\nmy_tuple\n)\n\n\n \nid\n(\nanother_tuple\n)\n\n\n140371873244816\n\n\n\n\n\n\nMore importantly, there is no reason for explicitly copying an immutable object anyway. We will see why in a moment when we discuss the third kind of assignment statement.\n\nWhat happpens when the right hand side is an operation?\n\n\nIn this case, what happens depends on the result of the operation. We will discuss two simple cases:\n\n\n\n\nadding an element to an immutable object (like a tuple) and\n\n\nadding an element to a mutable object (like a list).\n\n\n\n\nLet\u2019s start with the case of the tuple.\n\n\n \nanother_tuple\n \n+=\n \n(\n4\n,)\n\n\n\n\n\n\nWhen you add a new element to a tuple using another_tuple += (4,), this creates a new object in memory. The immutability of tuples is key to understanding this. Since tuples are immutable, any operation that leads to a changed tuple would result in an independent copy.\nThis is the reason why you don\u2019t need to explicitly copy immutable objects : it happens automatically under the hood. Here\u2019s an example.\n\n\n \nmy_tuple\n \n=\n \n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n \nanother_tuple\n \n=\n \nmy_tuple\n \n# both variables point to the same object\n\n\n \nanother_tuple\n \n+=\n \n(\n4\n,)\n \n# this statement creates a new independent object\n\n\n \nprint\n(\nanother_tuple\n)\n \n\n(\n1\n,\n \n2\n,\n \n3\n,\n \n4\n)\n\n\n \nprint\n(\nmy_tuple\n)\n \n# the old one remains unharmed\n\n\n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n\n\n\n\nThe situation is much different for mutable objects and much more confusing. Let\u2019s try the same example, but now for lists.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n \n# both variables point to the same object\n\n\n \nanother_list\n \n+=\n \n[\n4\n,]\n \n# this statement modifies the object in place\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is modified\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n\n\n\n\nMutable objects can be modified in place. Some operations modify the list in place and some operations don\u2019t. In this case, the statement another_list += [4,] calls another_list.\niadd\n([4,]) and \niadd\n modifies the existing object in place.\nTo make things doubly confusing, we would have completely different results if we used a slightly different notation.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n \n# both variables point to the same object\n\n\n \nanother_list\n \n=\n \nanother_list\n \n+\n \n[\n4\n,]\n \n# this creates an independent copy\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is unharmed\n\n\n[\n1\n,\n \n2\n,\n \n3\n]\n \n\n\n\n\n\nWoah! What\u2019s going on? What changed?\nIt turns out that when we change the third line, Python now internally calls a different function another_list.\nadd\n([4,]) instead of \niadd\n. This function returns a new copy instead of modifying the list in place.\nTo prevent this confusion, it is always better to create a true copy of the list if you wish to prevent modification to the original.\nLet\u2019s remember the list copy methods from before. They were List.copy(), [:], list() and copy.copy(). This is what we should use.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n.\ncopy\n()\n \n# this creates an independent copy\n\n\n \nanother_list\n \n+=\n \n[\n4\n,]\n \n# this statement modifies the independent copy\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is unharmed\n\n\n[\n1\n,\n \n2\n,\n \n3\n]\n \n\n\n\n\n\nThere\u2019s one last gotcha that can happen when copying lists.\nSuppose we have a list that has a nested list inside it. We copy this list using List.copy() and then modify the nested list. Unfortunately, this will modify the original list again!\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n.\ncopy\n()\n\n\n \nanother_list\n[\n0\n]\n \n+=\n \n[\n6\n,]\n\n\n \nprint\n(\nanother_list\n)\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n\n\n \nprint\n(\nmy_list\n)\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n \n\n\n\n\n\nWhy did that happen? Didn\u2019t we just copy the original list?\nThe truth is : we actually don\u2019t have a completely independent copy in this case. The copy() function generates a shallow copy. To see what it does, let\u2019s look at the ids of all the elements in my_list and the ids of all the elements in the copied list.\n\n\n# for my_list\n\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nid\n(\nmy_list\n)\n\n\n140371873277424\n\n\n \nprint\n([\nid\n(\nx\n)\n \nfor\n \nx\n \nin\n \nmy_list\n])\n\n\n[\n140371873599288\n,\n \n13820176\n,\n \n13820152\n]\n\n\n\n# for another_list obtained by my_list.copy()\n\n\n\n \nid\n(\nanother_list\n)\n\n\n140371873317016\n\n\n \nprint\n([\nid\n(\nx\n)\n \nfor\n \nx\n \nin\n \nanother_list\n])\n\n\n[\n140371873599288\n,\n \n13820176\n,\n \n13820152\n]\n\n\n\n\n\n\nWe see the ids of my_list and another_list are indeed different, indicating another_list is a copy. But the ids of the elements contained in another_list have the same ids as the elements in my_list . So the elements have not been copied!\nThis is the property of shallow copy. It creates a new copy of the object but reuses the attributes and elements of the old copy. Thus, when you modify the elements of the new copy, you are modifying the elements of the old copy too.\nTo solve this problem, we need to copy an object along with all its attributes and elements. This can be achieved by copy.deepcopy.\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nanother_list\n \n=\n \ncopy\n.\ndeepcopy\n(\nmy_list\n)\n\n\n \nanother_list\n[\n0\n]\n \n+=\n \n[\n6\n,]\n\n\n \nanother_list\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n\n\n \nmy_list\n\n\n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n\n\n\n\nDeep copy is a quite time intensive operation and can take 1o times longer to complete compared to a shallow copy. But in some situations, it is unavoidable.\n\n\nConclusion\n\n\nThis brings me to the end of this discussion. To summarize, we have talked about the different scenarios which can arise in an assignment statement in Python. We found that:\n\n\n\n\nWhen the right hand side is a simple expression, a new copy is\n created every time. There are some exceptions to this rule, which\n depend on the implementation\n\n\nWhen the right hand side is an existing Python variable, then an\n alias is created for the existing copy.\n\n\nWhen the right hand side is an operation, then the outcome depends on\n the operation. In a simple case involving a tuple, we saw that an\n independent copy was created. In the same case with lists, we saw\n that the list was modified in place in one case (when we used\n \niadd\n) and a new copy was generated in another case (when we used \nadd\n).\n\n\nList item\n\n\nMutable objects can be copied but immutable objects cannot be copied\n in a straightforward way. There is also no need to copy immutable\n objects.\n\n\nTo copy a mutable object along with all its attributes and elements,\n we need to use deep copy.\n\n\n\n\n\n\nSource:\n \n\n\n https://medium.com/broken-window/many-names-one-memory-address-122f78734cb6", "title": "Datatype And Variables" - }, + }, { - "location": "/beginner/Datatype_And_Variables/#datatype-variables", - "text": "Variables are named locations which are used to store references to the object stored in memory. The names we choose for variables and functions are commonly known as Identifiers. In python Identifiers must obey the following rules. All identifiers must start with letter or underscore ( _ ) , you\n can\u2019t use digits. For e.g my_var is valid identifier while 1digit \n is not. Identifiers can contain letters, digits and underscores ( _ ). They can be of any length. Identifier can\u2019t be a keyword (keywords are reserved words that\n Python uses for special purpose).Following are Keywords in python 3. and exec not as finally or assert for pass break from print class global raise continue if return def import try del in while elif is with else lambda yield except", + "location": "/beginner/Datatype_And_Variables/#datatype-variables", + "text": "Variables are named locations which are used to store references to the object stored in memory. The names we choose for variables and functions are commonly known as Identifiers. In python Identifiers must obey the following rules. All identifiers must start with letter or underscore ( _ ) , you\n can\u2019t use digits. For e.g my_var is valid identifier while 1digit \n is not. Identifiers can contain letters, digits and underscores ( _ ). They can be of any length. Identifier can\u2019t be a keyword (keywords are reserved words that\n Python uses for special purpose).Following are Keywords in python 3. and exec not as finally or assert for pass break from print class global raise continue if return def import try del in while elif is with else lambda yield except", "title": "Datatype & Variables" - }, + }, { - "location": "/beginner/Datatype_And_Variables/#assigning-values-to-variables", - "text": "Values are basic things that programs works with. For e.g 1 , 11 , 3.14 , \"hello\" are all values. In programming terminology they are also commonly known as literals. Literals can be of different type for e.g 1 , 11 are of type int , 3.14 is float and \"hello\" is string . Remember in python everything is object even basic data types like int, float, string, we will elaborate more on this in later chapters. In python you don\u2019t need to declare types of variable ahead of time. Interpreter automatically detects the type of the variable by the data it contains. To assign value to a variable equal sign ( = ) is used. = is also known as assignment operator. Following are some examples of variable declaration: x = 100 # x is integer pi = 3.14 # pi is float empname = python is great # empname is string a = b = c = 100 # this statement assign 100 to c, b and a. Note: \nIn the above code x stores reference to the 100 ( which is an int object ) , x don\u2019t store 100 itself. In Python comments are preceded by a pound sign ( # ). Comments are not programming statements that python interpreter executes while running the program. Comments are used by programmers to remind themselves how the program works. They are also used to write program documentation. #display hello world print ( hello world )", + "location": "/beginner/Datatype_And_Variables/#assigning-values-to-variables", + "text": "Values are basic things that programs works with. For e.g 1 , 11 , 3.14 , \"hello\" are all values. In programming terminology they are also commonly known as literals. Literals can be of different type for e.g 1 , 11 are of type int , 3.14 is float and \"hello\" is string . Remember in python everything is object even basic data types like int, float, string, we will elaborate more on this in later chapters. In python you don\u2019t need to declare types of variable ahead of time. Interpreter automatically detects the type of the variable by the data it contains. To assign value to a variable equal sign ( = ) is used. = is also known as assignment operator. Following are some examples of variable declaration: x = 100 # x is integer pi = 3.14 # pi is float empname = python is great # empname is string a = b = c = 100 # this statement assign 100 to c, b and a. Note: \nIn the above code x stores reference to the 100 ( which is an int object ) , x don\u2019t store 100 itself. In Python comments are preceded by a pound sign ( # ). Comments are not programming statements that python interpreter executes while running the program. Comments are used by programmers to remind themselves how the program works. They are also used to write program documentation. #display hello world print ( hello world )", "title": "Assigning Values to Variables" - }, + }, { - "location": "/beginner/Datatype_And_Variables/#simultaneous-assignments", - "text": "Python allow simultaneous assignment syntax like this: var1 , var2 , ... , varn = exp1 , exp2 , ... , expn this statements tells the python to evaluate all the expression on the right and assign them to the corresponding variables on the left. Simultaneous Assignments is helpful to swap values of two variables. For e.g x = 1 y = 2 y , x = x , y # assign y value to x and x value to y", + "location": "/beginner/Datatype_And_Variables/#simultaneous-assignments", + "text": "Python allow simultaneous assignment syntax like this: var1 , var2 , ... , varn = exp1 , exp2 , ... , expn this statements tells the python to evaluate all the expression on the right and assign them to the corresponding variables on the left. Simultaneous Assignments is helpful to swap values of two variables. For e.g x = 1 y = 2 y , x = x , y # assign y value to x and x value to y", "title": "Simultaneous Assignments" - }, + }, { - "location": "/beginner/Datatype_And_Variables/#python-data-types", - "text": "Python has 5 standard data types namely.\na) Numbers \nb) String \nc) List \nd) Tuple \ne) Dictionary \nf) Boolean \u2013 In Python True and False are boolean literals. But the following values are also considered as false. [] \u2013 empty list , () \u2013 empty tuple , {} \u2013 empty dictionary", + "location": "/beginner/Datatype_And_Variables/#python-data-types", + "text": "Python has 5 standard data types namely. \na) Numbers \nb) String \nc) List \nd) Tuple \ne) Dictionary \nf) Boolean \u2013 In Python True and False are boolean literals. But the following values are also considered as false. [] \u2013 empty list , () \u2013 empty tuple , {} \u2013 empty dictionary", "title": "Python Data Types" - }, + }, { - "location": "/beginner/Datatype_And_Variables/#receiving-input-from-console", - "text": "input() function is used to receive input from the console. Syntax: input([prompt]) - string input() function accepts an optional string argument called prompt and returns a string. name = input ( Enter your name: ) Enter your name : tim name tim Note that input() returns string even if you enter a number, to convert it to an integer you can use int() or eval() . age = int ( input ( Enter your age: )) Enter your age : 22 age 22 type ( age ) class int Source: http://thepythonguru.com", + "location": "/beginner/Datatype_And_Variables/#receiving-input-from-console", + "text": "input() function is used to receive input from the console. Syntax: input([prompt]) - string input() function accepts an optional string argument called prompt and returns a string. name = input ( Enter your name: ) Enter your name : tim name tim Note that input() returns string even if you enter a number, to convert it to an integer you can use int() or eval() . age = int ( input ( Enter your age: )) Enter your age : 22 age 22 type ( age ) class int Source: http://thepythonguru.com", "title": "Receiving input from Console" - }, + }, { - "location": "/beginner/Datatype_And_Variables/#understanding-python-variables-and-memory-management", - "text": "Have you ever noticed any difference between variables in Python and C? For example, when you do an assignment like the following in C, it actually creates a block of memory space so that it can hold the value for that variable int a = 1 ; You can think of it as putting the value assigned in a box with the variable name as shown below. And for all the variables you create a new box is created with the variable name to hold the value. If you change the value of the variable the box will be updated with the new value. That means doing a = 2 ; will result in Assigning one variable to another makes a copy of the value and put that value in the new box. int b = a ; But in Python variables work more like tags unlike the boxes you have seen before. When you do an assignment in Python, it tags the value with the variable name. a = 1 and if you change the value of the varaible, it just changes the tag to the new value in memory. You dont need to do the housekeeping job of freeing the memory here. Python's Automatic Garbage Collection does it for you. When a value is without names/tags it is automatically removed from memory. a = 2 Assigning one variable to another makes a new tag bound to the same value as show below. b = a \nOther languages have 'variables'. Python has 'names'.", + "location": "/beginner/Datatype_And_Variables/#understanding-python-variables-and-memory-management", + "text": "Have you ever noticed any difference between variables in Python and C? For example, when you do an assignment like the following in C, it actually creates a block of memory space so that it can hold the value for that variable int a = 1 ; You can think of it as putting the value assigned in a box with the variable name as shown below. And for all the variables you create a new box is created with the variable name to hold the value. If you change the value of the variable the box will be updated with the new value. That means doing a = 2 ; will result in Assigning one variable to another makes a copy of the value and put that value in the new box. int b = a ; But in Python variables work more like tags unlike the boxes you have seen before. When you do an assignment in Python, it tags the value with the variable name. a = 1 and if you change the value of the varaible, it just changes the tag to the new value in memory. You dont need to do the housekeeping job of freeing the memory here. Python's Automatic Garbage Collection does it for you. When a value is without names/tags it is automatically removed from memory. a = 2 Assigning one variable to another makes a new tag bound to the same value as show below. b = a \nOther languages have 'variables'. Python has 'names'.", "title": "Understanding Python variables and Memory Management" - }, + }, { - "location": "/beginner/Datatype_And_Variables/#a-bit-about-pythons-memory-management", - "text": "As you have seen before, a value will have only one copy in memory and all the variables having this value will refer to this memory location. For example when you have variables a, b, c having a value 10, it doesn't mean that there will be 3 copy of 10s in memory. There will be only one 10 and all the variables a, b, c will point to this value. Once a variable is updated, say you are doing a += 1 a new value 11 will be allocated in memory and a will be pointing to this. Let's check this behaviour with Python Interpreter. Start the Python Shell and try the following for yourselves. a = 10 b = 10 c = 10 id ( a ), id ( b ), id ( c ) ( 140621897573616 , 140621897573616 , 140621897573616 ) a += 1 id ( a ) 140621897573592 id() will return an objects memory address (object's identity). As you have noticed, when you assign the same integer value to the variables, we see the same ids. But this assumption does not hold true all the time. See the following for example x = 500 y = 500 id ( x ) 4338740848 id ( y ) 4338741040 What happened here? Even after assigning the same integer values to different variable names, we are getting two different ids here. These are actually the effects of CPython optimization we are observing here. CPython implementation keeps an array of integer objects for all integers between -5 and 256. So when we create an integer in that range, they simply back reference to the existing object. You may refer the following links for more information. Let's take a look at strings now. s1 = hello s2 = hello id ( s1 ), id ( s2 ) ( 4454725888 , 4454725888 ) s1 == s2 True s1 is s2 True s3 = hello, world! s4 = hello, world! id ( s3 ), id ( s4 ) ( 4454721608 , 4454721664 ) s3 == s4 True s3 is s4 False Looks interesting, isn't it? When the string was a simple and shorter one the variable names where referring to the same object in memory. But when they became bigger, this was not the case. This is called interning, and Python does interning (to some extent) of shorter string literals (as in s1 and s2) which are created at compile time. But in general, Python string literals creates a new string object each time (as in s3 and s4). Interning is runtime dependant and is always a trade-off between memory use and the cost of checking if you are creating the same string. There's a built-in intern() function to forcefully apply interning. Read more about interning from the following links. Stack Overflow: Does Python intern Strings? Stack Overflow: Python String Interning Internals of Python String Interning Source: http://foobarnbaz.com/2012/07/08/understanding-python-variables/", + "location": "/beginner/Datatype_And_Variables/#a-bit-about-pythons-memory-management", + "text": "As you have seen before, a value will have only one copy in memory and all the variables having this value will refer to this memory location. For example when you have variables a, b, c having a value 10, it doesn't mean that there will be 3 copy of 10s in memory. There will be only one 10 and all the variables a, b, c will point to this value. Once a variable is updated, say you are doing a += 1 a new value 11 will be allocated in memory and a will be pointing to this. Let's check this behaviour with Python Interpreter. Start the Python Shell and try the following for yourselves. a = 10 b = 10 c = 10 id ( a ), id ( b ), id ( c ) ( 140621897573616 , 140621897573616 , 140621897573616 ) a += 1 id ( a ) 140621897573592 id() will return an objects memory address (object's identity). As you have noticed, when you assign the same integer value to the variables, we see the same ids. But this assumption does not hold true all the time. See the following for example x = 500 y = 500 id ( x ) 4338740848 id ( y ) 4338741040 What happened here? Even after assigning the same integer values to different variable names, we are getting two different ids here. These are actually the effects of CPython optimization we are observing here. CPython implementation keeps an array of integer objects for all integers between -5 and 256. So when we create an integer in that range, they simply back reference to the existing object. You may refer the following links for more information. Let's take a look at strings now. s1 = hello s2 = hello id ( s1 ), id ( s2 ) ( 4454725888 , 4454725888 ) s1 == s2 True s1 is s2 True s3 = hello, world! s4 = hello, world! id ( s3 ), id ( s4 ) ( 4454721608 , 4454721664 ) s3 == s4 True s3 is s4 False Looks interesting, isn't it? When the string was a simple and shorter one the variable names where referring to the same object in memory. But when they became bigger, this was not the case. This is called interning, and Python does interning (to some extent) of shorter string literals (as in s1 and s2) which are created at compile time. But in general, Python string literals creates a new string object each time (as in s3 and s4). Interning is runtime dependant and is always a trade-off between memory use and the cost of checking if you are creating the same string. There's a built-in intern() function to forcefully apply interning. Read more about interning from the following links. Stack Overflow: Does Python intern Strings? Stack Overflow: Python String Interning Internals of Python String Interning Source: http://foobarnbaz.com/2012/07/08/understanding-python-variables/", "title": "A bit about Python's memory management" - }, + }, { - "location": "/beginner/Datatype_And_Variables/#assignment-statements-in-python-are-more-interesting-than-you-might-think", - "text": "In this article, we will take a deep look at three kinds of assignment statements in Python and discuss what\u2019s going on under the hood. my_string = Hello World # right hand side is a simple expression another_string = my_string # right hand side is another variable another_string = another_string + ! # right hand side is an operation What we find may surprise you. What happens when the right hand side is a simple expression? my_string = Hello World In simple terms, this creates a string \u201cHello World\u201d in memory and assigns the name my_string to it. If you are using CPython[1], then we can even check the memory address explicitly by using the built in function id . my_string = \u201c Hello World \u201d id ( my_string ) 140400709562064 That big number 140400709562064 denotes where the data lives in the memory. It will be very useful for us in this entire discussion.\nWhat happens if we create another string with the same value? another_string = \u201c Hello World \u201d Does it reuse the previous \u201cHello World\u201d stored in memory or does it create an independent copy? Let\u2019s check this by querying the id function again. id ( another_string ) 140400709562208 This outputs a different id, so this must be an independent copy. We conclude that: Note: \nAssignment statements where the right hand side is a simple expression creates independent copies every time. While for everyday programming, this is the rule we should remember, there are actually some weird exceptions to this rule. Here\u2019s an example. my_string = \u201c hello \u201d id ( my_string ) 140400709562016 another_string = \u201c hello \u201d id ( another_string ) 140400709562016 In this case, two consecutive assignment statements did not create independent copies. Why?\nIt gets interesting now.\nFor optimizing memory, Python treats a special set of objects differently. The string \u201chello\u201d belongs to this privileged set and has a different behavior. The exact set depends on the implementation like CPython, PyPy, Jython or IronPython. For CPython, the special rule applies to: Strings without whitespaces and less than 20 characters and Integers from -5 to +255. These objects are always reused or interned. The rationale behind doing this is as follows: Since programmers use these objects frequently, interning existing\n objects saves memory. Since immutable objects like tuples and strings cannot be modified,\n there is no risk in interning the same object. However, Python does not do this for all immutable objects because there is a runtime cost involved for this feature. For interning an object, it must first search for the object in memory, and searching takes time. This is why the special treatment only applies for small integers and strings, because finding them is not that costly. What happens when the right hand side is an existing Python variable? \nLet\u2019s move on to the second type of assignment statement where the right hand side is an existing Python variable. another_string = my_string In this case, nothing is created in memory. After the assignment, both variables refer to the already existing object. It\u2019s basically like giving the object an additional nickname or alias. Let\u2019s confirm this by using the id function. my_string = \u201c Hello World \u201d id ( my_string ) 140400709562160 another_string = my_string id ( another_string ) 140400709562160 The natural question at this stage is : what if, instead of just giving the existing object an alias, we wanted to create an independent copy?\nFor mutable objects, this is possible. You can either use the copy module of Python (which works on all objects) or you may use copy methods specific to the class. For a list, you have several possibilities for creating copies, all of which have different runtime. my_list = [ 1 , 2 , 3 ] copy_of_my_list = my_list . copy () # fastest, works only on latest Python versions copy_of_my_list = my_list [:] # same runtime as List.copy() copy_of_my_list = list ( my_list ) # slightly slower import copy copy_of_my_list = copy . copy ( my_list ) # slowest How can you copy an immutable object? Well\u2026you can\u2019t! At least not in a straightforward way. If you try to use the copy module or the slicing notation, you will get back the same object and not an independent copy. Here\u2019s proof. # Standard ways of copying lists do not apply for tuples my_tuple = ( 1 , 2 , 3 ) id ( my_tuple ) 140371873244816 another_tuple = my_tuple [:] id ( another_tuple ) 140371873244816 # The copy module also doesn\u2019t help import copy another_tuple = copy . copy ( my_tuple ) id ( another_tuple ) 140371873244816 More importantly, there is no reason for explicitly copying an immutable object anyway. We will see why in a moment when we discuss the third kind of assignment statement. What happpens when the right hand side is an operation? In this case, what happens depends on the result of the operation. We will discuss two simple cases: adding an element to an immutable object (like a tuple) and adding an element to a mutable object (like a list). Let\u2019s start with the case of the tuple. another_tuple += ( 4 ,) When you add a new element to a tuple using another_tuple += (4,), this creates a new object in memory. The immutability of tuples is key to understanding this. Since tuples are immutable, any operation that leads to a changed tuple would result in an independent copy.\nThis is the reason why you don\u2019t need to explicitly copy immutable objects : it happens automatically under the hood. Here\u2019s an example. my_tuple = ( 1 , 2 , 3 ) another_tuple = my_tuple # both variables point to the same object another_tuple += ( 4 ,) # this statement creates a new independent object print ( another_tuple ) ( 1 , 2 , 3 , 4 ) print ( my_tuple ) # the old one remains unharmed ( 1 , 2 , 3 ) The situation is much different for mutable objects and much more confusing. Let\u2019s try the same example, but now for lists. my_list = [ 1 , 2 , 3 ] another_list = my_list # both variables point to the same object another_list += [ 4 ,] # this statement modifies the object in place print ( another_list ) [ 1 , 2 , 3 , 4 ] print ( my_list ) # the original list is modified [ 1 , 2 , 3 , 4 ] Mutable objects can be modified in place. Some operations modify the list in place and some operations don\u2019t. In this case, the statement another_list += [4,] calls another_list. iadd ([4,]) and iadd modifies the existing object in place.\nTo make things doubly confusing, we would have completely different results if we used a slightly different notation. my_list = [ 1 , 2 , 3 ] another_list = my_list # both variables point to the same object another_list = another_list + [ 4 ,] # this creates an independent copy print ( another_list ) [ 1 , 2 , 3 , 4 ] print ( my_list ) # the original list is unharmed [ 1 , 2 , 3 ] Woah! What\u2019s going on? What changed?\nIt turns out that when we change the third line, Python now internally calls a different function another_list. add ([4,]) instead of iadd . This function returns a new copy instead of modifying the list in place.\nTo prevent this confusion, it is always better to create a true copy of the list if you wish to prevent modification to the original.\nLet\u2019s remember the list copy methods from before. They were List.copy(), [:], list() and copy.copy(). This is what we should use. my_list = [ 1 , 2 , 3 ] another_list = my_list . copy () # this creates an independent copy another_list += [ 4 ,] # this statement modifies the independent copy print ( another_list ) [ 1 , 2 , 3 , 4 ] print ( my_list ) # the original list is unharmed [ 1 , 2 , 3 ] There\u2019s one last gotcha that can happen when copying lists.\nSuppose we have a list that has a nested list inside it. We copy this list using List.copy() and then modify the nested list. Unfortunately, this will modify the original list again! my_list = [[ 1 , 2 , 3 ], 4 , 5 ] another_list = my_list . copy () another_list [ 0 ] += [ 6 ,] print ( another_list ) [[ 1 , 2 , 3 , 6 ], 4 , 5 ] print ( my_list ) [[ 1 , 2 , 3 , 6 ], 4 , 5 ] Why did that happen? Didn\u2019t we just copy the original list?\nThe truth is : we actually don\u2019t have a completely independent copy in this case. The copy() function generates a shallow copy. To see what it does, let\u2019s look at the ids of all the elements in my_list and the ids of all the elements in the copied list. # for my_list my_list = [[ 1 , 2 , 3 ], 4 , 5 ] id ( my_list ) 140371873277424 print ([ id ( x ) for x in my_list ]) [ 140371873599288 , 13820176 , 13820152 ] # for another_list obtained by my_list.copy() id ( another_list ) 140371873317016 print ([ id ( x ) for x in another_list ]) [ 140371873599288 , 13820176 , 13820152 ] We see the ids of my_list and another_list are indeed different, indicating another_list is a copy. But the ids of the elements contained in another_list have the same ids as the elements in my_list . So the elements have not been copied!\nThis is the property of shallow copy. It creates a new copy of the object but reuses the attributes and elements of the old copy. Thus, when you modify the elements of the new copy, you are modifying the elements of the old copy too.\nTo solve this problem, we need to copy an object along with all its attributes and elements. This can be achieved by copy.deepcopy. my_list = [[ 1 , 2 , 3 ], 4 , 5 ] another_list = copy . deepcopy ( my_list ) another_list [ 0 ] += [ 6 ,] another_list [[ 1 , 2 , 3 , 6 ], 4 , 5 ] my_list [[ 1 , 2 , 3 ], 4 , 5 ] Deep copy is a quite time intensive operation and can take 1o times longer to complete compared to a shallow copy. But in some situations, it is unavoidable.", + "location": "/beginner/Datatype_And_Variables/#assignment-statements-in-python-are-more-interesting-than-you-might-think", + "text": "In this article, we will take a deep look at three kinds of assignment statements in Python and discuss what\u2019s going on under the hood. my_string = Hello World # right hand side is a simple expression another_string = my_string # right hand side is another variable another_string = another_string + ! # right hand side is an operation What we find may surprise you. What happens when the right hand side is a simple expression? my_string = Hello World In simple terms, this creates a string \u201cHello World\u201d in memory and assigns the name my_string to it. If you are using CPython[1], then we can even check the memory address explicitly by using the built in function id . my_string = \u201c Hello World \u201d id ( my_string ) 140400709562064 That big number 140400709562064 denotes where the data lives in the memory. It will be very useful for us in this entire discussion.\nWhat happens if we create another string with the same value? another_string = \u201c Hello World \u201d Does it reuse the previous \u201cHello World\u201d stored in memory or does it create an independent copy? Let\u2019s check this by querying the id function again. id ( another_string ) 140400709562208 This outputs a different id, so this must be an independent copy. We conclude that: Note: \nAssignment statements where the right hand side is a simple expression creates independent copies every time. While for everyday programming, this is the rule we should remember, there are actually some weird exceptions to this rule. Here\u2019s an example. my_string = \u201c hello \u201d id ( my_string ) 140400709562016 another_string = \u201c hello \u201d id ( another_string ) 140400709562016 In this case, two consecutive assignment statements did not create independent copies. Why?\nIt gets interesting now.\nFor optimizing memory, Python treats a special set of objects differently. The string \u201chello\u201d belongs to this privileged set and has a different behavior. The exact set depends on the implementation like CPython, PyPy, Jython or IronPython. For CPython, the special rule applies to: Strings without whitespaces and less than 20 characters and Integers from -5 to +255. These objects are always reused or interned. The rationale behind doing this is as follows: Since programmers use these objects frequently, interning existing\n objects saves memory. Since immutable objects like tuples and strings cannot be modified,\n there is no risk in interning the same object. However, Python does not do this for all immutable objects because there is a runtime cost involved for this feature. For interning an object, it must first search for the object in memory, and searching takes time. This is why the special treatment only applies for small integers and strings, because finding them is not that costly. What happens when the right hand side is an existing Python variable? \nLet\u2019s move on to the second type of assignment statement where the right hand side is an existing Python variable. another_string = my_string In this case, nothing is created in memory. After the assignment, both variables refer to the already existing object. It\u2019s basically like giving the object an additional nickname or alias. Let\u2019s confirm this by using the id function. my_string = \u201c Hello World \u201d id ( my_string ) 140400709562160 another_string = my_string id ( another_string ) 140400709562160 The natural question at this stage is : what if, instead of just giving the existing object an alias, we wanted to create an independent copy?\nFor mutable objects, this is possible. You can either use the copy module of Python (which works on all objects) or you may use copy methods specific to the class. For a list, you have several possibilities for creating copies, all of which have different runtime. my_list = [ 1 , 2 , 3 ] copy_of_my_list = my_list . copy () # fastest, works only on latest Python versions copy_of_my_list = my_list [:] # same runtime as List.copy() copy_of_my_list = list ( my_list ) # slightly slower import copy copy_of_my_list = copy . copy ( my_list ) # slowest How can you copy an immutable object? Well\u2026you can\u2019t! At least not in a straightforward way. If you try to use the copy module or the slicing notation, you will get back the same object and not an independent copy. Here\u2019s proof. # Standard ways of copying lists do not apply for tuples my_tuple = ( 1 , 2 , 3 ) id ( my_tuple ) 140371873244816 another_tuple = my_tuple [:] id ( another_tuple ) 140371873244816 # The copy module also doesn\u2019t help import copy another_tuple = copy . copy ( my_tuple ) id ( another_tuple ) 140371873244816 More importantly, there is no reason for explicitly copying an immutable object anyway. We will see why in a moment when we discuss the third kind of assignment statement. What happpens when the right hand side is an operation? In this case, what happens depends on the result of the operation. We will discuss two simple cases: adding an element to an immutable object (like a tuple) and adding an element to a mutable object (like a list). Let\u2019s start with the case of the tuple. another_tuple += ( 4 ,) When you add a new element to a tuple using another_tuple += (4,), this creates a new object in memory. The immutability of tuples is key to understanding this. Since tuples are immutable, any operation that leads to a changed tuple would result in an independent copy.\nThis is the reason why you don\u2019t need to explicitly copy immutable objects : it happens automatically under the hood. Here\u2019s an example. my_tuple = ( 1 , 2 , 3 ) another_tuple = my_tuple # both variables point to the same object another_tuple += ( 4 ,) # this statement creates a new independent object print ( another_tuple ) ( 1 , 2 , 3 , 4 ) print ( my_tuple ) # the old one remains unharmed ( 1 , 2 , 3 ) The situation is much different for mutable objects and much more confusing. Let\u2019s try the same example, but now for lists. my_list = [ 1 , 2 , 3 ] another_list = my_list # both variables point to the same object another_list += [ 4 ,] # this statement modifies the object in place print ( another_list ) [ 1 , 2 , 3 , 4 ] print ( my_list ) # the original list is modified [ 1 , 2 , 3 , 4 ] Mutable objects can be modified in place. Some operations modify the list in place and some operations don\u2019t. In this case, the statement another_list += [4,] calls another_list. iadd ([4,]) and iadd modifies the existing object in place.\nTo make things doubly confusing, we would have completely different results if we used a slightly different notation. my_list = [ 1 , 2 , 3 ] another_list = my_list # both variables point to the same object another_list = another_list + [ 4 ,] # this creates an independent copy print ( another_list ) [ 1 , 2 , 3 , 4 ] print ( my_list ) # the original list is unharmed [ 1 , 2 , 3 ] Woah! What\u2019s going on? What changed?\nIt turns out that when we change the third line, Python now internally calls a different function another_list. add ([4,]) instead of iadd . This function returns a new copy instead of modifying the list in place.\nTo prevent this confusion, it is always better to create a true copy of the list if you wish to prevent modification to the original.\nLet\u2019s remember the list copy methods from before. They were List.copy(), [:], list() and copy.copy(). This is what we should use. my_list = [ 1 , 2 , 3 ] another_list = my_list . copy () # this creates an independent copy another_list += [ 4 ,] # this statement modifies the independent copy print ( another_list ) [ 1 , 2 , 3 , 4 ] print ( my_list ) # the original list is unharmed [ 1 , 2 , 3 ] There\u2019s one last gotcha that can happen when copying lists.\nSuppose we have a list that has a nested list inside it. We copy this list using List.copy() and then modify the nested list. Unfortunately, this will modify the original list again! my_list = [[ 1 , 2 , 3 ], 4 , 5 ] another_list = my_list . copy () another_list [ 0 ] += [ 6 ,] print ( another_list ) [[ 1 , 2 , 3 , 6 ], 4 , 5 ] print ( my_list ) [[ 1 , 2 , 3 , 6 ], 4 , 5 ] Why did that happen? Didn\u2019t we just copy the original list?\nThe truth is : we actually don\u2019t have a completely independent copy in this case. The copy() function generates a shallow copy. To see what it does, let\u2019s look at the ids of all the elements in my_list and the ids of all the elements in the copied list. # for my_list my_list = [[ 1 , 2 , 3 ], 4 , 5 ] id ( my_list ) 140371873277424 print ([ id ( x ) for x in my_list ]) [ 140371873599288 , 13820176 , 13820152 ] # for another_list obtained by my_list.copy() id ( another_list ) 140371873317016 print ([ id ( x ) for x in another_list ]) [ 140371873599288 , 13820176 , 13820152 ] We see the ids of my_list and another_list are indeed different, indicating another_list is a copy. But the ids of the elements contained in another_list have the same ids as the elements in my_list . So the elements have not been copied!\nThis is the property of shallow copy. It creates a new copy of the object but reuses the attributes and elements of the old copy. Thus, when you modify the elements of the new copy, you are modifying the elements of the old copy too.\nTo solve this problem, we need to copy an object along with all its attributes and elements. This can be achieved by copy.deepcopy. my_list = [[ 1 , 2 , 3 ], 4 , 5 ] another_list = copy . deepcopy ( my_list ) another_list [ 0 ] += [ 6 ,] another_list [[ 1 , 2 , 3 , 6 ], 4 , 5 ] my_list [[ 1 , 2 , 3 ], 4 , 5 ] Deep copy is a quite time intensive operation and can take 1o times longer to complete compared to a shallow copy. But in some situations, it is unavoidable.", "title": "Assignment statements in Python are more interesting than you might think" - }, + }, { - "location": "/beginner/Datatype_And_Variables/#conclusion", - "text": "This brings me to the end of this discussion. To summarize, we have talked about the different scenarios which can arise in an assignment statement in Python. We found that: When the right hand side is a simple expression, a new copy is\n created every time. There are some exceptions to this rule, which\n depend on the implementation When the right hand side is an existing Python variable, then an\n alias is created for the existing copy. When the right hand side is an operation, then the outcome depends on\n the operation. In a simple case involving a tuple, we saw that an\n independent copy was created. In the same case with lists, we saw\n that the list was modified in place in one case (when we used\n iadd ) and a new copy was generated in another case (when we used add ). List item Mutable objects can be copied but immutable objects cannot be copied\n in a straightforward way. There is also no need to copy immutable\n objects. To copy a mutable object along with all its attributes and elements,\n we need to use deep copy. Source: https://medium.com/broken-window/many-names-one-memory-address-122f78734cb6", + "location": "/beginner/Datatype_And_Variables/#conclusion", + "text": "This brings me to the end of this discussion. To summarize, we have talked about the different scenarios which can arise in an assignment statement in Python. We found that: When the right hand side is a simple expression, a new copy is\n created every time. There are some exceptions to this rule, which\n depend on the implementation When the right hand side is an existing Python variable, then an\n alias is created for the existing copy. When the right hand side is an operation, then the outcome depends on\n the operation. In a simple case involving a tuple, we saw that an\n independent copy was created. In the same case with lists, we saw\n that the list was modified in place in one case (when we used\n iadd ) and a new copy was generated in another case (when we used add ). List item Mutable objects can be copied but immutable objects cannot be copied\n in a straightforward way. There is also no need to copy immutable\n objects. To copy a mutable object along with all its attributes and elements,\n we need to use deep copy. Source: https://medium.com/broken-window/many-names-one-memory-address-122f78734cb6", "title": "Conclusion" - }, + }, { - "location": "/advanced/Python_Metaclasses/", - "text": "Quick Tip: What Is a Metaclass in Python\n\n\nThis quick tip gives a brief overview of what we mean by a metaclass in Python and shows some examples of the concept.\n\n\nBefore delving into this article, I should point out an important point \nabout classes in Python\n which makes it easier for us to grasp the concept of metaclasses.\n\n\nIs a Class an Object in Python?!\n\n\nIf you've used a programming language other than Python, the concept you understood about classes is most likely that it is a way used to create new objects. This is also true in Python, but Python even takes it one more step further\u2014classes are also considered objects!\n\n\nSo, if you created the following class in Python:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \npass\n\n\n\n\n\n\nThis simply means that an object with the name myClass has been created in memory. Since this object is able to create new objects, it is considered a class. This means we can apply object operations on classes in Python, as classes are objects themselves.\n\n\nWe can thus do operations on classes like assigning the class to a variable, as follows:\n\n\nclass_object\n \n=\n \nmyClass\n()\n\n\nprint\n \nclass_object\n\n\n\n\n\n\nWhich returns:\n\n\n__main__\n.\nmyClass\n \nobject\n \nat\n \n0x102623610\n\n\n\n\n\n\nYou can even pass the class \nmyClass\n as a parameter to a method, as follows:\n\n\ndef\n \nclass_object\n(\nobject\n):\n\n \nprint\n \nobject\n\n\n\nclass_object\n(\nmyClass\n)\n\n\n\n\n\n\nWhich returns the following output:\n\n\nclass\n \n__main__\n.\nmyClass\n\n\n\n\n\n\nIn addition to other operations you can normally apply on objects.\n\n\nMetaclasses\n\n\nMaybe you have come across the \ntype\n keyword in Python? You most likely used it to check the type of some object, as shown in the following examples:\n\n\nprint\n \ntype\n(\nabder\n)\n\n\nprint\n \ntype\n(\n100\n)\n\n\nprint\n \ntype\n(\n100.0\n)\n\n\nprint\n \ntype\n(\nint\n)\n\n\n\n\n\n\nIn which case you would get the following output:\n\n\ntype\n \nstr\n\n\ntype\n \nint\n\n\ntype\n \nfloat\n\n\ntype\n \ntype\n\n\n\n\n\n\nLooking at the output, everything seems pretty clear until you come to the type type. To see what this might mean, let's go back to our class we defined at the beginning of this article:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \npass\n\n\n\n\n\n\nNow, do the following:\n\n\nprint\n \ntype\n(\nmyClass\n)\n\n\n\n\n\n\nWhat would be the output of this statement? It will surprisingly be:\n\n\ntype\n \ntype\n\n\n\n\n\n\nSo, we can conclude that the type of classes in Python is \ntype\n!\n\n\nWhat is the relation between a \ntype\n and a \nmetaclass\n? Well, a \ntype\n is a \nmetaclass\n, provided that the default \nmetaclass\n is \ntype\n. I know this might be confusing, especially that type can be used to return the class of some object as shown above, but this is due to the backward compatibility in Python. So, if you write:\n\n\nprint\n \ntype\n(\ntype\n)\n\n\n\n\n\n\nYou will get:\n\n\ntype\n \ntype\n\n\n\n\n\n\nMeaning that a \ntype\n is a \ntype\n!\n\n\nThe term \nmetaclass\n simply means something used to create classes. In other words, it is the class of a class, meaning that the instance of a class in this case is a class. Thus, \ntype\n is considered a \nmetaclass\n since the instance of a \ntype\n is a class.\n\n\nFor instance, when we mentioned the following statement above:\n\n\nclass_object\n \n=\n \nmyClass\n()\n\n\n\n\n\n\nThis simply builds an object/instance of the class \nmyClass\n. In other words, we used a class to create an object. \n\n\nIn the same way, when we did the following:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \npass\n\n\n\n\n\n\nThe \nmetaclass\n was used to create the class \nmyClass\n (which is considered a \ntype\n). So, like the object being an instance of a class, a class is an instance of a \nmetaclass\n.\n\n\nUsing Metaclass to Create a Class\n\n\nIn this section, we are going to see how we can use a \nmetaclass\n to create a class, rather than using the \nclass\n statement as we saw in the classes and objects tutorial. As we saw above, the default \nmetaclass\n is \ntype\n. Thus, we can use the following statement to create a new class:\n\n\nnew_class\n \n=\n \ntype\n(\nmyClass\n,(),{})\n\n\n\n\n\n\nIf you want to make things simpler, you can assign the same class name myClass to the variable name.\n\n\nThe dictionary \n{ }\n here is used to define the attributes of the class. So, having the following statement:\n\n\nmyClass\n \n=\n \ntype\n(\nmyClass\n,(),{\na\n:\nTrue\n})\n\n\n\n\n\n\nIs similar to:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \na\n \n=\n \nTrue\n\n\n\n\n\n\nThe \nmetaclass\n Attribute\n\n\nSay that we created the class \nmyClass\n as follows:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \n__metaclass__\n \n=\n \nmyMetaClass\n\n \npass\n\n\n\n\n\n\nIn this case, class creation will occur using myMetaClass instead of type, as follows:\n\n\nmyClass\n \n=\n \nmyMetaClass\n(\nclassName\n,\n \nbases\n,\n \ndictionary\n)\n\n\n\n\n\n\nCreation and Initialization of a Metaclass\n\n\nIf you want to have control on how you create and initialize a class after its creation, you can simply use the metaclass \nnew\n method and \ninit\n constructor, respectively. So, when myMetaClass above is called, this is what will be happening behind the scenes:\n\n\nmyClass\n \n=\n \nmyMetaClass\n.\n__new__\n(\nmyMetaClass\n,\n \nname\n,\n \nbases\n,\n \ndictionary\n)\n\n\nmyMetaClass\n.\n__init__\n(\nmyClass\n,\n \nname\n,\n \nbases\n,\n \ndictionary\n)\n\n\n\n\n\n\n\n\nSource:\n \n\n\n https://code.tutsplus.com/tutorials/quick-tip-what-is-a-metaclass-in-python--cms-26016\n\n\n\n\n\n\nUnderstanding Python metaclasses from Ionelmc.ro\n\n\nA quick overview\n\n\nA high level explanation is necessary before we get down to the details.\n\n\nA class is an object, and just like any other object, it's an instance of something: a metaclass. The default metaclass is type. Unfortunately, due to backwards compatibility, type is a bit confusing: it can also be used as a function that return the class [13] of an object:\n\n\n \nclass\n \nFoobar\n:\n\n\n...\n \npass\n\n\n...\n\n\n \ntype\n(\nFoobar\n)\n\n\nclass\n \ntype\n\n\n \nfoo\n \n=\n \nFoobar\n()\n\n\n \ntype\n(\nfoo\n)\n\n\nclass\n \n__main__\n.\nFoobar\n\n\n\n\n\n\nIf you're familiar with the isinstance builtin then you'll know this:\n\n\n \nisinstance\n(\nfoo\n,\n \nFoobar\n)\n\n\nTrue\n\n\n \nisinstance\n(\nFoobar\n,\n \ntype\n)\n\n\nTrue\n\n\n\n\n\n\nTo put this in picture:\n\n\n \n\n\nBut lets go back to making classes ...\n\n\nSimple metaclass use\n\n\nWe can use type directly to make a class, without any class statement:\n\n\n \nMyClass\n \n=\n \ntype\n(\nMyClass\n,\n \n(),\n \n{})\n\n\n \nMyClass\n\n\nclass\n \n__main__\n.\nMyClass\n\n\n\n\n\n\nThe class statement isn't just syntactic sugar, it does some extra things, like setting an adequate \nqualname\n and \ndoc\n properties or calling \nprepare\n.\n\n\nWe can make a custom metaclass:\n\n\n \nclass\n \nMeta\n(\ntype\n):\n\n\n...\n \npass\n\n\n\n\n\n\nAnd then we can use it :\n\n\n \nclass\n \nComplex\n(\nmetaclass\n=\nMeta\n):\n\n\n...\n \npass\n\n\n \ntype\n(\nComplex\n)\n\n\nclass\n \n__main__\n.\nMeta\n\n\n\n\n\n\nNow we got a rough idea of what we'll be dealing with ...\n\n\nMagic methods\n\n\nOne distinctive feature of Python is magic methods: they allow the programmer to override behavior for various operators and behavior of objects. To override the call operator you'd do this:\n\n\n \nclass\n \nFunky\n:\n\n\n...\n \ndef\n \n__call__\n(\nself\n):\n\n\n...\n \nprint\n(\nLook at me, I work like a function!\n)\n\n\n \nf\n \n=\n \nFunky\n()\n\n\n \nf\n()\n\n\nLook\n \nat\n \nme\n,\n \nI\n \nwork\n \nlike\n \na\n \nfunction\n!\n\n\n\n\n\n\nMetaclasses rely on several magic methods so it's quite useful to know a bit more about them.\n\n\nThe slots\n\n\nWhen you define a magic method in your class the function will end up as a pointer in a struct that describes the class, in addition to the entry in \ndict\n. That struct [7] has a field for each magic method. For some reason these fields are called type slots.\n\n\nNow there's another feature, implemented via the \nslots\n attribute. A class with \nslots\n will create instances that don't have a \ndict\n (they use a little bit less memory). A side-effect of this is that instances cannot have other fields than what was specified in \nslots\n: if you try to set an unexpected field you'll get an exception.\n\n\nFor the scope of this article when slots are mentioned it will mean the type slots, not \nslots\n.\n\n\nObject attribute lookup\n\n\nNow this is something that's easy to get wrong because of the many slight differences to old-style objects in Python 2. \n\n\nAssuming Class is the class and instance is an instance of Class, evaluating instance.foobar roughly equates to this:\n\n\n\n\nCall the type slot for Class.\ngetattribute\n (tp_getattro). The default does this: \n\n\nDoes Class.\ndict\n have a foobar item that is a data descriptor ? \n\n\nIf yes, return the result of Class.\ndict\n['foobar'].\nget\n(instance, Class). \n\n\n\n\n\n\nDoes instance.\ndict\n have a foobar item in it? \n\n\nIf yes, return instance.\ndict\n['foobar']. \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item that is not a data descriptor ? \n\n\nIf yes, return the result of Class.\ndict\n['foobar'].\nget\n(instance, klass). \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item ? \n\n\nIf yes, return the result of Class.\ndict\n['foobar']. \n\n\n\n\n\n\n\n\n\n\nIf the attribute still wasn't found, and there's a Class.\ngetattr\n, call Class.\ngetattr\n('foobar').\n\n\n\n\nStill not clear? Perhaps a diagram normal attribute lookup helps:\n\n\n\n\n\nTo avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.\n\n\n\n\nClass attribute lookup\n\n\nBecause classes needs to be able support the classmethod and staticmethod properties [6] when you evaluate something like Class.foobar the lookup is slightly different than what would happen when you evaluate instance.foobar.\n\n\nAssuming Class is an instance of Metaclass, evaluating Class.foobar roughly equates to this:\n\n\n\n\nCall the type slot for Metaclass.\ngetattribute\n (tp_getattro). The default does this: \n\n\nDoes Metaclass.\ndict\n have a foobar item that is a data descriptor ?\n\n\nIf yes, return the result of Metaclass.\ndict\n['foobar'].\nget\n(Class, Metaclass). \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item that is a descriptor (of any kind)?\n\n\nIf yes, return the result of Class.\ndict\n['foobar'].\nget\n(None, Class). \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item in it?\n\n\nIf yes, return Class.\ndict\n['foobar'].\n\n\n\n\n\n\nDoes Metaclass.\ndict\n have a foobar item that is not a data descriptor ?\n\n\nIf yes, return the result of Metaclass.\ndict\n['foobar'].\nget\n(Class, Metaclass).\n\n\n\n\n\n\nDoes Metaclass.\ndict\n have any foobar item?\n\n\nIf yes, return Metaclass.\ndict\n['foobar'].\n\n\n\n\n\n\n\n\n\n\nIf the attribute still wasn't found, and there's a Metaclass.\ngetattr\n, call Metaclass.\ngetattr\n('foobar').\n\n\n\n\nThe whole shebang would look like this in a diagram:\n\n\n\n\n\nTo avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.\n\n\n\n\nMagic method lookup\n\n\nFor magic methods the lookup is done on the class, directly in the big struct with the slots:\n\n\n\n\nDoes the object's class have a slot for that magic method (roughly object-\nob_type-\ntp_\n in C code)? If yes, use it. If it's NULL then the operation is not supported.\n\n\n\n\n\n\nIn C internals parlance:\n - object-\nob_type is the class of the object. \n\n - ob_type-\ntp_\n is the type slot.\n\n\n\n\nThis looks much simpler, however, the type slots are filled with wrappers around your functions, so descriptors work as expected:\n\n\n \nclass\n \nMagic\n:\n\n\n...\n \n@property\n\n\n...\n \ndef\n \n__repr__\n(\nself\n):\n\n\n...\n \ndef\n \ninner\n():\n\n\n...\n \nreturn\n \nIt works!\n\n\n...\n \nreturn\n \ninner\n\n\n...\n\n\n \nrepr\n(\nMagic\n())\n\n\nIt works!\n\n\n\n\n\n\nThats it. Does that mean there are places that don't follow those rules and lookup the slot differently? Sadly yes, read on ...\n\n\nThe \nnew\n method\n\n\nOne of the most common point of confusion with both classes and metaclasses is the \nnew\n method. It has some very special conventions.\n\n\nThe \nnew\n method is the constructor (it returns the new instance) while \ninit\n is just a initializer (the instance is already created when \ninit\n is called).\n\n\nSuppose have a class like this:\n\n\nclass\n \nFoobar\n:\n\n \ndef\n \n__new__\n(\ncls\n):\n\n \nreturn\n \nsuper\n()\n.\n__new__\n(\ncls\n)\n\n\n\n\n\n\nNow if you recall the previous section, you'd expect that __new__ would be looked up on the metaclass, but alas, it wouldn't be so useful that way so it's looked up statically.\n\n\nWhen the Foobar class wants this magic method it will be looked up on the same object (the class), not on a upper level like all the other magic methods. This is very important to understand, because both the class and the metaclass can define this method:\n\n\n\n\nFoobar.__new__ is used to create instances of Foobar\n\n\ntype.__new__ is used to create the Foobar class (an instance of type in the example)\n\n\n\n\nThe \nprepare\n method\n\n\nThis method is called before the class body is executed and it must return a dictionary-like object that's used as the local namespace for all the code from the class body. It was added in Python 3.0, see \nPEP-3115\n.\n\n\nIf your __prepare__ returns an object x then this:\n\n\nclass\n \nClass\n(\nmetaclass\n=\nMeta\n):\n\n \na\n \n=\n \n1\n\n \nb\n \n=\n \n2\n\n \nc\n \n=\n \n3\n\n\n\n\n\n\nWill make the following changes to x:\n\n\nx\n[\na\n]\n \n=\n \n1\n\n\nx\n[\nb\n]\n \n=\n \n2\n\n\nx\n[\nc\n]\n \n=\n \n3\n\n\n\n\n\n\nThis x object needs to look like a dictionary. Note that this x object will end up as an argument to Metaclass.__new\n and if it's not an instance of dict you need to convert it before calling super().__new\n.\n\n\nInterestingly enough this method doesn't have __new__'s special lookup. It appears it doesn't have it's own type slot and it's looked up via the class attribute lookup, if you read back a bit. \n\n\nPutting it all together\n\n\nTo start things off, a diagram of how instances are constructed:\n\n\n\nHow to read this swim lane diagram: \n\n\n\n\nThe horizontal lanes is the place where you define the functions.\n\n\nSolid lines mean a function call.\n\n\nA line from Metaclass.__call\n to Class.__new\n means Metaclass.__call\n will call Class.__new\n.\n\n\n\n\n\n\nDashed lines means something is returned.\n\n\nClass.\nnew\n returns the instance of Class.\n\n\nMetaclass.\ncall\n returns whatever Class.\nnew\n returned (and if it returned an instance of Class it will also call Class.\ninit\n on it). \n\n\n\n\n\n\nThe number in the red circle signifies the call order.\n\n\n\n\nCreating a class is quite similar:\n\n\n\nFew more notes:\n- Metaclass.\nprepare\n just returns the namespace object (a dictionary-like object as explained before).\n- Metaclass.\nnew\n returns the Class object.\n- MetaMetaclass.\ncall\n returns whatever Metaclass.\nnew\n returned (and if it returned an instance of Metaclass it will also call Metaclass.\ninit\n on it). \n\n\nSo you see, metaclasses allow you to customize almost every part of an object life-cycle.\n\n\nMetaclasses are callables\n\n\nIf you look again at the diagrams, you'll notice that making an instance goes through Metaclass.\ncall\n. This means you can use any callable as the metaclass:\n\n\n \nclass\n \nFoo\n(\nmetaclass\n=\nprint\n):\n \n# pointless, but illustrative\n\n\n...\n \npass\n\n\n...\n\n\nFoo\n \n()\n \n{\n__module__\n:\n \n__main__\n,\n \n__qualname__\n:\n \nFoo\n}\n\n\n \nprint\n(\nFoo\n)\n\n\nNone\n\n\n\n\n\n\nIf you use a function as the metaclass then subclasses won't inherit your function metaclass, but the type of whatever that function returned.\n\n\nSubclasses inherit the metaclass\n\n\nOne advantage compared to class decorators is the fact that subclasses inherit the metaclass.\n\n\nThis is a consequence of the fact that Metaclass(...) returns an object which usually has Metaclass as the \nclass\n.\n\n\nRestrictions with multiple metaclasses\n\n\nIn the same tone of classes allowing you to have multiple baseclasses, each one of those baseclasses may have a different metaclass. But with a twist: everything has to be linear - the inheritance tree must have a single leaf.\n\n\nFor example, this is not accepted because there would be two leafs (Meta1 and Meta2):\n\n\n \nclass\n \nMeta1\n(\ntype\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nMeta2\n(\ntype\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase1\n(\nmetaclass\n=\nMeta1\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase2\n(\nmetaclass\n=\nMeta2\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nFoobar\n(\nBase1\n,\n \nBase2\n):\n\n\n...\n \npass\n\n\n...\n\n\nTraceback\n \n(\nmost\n \nrecent\n \ncall\n \nlast\n):\n\n \nFile\n \nstdin\n,\n \nline\n \n1\n,\n \nin\n \nmodule\n\n\nTypeError\n:\n \nmetaclass\n \nconflict\n:\n \nthe\n \nmetaclass\n \nof\n \na\n \nderived\n \nclass\n \nmust\n \nbe\n \na\n \n(\nnon\n-\nstrict\n)\n \nsubclass\n \nof\n \nthe\n \nmetaclasses\n \nof\n \nall\n \nits\n \nbases\n\n\n\n\n\n\nThis will work (and will use the leaf as the metaclass):\n\n\n \nclass\n \nMeta\n(\ntype\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nSubMeta\n(\nMeta\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase1\n(\nmetaclass\n=\nMeta\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase2\n(\nmetaclass\n=\nSubMeta\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nFoobar\n(\nBase1\n,\n \nBase2\n):\n\n\n...\n \npass\n\n\n...\n\n\n \ntype\n(\nFoobar\n)\n\n\nclass\n \n__main__\n.\nSubMeta\n\n\n\n\n\n\nThe method signatures\n\n\nThere are still few important details missing, like the method signatures. Lets look at class and metaclass with all the important stuff implemented.\n\n\nNote the extra **kwargs - those are the extra keywords arguments you can pass in the class statement. \n\n\n \nclass\n \nMeta\n(\ntype\n):\n\n\n...\n \n@classmethod\n\n\n...\n \ndef\n \n__prepare__\n(\nmcs\n,\n \nname\n,\n \nbases\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__prepare__(mcs=\n%s\n, name=\n%r\n, bases=\n%s\n, **\n%s\n)\n \n%\n \n(\n\n\n...\n \nmcs\n,\n \nname\n,\n \nbases\n,\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \n{}\n\n\n\n\n\n\nAs mentioned before, __prepare\n can return objects that are not dict instances, so you need to make sure your __new\n handles that.\n\n\n...\n \ndef\n \n__new__\n(\nmcs\n,\n \nname\n,\n \nbases\n,\n \nattrs\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__new__(mcs=\n%s\n, name=\n%r\n, bases=\n%s\n, attrs=[\n%s\n], **\n%s\n)\n \n%\n \n(\n\n\n...\n \nmcs\n,\n \nname\n,\n \nbases\n,\n \n, \n.\njoin\n(\nattrs\n),\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__new__\n(\nmcs\n,\n \nname\n,\n \nbases\n,\n \nattrs\n)\n\n\n\n\n\n\nIt's uncommon to see \ninit\n being implemented in a metaclass because it's not that powerful - the class is already constructed when \ninit\n is called. It roughly equates to having a class decorator with the difference that \ninit\n would get run when making subclasses, while class decorators are not called for subclasses.\n\n\n...\n \ndef\n \n__init__\n(\ncls\n,\n \nname\n,\n \nbases\n,\n \nattrs\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__init__(cls=\n%s\n, name=\n%r\n, bases=\n%s\n, attrs=[\n%s\n], **\n%s\n)\n \n%\n \n(\n\n\n...\n \ncls\n,\n \nname\n,\n \nbases\n,\n \n, \n.\njoin\n(\nattrs\n),\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__init__\n(\nname\n,\n \nbases\n,\n \nattrs\n)\n\n\n\n\n\n\nThe __call__ method will be called when you make instances of Class.\n\n\n...\n \ndef\n \n__call__\n(\ncls\n,\n \n*\nargs\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__call__(cls=\n%s\n, args=\n%s\n, kwargs=\n%s\n)\n \n%\n \n(\n\n\n...\n \ncls\n,\n \nargs\n,\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__call__\n(\n*\nargs\n,\n \n**\nkwargs\n)\n\n\n...\n\n\n\n\n\n\nUsing Meta, note the extra=1: \n\n\n \nclass\n \nClass\n(\nmetaclass\n=\nMeta\n,\n \nextra\n=\n1\n):\n\n\n...\n \ndef\n \n__new__\n(\ncls\n,\n \nmyarg\n):\n\n\n...\n \nprint\n(\n Class.__new__(cls=\n%s\n, myarg=\n%s\n)\n \n%\n \n(\n\n\n...\n \ncls\n,\n \nmyarg\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__new__\n(\ncls\n)\n\n\n...\n\n\n...\n \ndef\n \n__init__\n(\nself\n,\n \nmyarg\n):\n\n\n...\n \nprint\n(\n Class.__init__(self=\n%s\n, myarg=\n%s\n)\n \n%\n \n(\n\n\n...\n \nself\n,\n \nmyarg\n\n\n...\n \n))\n\n\n...\n \nself\n.\nmyarg\n \n=\n \nmyarg\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__init__\n()\n\n\n...\n\n\n...\n \ndef\n \n__str__\n(\nself\n):\n\n\n...\n \nreturn\n \ninstance of Class; myargs=\n%s\n \n%\n \n(\n\n\n...\n \ngetattr\n(\nself\n,\n \nmyarg\n,\n \nMISSING\n),\n\n\n...\n \n)\n\n \nMeta\n.\n__prepare__\n(\nmcs\n=\nclass\n \n__main__\n.\nMeta\n, name=\nClass\n, bases=(),\n\n \n**\n{\nextra\n:\n \n1\n})\n\n \nMeta\n.\n__new__\n(\nmcs\n=\nclass\n \n__main__\n.\nMeta\n, name=\nClass\n, bases=(),\n\n \nattrs\n=\n[\n__qualname__\n,\n \n__new__\n,\n \n__init__\n,\n \n__str__\n,\n \n__module__\n],\n\n \n**\n{\nextra\n:\n \n1\n})\n\n \nMeta\n.\n__init__\n(\ncls\n=\nclass\n \n__main__\n.\nClass\n, name=\nClass\n, bases=(),\n\n \nattrs\n=\n[\n__qualname__\n,\n \n__new__\n,\n \n__init__\n,\n \n__str__\n,\n \n__module__\n],\n\n \n**\n{\nextra\n:\n \n1\n})\n\n\n\n\n\n\nNote that Meta.__call__ is called when we make instance of Class:\n\n\n \nClass\n(\n1\n)\n\n \nMeta\n.\n__call__\n(\ncls\n=\nclass\n \n__main__\n.\nClass\n, args=(1,), kwargs={})\n\n \nClass\n.\n__new__\n(\ncls\n=\nclass\n \n__main__\n.\nClass\n, myarg=1)\n\n \nClass\n.\n__init__\n(\nself\n=\ninstance\n \nof\n \nClass\n;\n \nmyargs\n=\nMISSING\n,\n \nmyarg\n=\n1\n)\n\n\ninstance\n \nof\n \nClass\n;\n \nmyargs\n=\n1\n\n\n\n\n\n\n\n\nSource:\n \n\n\n https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/", + "location": "/advanced/Python_Metaclasses/", + "text": "Quick Tip: What Is a Metaclass in Python\n\n\nThis quick tip gives a brief overview of what we mean by a metaclass in Python and shows some examples of the concept.\n\n\nBefore delving into this article, I should point out an important point \nabout classes in Python\n which makes it easier for us to grasp the concept of metaclasses.\n\n\nIs a Class an Object in Python?!\n\n\nIf you've used a programming language other than Python, the concept you understood about classes is most likely that it is a way used to create new objects. This is also true in Python, but Python even takes it one more step further\u2014classes are also considered objects!\n\n\nSo, if you created the following class in Python:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \npass\n\n\n\n\n\n\nThis simply means that an object with the name myClass has been created in memory. Since this object is able to create new objects, it is considered a class. This means we can apply object operations on classes in Python, as classes are objects themselves.\n\n\nWe can thus do operations on classes like assigning the class to a variable, as follows:\n\n\nclass_object\n \n=\n \nmyClass\n()\n\n\nprint\n \nclass_object\n\n\n\n\n\n\nWhich returns:\n\n\n__main__\n.\nmyClass\n \nobject\n \nat\n \n0x102623610\n\n\n\n\n\n\nYou can even pass the class \nmyClass\n as a parameter to a method, as follows:\n\n\ndef\n \nclass_object\n(\nobject\n):\n\n \nprint\n \nobject\n\n\n\nclass_object\n(\nmyClass\n)\n\n\n\n\n\n\nWhich returns the following output:\n\n\nclass\n \n__main__\n.\nmyClass\n\n\n\n\n\n\nIn addition to other operations you can normally apply on objects.\n\n\nMetaclasses\n\n\nMaybe you have come across the \ntype\n keyword in Python? You most likely used it to check the type of some object, as shown in the following examples:\n\n\nprint\n \ntype\n(\nabder\n)\n\n\nprint\n \ntype\n(\n100\n)\n\n\nprint\n \ntype\n(\n100.0\n)\n\n\nprint\n \ntype\n(\nint\n)\n\n\n\n\n\n\nIn which case you would get the following output:\n\n\ntype\n \nstr\n\n\ntype\n \nint\n\n\ntype\n \nfloat\n\n\ntype\n \ntype\n\n\n\n\n\n\nLooking at the output, everything seems pretty clear until you come to the type type. To see what this might mean, let's go back to our class we defined at the beginning of this article:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \npass\n\n\n\n\n\n\nNow, do the following:\n\n\nprint\n \ntype\n(\nmyClass\n)\n\n\n\n\n\n\nWhat would be the output of this statement? It will surprisingly be:\n\n\ntype\n \ntype\n\n\n\n\n\n\nSo, we can conclude that the type of classes in Python is \ntype\n!\n\n\nWhat is the relation between a \ntype\n and a \nmetaclass\n? Well, a \ntype\n is a \nmetaclass\n, provided that the default \nmetaclass\n is \ntype\n. I know this might be confusing, especially that type can be used to return the class of some object as shown above, but this is due to the backward compatibility in Python. So, if you write:\n\n\nprint\n \ntype\n(\ntype\n)\n\n\n\n\n\n\nYou will get:\n\n\ntype\n \ntype\n\n\n\n\n\n\nMeaning that a \ntype\n is a \ntype\n!\n\n\nThe term \nmetaclass\n simply means something used to create classes. In other words, it is the class of a class, meaning that the instance of a class in this case is a class. Thus, \ntype\n is considered a \nmetaclass\n since the instance of a \ntype\n is a class.\n\n\nFor instance, when we mentioned the following statement above:\n\n\nclass_object\n \n=\n \nmyClass\n()\n\n\n\n\n\n\nThis simply builds an object/instance of the class \nmyClass\n. In other words, we used a class to create an object. \n\n\nIn the same way, when we did the following:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \npass\n\n\n\n\n\n\nThe \nmetaclass\n was used to create the class \nmyClass\n (which is considered a \ntype\n). So, like the object being an instance of a class, a class is an instance of a \nmetaclass\n.\n\n\nUsing Metaclass to Create a Class\n\n\nIn this section, we are going to see how we can use a \nmetaclass\n to create a class, rather than using the \nclass\n statement as we saw in the classes and objects tutorial. As we saw above, the default \nmetaclass\n is \ntype\n. Thus, we can use the following statement to create a new class:\n\n\nnew_class\n \n=\n \ntype\n(\nmyClass\n,(),{})\n\n\n\n\n\n\nIf you want to make things simpler, you can assign the same class name myClass to the variable name.\n\n\nThe dictionary \n{ }\n here is used to define the attributes of the class. So, having the following statement:\n\n\nmyClass\n \n=\n \ntype\n(\nmyClass\n,(),{\na\n:\nTrue\n})\n\n\n\n\n\n\nIs similar to:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \na\n \n=\n \nTrue\n\n\n\n\n\n\nThe \nmetaclass\n Attribute\n\n\nSay that we created the class \nmyClass\n as follows:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \n__metaclass__\n \n=\n \nmyMetaClass\n\n \npass\n\n\n\n\n\n\nIn this case, class creation will occur using myMetaClass instead of type, as follows:\n\n\nmyClass\n \n=\n \nmyMetaClass\n(\nclassName\n,\n \nbases\n,\n \ndictionary\n)\n\n\n\n\n\n\nCreation and Initialization of a Metaclass\n\n\nIf you want to have control on how you create and initialize a class after its creation, you can simply use the metaclass \nnew\n method and \ninit\n constructor, respectively. So, when myMetaClass above is called, this is what will be happening behind the scenes:\n\n\nmyClass\n \n=\n \nmyMetaClass\n.\n__new__\n(\nmyMetaClass\n,\n \nname\n,\n \nbases\n,\n \ndictionary\n)\n\n\nmyMetaClass\n.\n__init__\n(\nmyClass\n,\n \nname\n,\n \nbases\n,\n \ndictionary\n)\n\n\n\n\n\n\n\n\nSource:\n \n\n\n https://code.tutsplus.com/tutorials/quick-tip-what-is-a-metaclass-in-python--cms-26016\n\n\n\n\n\n\nUnderstanding Python metaclasses from Ionelmc.ro\n\n\nA quick overview\n\n\nA high level explanation is necessary before we get down to the details.\n\n\nA class is an object, and just like any other object, it's an instance of something: a metaclass. The default metaclass is type. Unfortunately, due to backwards compatibility, type is a bit confusing: it can also be used as a function that return the class [13] of an object:\n\n\n \nclass\n \nFoobar\n:\n\n\n...\n \npass\n\n\n...\n\n\n \ntype\n(\nFoobar\n)\n\n\nclass\n \ntype\n\n\n \nfoo\n \n=\n \nFoobar\n()\n\n\n \ntype\n(\nfoo\n)\n\n\nclass\n \n__main__\n.\nFoobar\n\n\n\n\n\n\nIf you're familiar with the isinstance builtin then you'll know this:\n\n\n \nisinstance\n(\nfoo\n,\n \nFoobar\n)\n\n\nTrue\n\n\n \nisinstance\n(\nFoobar\n,\n \ntype\n)\n\n\nTrue\n\n\n\n\n\n\nTo put this in picture:\n\n\n \n\n\nBut lets go back to making classes ...\n\n\nSimple metaclass use\n\n\nWe can use type directly to make a class, without any class statement:\n\n\n \nMyClass\n \n=\n \ntype\n(\nMyClass\n,\n \n(),\n \n{})\n\n\n \nMyClass\n\n\nclass\n \n__main__\n.\nMyClass\n\n\n\n\n\n\nThe class statement isn't just syntactic sugar, it does some extra things, like setting an adequate \nqualname\n and \ndoc\n properties or calling \nprepare\n.\n\n\nWe can make a custom metaclass:\n\n\n \nclass\n \nMeta\n(\ntype\n):\n\n\n...\n \npass\n\n\n\n\n\n\nAnd then we can use it :\n\n\n \nclass\n \nComplex\n(\nmetaclass\n=\nMeta\n):\n\n\n...\n \npass\n\n\n \ntype\n(\nComplex\n)\n\n\nclass\n \n__main__\n.\nMeta\n\n\n\n\n\n\nNow we got a rough idea of what we'll be dealing with ...\n\n\nMagic methods\n\n\nOne distinctive feature of Python is magic methods: they allow the programmer to override behavior for various operators and behavior of objects. To override the call operator you'd do this:\n\n\n \nclass\n \nFunky\n:\n\n\n...\n \ndef\n \n__call__\n(\nself\n):\n\n\n...\n \nprint\n(\nLook at me, I work like a function!\n)\n\n\n \nf\n \n=\n \nFunky\n()\n\n\n \nf\n()\n\n\nLook\n \nat\n \nme\n,\n \nI\n \nwork\n \nlike\n \na\n \nfunction\n!\n\n\n\n\n\n\nMetaclasses rely on several magic methods so it's quite useful to know a bit more about them.\n\n\nThe slots\n\n\nWhen you define a magic method in your class the function will end up as a pointer in a struct that describes the class, in addition to the entry in \ndict\n. That struct [7] has a field for each magic method. For some reason these fields are called type slots.\n\n\nNow there's another feature, implemented via the \nslots\n attribute. A class with \nslots\n will create instances that don't have a \ndict\n (they use a little bit less memory). A side-effect of this is that instances cannot have other fields than what was specified in \nslots\n: if you try to set an unexpected field you'll get an exception.\n\n\nFor the scope of this article when slots are mentioned it will mean the type slots, not \nslots\n.\n\n\nObject attribute lookup\n\n\nNow this is something that's easy to get wrong because of the many slight differences to old-style objects in Python 2. \n\n\nAssuming Class is the class and instance is an instance of Class, evaluating instance.foobar roughly equates to this:\n\n\n\n\nCall the type slot for Class.\ngetattribute\n (tp_getattro). The default does this: \n\n\nDoes Class.\ndict\n have a foobar item that is a data descriptor ? \n\n\nIf yes, return the result of Class.\ndict\n['foobar'].\nget\n(instance, Class). \n\n\n\n\n\n\nDoes instance.\ndict\n have a foobar item in it? \n\n\nIf yes, return instance.\ndict\n['foobar']. \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item that is not a data descriptor ? \n\n\nIf yes, return the result of Class.\ndict\n['foobar'].\nget\n(instance, klass). \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item ? \n\n\nIf yes, return the result of Class.\ndict\n['foobar']. \n\n\n\n\n\n\n\n\n\n\nIf the attribute still wasn't found, and there's a Class.\ngetattr\n, call Class.\ngetattr\n('foobar').\n\n\n\n\nStill not clear? Perhaps a diagram normal attribute lookup helps:\n\n\n\n\n\nTo avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.\n\n\n\n\nClass attribute lookup\n\n\nBecause classes needs to be able support the classmethod and staticmethod properties [6] when you evaluate something like Class.foobar the lookup is slightly different than what would happen when you evaluate instance.foobar.\n\n\nAssuming Class is an instance of Metaclass, evaluating Class.foobar roughly equates to this:\n\n\n\n\nCall the type slot for Metaclass.\ngetattribute\n (tp_getattro). The default does this: \n\n\nDoes Metaclass.\ndict\n have a foobar item that is a data descriptor ?\n\n\nIf yes, return the result of Metaclass.\ndict\n['foobar'].\nget\n(Class, Metaclass). \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item that is a descriptor (of any kind)?\n\n\nIf yes, return the result of Class.\ndict\n['foobar'].\nget\n(None, Class). \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item in it?\n\n\nIf yes, return Class.\ndict\n['foobar'].\n\n\n\n\n\n\nDoes Metaclass.\ndict\n have a foobar item that is not a data descriptor ?\n\n\nIf yes, return the result of Metaclass.\ndict\n['foobar'].\nget\n(Class, Metaclass).\n\n\n\n\n\n\nDoes Metaclass.\ndict\n have any foobar item?\n\n\nIf yes, return Metaclass.\ndict\n['foobar'].\n\n\n\n\n\n\n\n\n\n\nIf the attribute still wasn't found, and there's a Metaclass.\ngetattr\n, call Metaclass.\ngetattr\n('foobar').\n\n\n\n\nThe whole shebang would look like this in a diagram:\n\n\n\n\n\nTo avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.\n\n\n\n\nMagic method lookup\n\n\nFor magic methods the lookup is done on the class, directly in the big struct with the slots:\n\n\n\n\nDoes the object's class have a slot for that magic method (roughly object-\nob_type-\ntp_\n in C code)? If yes, use it. If it's NULL then the operation is not supported.\n\n\n\n\n\n\nIn C internals parlance:\n - object-\nob_type is the class of the object. \n\n - ob_type-\ntp_\n is the type slot.\n\n\n\n\nThis looks much simpler, however, the type slots are filled with wrappers around your functions, so descriptors work as expected:\n\n\n \nclass\n \nMagic\n:\n\n\n...\n \n@property\n\n\n...\n \ndef\n \n__repr__\n(\nself\n):\n\n\n...\n \ndef\n \ninner\n():\n\n\n...\n \nreturn\n \nIt works!\n\n\n...\n \nreturn\n \ninner\n\n\n...\n\n\n \nrepr\n(\nMagic\n())\n\n\nIt works!\n\n\n\n\n\n\nThats it. Does that mean there are places that don't follow those rules and lookup the slot differently? Sadly yes, read on ...\n\n\nThe \nnew\n method\n\n\nOne of the most common point of confusion with both classes and metaclasses is the \nnew\n method. It has some very special conventions.\n\n\nThe \nnew\n method is the constructor (it returns the new instance) while \ninit\n is just a initializer (the instance is already created when \ninit\n is called).\n\n\nSuppose have a class like this:\n\n\nclass\n \nFoobar\n:\n\n \ndef\n \n__new__\n(\ncls\n):\n\n \nreturn\n \nsuper\n()\n.\n__new__\n(\ncls\n)\n\n\n\n\n\n\nNow if you recall the previous section, you'd expect that __new__ would be looked up on the metaclass, but alas, it wouldn't be so useful that way so it's looked up statically.\n\n\nWhen the Foobar class wants this magic method it will be looked up on the same object (the class), not on a upper level like all the other magic methods. This is very important to understand, because both the class and the metaclass can define this method:\n\n\n\n\nFoobar.__new__ is used to create instances of Foobar\n\n\ntype.__new__ is used to create the Foobar class (an instance of type in the example)\n\n\n\n\nThe \nprepare\n method\n\n\nThis method is called before the class body is executed and it must return a dictionary-like object that's used as the local namespace for all the code from the class body. It was added in Python 3.0, see \nPEP-3115\n.\n\n\nIf your __prepare__ returns an object x then this:\n\n\nclass\n \nClass\n(\nmetaclass\n=\nMeta\n):\n\n \na\n \n=\n \n1\n\n \nb\n \n=\n \n2\n\n \nc\n \n=\n \n3\n\n\n\n\n\n\nWill make the following changes to x:\n\n\nx\n[\na\n]\n \n=\n \n1\n\n\nx\n[\nb\n]\n \n=\n \n2\n\n\nx\n[\nc\n]\n \n=\n \n3\n\n\n\n\n\n\nThis x object needs to look like a dictionary. Note that this x object will end up as an argument to Metaclass.__new\n and if it's not an instance of dict you need to convert it before calling super().__new\n.\n\n\nInterestingly enough this method doesn't have __new__'s special lookup. It appears it doesn't have it's own type slot and it's looked up via the class attribute lookup, if you read back a bit. \n\n\nPutting it all together\n\n\nTo start things off, a diagram of how instances are constructed:\n\n\n\nHow to read this swim lane diagram: \n\n\n\n\nThe horizontal lanes is the place where you define the functions.\n\n\nSolid lines mean a function call.\n\n\nA line from Metaclass.__call\n to Class.__new\n means Metaclass.__call\n will call Class.__new\n.\n\n\n\n\n\n\nDashed lines means something is returned.\n\n\nClass.\nnew\n returns the instance of Class.\n\n\nMetaclass.\ncall\n returns whatever Class.\nnew\n returned (and if it returned an instance of Class it will also call Class.\ninit\n on it). \n\n\n\n\n\n\nThe number in the red circle signifies the call order.\n\n\n\n\nCreating a class is quite similar:\n\n\n\nFew more notes:\n- Metaclass.\nprepare\n just returns the namespace object (a dictionary-like object as explained before).\n- Metaclass.\nnew\n returns the Class object.\n- MetaMetaclass.\ncall\n returns whatever Metaclass.\nnew\n returned (and if it returned an instance of Metaclass it will also call Metaclass.\ninit\n on it). \n\n\nSo you see, metaclasses allow you to customize almost every part of an object life-cycle.\n\n\nMetaclasses are callables\n\n\nIf you look again at the diagrams, you'll notice that making an instance goes through Metaclass.\ncall\n. This means you can use any callable as the metaclass:\n\n\n \nclass\n \nFoo\n(\nmetaclass\n=\nprint\n):\n \n# pointless, but illustrative\n\n\n...\n \npass\n\n\n...\n\n\nFoo\n \n()\n \n{\n__module__\n:\n \n__main__\n,\n \n__qualname__\n:\n \nFoo\n}\n\n\n \nprint\n(\nFoo\n)\n\n\nNone\n\n\n\n\n\n\nIf you use a function as the metaclass then subclasses won't inherit your function metaclass, but the type of whatever that function returned.\n\n\nSubclasses inherit the metaclass\n\n\nOne advantage compared to class decorators is the fact that subclasses inherit the metaclass.\n\n\nThis is a consequence of the fact that Metaclass(...) returns an object which usually has Metaclass as the \nclass\n.\n\n\nRestrictions with multiple metaclasses\n\n\nIn the same tone of classes allowing you to have multiple baseclasses, each one of those baseclasses may have a different metaclass. But with a twist: everything has to be linear - the inheritance tree must have a single leaf.\n\n\nFor example, this is not accepted because there would be two leafs (Meta1 and Meta2):\n\n\n \nclass\n \nMeta1\n(\ntype\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nMeta2\n(\ntype\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase1\n(\nmetaclass\n=\nMeta1\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase2\n(\nmetaclass\n=\nMeta2\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nFoobar\n(\nBase1\n,\n \nBase2\n):\n\n\n...\n \npass\n\n\n...\n\n\nTraceback\n \n(\nmost\n \nrecent\n \ncall\n \nlast\n):\n\n \nFile\n \nstdin\n,\n \nline\n \n1\n,\n \nin\n \nmodule\n\n\nTypeError\n:\n \nmetaclass\n \nconflict\n:\n \nthe\n \nmetaclass\n \nof\n \na\n \nderived\n \nclass\n \nmust\n \nbe\n \na\n \n(\nnon\n-\nstrict\n)\n \nsubclass\n \nof\n \nthe\n \nmetaclasses\n \nof\n \nall\n \nits\n \nbases\n\n\n\n\n\n\nThis will work (and will use the leaf as the metaclass):\n\n\n \nclass\n \nMeta\n(\ntype\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nSubMeta\n(\nMeta\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase1\n(\nmetaclass\n=\nMeta\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase2\n(\nmetaclass\n=\nSubMeta\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nFoobar\n(\nBase1\n,\n \nBase2\n):\n\n\n...\n \npass\n\n\n...\n\n\n \ntype\n(\nFoobar\n)\n\n\nclass\n \n__main__\n.\nSubMeta\n\n\n\n\n\n\nThe method signatures\n\n\nThere are still few important details missing, like the method signatures. Lets look at class and metaclass with all the important stuff implemented.\n\n\nNote the extra **kwargs - those are the extra keywords arguments you can pass in the class statement. \n\n\n \nclass\n \nMeta\n(\ntype\n):\n\n\n...\n \n@classmethod\n\n\n...\n \ndef\n \n__prepare__\n(\nmcs\n,\n \nname\n,\n \nbases\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__prepare__(mcs=\n%s\n, name=\n%r\n, bases=\n%s\n, **\n%s\n)\n \n%\n \n(\n\n\n...\n \nmcs\n,\n \nname\n,\n \nbases\n,\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \n{}\n\n\n\n\n\n\nAs mentioned before, __prepare\n can return objects that are not dict instances, so you need to make sure your __new\n handles that.\n\n\n...\n \ndef\n \n__new__\n(\nmcs\n,\n \nname\n,\n \nbases\n,\n \nattrs\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__new__(mcs=\n%s\n, name=\n%r\n, bases=\n%s\n, attrs=[\n%s\n], **\n%s\n)\n \n%\n \n(\n\n\n...\n \nmcs\n,\n \nname\n,\n \nbases\n,\n \n, \n.\njoin\n(\nattrs\n),\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__new__\n(\nmcs\n,\n \nname\n,\n \nbases\n,\n \nattrs\n)\n\n\n\n\n\n\nIt's uncommon to see \ninit\n being implemented in a metaclass because it's not that powerful - the class is already constructed when \ninit\n is called. It roughly equates to having a class decorator with the difference that \ninit\n would get run when making subclasses, while class decorators are not called for subclasses.\n\n\n...\n \ndef\n \n__init__\n(\ncls\n,\n \nname\n,\n \nbases\n,\n \nattrs\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__init__(cls=\n%s\n, name=\n%r\n, bases=\n%s\n, attrs=[\n%s\n], **\n%s\n)\n \n%\n \n(\n\n\n...\n \ncls\n,\n \nname\n,\n \nbases\n,\n \n, \n.\njoin\n(\nattrs\n),\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__init__\n(\nname\n,\n \nbases\n,\n \nattrs\n)\n\n\n\n\n\n\nThe __call__ method will be called when you make instances of Class.\n\n\n...\n \ndef\n \n__call__\n(\ncls\n,\n \n*\nargs\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__call__(cls=\n%s\n, args=\n%s\n, kwargs=\n%s\n)\n \n%\n \n(\n\n\n...\n \ncls\n,\n \nargs\n,\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__call__\n(\n*\nargs\n,\n \n**\nkwargs\n)\n\n\n...\n\n\n\n\n\n\nUsing Meta, note the extra=1: \n\n\n \nclass\n \nClass\n(\nmetaclass\n=\nMeta\n,\n \nextra\n=\n1\n):\n\n\n...\n \ndef\n \n__new__\n(\ncls\n,\n \nmyarg\n):\n\n\n...\n \nprint\n(\n Class.__new__(cls=\n%s\n, myarg=\n%s\n)\n \n%\n \n(\n\n\n...\n \ncls\n,\n \nmyarg\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__new__\n(\ncls\n)\n\n\n...\n\n\n...\n \ndef\n \n__init__\n(\nself\n,\n \nmyarg\n):\n\n\n...\n \nprint\n(\n Class.__init__(self=\n%s\n, myarg=\n%s\n)\n \n%\n \n(\n\n\n...\n \nself\n,\n \nmyarg\n\n\n...\n \n))\n\n\n...\n \nself\n.\nmyarg\n \n=\n \nmyarg\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__init__\n()\n\n\n...\n\n\n...\n \ndef\n \n__str__\n(\nself\n):\n\n\n...\n \nreturn\n \ninstance of Class; myargs=\n%s\n \n%\n \n(\n\n\n...\n \ngetattr\n(\nself\n,\n \nmyarg\n,\n \nMISSING\n),\n\n\n...\n \n)\n\n \nMeta\n.\n__prepare__\n(\nmcs\n=\nclass\n \n__main__\n.\nMeta\n, name=\nClass\n, bases=(),\n\n \n**\n{\nextra\n:\n \n1\n})\n\n \nMeta\n.\n__new__\n(\nmcs\n=\nclass\n \n__main__\n.\nMeta\n, name=\nClass\n, bases=(),\n\n \nattrs\n=\n[\n__qualname__\n,\n \n__new__\n,\n \n__init__\n,\n \n__str__\n,\n \n__module__\n],\n\n \n**\n{\nextra\n:\n \n1\n})\n\n \nMeta\n.\n__init__\n(\ncls\n=\nclass\n \n__main__\n.\nClass\n, name=\nClass\n, bases=(),\n\n \nattrs\n=\n[\n__qualname__\n,\n \n__new__\n,\n \n__init__\n,\n \n__str__\n,\n \n__module__\n],\n\n \n**\n{\nextra\n:\n \n1\n})\n\n\n\n\n\n\nNote that Meta.__call__ is called when we make instance of Class:\n\n\n \nClass\n(\n1\n)\n\n \nMeta\n.\n__call__\n(\ncls\n=\nclass\n \n__main__\n.\nClass\n, args=(1,), kwargs={})\n\n \nClass\n.\n__new__\n(\ncls\n=\nclass\n \n__main__\n.\nClass\n, myarg=1)\n\n \nClass\n.\n__init__\n(\nself\n=\ninstance\n \nof\n \nClass\n;\n \nmyargs\n=\nMISSING\n,\n \nmyarg\n=\n1\n)\n\n\ninstance\n \nof\n \nClass\n;\n \nmyargs\n=\n1\n\n\n\n\n\n\n\n\nSource:\n \n\n\n https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/", "title": "Python Metaclasses" - }, + }, { - "location": "/advanced/Python_Metaclasses/#quick-tip-what-is-a-metaclass-in-python", - "text": "This quick tip gives a brief overview of what we mean by a metaclass in Python and shows some examples of the concept. Before delving into this article, I should point out an important point about classes in Python which makes it easier for us to grasp the concept of metaclasses.", + "location": "/advanced/Python_Metaclasses/#quick-tip-what-is-a-metaclass-in-python", + "text": "This quick tip gives a brief overview of what we mean by a metaclass in Python and shows some examples of the concept. Before delving into this article, I should point out an important point about classes in Python which makes it easier for us to grasp the concept of metaclasses.", "title": "Quick Tip: What Is a Metaclass in Python" - }, + }, { - "location": "/advanced/Python_Metaclasses/#is-a-class-an-object-in-python", - "text": "If you've used a programming language other than Python, the concept you understood about classes is most likely that it is a way used to create new objects. This is also true in Python, but Python even takes it one more step further\u2014classes are also considered objects! So, if you created the following class in Python: class myClass ( object ): \n pass This simply means that an object with the name myClass has been created in memory. Since this object is able to create new objects, it is considered a class. This means we can apply object operations on classes in Python, as classes are objects themselves. We can thus do operations on classes like assigning the class to a variable, as follows: class_object = myClass () print class_object Which returns: __main__ . myClass object at 0x102623610 You can even pass the class myClass as a parameter to a method, as follows: def class_object ( object ): \n print object class_object ( myClass ) Which returns the following output: class __main__ . myClass In addition to other operations you can normally apply on objects.", + "location": "/advanced/Python_Metaclasses/#is-a-class-an-object-in-python", + "text": "If you've used a programming language other than Python, the concept you understood about classes is most likely that it is a way used to create new objects. This is also true in Python, but Python even takes it one more step further\u2014classes are also considered objects! So, if you created the following class in Python: class myClass ( object ): \n pass This simply means that an object with the name myClass has been created in memory. Since this object is able to create new objects, it is considered a class. This means we can apply object operations on classes in Python, as classes are objects themselves. We can thus do operations on classes like assigning the class to a variable, as follows: class_object = myClass () print class_object Which returns: __main__ . myClass object at 0x102623610 You can even pass the class myClass as a parameter to a method, as follows: def class_object ( object ): \n print object class_object ( myClass ) Which returns the following output: class __main__ . myClass In addition to other operations you can normally apply on objects.", "title": "Is a Class an Object in Python?!" - }, + }, { - "location": "/advanced/Python_Metaclasses/#metaclasses", - "text": "Maybe you have come across the type keyword in Python? You most likely used it to check the type of some object, as shown in the following examples: print type ( abder ) print type ( 100 ) print type ( 100.0 ) print type ( int ) In which case you would get the following output: type str type int type float type type Looking at the output, everything seems pretty clear until you come to the type type. To see what this might mean, let's go back to our class we defined at the beginning of this article: class myClass ( object ): \n pass Now, do the following: print type ( myClass ) What would be the output of this statement? It will surprisingly be: type type So, we can conclude that the type of classes in Python is type ! What is the relation between a type and a metaclass ? Well, a type is a metaclass , provided that the default metaclass is type . I know this might be confusing, especially that type can be used to return the class of some object as shown above, but this is due to the backward compatibility in Python. So, if you write: print type ( type ) You will get: type type Meaning that a type is a type ! The term metaclass simply means something used to create classes. In other words, it is the class of a class, meaning that the instance of a class in this case is a class. Thus, type is considered a metaclass since the instance of a type is a class. For instance, when we mentioned the following statement above: class_object = myClass () This simply builds an object/instance of the class myClass . In other words, we used a class to create an object. In the same way, when we did the following: class myClass ( object ): \n pass The metaclass was used to create the class myClass (which is considered a type ). So, like the object being an instance of a class, a class is an instance of a metaclass .", + "location": "/advanced/Python_Metaclasses/#metaclasses", + "text": "Maybe you have come across the type keyword in Python? You most likely used it to check the type of some object, as shown in the following examples: print type ( abder ) print type ( 100 ) print type ( 100.0 ) print type ( int ) In which case you would get the following output: type str type int type float type type Looking at the output, everything seems pretty clear until you come to the type type. To see what this might mean, let's go back to our class we defined at the beginning of this article: class myClass ( object ): \n pass Now, do the following: print type ( myClass ) What would be the output of this statement? It will surprisingly be: type type So, we can conclude that the type of classes in Python is type ! What is the relation between a type and a metaclass ? Well, a type is a metaclass , provided that the default metaclass is type . I know this might be confusing, especially that type can be used to return the class of some object as shown above, but this is due to the backward compatibility in Python. So, if you write: print type ( type ) You will get: type type Meaning that a type is a type ! The term metaclass simply means something used to create classes. In other words, it is the class of a class, meaning that the instance of a class in this case is a class. Thus, type is considered a metaclass since the instance of a type is a class. For instance, when we mentioned the following statement above: class_object = myClass () This simply builds an object/instance of the class myClass . In other words, we used a class to create an object. In the same way, when we did the following: class myClass ( object ): \n pass The metaclass was used to create the class myClass (which is considered a type ). So, like the object being an instance of a class, a class is an instance of a metaclass .", "title": "Metaclasses" - }, + }, { - "location": "/advanced/Python_Metaclasses/#using-metaclass-to-create-a-class", - "text": "In this section, we are going to see how we can use a metaclass to create a class, rather than using the class statement as we saw in the classes and objects tutorial. As we saw above, the default metaclass is type . Thus, we can use the following statement to create a new class: new_class = type ( myClass ,(),{}) If you want to make things simpler, you can assign the same class name myClass to the variable name. The dictionary { } here is used to define the attributes of the class. So, having the following statement: myClass = type ( myClass ,(),{ a : True }) Is similar to: class myClass ( object ): \n a = True", + "location": "/advanced/Python_Metaclasses/#using-metaclass-to-create-a-class", + "text": "In this section, we are going to see how we can use a metaclass to create a class, rather than using the class statement as we saw in the classes and objects tutorial. As we saw above, the default metaclass is type . Thus, we can use the following statement to create a new class: new_class = type ( myClass ,(),{}) If you want to make things simpler, you can assign the same class name myClass to the variable name. The dictionary { } here is used to define the attributes of the class. So, having the following statement: myClass = type ( myClass ,(),{ a : True }) Is similar to: class myClass ( object ): \n a = True", "title": "Using Metaclass to Create a Class" - }, + }, { - "location": "/advanced/Python_Metaclasses/#the-metaclass-attribute", - "text": "Say that we created the class myClass as follows: class myClass ( object ): \n __metaclass__ = myMetaClass \n pass In this case, class creation will occur using myMetaClass instead of type, as follows: myClass = myMetaClass ( className , bases , dictionary )", + "location": "/advanced/Python_Metaclasses/#the-metaclass-attribute", + "text": "Say that we created the class myClass as follows: class myClass ( object ): \n __metaclass__ = myMetaClass \n pass In this case, class creation will occur using myMetaClass instead of type, as follows: myClass = myMetaClass ( className , bases , dictionary )", "title": "The metaclass Attribute" - }, + }, { - "location": "/advanced/Python_Metaclasses/#creation-and-initialization-of-a-metaclass", - "text": "If you want to have control on how you create and initialize a class after its creation, you can simply use the metaclass new method and init constructor, respectively. So, when myMetaClass above is called, this is what will be happening behind the scenes: myClass = myMetaClass . __new__ ( myMetaClass , name , bases , dictionary ) myMetaClass . __init__ ( myClass , name , bases , dictionary ) Source: https://code.tutsplus.com/tutorials/quick-tip-what-is-a-metaclass-in-python--cms-26016", + "location": "/advanced/Python_Metaclasses/#creation-and-initialization-of-a-metaclass", + "text": "If you want to have control on how you create and initialize a class after its creation, you can simply use the metaclass new method and init constructor, respectively. So, when myMetaClass above is called, this is what will be happening behind the scenes: myClass = myMetaClass . __new__ ( myMetaClass , name , bases , dictionary ) myMetaClass . __init__ ( myClass , name , bases , dictionary ) Source: https://code.tutsplus.com/tutorials/quick-tip-what-is-a-metaclass-in-python--cms-26016", "title": "Creation and Initialization of a Metaclass" - }, + }, { - "location": "/advanced/Python_Metaclasses/#understanding-python-metaclasses-from-ionelmcro", - "text": "", + "location": "/advanced/Python_Metaclasses/#understanding-python-metaclasses-from-ionelmcro", + "text": "", "title": "Understanding Python metaclasses from Ionelmc.ro" - }, + }, { - "location": "/advanced/Python_Metaclasses/#a-quick-overview", - "text": "A high level explanation is necessary before we get down to the details. A class is an object, and just like any other object, it's an instance of something: a metaclass. The default metaclass is type. Unfortunately, due to backwards compatibility, type is a bit confusing: it can also be used as a function that return the class [13] of an object: class Foobar : ... pass ... type ( Foobar ) class type foo = Foobar () type ( foo ) class __main__ . Foobar If you're familiar with the isinstance builtin then you'll know this: isinstance ( foo , Foobar ) True isinstance ( Foobar , type ) True To put this in picture: But lets go back to making classes ...", + "location": "/advanced/Python_Metaclasses/#a-quick-overview", + "text": "A high level explanation is necessary before we get down to the details. A class is an object, and just like any other object, it's an instance of something: a metaclass. The default metaclass is type. Unfortunately, due to backwards compatibility, type is a bit confusing: it can also be used as a function that return the class [13] of an object: class Foobar : ... pass ... type ( Foobar ) class type foo = Foobar () type ( foo ) class __main__ . Foobar If you're familiar with the isinstance builtin then you'll know this: isinstance ( foo , Foobar ) True isinstance ( Foobar , type ) True To put this in picture: But lets go back to making classes ...", "title": "A quick overview" - }, + }, { - "location": "/advanced/Python_Metaclasses/#simple-metaclass-use", - "text": "We can use type directly to make a class, without any class statement: MyClass = type ( MyClass , (), {}) MyClass class __main__ . MyClass The class statement isn't just syntactic sugar, it does some extra things, like setting an adequate qualname and doc properties or calling prepare . We can make a custom metaclass: class Meta ( type ): ... pass And then we can use it : class Complex ( metaclass = Meta ): ... pass type ( Complex ) class __main__ . Meta Now we got a rough idea of what we'll be dealing with ...", + "location": "/advanced/Python_Metaclasses/#simple-metaclass-use", + "text": "We can use type directly to make a class, without any class statement: MyClass = type ( MyClass , (), {}) MyClass class __main__ . MyClass The class statement isn't just syntactic sugar, it does some extra things, like setting an adequate qualname and doc properties or calling prepare . We can make a custom metaclass: class Meta ( type ): ... pass And then we can use it : class Complex ( metaclass = Meta ): ... pass type ( Complex ) class __main__ . Meta Now we got a rough idea of what we'll be dealing with ...", "title": "Simple metaclass use" - }, + }, { - "location": "/advanced/Python_Metaclasses/#magic-methods", - "text": "One distinctive feature of Python is magic methods: they allow the programmer to override behavior for various operators and behavior of objects. To override the call operator you'd do this: class Funky : ... def __call__ ( self ): ... print ( Look at me, I work like a function! ) f = Funky () f () Look at me , I work like a function ! Metaclasses rely on several magic methods so it's quite useful to know a bit more about them.", + "location": "/advanced/Python_Metaclasses/#magic-methods", + "text": "One distinctive feature of Python is magic methods: they allow the programmer to override behavior for various operators and behavior of objects. To override the call operator you'd do this: class Funky : ... def __call__ ( self ): ... print ( Look at me, I work like a function! ) f = Funky () f () Look at me , I work like a function ! Metaclasses rely on several magic methods so it's quite useful to know a bit more about them.", "title": "Magic methods" - }, + }, { - "location": "/advanced/Python_Metaclasses/#the-slots", - "text": "When you define a magic method in your class the function will end up as a pointer in a struct that describes the class, in addition to the entry in dict . That struct [7] has a field for each magic method. For some reason these fields are called type slots. Now there's another feature, implemented via the slots attribute. A class with slots will create instances that don't have a dict (they use a little bit less memory). A side-effect of this is that instances cannot have other fields than what was specified in slots : if you try to set an unexpected field you'll get an exception. For the scope of this article when slots are mentioned it will mean the type slots, not slots .", + "location": "/advanced/Python_Metaclasses/#the-slots", + "text": "When you define a magic method in your class the function will end up as a pointer in a struct that describes the class, in addition to the entry in dict . That struct [7] has a field for each magic method. For some reason these fields are called type slots. Now there's another feature, implemented via the slots attribute. A class with slots will create instances that don't have a dict (they use a little bit less memory). A side-effect of this is that instances cannot have other fields than what was specified in slots : if you try to set an unexpected field you'll get an exception. For the scope of this article when slots are mentioned it will mean the type slots, not slots .", "title": "The slots" - }, + }, { - "location": "/advanced/Python_Metaclasses/#object-attribute-lookup", - "text": "Now this is something that's easy to get wrong because of the many slight differences to old-style objects in Python 2. Assuming Class is the class and instance is an instance of Class, evaluating instance.foobar roughly equates to this: Call the type slot for Class. getattribute (tp_getattro). The default does this: Does Class. dict have a foobar item that is a data descriptor ? If yes, return the result of Class. dict ['foobar']. get (instance, Class). Does instance. dict have a foobar item in it? If yes, return instance. dict ['foobar']. Does Class. dict have a foobar item that is not a data descriptor ? If yes, return the result of Class. dict ['foobar']. get (instance, klass). Does Class. dict have a foobar item ? If yes, return the result of Class. dict ['foobar']. If the attribute still wasn't found, and there's a Class. getattr , call Class. getattr ('foobar'). Still not clear? Perhaps a diagram normal attribute lookup helps: To avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.", + "location": "/advanced/Python_Metaclasses/#object-attribute-lookup", + "text": "Now this is something that's easy to get wrong because of the many slight differences to old-style objects in Python 2. Assuming Class is the class and instance is an instance of Class, evaluating instance.foobar roughly equates to this: Call the type slot for Class. getattribute (tp_getattro). The default does this: Does Class. dict have a foobar item that is a data descriptor ? If yes, return the result of Class. dict ['foobar']. get (instance, Class). Does instance. dict have a foobar item in it? If yes, return instance. dict ['foobar']. Does Class. dict have a foobar item that is not a data descriptor ? If yes, return the result of Class. dict ['foobar']. get (instance, klass). Does Class. dict have a foobar item ? If yes, return the result of Class. dict ['foobar']. If the attribute still wasn't found, and there's a Class. getattr , call Class. getattr ('foobar'). Still not clear? Perhaps a diagram normal attribute lookup helps: To avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.", "title": "Object attribute lookup" - }, + }, { - "location": "/advanced/Python_Metaclasses/#class-attribute-lookup", - "text": "Because classes needs to be able support the classmethod and staticmethod properties [6] when you evaluate something like Class.foobar the lookup is slightly different than what would happen when you evaluate instance.foobar. Assuming Class is an instance of Metaclass, evaluating Class.foobar roughly equates to this: Call the type slot for Metaclass. getattribute (tp_getattro). The default does this: Does Metaclass. dict have a foobar item that is a data descriptor ? If yes, return the result of Metaclass. dict ['foobar']. get (Class, Metaclass). Does Class. dict have a foobar item that is a descriptor (of any kind)? If yes, return the result of Class. dict ['foobar']. get (None, Class). Does Class. dict have a foobar item in it? If yes, return Class. dict ['foobar']. Does Metaclass. dict have a foobar item that is not a data descriptor ? If yes, return the result of Metaclass. dict ['foobar']. get (Class, Metaclass). Does Metaclass. dict have any foobar item? If yes, return Metaclass. dict ['foobar']. If the attribute still wasn't found, and there's a Metaclass. getattr , call Metaclass. getattr ('foobar'). The whole shebang would look like this in a diagram: To avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.", + "location": "/advanced/Python_Metaclasses/#class-attribute-lookup", + "text": "Because classes needs to be able support the classmethod and staticmethod properties [6] when you evaluate something like Class.foobar the lookup is slightly different than what would happen when you evaluate instance.foobar. Assuming Class is an instance of Metaclass, evaluating Class.foobar roughly equates to this: Call the type slot for Metaclass. getattribute (tp_getattro). The default does this: Does Metaclass. dict have a foobar item that is a data descriptor ? If yes, return the result of Metaclass. dict ['foobar']. get (Class, Metaclass). Does Class. dict have a foobar item that is a descriptor (of any kind)? If yes, return the result of Class. dict ['foobar']. get (None, Class). Does Class. dict have a foobar item in it? If yes, return Class. dict ['foobar']. Does Metaclass. dict have a foobar item that is not a data descriptor ? If yes, return the result of Metaclass. dict ['foobar']. get (Class, Metaclass). Does Metaclass. dict have any foobar item? If yes, return Metaclass. dict ['foobar']. If the attribute still wasn't found, and there's a Metaclass. getattr , call Metaclass. getattr ('foobar'). The whole shebang would look like this in a diagram: To avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.", "title": "Class attribute lookup" - }, + }, { - "location": "/advanced/Python_Metaclasses/#magic-method-lookup", - "text": "For magic methods the lookup is done on the class, directly in the big struct with the slots: Does the object's class have a slot for that magic method (roughly object- ob_type- tp_ in C code)? If yes, use it. If it's NULL then the operation is not supported. In C internals parlance:\n - object- ob_type is the class of the object. \n - ob_type- tp_ is the type slot. This looks much simpler, however, the type slots are filled with wrappers around your functions, so descriptors work as expected: class Magic : ... @property ... def __repr__ ( self ): ... def inner (): ... return It works! ... return inner ... repr ( Magic ()) It works! Thats it. Does that mean there are places that don't follow those rules and lookup the slot differently? Sadly yes, read on ...", + "location": "/advanced/Python_Metaclasses/#magic-method-lookup", + "text": "For magic methods the lookup is done on the class, directly in the big struct with the slots: Does the object's class have a slot for that magic method (roughly object- ob_type- tp_ in C code)? If yes, use it. If it's NULL then the operation is not supported. In C internals parlance:\n - object- ob_type is the class of the object. \n - ob_type- tp_ is the type slot. This looks much simpler, however, the type slots are filled with wrappers around your functions, so descriptors work as expected: class Magic : ... @property ... def __repr__ ( self ): ... def inner (): ... return It works! ... return inner ... repr ( Magic ()) It works! Thats it. Does that mean there are places that don't follow those rules and lookup the slot differently? Sadly yes, read on ...", "title": "Magic method lookup" - }, + }, { - "location": "/advanced/Python_Metaclasses/#the-new-method", - "text": "One of the most common point of confusion with both classes and metaclasses is the new method. It has some very special conventions. The new method is the constructor (it returns the new instance) while init is just a initializer (the instance is already created when init is called). Suppose have a class like this: class Foobar : \n def __new__ ( cls ): \n return super () . __new__ ( cls ) Now if you recall the previous section, you'd expect that __new__ would be looked up on the metaclass, but alas, it wouldn't be so useful that way so it's looked up statically. When the Foobar class wants this magic method it will be looked up on the same object (the class), not on a upper level like all the other magic methods. This is very important to understand, because both the class and the metaclass can define this method: Foobar.__new__ is used to create instances of Foobar type.__new__ is used to create the Foobar class (an instance of type in the example)", + "location": "/advanced/Python_Metaclasses/#the-new-method", + "text": "One of the most common point of confusion with both classes and metaclasses is the new method. It has some very special conventions. The new method is the constructor (it returns the new instance) while init is just a initializer (the instance is already created when init is called). Suppose have a class like this: class Foobar : \n def __new__ ( cls ): \n return super () . __new__ ( cls ) Now if you recall the previous section, you'd expect that __new__ would be looked up on the metaclass, but alas, it wouldn't be so useful that way so it's looked up statically. When the Foobar class wants this magic method it will be looked up on the same object (the class), not on a upper level like all the other magic methods. This is very important to understand, because both the class and the metaclass can define this method: Foobar.__new__ is used to create instances of Foobar type.__new__ is used to create the Foobar class (an instance of type in the example)", "title": "The new method" - }, + }, { - "location": "/advanced/Python_Metaclasses/#the-prepare-method", - "text": "This method is called before the class body is executed and it must return a dictionary-like object that's used as the local namespace for all the code from the class body. It was added in Python 3.0, see PEP-3115 . If your __prepare__ returns an object x then this: class Class ( metaclass = Meta ): \n a = 1 \n b = 2 \n c = 3 Will make the following changes to x: x [ a ] = 1 x [ b ] = 2 x [ c ] = 3 This x object needs to look like a dictionary. Note that this x object will end up as an argument to Metaclass.__new and if it's not an instance of dict you need to convert it before calling super().__new . Interestingly enough this method doesn't have __new__'s special lookup. It appears it doesn't have it's own type slot and it's looked up via the class attribute lookup, if you read back a bit.", + "location": "/advanced/Python_Metaclasses/#the-prepare-method", + "text": "This method is called before the class body is executed and it must return a dictionary-like object that's used as the local namespace for all the code from the class body. It was added in Python 3.0, see PEP-3115 . If your __prepare__ returns an object x then this: class Class ( metaclass = Meta ): \n a = 1 \n b = 2 \n c = 3 Will make the following changes to x: x [ a ] = 1 x [ b ] = 2 x [ c ] = 3 This x object needs to look like a dictionary. Note that this x object will end up as an argument to Metaclass.__new and if it's not an instance of dict you need to convert it before calling super().__new . Interestingly enough this method doesn't have __new__'s special lookup. It appears it doesn't have it's own type slot and it's looked up via the class attribute lookup, if you read back a bit.", "title": "The prepare method" - }, + }, { - "location": "/advanced/Python_Metaclasses/#putting-it-all-together", - "text": "To start things off, a diagram of how instances are constructed: How to read this swim lane diagram: The horizontal lanes is the place where you define the functions. Solid lines mean a function call. A line from Metaclass.__call to Class.__new means Metaclass.__call will call Class.__new . Dashed lines means something is returned. Class. new returns the instance of Class. Metaclass. call returns whatever Class. new returned (and if it returned an instance of Class it will also call Class. init on it). The number in the red circle signifies the call order. Creating a class is quite similar: Few more notes:\n- Metaclass. prepare just returns the namespace object (a dictionary-like object as explained before).\n- Metaclass. new returns the Class object.\n- MetaMetaclass. call returns whatever Metaclass. new returned (and if it returned an instance of Metaclass it will also call Metaclass. init on it). So you see, metaclasses allow you to customize almost every part of an object life-cycle.", + "location": "/advanced/Python_Metaclasses/#putting-it-all-together", + "text": "To start things off, a diagram of how instances are constructed: How to read this swim lane diagram: The horizontal lanes is the place where you define the functions. Solid lines mean a function call. A line from Metaclass.__call to Class.__new means Metaclass.__call will call Class.__new . Dashed lines means something is returned. Class. new returns the instance of Class. Metaclass. call returns whatever Class. new returned (and if it returned an instance of Class it will also call Class. init on it). The number in the red circle signifies the call order. Creating a class is quite similar: Few more notes:\n- Metaclass. prepare just returns the namespace object (a dictionary-like object as explained before).\n- Metaclass. new returns the Class object.\n- MetaMetaclass. call returns whatever Metaclass. new returned (and if it returned an instance of Metaclass it will also call Metaclass. init on it). So you see, metaclasses allow you to customize almost every part of an object life-cycle.", "title": "Putting it all together" - }, + }, { - "location": "/advanced/Python_Metaclasses/#metaclasses-are-callables", - "text": "If you look again at the diagrams, you'll notice that making an instance goes through Metaclass. call . This means you can use any callable as the metaclass: class Foo ( metaclass = print ): # pointless, but illustrative ... pass ... Foo () { __module__ : __main__ , __qualname__ : Foo } print ( Foo ) None If you use a function as the metaclass then subclasses won't inherit your function metaclass, but the type of whatever that function returned.", + "location": "/advanced/Python_Metaclasses/#metaclasses-are-callables", + "text": "If you look again at the diagrams, you'll notice that making an instance goes through Metaclass. call . This means you can use any callable as the metaclass: class Foo ( metaclass = print ): # pointless, but illustrative ... pass ... Foo () { __module__ : __main__ , __qualname__ : Foo } print ( Foo ) None If you use a function as the metaclass then subclasses won't inherit your function metaclass, but the type of whatever that function returned.", "title": "Metaclasses are callables" - }, + }, { - "location": "/advanced/Python_Metaclasses/#subclasses-inherit-the-metaclass", - "text": "One advantage compared to class decorators is the fact that subclasses inherit the metaclass. This is a consequence of the fact that Metaclass(...) returns an object which usually has Metaclass as the class .", + "location": "/advanced/Python_Metaclasses/#subclasses-inherit-the-metaclass", + "text": "One advantage compared to class decorators is the fact that subclasses inherit the metaclass. This is a consequence of the fact that Metaclass(...) returns an object which usually has Metaclass as the class .", "title": "Subclasses inherit the metaclass" - }, + }, { - "location": "/advanced/Python_Metaclasses/#restrictions-with-multiple-metaclasses", - "text": "In the same tone of classes allowing you to have multiple baseclasses, each one of those baseclasses may have a different metaclass. But with a twist: everything has to be linear - the inheritance tree must have a single leaf. For example, this is not accepted because there would be two leafs (Meta1 and Meta2): class Meta1 ( type ): ... pass ... class Meta2 ( type ): ... pass ... class Base1 ( metaclass = Meta1 ): ... pass ... class Base2 ( metaclass = Meta2 ): ... pass ... class Foobar ( Base1 , Base2 ): ... pass ... Traceback ( most recent call last ): \n File stdin , line 1 , in module TypeError : metaclass conflict : the metaclass of a derived class must be a ( non - strict ) subclass of the metaclasses of all its bases This will work (and will use the leaf as the metaclass): class Meta ( type ): ... pass ... class SubMeta ( Meta ): ... pass ... class Base1 ( metaclass = Meta ): ... pass ... class Base2 ( metaclass = SubMeta ): ... pass ... class Foobar ( Base1 , Base2 ): ... pass ... type ( Foobar ) class __main__ . SubMeta", + "location": "/advanced/Python_Metaclasses/#restrictions-with-multiple-metaclasses", + "text": "In the same tone of classes allowing you to have multiple baseclasses, each one of those baseclasses may have a different metaclass. But with a twist: everything has to be linear - the inheritance tree must have a single leaf. For example, this is not accepted because there would be two leafs (Meta1 and Meta2): class Meta1 ( type ): ... pass ... class Meta2 ( type ): ... pass ... class Base1 ( metaclass = Meta1 ): ... pass ... class Base2 ( metaclass = Meta2 ): ... pass ... class Foobar ( Base1 , Base2 ): ... pass ... Traceback ( most recent call last ): \n File stdin , line 1 , in module TypeError : metaclass conflict : the metaclass of a derived class must be a ( non - strict ) subclass of the metaclasses of all its bases This will work (and will use the leaf as the metaclass): class Meta ( type ): ... pass ... class SubMeta ( Meta ): ... pass ... class Base1 ( metaclass = Meta ): ... pass ... class Base2 ( metaclass = SubMeta ): ... pass ... class Foobar ( Base1 , Base2 ): ... pass ... type ( Foobar ) class __main__ . SubMeta", "title": "Restrictions with multiple metaclasses" - }, + }, { - "location": "/advanced/Python_Metaclasses/#the-method-signatures", - "text": "There are still few important details missing, like the method signatures. Lets look at class and metaclass with all the important stuff implemented. Note the extra **kwargs - those are the extra keywords arguments you can pass in the class statement. class Meta ( type ): ... @classmethod ... def __prepare__ ( mcs , name , bases , ** kwargs ): ... print ( Meta.__prepare__(mcs= %s , name= %r , bases= %s , ** %s ) % ( ... mcs , name , bases , kwargs ... )) ... return {} As mentioned before, __prepare can return objects that are not dict instances, so you need to make sure your __new handles that. ... def __new__ ( mcs , name , bases , attrs , ** kwargs ): ... print ( Meta.__new__(mcs= %s , name= %r , bases= %s , attrs=[ %s ], ** %s ) % ( ... mcs , name , bases , , . join ( attrs ), kwargs ... )) ... return super () . __new__ ( mcs , name , bases , attrs ) It's uncommon to see init being implemented in a metaclass because it's not that powerful - the class is already constructed when init is called. It roughly equates to having a class decorator with the difference that init would get run when making subclasses, while class decorators are not called for subclasses. ... def __init__ ( cls , name , bases , attrs , ** kwargs ): ... print ( Meta.__init__(cls= %s , name= %r , bases= %s , attrs=[ %s ], ** %s ) % ( ... cls , name , bases , , . join ( attrs ), kwargs ... )) ... return super () . __init__ ( name , bases , attrs ) The __call__ method will be called when you make instances of Class. ... def __call__ ( cls , * args , ** kwargs ): ... print ( Meta.__call__(cls= %s , args= %s , kwargs= %s ) % ( ... cls , args , kwargs ... )) ... return super () . __call__ ( * args , ** kwargs ) ... Using Meta, note the extra=1: class Class ( metaclass = Meta , extra = 1 ): ... def __new__ ( cls , myarg ): ... print ( Class.__new__(cls= %s , myarg= %s ) % ( ... cls , myarg ... )) ... return super () . __new__ ( cls ) ... ... def __init__ ( self , myarg ): ... print ( Class.__init__(self= %s , myarg= %s ) % ( ... self , myarg ... )) ... self . myarg = myarg ... return super () . __init__ () ... ... def __str__ ( self ): ... return instance of Class; myargs= %s % ( ... getattr ( self , myarg , MISSING ), ... ) \n Meta . __prepare__ ( mcs = class __main__ . Meta , name= Class , bases=(), \n ** { extra : 1 }) \n Meta . __new__ ( mcs = class __main__ . Meta , name= Class , bases=(), \n attrs = [ __qualname__ , __new__ , __init__ , __str__ , __module__ ], \n ** { extra : 1 }) \n Meta . __init__ ( cls = class __main__ . Class , name= Class , bases=(), \n attrs = [ __qualname__ , __new__ , __init__ , __str__ , __module__ ], \n ** { extra : 1 }) Note that Meta.__call__ is called when we make instance of Class: Class ( 1 ) \n Meta . __call__ ( cls = class __main__ . Class , args=(1,), kwargs={}) \n Class . __new__ ( cls = class __main__ . Class , myarg=1) \n Class . __init__ ( self = instance of Class ; myargs = MISSING , myarg = 1 ) instance of Class ; myargs = 1 Source: https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/", + "location": "/advanced/Python_Metaclasses/#the-method-signatures", + "text": "There are still few important details missing, like the method signatures. Lets look at class and metaclass with all the important stuff implemented. Note the extra **kwargs - those are the extra keywords arguments you can pass in the class statement. class Meta ( type ): ... @classmethod ... def __prepare__ ( mcs , name , bases , ** kwargs ): ... print ( Meta.__prepare__(mcs= %s , name= %r , bases= %s , ** %s ) % ( ... mcs , name , bases , kwargs ... )) ... return {} As mentioned before, __prepare can return objects that are not dict instances, so you need to make sure your __new handles that. ... def __new__ ( mcs , name , bases , attrs , ** kwargs ): ... print ( Meta.__new__(mcs= %s , name= %r , bases= %s , attrs=[ %s ], ** %s ) % ( ... mcs , name , bases , , . join ( attrs ), kwargs ... )) ... return super () . __new__ ( mcs , name , bases , attrs ) It's uncommon to see init being implemented in a metaclass because it's not that powerful - the class is already constructed when init is called. It roughly equates to having a class decorator with the difference that init would get run when making subclasses, while class decorators are not called for subclasses. ... def __init__ ( cls , name , bases , attrs , ** kwargs ): ... print ( Meta.__init__(cls= %s , name= %r , bases= %s , attrs=[ %s ], ** %s ) % ( ... cls , name , bases , , . join ( attrs ), kwargs ... )) ... return super () . __init__ ( name , bases , attrs ) The __call__ method will be called when you make instances of Class. ... def __call__ ( cls , * args , ** kwargs ): ... print ( Meta.__call__(cls= %s , args= %s , kwargs= %s ) % ( ... cls , args , kwargs ... )) ... return super () . __call__ ( * args , ** kwargs ) ... Using Meta, note the extra=1: class Class ( metaclass = Meta , extra = 1 ): ... def __new__ ( cls , myarg ): ... print ( Class.__new__(cls= %s , myarg= %s ) % ( ... cls , myarg ... )) ... return super () . __new__ ( cls ) ... ... def __init__ ( self , myarg ): ... print ( Class.__init__(self= %s , myarg= %s ) % ( ... self , myarg ... )) ... self . myarg = myarg ... return super () . __init__ () ... ... def __str__ ( self ): ... return instance of Class; myargs= %s % ( ... getattr ( self , myarg , MISSING ), ... ) \n Meta . __prepare__ ( mcs = class __main__ . Meta , name= Class , bases=(), \n ** { extra : 1 }) \n Meta . __new__ ( mcs = class __main__ . Meta , name= Class , bases=(), \n attrs = [ __qualname__ , __new__ , __init__ , __str__ , __module__ ], \n ** { extra : 1 }) \n Meta . __init__ ( cls = class __main__ . Class , name= Class , bases=(), \n attrs = [ __qualname__ , __new__ , __init__ , __str__ , __module__ ], \n ** { extra : 1 }) Note that Meta.__call__ is called when we make instance of Class: Class ( 1 ) \n Meta . __call__ ( cls = class __main__ . Class , args=(1,), kwargs={}) \n Class . __new__ ( cls = class __main__ . Class , myarg=1) \n Class . __init__ ( self = instance of Class ; myargs = MISSING , myarg = 1 ) instance of Class ; myargs = 1 Source: https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/", "title": "The method signatures" - }, + }, { - "location": "/About/", - "text": "I'll write later", + "location": "/About/", + "text": "I'll write later", "title": "About" - }, + }, { - "location": "/About/#ill-write-later", - "text": "", + "location": "/About/#ill-write-later", + "text": "", "title": "I'll write later" } ] diff --git a/site/sitemap.xml b/site/sitemap.xml index 14ce24c..88abe9f 100644 --- a/site/sitemap.xml +++ b/site/sitemap.xml @@ -4,7 +4,7 @@ / - 2017-08-24 + 2017-08-26 daily @@ -13,25 +13,31 @@ /beginner/Python_Programming_Lanuage/ - 2017-08-24 + 2017-08-26 daily /beginner/Python_Installation/ - 2017-08-24 + 2017-08-26 daily /beginner/Start_Coding_With_Python/ - 2017-08-24 + 2017-08-26 + daily + + + + /beginner/Data_Types_In_Python_3/ + 2017-08-26 daily /beginner/Datatype_And_Variables/ - 2017-08-24 + 2017-08-26 daily @@ -41,7 +47,7 @@ /advanced/Python_Metaclasses/ - 2017-08-24 + 2017-08-26 daily @@ -50,7 +56,7 @@ /About/ - 2017-08-24 + 2017-08-26 daily From 1fe6b56c5e0fec2a93ea850bd16fc077063e2637 Mon Sep 17 00:00:00 2001 From: ent1c3d Date: Sat, 26 Aug 2017 20:47:46 +0400 Subject: [PATCH 23/39] changed topic names --- README.md | 2 +- ...riables.md => Variables_And_Assignment.md} | 2 +- docs/index.md | 2 +- mkdocs.yml | 2 +- site/404.html | 4 +-- site/About/index.html | 4 +-- site/advanced/Python_Metaclasses/index.html | 8 ++--- .../Data_Types_In_Python_3/index.html | 8 ++--- site/beginner/Python_Installation/index.html | 4 +-- .../Python_Programming_Lanuage/index.html | 4 +-- .../Start_Coding_With_Python/index.html | 4 +-- .../index.html | 12 ++++---- site/index.html | 6 ++-- site/mkdocs/search_index.json | 30 +++++++++---------- site/sitemap.xml | 2 +- 15 files changed, 47 insertions(+), 47 deletions(-) rename docs/beginner/{Datatype_And_Variables.md => Variables_And_Assignment.md} (99%) rename site/beginner/{Datatype_And_Variables => Variables_And_Assignment}/index.html (99%) diff --git a/README.md b/README.md index 412de79..e1ddfcf 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ So, You can start study from here: - [Python Installation](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Python_Installation) - [Start Coding With Python](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Start_Coding_With_Python) - [Data Types In Python 3](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Data_Types_In_Python_3) - - [Datatype And Variables](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Datatype_And_Variables) + - [Variables and Assignment](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Variables_And_Assignment) - ... - Intermediate - ... diff --git a/docs/beginner/Datatype_And_Variables.md b/docs/beginner/Variables_And_Assignment.md similarity index 99% rename from docs/beginner/Datatype_And_Variables.md rename to docs/beginner/Variables_And_Assignment.md index efddd14..ed35207 100644 --- a/docs/beginner/Datatype_And_Variables.md +++ b/docs/beginner/Variables_And_Assignment.md @@ -1,4 +1,4 @@ -# Datatype & Variables +# Variables and Assignment Variables are named locations which are used to store references to the object stored in memory. The names we choose for variables and functions are commonly known as Identifiers. In python Identifiers must obey the following rules. diff --git a/docs/index.md b/docs/index.md index 786591d..a98720b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -16,7 +16,7 @@ Of course, it needs plenty of time to organize best resources based on the topic - [Python Installation](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Python_Installation) - [Start Coding With Python](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Start_Coding_With_Python) - [Data Types In Python 3](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Data_Types_In_Python_3) - - [Datatype And Variables](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Datatype_And_Variables) + - [Variables and Assignment](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Variables_And_Assignment) - ... - Intermediate - ... diff --git a/mkdocs.yml b/mkdocs.yml index 2545650..aac3b05 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -17,7 +17,7 @@ pages: - Python Installation : beginner/Python_Installation.md - Start Coding With Python : beginner/Start_Coding_With_Python.md - Data Types in Python 3 : beginner/Data_Types_In_Python_3.md - - Datatype And Variables : beginner/Datatype_And_Variables.md + - Variables and Assignment : beginner/Variables_And_Assignment.md - Advanced: - Python Metaclasses : advanced/Python_Metaclasses.md - About: About.md diff --git a/site/404.html b/site/404.html index 2dabd80..aedf1af 100644 --- a/site/404.html +++ b/site/404.html @@ -265,8 +265,8 @@
    34. - - Datatype And Variables + + Variables and Assignment
    35. diff --git a/site/About/index.html b/site/About/index.html index b682238..7498274 100644 --- a/site/About/index.html +++ b/site/About/index.html @@ -267,8 +267,8 @@
    36. - - Datatype And Variables + + Variables and Assignment
    37. diff --git a/site/advanced/Python_Metaclasses/index.html b/site/advanced/Python_Metaclasses/index.html index 33b926e..bba0e37 100644 --- a/site/advanced/Python_Metaclasses/index.html +++ b/site/advanced/Python_Metaclasses/index.html @@ -271,8 +271,8 @@
    38. - - Datatype And Variables + + Variables and Assignment
    39. @@ -1214,7 +1214,7 @@

      The method signatures

      diff --git a/site/beginner/Data_Types_In_Python_3/index.html b/site/beginner/Data_Types_In_Python_3/index.html index 3879db0..189833a 100644 --- a/site/beginner/Data_Types_In_Python_3/index.html +++ b/site/beginner/Data_Types_In_Python_3/index.html @@ -453,8 +453,8 @@
    40. - - Datatype And Variables + + Variables and Assignment
    41. @@ -1155,13 +1155,13 @@

      Python Dictionary

      -
    42. - Datatype And Variables + + Variables and Assignment
    43. diff --git a/site/beginner/Python_Programming_Lanuage/index.html b/site/beginner/Python_Programming_Lanuage/index.html index f9e5cfe..c749647 100644 --- a/site/beginner/Python_Programming_Lanuage/index.html +++ b/site/beginner/Python_Programming_Lanuage/index.html @@ -397,8 +397,8 @@
    44. - - Datatype And Variables + + Variables and Assignment
    45. diff --git a/site/beginner/Start_Coding_With_Python/index.html b/site/beginner/Start_Coding_With_Python/index.html index 6f23668..2d07b6a 100644 --- a/site/beginner/Start_Coding_With_Python/index.html +++ b/site/beginner/Start_Coding_With_Python/index.html @@ -427,8 +427,8 @@
    46. - - Datatype And Variables + + Variables and Assignment
    47. diff --git a/site/beginner/Datatype_And_Variables/index.html b/site/beginner/Variables_And_Assignment/index.html similarity index 99% rename from site/beginner/Datatype_And_Variables/index.html rename to site/beginner/Variables_And_Assignment/index.html index fcffcfa..afe955c 100644 --- a/site/beginner/Datatype_And_Variables/index.html +++ b/site/beginner/Variables_And_Assignment/index.html @@ -20,7 +20,7 @@ - Datatype And Variables - Python Synopsis + Variables and Assignment - Python Synopsis @@ -85,7 +85,7 @@ - Datatype And Variables + Variables and Assignment
      @@ -282,11 +282,11 @@ - - Datatype And Variables + + Variables and Assignment @@ -532,7 +532,7 @@ -

      Datatype & Variables

      +

      Variables and Assignment

      Variables are named locations which are used to store references to the object stored in memory. The names we choose for variables and functions are commonly known as Identifiers. In python Identifiers must obey the following rules.

      1. All identifiers must start with letter or underscore ( _ ) , you diff --git a/site/index.html b/site/index.html index 7056763..23ba29d 100644 --- a/site/index.html +++ b/site/index.html @@ -303,8 +303,8 @@
      2. - - Datatype And Variables + + Variables and Assignment
      3. @@ -416,7 +416,7 @@

        Python Study Guide

      4. Python Installation
      5. Start Coding With Python
      6. Data Types In Python 3
      7. -
      8. Datatype And Variables
      9. +
      10. Variables and Assignment
      11. ...
      12. diff --git a/site/mkdocs/search_index.json b/site/mkdocs/search_index.json index 18a235e..cc8b1e5 100644 --- a/site/mkdocs/search_index.json +++ b/site/mkdocs/search_index.json @@ -2,7 +2,7 @@ "docs": [ { "location": "/", - "text": "Welcome to Python Synopsis!\n\n\nPython Study Guide\n\n\nIn this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate \nbooks, articles, answers from Stackoverflow, online courses, videos from py conferences\n and etc. \n\n\nSo, after all I decided to share \ntop resources\n for everyone about each topic, that you need to know about python, if you want to be senior python \nSoftware Engineer\n. \n\n\nOf course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than \n30-40\n chapters.\n\n\n\n\nBeginner\n\n\nThe Python Programming Language, Implementation and Adventages\n\n\nPython Installation\n\n\nStart Coding With Python\n\n\nData Types In Python 3\n\n\nDatatype And Variables\n\n\n...\n\n\n\n\n\n\nIntermediate\n\n\n... \n\n\n\n\n\n\nAdvanced\n\n\n...\n\n\nPython Metaclasses\n\n\n...", + "text": "Welcome to Python Synopsis!\n\n\nPython Study Guide\n\n\nIn this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate \nbooks, articles, answers from Stackoverflow, online courses, videos from py conferences\n and etc. \n\n\nSo, after all I decided to share \ntop resources\n for everyone about each topic, that you need to know about python, if you want to be senior python \nSoftware Engineer\n. \n\n\nOf course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than \n30-40\n chapters.\n\n\n\n\nBeginner\n\n\nThe Python Programming Language, Implementation and Adventages\n\n\nPython Installation\n\n\nStart Coding With Python\n\n\nData Types In Python 3\n\n\nVariables and Assignment\n\n\n...\n\n\n\n\n\n\nIntermediate\n\n\n... \n\n\n\n\n\n\nAdvanced\n\n\n...\n\n\nPython Metaclasses\n\n\n...", "title": "Home" }, { @@ -12,7 +12,7 @@ }, { "location": "/#python-study-guide", - "text": "In this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate books, articles, answers from Stackoverflow, online courses, videos from py conferences and etc. So, after all I decided to share top resources for everyone about each topic, that you need to know about python, if you want to be senior python Software Engineer . Of course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than 30-40 chapters. Beginner The Python Programming Language, Implementation and Adventages Python Installation Start Coding With Python Data Types In Python 3 Datatype And Variables ... Intermediate ... Advanced ... Python Metaclasses ...", + "text": "In this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate books, articles, answers from Stackoverflow, online courses, videos from py conferences and etc. So, after all I decided to share top resources for everyone about each topic, that you need to know about python, if you want to be senior python Software Engineer . Of course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than 30-40 chapters. Beginner The Python Programming Language, Implementation and Adventages Python Installation Start Coding With Python Data Types In Python 3 Variables and Assignment ... Intermediate ... Advanced ... Python Metaclasses ...", "title": "Python Study Guide" }, { @@ -291,52 +291,52 @@ "title": "Python Dictionary" }, { - "location": "/beginner/Datatype_And_Variables/", - "text": "Datatype \n Variables\n\n\nVariables are named locations which are used to store references to the object stored in memory. The names we choose for variables and functions are commonly known as Identifiers. In python Identifiers must obey the following rules.\n\n\n\n\nAll identifiers must start with letter or underscore ( _ ) , you\n can\u2019t use digits. For e.g my_var is valid identifier while 1digit \n is not.\n\n\nIdentifiers can contain letters, digits and underscores ( _ ). \n\n\nThey can be of any length.\n\n\n\n\nIdentifier can\u2019t be a keyword (keywords are reserved words that\n Python uses for special purpose).Following are Keywords in python 3.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nand\n\n\nexec\n\n\nnot\n\n\n\n\n\n\nas\n\n\nfinally\n\n\nor\n\n\n\n\n\n\nassert\n\n\nfor\n\n\npass\n\n\n\n\n\n\nbreak\n\n\nfrom\n\n\nprint\n\n\n\n\n\n\nclass\n\n\nglobal\n\n\nraise\n\n\n\n\n\n\ncontinue\n\n\nif\n\n\nreturn\n\n\n\n\n\n\ndef\n\n\nimport\n\n\ntry\n\n\n\n\n\n\ndel\n\n\nin\n\n\nwhile\n\n\n\n\n\n\nelif\n\n\nis\n\n\nwith\n\n\n\n\n\n\nelse\n\n\nlambda\n\n\nyield\n\n\n\n\n\n\nexcept\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nAssigning Values to Variables\n\n\nValues are basic things that programs works with. For e.g 1 , 11 , 3.14 , \"hello\" are all values. In programming terminology they are also commonly known as literals. Literals can be of different type for e.g 1 , 11 are of type int , 3.14 is float and \"hello\" is string . Remember in python everything is object even basic data types like int, float, string, we will elaborate more on this in later chapters.\n\n\nIn python you don\u2019t need to declare types of variable ahead of time. Interpreter automatically detects the type of the variable by the data it contains. To assign value to a variable equal sign ( = ) is used. = is also known as assignment operator.\n\n\nFollowing are some examples of variable declaration:\n\n\nx\n \n=\n \n100\n \n# x is integer\n\n\npi\n \n=\n \n3.14\n \n# pi is float\n\n\nempname\n \n=\n \npython is great\n \n# empname is string\n\n\n\na\n \n=\n \nb\n \n=\n \nc\n \n=\n \n100\n \n# this statement assign 100 to c, b and a.\n\n\n\n\n\n\n\n\nNote:\n\nIn the above code x stores reference to the 100 ( which is an int object ) , x don\u2019t store 100 itself.\n\n\n\n\nIn Python comments are preceded by a pound sign ( # ). Comments are not programming statements that python interpreter executes while running the program. Comments are used by programmers to remind themselves how the program works. They are also used to write program documentation.\n\n\n#display hello world\n\n\nprint\n(\nhello world\n)\n\n\n\n\n\n\nSimultaneous Assignments\n\n\nPython allow simultaneous assignment syntax like this:\n\n\nvar1\n,\n \nvar2\n,\n \n...\n,\n \nvarn\n \n=\n \nexp1\n,\n \nexp2\n,\n \n...\n,\n \nexpn\n\n\n\n\n\n\nthis statements tells the python to evaluate all the expression on the right and assign them to the corresponding variables on the left. Simultaneous Assignments is helpful to swap values of two variables. For e.g\n\n\n \nx\n \n=\n \n1\n\n\n \ny\n \n=\n \n2\n\n\n\n \ny\n,\n \nx\n \n=\n \nx\n,\n \ny\n \n# assign y value to x and x value to y\n\n\n\n\n\n\nPython Data Types\n\n\nPython has 5 standard data types namely.\n\na) \nNumbers\n\nb) \nString\n\nc) \nList\n\nd) \nTuple\n\ne) \nDictionary\n\nf) Boolean \u2013 In Python True and False are boolean literals. But the following values are also considered as false.\n\n\n[] \u2013 empty list , () \u2013 empty tuple , {} \u2013 empty dictionary\n \n\n\nReceiving input from Console\n\n\ninput() function is used to receive input from the console.\n\n\nSyntax: input([prompt]) -\n string\n\n\ninput() function accepts an optional string argument called prompt and returns a string.\n\n\n \nname\n \n=\n \ninput\n(\nEnter your name: \n)\n\n\n \nEnter\n \nyour\n \nname\n:\n \ntim\n\n\n \nname\n\n\ntim\n\n\n\n\n\n\nNote that input() returns string even if you enter a number, to convert it to an integer you can use int() or eval() .\n\n\n \nage\n \n=\n \nint\n(\ninput\n(\nEnter your age: \n))\n\n\nEnter\n \nyour\n \nage\n:\n \n22\n\n\n \nage\n\n\n22\n\n\n \ntype\n(\nage\n)\n\n\nclass\n \nint\n\n\n\n\n\n\n\n\nSource:\n \n\n\n http://thepythonguru.com\n\n\n\n\nUnderstanding Python variables and Memory Management\n\n\nHave you ever noticed any difference between variables in Python and C? For example, when you do an assignment like the following in C, it actually creates a block of memory space so that it can hold the value for that variable\n\n\nint\n \na\n \n=\n \n1\n;\n\n\n\n\n\n\nYou can think of it as putting the value assigned in a box with the variable name as shown below.\n\n\n\nAnd for all the variables you create a new box is created with the variable name to hold the value. If you change the value of the variable the box will be updated with the new value. That means doing\n\n\na\n \n=\n \n2\n;\n\n\n\n\n\n\nwill result in\n\n\n\n\nAssigning one variable to another makes a copy of the value and put that value in the new box.\n\n\nint\n \nb\n \n=\n \na\n;\n\n\n\n\n\n\n \n\n\nBut in Python variables work more like tags unlike the boxes you have seen before. When you do an assignment in Python, it tags the value with the variable name.\n\n\na\n \n=\n \n1\n\n\n\n\n\n\n\n\nand if you change the value of the varaible, it just changes the tag to the new value in memory. You dont need to do the housekeeping job of freeing the memory here. Python's Automatic Garbage Collection does it for you. When a value is without names/tags it is automatically removed from memory.\n\n\na\n \n=\n \n2\n\n\n\n\n\n\n\n\nAssigning one variable to another makes a new tag bound to the same value as show below.\n\n\nb\n \n=\n \na\n\n\n\n\n\n\n\nOther languages have 'variables'. Python has 'names'.\n\n\nA bit about Python's memory management\n\n\nAs you have seen before, a value will have only one copy in memory and all the variables having this value will refer to this memory location. For example when you have variables a, b, c having a value 10, it doesn't mean that there will be 3 copy of 10s in memory. There will be only one 10 and all the variables a, b, c will point to this value. Once a variable is updated, say you are doing a += 1 a new value 11 will be allocated in memory and a will be pointing to this.\n\n\nLet's check this behaviour with Python Interpreter. Start the Python Shell and try the following for yourselves.\n\n\n \na\n \n=\n \n10\n\n\n \nb\n \n=\n \n10\n\n\n \nc\n \n=\n \n10\n\n\n \nid\n(\na\n),\n \nid\n(\nb\n),\n \nid\n(\nc\n)\n\n\n(\n140621897573616\n,\n \n140621897573616\n,\n \n140621897573616\n)\n\n\n \na\n \n+=\n \n1\n\n\n \nid\n(\na\n)\n\n\n140621897573592\n\n\n\n\n\n\nid() will return an objects memory address (object's identity). As you have noticed, when you assign the same integer value to the variables, we see the same ids. But this assumption does not hold true all the time. See the following for example\n\n\n \nx\n \n=\n \n500\n\n\n \ny\n \n=\n \n500\n\n\n \nid\n(\nx\n)\n\n\n4338740848\n\n\n \nid\n(\ny\n)\n\n\n4338741040\n\n\n\n\n\n\nWhat happened here? Even after assigning the same integer values to different variable names, we are getting two different ids here. These are actually the effects of CPython optimization we are observing here. CPython implementation keeps an array of integer objects for all integers between -5 and 256. So when we create an integer in that range, they simply back reference to the existing object. You may refer the following \nlinks\n for more information.\n\n\nLet's take a look at strings now.\n\n\n \ns1\n \n=\n \nhello\n\n\n \ns2\n \n=\n \nhello\n\n\n \nid\n(\ns1\n),\n \nid\n(\ns2\n)\n\n\n(\n4454725888\n,\n \n4454725888\n)\n\n\n \ns1\n \n==\n \ns2\n\n\nTrue\n\n\n \ns1\n \nis\n \ns2\n\n\nTrue\n\n\n \ns3\n \n=\n \nhello, world!\n\n\n \ns4\n \n=\n \nhello, world!\n\n\n \nid\n(\ns3\n),\n \nid\n(\ns4\n)\n\n\n(\n4454721608\n,\n \n4454721664\n)\n\n\n \ns3\n \n==\n \ns4\n\n\nTrue\n\n\n \ns3\n \nis\n \ns4\n\n\nFalse\n\n\n\n\n\n\nLooks interesting, isn't it? When the string was a simple and shorter one the variable names where referring to the same object in memory. But when they became bigger, this was not the case. This is called interning, and Python does interning (to some extent) of shorter string literals (as in s1 and s2) which are created at compile time. But in general, Python string literals creates a new string object each time (as in s3 and s4). Interning is runtime dependant and is always a trade-off between memory use and the cost of checking if you are creating the same string. There's a built-in intern() function to forcefully apply interning. Read more about interning from the following links.\n\n\nStack Overflow: Does Python intern Strings?\n\n\nStack Overflow: Python String Interning\n\n\nInternals of Python String Interning\n\n\n\n\nSource:\n \n\n\n http://foobarnbaz.com/2012/07/08/understanding-python-variables/\n\n\n\n\nAssignment statements in Python are more interesting than you might think\n\n\nIn this article, we will take a deep look at three kinds of assignment statements in Python and discuss what\u2019s going on under the hood.\n\n\n \nmy_string\n \n=\n \nHello World\n \n# right hand side is a simple expression\n\n\n \nanother_string\n \n=\n \nmy_string\n \n# right hand side is another variable\n\n\n \nanother_string\n \n=\n \nanother_string\n \n+\n \n!\n \n# right hand side is an operation\n\n\n\n\n\n\nWhat we find may surprise you.\n\n\nWhat happens when the right hand side is a simple expression?\n\n\n \nmy_string\n \n=\n \nHello World\n\n\n\n\n\n\nIn simple terms, this creates a string \u201cHello World\u201d in memory and assigns the name my_string to it. If you are using CPython[1], then we can even check the memory address explicitly by using the built in function id .\n\n\n \nmy_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n \n\n \nid\n(\nmy_string\n)\n\n\n140400709562064\n\n\n\n\n\n\nThat big number 140400709562064 denotes where the data lives in the memory. It will be very useful for us in this entire discussion.\nWhat happens if we create another string with the same value?\n\n\n \nanother_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n\n\n\n\n\n\nDoes it reuse the previous \u201cHello World\u201d stored in memory or does it create an independent copy? Let\u2019s check this by querying the id function again.\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562208\n\n\n\n\n\n\nThis outputs a different id, so this must be an independent copy. We conclude that:\n\n\n\n\nNote:\n\nAssignment statements where the right hand side is a simple expression creates independent copies every time.\n\n\n\n\nWhile for everyday programming, this is the rule we should remember, there are actually some weird exceptions to this rule. Here\u2019s an example.\n\n\n \nmy_string\n \n=\n \n\u201c\nhello\n\u201d\n\n\n \nid\n(\nmy_string\n)\n\n\n140400709562016\n\n\n \nanother_string\n \n=\n \n\u201c\nhello\n\u201d\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562016\n\n\n\n\n\n\nIn this case, two consecutive assignment statements did not create independent copies. Why?\nIt gets interesting now.\nFor optimizing memory, Python treats a special set of objects differently. The string \u201chello\u201d belongs to this privileged set and has a different behavior. The exact set depends on the implementation like CPython, PyPy, Jython or IronPython. For CPython, the special rule applies to:\n\n\n\n\nStrings without whitespaces and less than 20 characters and\n\n\nIntegers from -5 to +255.\n\n\n\n\nThese objects are always reused or interned. The rationale behind doing this is as follows:\n\n\n\n\nSince programmers use these objects frequently, interning existing\n objects saves memory.\n\n\nSince immutable objects like tuples and strings cannot be modified,\n there is no risk in interning the same object.\n\n\n\n\nHowever, Python does not do this for all immutable objects because there is a runtime cost involved for this feature. For interning an object, it must first search for the object in memory, and searching takes time. This is why the special treatment only applies for small integers and strings, because finding them is not that costly.\n\n\nWhat happens when the right hand side is an existing Python variable?\n\nLet\u2019s move on to the second type of assignment statement where the right hand side is an existing Python variable.\n\n\n \nanother_string\n \n=\n \nmy_string\n\n\n\n\n\n\nIn this case, nothing is created in memory. After the assignment, both variables refer to the already existing object. It\u2019s basically like giving the object an additional nickname or alias. Let\u2019s confirm this by using the id function.\n\n\n \nmy_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n\n\n \nid\n(\nmy_string\n)\n\n\n140400709562160\n\n\n \nanother_string\n \n=\n \nmy_string\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562160\n\n\n\n\n\n\nThe natural question at this stage is : what if, instead of just giving the existing object an alias, we wanted to create an independent copy?\nFor mutable objects, this is possible. You can either use the copy module of Python (which works on all objects) or you may use copy methods specific to the class. For a list, you have several possibilities for creating copies, all of which have different runtime.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \ncopy_of_my_list\n \n=\n \nmy_list\n.\ncopy\n()\n \n# fastest, works only on latest Python versions\n\n\n \ncopy_of_my_list\n \n=\n \nmy_list\n[:]\n \n# same runtime as List.copy()\n\n\n \ncopy_of_my_list\n \n=\n \nlist\n(\nmy_list\n)\n \n# slightly slower\n\n\n \nimport\n \ncopy\n\n\n \ncopy_of_my_list\n \n=\n \ncopy\n.\ncopy\n(\nmy_list\n)\n \n# slowest\n\n\n\n\n\n\nHow can you copy an immutable object? Well\u2026you can\u2019t! At least not in a straightforward way. If you try to use the copy module or the slicing notation, you will get back the same object and not an independent copy. Here\u2019s proof.\n\n\n# Standard ways of copying lists do not apply for tuples\n\n\n\n \nmy_tuple\n \n=\n \n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n \nid\n(\nmy_tuple\n)\n\n\n140371873244816\n\n\n \nanother_tuple\n \n=\n \nmy_tuple\n[:]\n\n\n \nid\n(\nanother_tuple\n)\n\n\n140371873244816\n\n\n\n# The copy module also doesn\u2019t help\n\n\n\n \nimport\n \ncopy\n \n\n \nanother_tuple\n \n=\n \ncopy\n.\ncopy\n(\nmy_tuple\n)\n\n\n \nid\n(\nanother_tuple\n)\n\n\n140371873244816\n\n\n\n\n\n\nMore importantly, there is no reason for explicitly copying an immutable object anyway. We will see why in a moment when we discuss the third kind of assignment statement.\n\nWhat happpens when the right hand side is an operation?\n\n\nIn this case, what happens depends on the result of the operation. We will discuss two simple cases:\n\n\n\n\nadding an element to an immutable object (like a tuple) and\n\n\nadding an element to a mutable object (like a list).\n\n\n\n\nLet\u2019s start with the case of the tuple.\n\n\n \nanother_tuple\n \n+=\n \n(\n4\n,)\n\n\n\n\n\n\nWhen you add a new element to a tuple using another_tuple += (4,), this creates a new object in memory. The immutability of tuples is key to understanding this. Since tuples are immutable, any operation that leads to a changed tuple would result in an independent copy.\nThis is the reason why you don\u2019t need to explicitly copy immutable objects : it happens automatically under the hood. Here\u2019s an example.\n\n\n \nmy_tuple\n \n=\n \n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n \nanother_tuple\n \n=\n \nmy_tuple\n \n# both variables point to the same object\n\n\n \nanother_tuple\n \n+=\n \n(\n4\n,)\n \n# this statement creates a new independent object\n\n\n \nprint\n(\nanother_tuple\n)\n \n\n(\n1\n,\n \n2\n,\n \n3\n,\n \n4\n)\n\n\n \nprint\n(\nmy_tuple\n)\n \n# the old one remains unharmed\n\n\n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n\n\n\n\nThe situation is much different for mutable objects and much more confusing. Let\u2019s try the same example, but now for lists.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n \n# both variables point to the same object\n\n\n \nanother_list\n \n+=\n \n[\n4\n,]\n \n# this statement modifies the object in place\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is modified\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n\n\n\n\nMutable objects can be modified in place. Some operations modify the list in place and some operations don\u2019t. In this case, the statement another_list += [4,] calls another_list.\niadd\n([4,]) and \niadd\n modifies the existing object in place.\nTo make things doubly confusing, we would have completely different results if we used a slightly different notation.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n \n# both variables point to the same object\n\n\n \nanother_list\n \n=\n \nanother_list\n \n+\n \n[\n4\n,]\n \n# this creates an independent copy\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is unharmed\n\n\n[\n1\n,\n \n2\n,\n \n3\n]\n \n\n\n\n\n\nWoah! What\u2019s going on? What changed?\nIt turns out that when we change the third line, Python now internally calls a different function another_list.\nadd\n([4,]) instead of \niadd\n. This function returns a new copy instead of modifying the list in place.\nTo prevent this confusion, it is always better to create a true copy of the list if you wish to prevent modification to the original.\nLet\u2019s remember the list copy methods from before. They were List.copy(), [:], list() and copy.copy(). This is what we should use.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n.\ncopy\n()\n \n# this creates an independent copy\n\n\n \nanother_list\n \n+=\n \n[\n4\n,]\n \n# this statement modifies the independent copy\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is unharmed\n\n\n[\n1\n,\n \n2\n,\n \n3\n]\n \n\n\n\n\n\nThere\u2019s one last gotcha that can happen when copying lists.\nSuppose we have a list that has a nested list inside it. We copy this list using List.copy() and then modify the nested list. Unfortunately, this will modify the original list again!\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n.\ncopy\n()\n\n\n \nanother_list\n[\n0\n]\n \n+=\n \n[\n6\n,]\n\n\n \nprint\n(\nanother_list\n)\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n\n\n \nprint\n(\nmy_list\n)\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n \n\n\n\n\n\nWhy did that happen? Didn\u2019t we just copy the original list?\nThe truth is : we actually don\u2019t have a completely independent copy in this case. The copy() function generates a shallow copy. To see what it does, let\u2019s look at the ids of all the elements in my_list and the ids of all the elements in the copied list.\n\n\n# for my_list\n\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nid\n(\nmy_list\n)\n\n\n140371873277424\n\n\n \nprint\n([\nid\n(\nx\n)\n \nfor\n \nx\n \nin\n \nmy_list\n])\n\n\n[\n140371873599288\n,\n \n13820176\n,\n \n13820152\n]\n\n\n\n# for another_list obtained by my_list.copy()\n\n\n\n \nid\n(\nanother_list\n)\n\n\n140371873317016\n\n\n \nprint\n([\nid\n(\nx\n)\n \nfor\n \nx\n \nin\n \nanother_list\n])\n\n\n[\n140371873599288\n,\n \n13820176\n,\n \n13820152\n]\n\n\n\n\n\n\nWe see the ids of my_list and another_list are indeed different, indicating another_list is a copy. But the ids of the elements contained in another_list have the same ids as the elements in my_list . So the elements have not been copied!\nThis is the property of shallow copy. It creates a new copy of the object but reuses the attributes and elements of the old copy. Thus, when you modify the elements of the new copy, you are modifying the elements of the old copy too.\nTo solve this problem, we need to copy an object along with all its attributes and elements. This can be achieved by copy.deepcopy.\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nanother_list\n \n=\n \ncopy\n.\ndeepcopy\n(\nmy_list\n)\n\n\n \nanother_list\n[\n0\n]\n \n+=\n \n[\n6\n,]\n\n\n \nanother_list\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n\n\n \nmy_list\n\n\n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n\n\n\n\nDeep copy is a quite time intensive operation and can take 1o times longer to complete compared to a shallow copy. But in some situations, it is unavoidable.\n\n\nConclusion\n\n\nThis brings me to the end of this discussion. To summarize, we have talked about the different scenarios which can arise in an assignment statement in Python. We found that:\n\n\n\n\nWhen the right hand side is a simple expression, a new copy is\n created every time. There are some exceptions to this rule, which\n depend on the implementation\n\n\nWhen the right hand side is an existing Python variable, then an\n alias is created for the existing copy.\n\n\nWhen the right hand side is an operation, then the outcome depends on\n the operation. In a simple case involving a tuple, we saw that an\n independent copy was created. In the same case with lists, we saw\n that the list was modified in place in one case (when we used\n \niadd\n) and a new copy was generated in another case (when we used \nadd\n).\n\n\nList item\n\n\nMutable objects can be copied but immutable objects cannot be copied\n in a straightforward way. There is also no need to copy immutable\n objects.\n\n\nTo copy a mutable object along with all its attributes and elements,\n we need to use deep copy.\n\n\n\n\n\n\nSource:\n \n\n\n https://medium.com/broken-window/many-names-one-memory-address-122f78734cb6", - "title": "Datatype And Variables" + "location": "/beginner/Variables_And_Assignment/", + "text": "Variables and Assignment\n\n\nVariables are named locations which are used to store references to the object stored in memory. The names we choose for variables and functions are commonly known as Identifiers. In python Identifiers must obey the following rules.\n\n\n\n\nAll identifiers must start with letter or underscore ( _ ) , you\n can\u2019t use digits. For e.g my_var is valid identifier while 1digit \n is not.\n\n\nIdentifiers can contain letters, digits and underscores ( _ ). \n\n\nThey can be of any length.\n\n\n\n\nIdentifier can\u2019t be a keyword (keywords are reserved words that\n Python uses for special purpose).Following are Keywords in python 3.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nand\n\n\nexec\n\n\nnot\n\n\n\n\n\n\nas\n\n\nfinally\n\n\nor\n\n\n\n\n\n\nassert\n\n\nfor\n\n\npass\n\n\n\n\n\n\nbreak\n\n\nfrom\n\n\nprint\n\n\n\n\n\n\nclass\n\n\nglobal\n\n\nraise\n\n\n\n\n\n\ncontinue\n\n\nif\n\n\nreturn\n\n\n\n\n\n\ndef\n\n\nimport\n\n\ntry\n\n\n\n\n\n\ndel\n\n\nin\n\n\nwhile\n\n\n\n\n\n\nelif\n\n\nis\n\n\nwith\n\n\n\n\n\n\nelse\n\n\nlambda\n\n\nyield\n\n\n\n\n\n\nexcept\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nAssigning Values to Variables\n\n\nValues are basic things that programs works with. For e.g 1 , 11 , 3.14 , \"hello\" are all values. In programming terminology they are also commonly known as literals. Literals can be of different type for e.g 1 , 11 are of type int , 3.14 is float and \"hello\" is string . Remember in python everything is object even basic data types like int, float, string, we will elaborate more on this in later chapters.\n\n\nIn python you don\u2019t need to declare types of variable ahead of time. Interpreter automatically detects the type of the variable by the data it contains. To assign value to a variable equal sign ( = ) is used. = is also known as assignment operator.\n\n\nFollowing are some examples of variable declaration:\n\n\nx\n \n=\n \n100\n \n# x is integer\n\n\npi\n \n=\n \n3.14\n \n# pi is float\n\n\nempname\n \n=\n \npython is great\n \n# empname is string\n\n\n\na\n \n=\n \nb\n \n=\n \nc\n \n=\n \n100\n \n# this statement assign 100 to c, b and a.\n\n\n\n\n\n\n\n\nNote:\n\nIn the above code x stores reference to the 100 ( which is an int object ) , x don\u2019t store 100 itself.\n\n\n\n\nIn Python comments are preceded by a pound sign ( # ). Comments are not programming statements that python interpreter executes while running the program. Comments are used by programmers to remind themselves how the program works. They are also used to write program documentation.\n\n\n#display hello world\n\n\nprint\n(\nhello world\n)\n\n\n\n\n\n\nSimultaneous Assignments\n\n\nPython allow simultaneous assignment syntax like this:\n\n\nvar1\n,\n \nvar2\n,\n \n...\n,\n \nvarn\n \n=\n \nexp1\n,\n \nexp2\n,\n \n...\n,\n \nexpn\n\n\n\n\n\n\nthis statements tells the python to evaluate all the expression on the right and assign them to the corresponding variables on the left. Simultaneous Assignments is helpful to swap values of two variables. For e.g\n\n\n \nx\n \n=\n \n1\n\n\n \ny\n \n=\n \n2\n\n\n\n \ny\n,\n \nx\n \n=\n \nx\n,\n \ny\n \n# assign y value to x and x value to y\n\n\n\n\n\n\nPython Data Types\n\n\nPython has 5 standard data types namely.\n\na) \nNumbers\n\nb) \nString\n\nc) \nList\n\nd) \nTuple\n\ne) \nDictionary\n\nf) Boolean \u2013 In Python True and False are boolean literals. But the following values are also considered as false.\n\n\n[] \u2013 empty list , () \u2013 empty tuple , {} \u2013 empty dictionary\n \n\n\nReceiving input from Console\n\n\ninput() function is used to receive input from the console.\n\n\nSyntax: input([prompt]) -\n string\n\n\ninput() function accepts an optional string argument called prompt and returns a string.\n\n\n \nname\n \n=\n \ninput\n(\nEnter your name: \n)\n\n\n \nEnter\n \nyour\n \nname\n:\n \ntim\n\n\n \nname\n\n\ntim\n\n\n\n\n\n\nNote that input() returns string even if you enter a number, to convert it to an integer you can use int() or eval() .\n\n\n \nage\n \n=\n \nint\n(\ninput\n(\nEnter your age: \n))\n\n\nEnter\n \nyour\n \nage\n:\n \n22\n\n\n \nage\n\n\n22\n\n\n \ntype\n(\nage\n)\n\n\nclass\n \nint\n\n\n\n\n\n\n\n\nSource:\n \n\n\n http://thepythonguru.com\n\n\n\n\nUnderstanding Python variables and Memory Management\n\n\nHave you ever noticed any difference between variables in Python and C? For example, when you do an assignment like the following in C, it actually creates a block of memory space so that it can hold the value for that variable\n\n\nint\n \na\n \n=\n \n1\n;\n\n\n\n\n\n\nYou can think of it as putting the value assigned in a box with the variable name as shown below.\n\n\n\nAnd for all the variables you create a new box is created with the variable name to hold the value. If you change the value of the variable the box will be updated with the new value. That means doing\n\n\na\n \n=\n \n2\n;\n\n\n\n\n\n\nwill result in\n\n\n\n\nAssigning one variable to another makes a copy of the value and put that value in the new box.\n\n\nint\n \nb\n \n=\n \na\n;\n\n\n\n\n\n\n \n\n\nBut in Python variables work more like tags unlike the boxes you have seen before. When you do an assignment in Python, it tags the value with the variable name.\n\n\na\n \n=\n \n1\n\n\n\n\n\n\n\n\nand if you change the value of the varaible, it just changes the tag to the new value in memory. You dont need to do the housekeeping job of freeing the memory here. Python's Automatic Garbage Collection does it for you. When a value is without names/tags it is automatically removed from memory.\n\n\na\n \n=\n \n2\n\n\n\n\n\n\n\n\nAssigning one variable to another makes a new tag bound to the same value as show below.\n\n\nb\n \n=\n \na\n\n\n\n\n\n\n\nOther languages have 'variables'. Python has 'names'.\n\n\nA bit about Python's memory management\n\n\nAs you have seen before, a value will have only one copy in memory and all the variables having this value will refer to this memory location. For example when you have variables a, b, c having a value 10, it doesn't mean that there will be 3 copy of 10s in memory. There will be only one 10 and all the variables a, b, c will point to this value. Once a variable is updated, say you are doing a += 1 a new value 11 will be allocated in memory and a will be pointing to this.\n\n\nLet's check this behaviour with Python Interpreter. Start the Python Shell and try the following for yourselves.\n\n\n \na\n \n=\n \n10\n\n\n \nb\n \n=\n \n10\n\n\n \nc\n \n=\n \n10\n\n\n \nid\n(\na\n),\n \nid\n(\nb\n),\n \nid\n(\nc\n)\n\n\n(\n140621897573616\n,\n \n140621897573616\n,\n \n140621897573616\n)\n\n\n \na\n \n+=\n \n1\n\n\n \nid\n(\na\n)\n\n\n140621897573592\n\n\n\n\n\n\nid() will return an objects memory address (object's identity). As you have noticed, when you assign the same integer value to the variables, we see the same ids. But this assumption does not hold true all the time. See the following for example\n\n\n \nx\n \n=\n \n500\n\n\n \ny\n \n=\n \n500\n\n\n \nid\n(\nx\n)\n\n\n4338740848\n\n\n \nid\n(\ny\n)\n\n\n4338741040\n\n\n\n\n\n\nWhat happened here? Even after assigning the same integer values to different variable names, we are getting two different ids here. These are actually the effects of CPython optimization we are observing here. CPython implementation keeps an array of integer objects for all integers between -5 and 256. So when we create an integer in that range, they simply back reference to the existing object. You may refer the following \nlinks\n for more information.\n\n\nLet's take a look at strings now.\n\n\n \ns1\n \n=\n \nhello\n\n\n \ns2\n \n=\n \nhello\n\n\n \nid\n(\ns1\n),\n \nid\n(\ns2\n)\n\n\n(\n4454725888\n,\n \n4454725888\n)\n\n\n \ns1\n \n==\n \ns2\n\n\nTrue\n\n\n \ns1\n \nis\n \ns2\n\n\nTrue\n\n\n \ns3\n \n=\n \nhello, world!\n\n\n \ns4\n \n=\n \nhello, world!\n\n\n \nid\n(\ns3\n),\n \nid\n(\ns4\n)\n\n\n(\n4454721608\n,\n \n4454721664\n)\n\n\n \ns3\n \n==\n \ns4\n\n\nTrue\n\n\n \ns3\n \nis\n \ns4\n\n\nFalse\n\n\n\n\n\n\nLooks interesting, isn't it? When the string was a simple and shorter one the variable names where referring to the same object in memory. But when they became bigger, this was not the case. This is called interning, and Python does interning (to some extent) of shorter string literals (as in s1 and s2) which are created at compile time. But in general, Python string literals creates a new string object each time (as in s3 and s4). Interning is runtime dependant and is always a trade-off between memory use and the cost of checking if you are creating the same string. There's a built-in intern() function to forcefully apply interning. Read more about interning from the following links.\n\n\nStack Overflow: Does Python intern Strings?\n\n\nStack Overflow: Python String Interning\n\n\nInternals of Python String Interning\n\n\n\n\nSource:\n \n\n\n http://foobarnbaz.com/2012/07/08/understanding-python-variables/\n\n\n\n\nAssignment statements in Python are more interesting than you might think\n\n\nIn this article, we will take a deep look at three kinds of assignment statements in Python and discuss what\u2019s going on under the hood.\n\n\n \nmy_string\n \n=\n \nHello World\n \n# right hand side is a simple expression\n\n\n \nanother_string\n \n=\n \nmy_string\n \n# right hand side is another variable\n\n\n \nanother_string\n \n=\n \nanother_string\n \n+\n \n!\n \n# right hand side is an operation\n\n\n\n\n\n\nWhat we find may surprise you.\n\n\nWhat happens when the right hand side is a simple expression?\n\n\n \nmy_string\n \n=\n \nHello World\n\n\n\n\n\n\nIn simple terms, this creates a string \u201cHello World\u201d in memory and assigns the name my_string to it. If you are using CPython[1], then we can even check the memory address explicitly by using the built in function id .\n\n\n \nmy_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n \n\n \nid\n(\nmy_string\n)\n\n\n140400709562064\n\n\n\n\n\n\nThat big number 140400709562064 denotes where the data lives in the memory. It will be very useful for us in this entire discussion.\nWhat happens if we create another string with the same value?\n\n\n \nanother_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n\n\n\n\n\n\nDoes it reuse the previous \u201cHello World\u201d stored in memory or does it create an independent copy? Let\u2019s check this by querying the id function again.\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562208\n\n\n\n\n\n\nThis outputs a different id, so this must be an independent copy. We conclude that:\n\n\n\n\nNote:\n\nAssignment statements where the right hand side is a simple expression creates independent copies every time.\n\n\n\n\nWhile for everyday programming, this is the rule we should remember, there are actually some weird exceptions to this rule. Here\u2019s an example.\n\n\n \nmy_string\n \n=\n \n\u201c\nhello\n\u201d\n\n\n \nid\n(\nmy_string\n)\n\n\n140400709562016\n\n\n \nanother_string\n \n=\n \n\u201c\nhello\n\u201d\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562016\n\n\n\n\n\n\nIn this case, two consecutive assignment statements did not create independent copies. Why?\nIt gets interesting now.\nFor optimizing memory, Python treats a special set of objects differently. The string \u201chello\u201d belongs to this privileged set and has a different behavior. The exact set depends on the implementation like CPython, PyPy, Jython or IronPython. For CPython, the special rule applies to:\n\n\n\n\nStrings without whitespaces and less than 20 characters and\n\n\nIntegers from -5 to +255.\n\n\n\n\nThese objects are always reused or interned. The rationale behind doing this is as follows:\n\n\n\n\nSince programmers use these objects frequently, interning existing\n objects saves memory.\n\n\nSince immutable objects like tuples and strings cannot be modified,\n there is no risk in interning the same object.\n\n\n\n\nHowever, Python does not do this for all immutable objects because there is a runtime cost involved for this feature. For interning an object, it must first search for the object in memory, and searching takes time. This is why the special treatment only applies for small integers and strings, because finding them is not that costly.\n\n\nWhat happens when the right hand side is an existing Python variable?\n\nLet\u2019s move on to the second type of assignment statement where the right hand side is an existing Python variable.\n\n\n \nanother_string\n \n=\n \nmy_string\n\n\n\n\n\n\nIn this case, nothing is created in memory. After the assignment, both variables refer to the already existing object. It\u2019s basically like giving the object an additional nickname or alias. Let\u2019s confirm this by using the id function.\n\n\n \nmy_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n\n\n \nid\n(\nmy_string\n)\n\n\n140400709562160\n\n\n \nanother_string\n \n=\n \nmy_string\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562160\n\n\n\n\n\n\nThe natural question at this stage is : what if, instead of just giving the existing object an alias, we wanted to create an independent copy?\nFor mutable objects, this is possible. You can either use the copy module of Python (which works on all objects) or you may use copy methods specific to the class. For a list, you have several possibilities for creating copies, all of which have different runtime.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \ncopy_of_my_list\n \n=\n \nmy_list\n.\ncopy\n()\n \n# fastest, works only on latest Python versions\n\n\n \ncopy_of_my_list\n \n=\n \nmy_list\n[:]\n \n# same runtime as List.copy()\n\n\n \ncopy_of_my_list\n \n=\n \nlist\n(\nmy_list\n)\n \n# slightly slower\n\n\n \nimport\n \ncopy\n\n\n \ncopy_of_my_list\n \n=\n \ncopy\n.\ncopy\n(\nmy_list\n)\n \n# slowest\n\n\n\n\n\n\nHow can you copy an immutable object? Well\u2026you can\u2019t! At least not in a straightforward way. If you try to use the copy module or the slicing notation, you will get back the same object and not an independent copy. Here\u2019s proof.\n\n\n# Standard ways of copying lists do not apply for tuples\n\n\n\n \nmy_tuple\n \n=\n \n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n \nid\n(\nmy_tuple\n)\n\n\n140371873244816\n\n\n \nanother_tuple\n \n=\n \nmy_tuple\n[:]\n\n\n \nid\n(\nanother_tuple\n)\n\n\n140371873244816\n\n\n\n# The copy module also doesn\u2019t help\n\n\n\n \nimport\n \ncopy\n \n\n \nanother_tuple\n \n=\n \ncopy\n.\ncopy\n(\nmy_tuple\n)\n\n\n \nid\n(\nanother_tuple\n)\n\n\n140371873244816\n\n\n\n\n\n\nMore importantly, there is no reason for explicitly copying an immutable object anyway. We will see why in a moment when we discuss the third kind of assignment statement.\n\nWhat happpens when the right hand side is an operation?\n\n\nIn this case, what happens depends on the result of the operation. We will discuss two simple cases:\n\n\n\n\nadding an element to an immutable object (like a tuple) and\n\n\nadding an element to a mutable object (like a list).\n\n\n\n\nLet\u2019s start with the case of the tuple.\n\n\n \nanother_tuple\n \n+=\n \n(\n4\n,)\n\n\n\n\n\n\nWhen you add a new element to a tuple using another_tuple += (4,), this creates a new object in memory. The immutability of tuples is key to understanding this. Since tuples are immutable, any operation that leads to a changed tuple would result in an independent copy.\nThis is the reason why you don\u2019t need to explicitly copy immutable objects : it happens automatically under the hood. Here\u2019s an example.\n\n\n \nmy_tuple\n \n=\n \n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n \nanother_tuple\n \n=\n \nmy_tuple\n \n# both variables point to the same object\n\n\n \nanother_tuple\n \n+=\n \n(\n4\n,)\n \n# this statement creates a new independent object\n\n\n \nprint\n(\nanother_tuple\n)\n \n\n(\n1\n,\n \n2\n,\n \n3\n,\n \n4\n)\n\n\n \nprint\n(\nmy_tuple\n)\n \n# the old one remains unharmed\n\n\n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n\n\n\n\nThe situation is much different for mutable objects and much more confusing. Let\u2019s try the same example, but now for lists.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n \n# both variables point to the same object\n\n\n \nanother_list\n \n+=\n \n[\n4\n,]\n \n# this statement modifies the object in place\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is modified\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n\n\n\n\nMutable objects can be modified in place. Some operations modify the list in place and some operations don\u2019t. In this case, the statement another_list += [4,] calls another_list.\niadd\n([4,]) and \niadd\n modifies the existing object in place.\nTo make things doubly confusing, we would have completely different results if we used a slightly different notation.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n \n# both variables point to the same object\n\n\n \nanother_list\n \n=\n \nanother_list\n \n+\n \n[\n4\n,]\n \n# this creates an independent copy\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is unharmed\n\n\n[\n1\n,\n \n2\n,\n \n3\n]\n \n\n\n\n\n\nWoah! What\u2019s going on? What changed?\nIt turns out that when we change the third line, Python now internally calls a different function another_list.\nadd\n([4,]) instead of \niadd\n. This function returns a new copy instead of modifying the list in place.\nTo prevent this confusion, it is always better to create a true copy of the list if you wish to prevent modification to the original.\nLet\u2019s remember the list copy methods from before. They were List.copy(), [:], list() and copy.copy(). This is what we should use.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n.\ncopy\n()\n \n# this creates an independent copy\n\n\n \nanother_list\n \n+=\n \n[\n4\n,]\n \n# this statement modifies the independent copy\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is unharmed\n\n\n[\n1\n,\n \n2\n,\n \n3\n]\n \n\n\n\n\n\nThere\u2019s one last gotcha that can happen when copying lists.\nSuppose we have a list that has a nested list inside it. We copy this list using List.copy() and then modify the nested list. Unfortunately, this will modify the original list again!\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n.\ncopy\n()\n\n\n \nanother_list\n[\n0\n]\n \n+=\n \n[\n6\n,]\n\n\n \nprint\n(\nanother_list\n)\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n\n\n \nprint\n(\nmy_list\n)\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n \n\n\n\n\n\nWhy did that happen? Didn\u2019t we just copy the original list?\nThe truth is : we actually don\u2019t have a completely independent copy in this case. The copy() function generates a shallow copy. To see what it does, let\u2019s look at the ids of all the elements in my_list and the ids of all the elements in the copied list.\n\n\n# for my_list\n\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nid\n(\nmy_list\n)\n\n\n140371873277424\n\n\n \nprint\n([\nid\n(\nx\n)\n \nfor\n \nx\n \nin\n \nmy_list\n])\n\n\n[\n140371873599288\n,\n \n13820176\n,\n \n13820152\n]\n\n\n\n# for another_list obtained by my_list.copy()\n\n\n\n \nid\n(\nanother_list\n)\n\n\n140371873317016\n\n\n \nprint\n([\nid\n(\nx\n)\n \nfor\n \nx\n \nin\n \nanother_list\n])\n\n\n[\n140371873599288\n,\n \n13820176\n,\n \n13820152\n]\n\n\n\n\n\n\nWe see the ids of my_list and another_list are indeed different, indicating another_list is a copy. But the ids of the elements contained in another_list have the same ids as the elements in my_list . So the elements have not been copied!\nThis is the property of shallow copy. It creates a new copy of the object but reuses the attributes and elements of the old copy. Thus, when you modify the elements of the new copy, you are modifying the elements of the old copy too.\nTo solve this problem, we need to copy an object along with all its attributes and elements. This can be achieved by copy.deepcopy.\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nanother_list\n \n=\n \ncopy\n.\ndeepcopy\n(\nmy_list\n)\n\n\n \nanother_list\n[\n0\n]\n \n+=\n \n[\n6\n,]\n\n\n \nanother_list\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n\n\n \nmy_list\n\n\n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n\n\n\n\nDeep copy is a quite time intensive operation and can take 1o times longer to complete compared to a shallow copy. But in some situations, it is unavoidable.\n\n\nConclusion\n\n\nThis brings me to the end of this discussion. To summarize, we have talked about the different scenarios which can arise in an assignment statement in Python. We found that:\n\n\n\n\nWhen the right hand side is a simple expression, a new copy is\n created every time. There are some exceptions to this rule, which\n depend on the implementation\n\n\nWhen the right hand side is an existing Python variable, then an\n alias is created for the existing copy.\n\n\nWhen the right hand side is an operation, then the outcome depends on\n the operation. In a simple case involving a tuple, we saw that an\n independent copy was created. In the same case with lists, we saw\n that the list was modified in place in one case (when we used\n \niadd\n) and a new copy was generated in another case (when we used \nadd\n).\n\n\nList item\n\n\nMutable objects can be copied but immutable objects cannot be copied\n in a straightforward way. There is also no need to copy immutable\n objects.\n\n\nTo copy a mutable object along with all its attributes and elements,\n we need to use deep copy.\n\n\n\n\n\n\nSource:\n \n\n\n https://medium.com/broken-window/many-names-one-memory-address-122f78734cb6", + "title": "Variables and Assignment" }, { - "location": "/beginner/Datatype_And_Variables/#datatype-variables", + "location": "/beginner/Variables_And_Assignment/#variables-and-assignment", "text": "Variables are named locations which are used to store references to the object stored in memory. The names we choose for variables and functions are commonly known as Identifiers. In python Identifiers must obey the following rules. All identifiers must start with letter or underscore ( _ ) , you\n can\u2019t use digits. For e.g my_var is valid identifier while 1digit \n is not. Identifiers can contain letters, digits and underscores ( _ ). They can be of any length. Identifier can\u2019t be a keyword (keywords are reserved words that\n Python uses for special purpose).Following are Keywords in python 3. and exec not as finally or assert for pass break from print class global raise continue if return def import try del in while elif is with else lambda yield except", - "title": "Datatype & Variables" + "title": "Variables and Assignment" }, { - "location": "/beginner/Datatype_And_Variables/#assigning-values-to-variables", + "location": "/beginner/Variables_And_Assignment/#assigning-values-to-variables", "text": "Values are basic things that programs works with. For e.g 1 , 11 , 3.14 , \"hello\" are all values. In programming terminology they are also commonly known as literals. Literals can be of different type for e.g 1 , 11 are of type int , 3.14 is float and \"hello\" is string . Remember in python everything is object even basic data types like int, float, string, we will elaborate more on this in later chapters. In python you don\u2019t need to declare types of variable ahead of time. Interpreter automatically detects the type of the variable by the data it contains. To assign value to a variable equal sign ( = ) is used. = is also known as assignment operator. Following are some examples of variable declaration: x = 100 # x is integer pi = 3.14 # pi is float empname = python is great # empname is string a = b = c = 100 # this statement assign 100 to c, b and a. Note: \nIn the above code x stores reference to the 100 ( which is an int object ) , x don\u2019t store 100 itself. In Python comments are preceded by a pound sign ( # ). Comments are not programming statements that python interpreter executes while running the program. Comments are used by programmers to remind themselves how the program works. They are also used to write program documentation. #display hello world print ( hello world )", "title": "Assigning Values to Variables" }, { - "location": "/beginner/Datatype_And_Variables/#simultaneous-assignments", + "location": "/beginner/Variables_And_Assignment/#simultaneous-assignments", "text": "Python allow simultaneous assignment syntax like this: var1 , var2 , ... , varn = exp1 , exp2 , ... , expn this statements tells the python to evaluate all the expression on the right and assign them to the corresponding variables on the left. Simultaneous Assignments is helpful to swap values of two variables. For e.g x = 1 y = 2 y , x = x , y # assign y value to x and x value to y", "title": "Simultaneous Assignments" }, { - "location": "/beginner/Datatype_And_Variables/#python-data-types", + "location": "/beginner/Variables_And_Assignment/#python-data-types", "text": "Python has 5 standard data types namely. \na) Numbers \nb) String \nc) List \nd) Tuple \ne) Dictionary \nf) Boolean \u2013 In Python True and False are boolean literals. But the following values are also considered as false. [] \u2013 empty list , () \u2013 empty tuple , {} \u2013 empty dictionary", "title": "Python Data Types" }, { - "location": "/beginner/Datatype_And_Variables/#receiving-input-from-console", + "location": "/beginner/Variables_And_Assignment/#receiving-input-from-console", "text": "input() function is used to receive input from the console. Syntax: input([prompt]) - string input() function accepts an optional string argument called prompt and returns a string. name = input ( Enter your name: ) Enter your name : tim name tim Note that input() returns string even if you enter a number, to convert it to an integer you can use int() or eval() . age = int ( input ( Enter your age: )) Enter your age : 22 age 22 type ( age ) class int Source: http://thepythonguru.com", "title": "Receiving input from Console" }, { - "location": "/beginner/Datatype_And_Variables/#understanding-python-variables-and-memory-management", + "location": "/beginner/Variables_And_Assignment/#understanding-python-variables-and-memory-management", "text": "Have you ever noticed any difference between variables in Python and C? For example, when you do an assignment like the following in C, it actually creates a block of memory space so that it can hold the value for that variable int a = 1 ; You can think of it as putting the value assigned in a box with the variable name as shown below. And for all the variables you create a new box is created with the variable name to hold the value. If you change the value of the variable the box will be updated with the new value. That means doing a = 2 ; will result in Assigning one variable to another makes a copy of the value and put that value in the new box. int b = a ; But in Python variables work more like tags unlike the boxes you have seen before. When you do an assignment in Python, it tags the value with the variable name. a = 1 and if you change the value of the varaible, it just changes the tag to the new value in memory. You dont need to do the housekeeping job of freeing the memory here. Python's Automatic Garbage Collection does it for you. When a value is without names/tags it is automatically removed from memory. a = 2 Assigning one variable to another makes a new tag bound to the same value as show below. b = a \nOther languages have 'variables'. Python has 'names'.", "title": "Understanding Python variables and Memory Management" }, { - "location": "/beginner/Datatype_And_Variables/#a-bit-about-pythons-memory-management", + "location": "/beginner/Variables_And_Assignment/#a-bit-about-pythons-memory-management", "text": "As you have seen before, a value will have only one copy in memory and all the variables having this value will refer to this memory location. For example when you have variables a, b, c having a value 10, it doesn't mean that there will be 3 copy of 10s in memory. There will be only one 10 and all the variables a, b, c will point to this value. Once a variable is updated, say you are doing a += 1 a new value 11 will be allocated in memory and a will be pointing to this. Let's check this behaviour with Python Interpreter. Start the Python Shell and try the following for yourselves. a = 10 b = 10 c = 10 id ( a ), id ( b ), id ( c ) ( 140621897573616 , 140621897573616 , 140621897573616 ) a += 1 id ( a ) 140621897573592 id() will return an objects memory address (object's identity). As you have noticed, when you assign the same integer value to the variables, we see the same ids. But this assumption does not hold true all the time. See the following for example x = 500 y = 500 id ( x ) 4338740848 id ( y ) 4338741040 What happened here? Even after assigning the same integer values to different variable names, we are getting two different ids here. These are actually the effects of CPython optimization we are observing here. CPython implementation keeps an array of integer objects for all integers between -5 and 256. So when we create an integer in that range, they simply back reference to the existing object. You may refer the following links for more information. Let's take a look at strings now. s1 = hello s2 = hello id ( s1 ), id ( s2 ) ( 4454725888 , 4454725888 ) s1 == s2 True s1 is s2 True s3 = hello, world! s4 = hello, world! id ( s3 ), id ( s4 ) ( 4454721608 , 4454721664 ) s3 == s4 True s3 is s4 False Looks interesting, isn't it? When the string was a simple and shorter one the variable names where referring to the same object in memory. But when they became bigger, this was not the case. This is called interning, and Python does interning (to some extent) of shorter string literals (as in s1 and s2) which are created at compile time. But in general, Python string literals creates a new string object each time (as in s3 and s4). Interning is runtime dependant and is always a trade-off between memory use and the cost of checking if you are creating the same string. There's a built-in intern() function to forcefully apply interning. Read more about interning from the following links. Stack Overflow: Does Python intern Strings? Stack Overflow: Python String Interning Internals of Python String Interning Source: http://foobarnbaz.com/2012/07/08/understanding-python-variables/", "title": "A bit about Python's memory management" }, { - "location": "/beginner/Datatype_And_Variables/#assignment-statements-in-python-are-more-interesting-than-you-might-think", + "location": "/beginner/Variables_And_Assignment/#assignment-statements-in-python-are-more-interesting-than-you-might-think", "text": "In this article, we will take a deep look at three kinds of assignment statements in Python and discuss what\u2019s going on under the hood. my_string = Hello World # right hand side is a simple expression another_string = my_string # right hand side is another variable another_string = another_string + ! # right hand side is an operation What we find may surprise you. What happens when the right hand side is a simple expression? my_string = Hello World In simple terms, this creates a string \u201cHello World\u201d in memory and assigns the name my_string to it. If you are using CPython[1], then we can even check the memory address explicitly by using the built in function id . my_string = \u201c Hello World \u201d id ( my_string ) 140400709562064 That big number 140400709562064 denotes where the data lives in the memory. It will be very useful for us in this entire discussion.\nWhat happens if we create another string with the same value? another_string = \u201c Hello World \u201d Does it reuse the previous \u201cHello World\u201d stored in memory or does it create an independent copy? Let\u2019s check this by querying the id function again. id ( another_string ) 140400709562208 This outputs a different id, so this must be an independent copy. We conclude that: Note: \nAssignment statements where the right hand side is a simple expression creates independent copies every time. While for everyday programming, this is the rule we should remember, there are actually some weird exceptions to this rule. Here\u2019s an example. my_string = \u201c hello \u201d id ( my_string ) 140400709562016 another_string = \u201c hello \u201d id ( another_string ) 140400709562016 In this case, two consecutive assignment statements did not create independent copies. Why?\nIt gets interesting now.\nFor optimizing memory, Python treats a special set of objects differently. The string \u201chello\u201d belongs to this privileged set and has a different behavior. The exact set depends on the implementation like CPython, PyPy, Jython or IronPython. For CPython, the special rule applies to: Strings without whitespaces and less than 20 characters and Integers from -5 to +255. These objects are always reused or interned. The rationale behind doing this is as follows: Since programmers use these objects frequently, interning existing\n objects saves memory. Since immutable objects like tuples and strings cannot be modified,\n there is no risk in interning the same object. However, Python does not do this for all immutable objects because there is a runtime cost involved for this feature. For interning an object, it must first search for the object in memory, and searching takes time. This is why the special treatment only applies for small integers and strings, because finding them is not that costly. What happens when the right hand side is an existing Python variable? \nLet\u2019s move on to the second type of assignment statement where the right hand side is an existing Python variable. another_string = my_string In this case, nothing is created in memory. After the assignment, both variables refer to the already existing object. It\u2019s basically like giving the object an additional nickname or alias. Let\u2019s confirm this by using the id function. my_string = \u201c Hello World \u201d id ( my_string ) 140400709562160 another_string = my_string id ( another_string ) 140400709562160 The natural question at this stage is : what if, instead of just giving the existing object an alias, we wanted to create an independent copy?\nFor mutable objects, this is possible. You can either use the copy module of Python (which works on all objects) or you may use copy methods specific to the class. For a list, you have several possibilities for creating copies, all of which have different runtime. my_list = [ 1 , 2 , 3 ] copy_of_my_list = my_list . copy () # fastest, works only on latest Python versions copy_of_my_list = my_list [:] # same runtime as List.copy() copy_of_my_list = list ( my_list ) # slightly slower import copy copy_of_my_list = copy . copy ( my_list ) # slowest How can you copy an immutable object? Well\u2026you can\u2019t! At least not in a straightforward way. If you try to use the copy module or the slicing notation, you will get back the same object and not an independent copy. Here\u2019s proof. # Standard ways of copying lists do not apply for tuples my_tuple = ( 1 , 2 , 3 ) id ( my_tuple ) 140371873244816 another_tuple = my_tuple [:] id ( another_tuple ) 140371873244816 # The copy module also doesn\u2019t help import copy another_tuple = copy . copy ( my_tuple ) id ( another_tuple ) 140371873244816 More importantly, there is no reason for explicitly copying an immutable object anyway. We will see why in a moment when we discuss the third kind of assignment statement. What happpens when the right hand side is an operation? In this case, what happens depends on the result of the operation. We will discuss two simple cases: adding an element to an immutable object (like a tuple) and adding an element to a mutable object (like a list). Let\u2019s start with the case of the tuple. another_tuple += ( 4 ,) When you add a new element to a tuple using another_tuple += (4,), this creates a new object in memory. The immutability of tuples is key to understanding this. Since tuples are immutable, any operation that leads to a changed tuple would result in an independent copy.\nThis is the reason why you don\u2019t need to explicitly copy immutable objects : it happens automatically under the hood. Here\u2019s an example. my_tuple = ( 1 , 2 , 3 ) another_tuple = my_tuple # both variables point to the same object another_tuple += ( 4 ,) # this statement creates a new independent object print ( another_tuple ) ( 1 , 2 , 3 , 4 ) print ( my_tuple ) # the old one remains unharmed ( 1 , 2 , 3 ) The situation is much different for mutable objects and much more confusing. Let\u2019s try the same example, but now for lists. my_list = [ 1 , 2 , 3 ] another_list = my_list # both variables point to the same object another_list += [ 4 ,] # this statement modifies the object in place print ( another_list ) [ 1 , 2 , 3 , 4 ] print ( my_list ) # the original list is modified [ 1 , 2 , 3 , 4 ] Mutable objects can be modified in place. Some operations modify the list in place and some operations don\u2019t. In this case, the statement another_list += [4,] calls another_list. iadd ([4,]) and iadd modifies the existing object in place.\nTo make things doubly confusing, we would have completely different results if we used a slightly different notation. my_list = [ 1 , 2 , 3 ] another_list = my_list # both variables point to the same object another_list = another_list + [ 4 ,] # this creates an independent copy print ( another_list ) [ 1 , 2 , 3 , 4 ] print ( my_list ) # the original list is unharmed [ 1 , 2 , 3 ] Woah! What\u2019s going on? What changed?\nIt turns out that when we change the third line, Python now internally calls a different function another_list. add ([4,]) instead of iadd . This function returns a new copy instead of modifying the list in place.\nTo prevent this confusion, it is always better to create a true copy of the list if you wish to prevent modification to the original.\nLet\u2019s remember the list copy methods from before. They were List.copy(), [:], list() and copy.copy(). This is what we should use. my_list = [ 1 , 2 , 3 ] another_list = my_list . copy () # this creates an independent copy another_list += [ 4 ,] # this statement modifies the independent copy print ( another_list ) [ 1 , 2 , 3 , 4 ] print ( my_list ) # the original list is unharmed [ 1 , 2 , 3 ] There\u2019s one last gotcha that can happen when copying lists.\nSuppose we have a list that has a nested list inside it. We copy this list using List.copy() and then modify the nested list. Unfortunately, this will modify the original list again! my_list = [[ 1 , 2 , 3 ], 4 , 5 ] another_list = my_list . copy () another_list [ 0 ] += [ 6 ,] print ( another_list ) [[ 1 , 2 , 3 , 6 ], 4 , 5 ] print ( my_list ) [[ 1 , 2 , 3 , 6 ], 4 , 5 ] Why did that happen? Didn\u2019t we just copy the original list?\nThe truth is : we actually don\u2019t have a completely independent copy in this case. The copy() function generates a shallow copy. To see what it does, let\u2019s look at the ids of all the elements in my_list and the ids of all the elements in the copied list. # for my_list my_list = [[ 1 , 2 , 3 ], 4 , 5 ] id ( my_list ) 140371873277424 print ([ id ( x ) for x in my_list ]) [ 140371873599288 , 13820176 , 13820152 ] # for another_list obtained by my_list.copy() id ( another_list ) 140371873317016 print ([ id ( x ) for x in another_list ]) [ 140371873599288 , 13820176 , 13820152 ] We see the ids of my_list and another_list are indeed different, indicating another_list is a copy. But the ids of the elements contained in another_list have the same ids as the elements in my_list . So the elements have not been copied!\nThis is the property of shallow copy. It creates a new copy of the object but reuses the attributes and elements of the old copy. Thus, when you modify the elements of the new copy, you are modifying the elements of the old copy too.\nTo solve this problem, we need to copy an object along with all its attributes and elements. This can be achieved by copy.deepcopy. my_list = [[ 1 , 2 , 3 ], 4 , 5 ] another_list = copy . deepcopy ( my_list ) another_list [ 0 ] += [ 6 ,] another_list [[ 1 , 2 , 3 , 6 ], 4 , 5 ] my_list [[ 1 , 2 , 3 ], 4 , 5 ] Deep copy is a quite time intensive operation and can take 1o times longer to complete compared to a shallow copy. But in some situations, it is unavoidable.", "title": "Assignment statements in Python are more interesting than you might think" }, { - "location": "/beginner/Datatype_And_Variables/#conclusion", + "location": "/beginner/Variables_And_Assignment/#conclusion", "text": "This brings me to the end of this discussion. To summarize, we have talked about the different scenarios which can arise in an assignment statement in Python. We found that: When the right hand side is a simple expression, a new copy is\n created every time. There are some exceptions to this rule, which\n depend on the implementation When the right hand side is an existing Python variable, then an\n alias is created for the existing copy. When the right hand side is an operation, then the outcome depends on\n the operation. In a simple case involving a tuple, we saw that an\n independent copy was created. In the same case with lists, we saw\n that the list was modified in place in one case (when we used\n iadd ) and a new copy was generated in another case (when we used add ). List item Mutable objects can be copied but immutable objects cannot be copied\n in a straightforward way. There is also no need to copy immutable\n objects. To copy a mutable object along with all its attributes and elements,\n we need to use deep copy. Source: https://medium.com/broken-window/many-names-one-memory-address-122f78734cb6", "title": "Conclusion" }, diff --git a/site/sitemap.xml b/site/sitemap.xml index 88abe9f..4a234c9 100644 --- a/site/sitemap.xml +++ b/site/sitemap.xml @@ -36,7 +36,7 @@ - /beginner/Datatype_And_Variables/ + /beginner/Variables_And_Assignment/ 2017-08-26 daily From cdaa5af263076b13bc835c6e204eb84b92393432 Mon Sep 17 00:00:00 2001 From: ent1c3d Date: Mon, 28 Aug 2017 21:06:26 +0400 Subject: [PATCH 24/39] added bibliography into readme --- README.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e1ddfcf..33dde06 100644 --- a/README.md +++ b/README.md @@ -28,4 +28,28 @@ So, You can start study from here: - Advanced - ... - [Python Metaclasses](https://ent1c3d.github.io/Python-Synopsis/site/advanced/Python_Metaclasses) - - ... \ No newline at end of file + - ... + + +### Bibliography +- Books : + - **How To Code in Python 3** by Lisa Tagliaferri + - **Dive into Python 3** by Mark Pilgrim + - **Learning Python, Fourth Edition** by Mark Lutz + - **Think Python** by Allen B. Downey + - **Learn Python The Hard Way** by Zed A. Shaw + - **Python In A Nutshell, Second Edition** by Alex Martelli + - **Bioinformatics Programming Using Python** by Mitchell L Model + - **Python 3 Object-oriented Programming, Second Edition** by Dusty Phillips +- Sites: + - **https://www.tutorialspoint.com/python3/** + - **https://stackoverflow.com/** + - **https://en.wikiversity.org/** + - **http://pythoncentral.io** + - **http://thepythonguru.com** + - **https://code.tutsplus.com** +- Articles : + - **Assignment statements in Python are more interesting than you might think** by Dibya Chakravorty + - **Understanding Python variables and Memory Management** by Sreejith Kesavan + - **Quick Tip: What Is a Metaclass in Python?** by Abder-Rahman Ali + - **Understanding Python metaclasses** by Ionel Cristian Mărieș \ No newline at end of file From 94f70bc403581ff78266cec22162c696cace6792 Mon Sep 17 00:00:00 2001 From: Goga Patarkatsishvili Date: Tue, 29 Aug 2017 17:04:59 +0400 Subject: [PATCH 25/39] answers about python slots --- docs/questions/questions.md | 93 ++++++++++++++++++++++++++++++++++++- 1 file changed, 91 insertions(+), 2 deletions(-) diff --git a/docs/questions/questions.md b/docs/questions/questions.md index ea90434..1ea694d 100644 --- a/docs/questions/questions.md +++ b/docs/questions/questions.md @@ -49,6 +49,95 @@ These points should also be considered when writing __str__ or __repr__ for your > **Source:** > :fa-link: http://brennerm.github.io/posts/python-str-vs-repr.html -answers from stackoverflow : +### answers from stackoverflow : https://stackoverflow.com/questions/1436703/difference-between-str-and-repr-in-python -https://stackoverflow.com/questions/18393701/the-difference-between-str-and-repr \ No newline at end of file +https://stackoverflow.com/questions/18393701/the-difference-between-str-and-repr + + +## What is a Slot? +A slot is nothing more than a memory management nicety: when you define __slots__ on a class, you’re telling the Python interpreter that the list of attributes described within are the only attributes this class will ever need, and a dynamic dictionary is not needed to manage the references to other objects within the class. This can save enormous amounts of space if you have thousands or millions of objects in memory. +For example, if you define: +```python +class Foo: + __slots__ = ['x'] + def __init__(self, n): + self.x = n + +y = Foo(1) +print y.x # prints "1" +y.x = 2 +print y.x # prints "2" +y.z = 4 # Throws exception. +print y.z +``` +Without the __slots__ definition, that last assignment would have worked. Without any other magic (say, overrides of getattr or setattr), you can always assign attributes to an object. But with a __slots__ definition, you can’t: python hasn’t allocated a dictionary for the object, so you’re stuck with what you’ve got and nothing more. +Slots should only be used as a memory optimization tool; using it to constrain attribute management is silly, and breaks important features like static serialization. + +> **Source:** +> :fa-link: http://www.elfsternberg.com/2009/07/06/python-what-the-hell-is-a-slot/ + +### Avoiding Dynamically Created Attributes +The attributes of objects are stored in a dictionary "__dict__". Like any other dictionary, a dictionary used for attribute storage doesn't have a fixed number of elements. In other words, you can add elements to dictionaries after they have been defined, as we have seen in our chapter on dictionaries. This is the reason, why you can dynamically add attributes to objects of classes that we have created so far: +```python +>>> class A(object): +... pass +... +>>> a = A() +>>> a.x = 66 +>>> a.y = "dynamically created attribute" +``` +The dictionary containing the attributes of "a" can be accessed like this: +```python +>>> a.__dict__ +{'y': 'dynamically created attribute', 'x': 66} +``` +You might have wondered that you can dynamically add attributes to the classes, we have defined so far, but that you can't do this with built-in classes like 'int', or 'list': +```python +>>> x = 42 +>>> x.a = "not possible to do it" +Traceback (most recent call last): + File "", line 1, in +AttributeError: 'int' object has no attribute 'a' +>>> +>>> lst = [34, 999, 1001] +>>> lst.a = "forget it" +Traceback (most recent call last): + File "", line 1, in +AttributeError: 'list' object has no attribute 'a' +``` + +Using a dictionary for attribute storage is very convenient, but it can mean a waste of space for objects, which have only a small amount of instance variables. The space consumption can become critical when creating large numbers of instances. Slots are a nice way to work around this space consumption problem. Instead of having a dynamic dict that allows adding attributes to objects dynamically, slots provide a static structure which prohibits additions after the creation of an instance. + +When we design a class, we can use slots to prevent the dynamic creation of attributes. To define slots, you have to define a list with the name __slots__. The list has to contain all the attributes, you want to use. We demonstrate this in the following class, in which the slots list contains only the name for an attribute "val". + +```python +class S(object): + + __slots__ = ['val'] + + def __init__(self, v): + self.val = v + + +x = S(42) +print(x.val) + +x.new = "not possible" +``` + +If we start this program, we can see, that it is not possible to create dynamically a new attribute. We fail to create an attribute "new": +```python +42 +Traceback (most recent call last): + File "slots_ex.py", line 12, in + x.new = "not possible" +AttributeError: 'S' object has no attribute 'new' +``` + +We mentioned in the beginning that slots are preventing a waste of space with objects. Since Python 3.3 this advantage is not as impressive any more. With Python 3.3 Key-Sharing Dictionaries are used for the storage of objects. The attributes of the instances are capable of sharing part of their internal storage between each other, i.e. the part which stores the keys and their corresponding hashes. This helps to reduce the memory consumption of programs, which create many instances of non-builtin types. + +> **Source:** +> :fa-link: http://www.python-course.eu/python3_slots.php + +### answers from stackoverflow : +https://stackoverflow.com/questions/472000/usage-of-slots \ No newline at end of file From 037277e8c964739782d8be502bc02825fb5d0569 Mon Sep 17 00:00:00 2001 From: Goga Patarkatsishvili Date: Fri, 1 Sep 2017 18:11:35 +0400 Subject: [PATCH 26/39] python name mangling --- docs/questions/questions.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/questions/questions.md b/docs/questions/questions.md index 1ea694d..df27730 100644 --- a/docs/questions/questions.md +++ b/docs/questions/questions.md @@ -140,4 +140,9 @@ We mentioned in the beginning that slots are preventing a waste of space with ob > :fa-link: http://www.python-course.eu/python3_slots.php ### answers from stackoverflow : -https://stackoverflow.com/questions/472000/usage-of-slots \ No newline at end of file +https://stackoverflow.com/questions/472000/usage-of-slots + +## what means name mangling in python +http://radek.io/2011/07/21/private-protected-and-public-in-python/ +### answers from stackoverflow : +https://stackoverflow.com/questions/7456807/python-name-mangling \ No newline at end of file From ae17d89065ce0d4152ee6a9fe09d95ee30f5540a Mon Sep 17 00:00:00 2001 From: Goga Patarkatsishvili Date: Wed, 6 Sep 2017 17:59:18 +0400 Subject: [PATCH 27/39] new topic about functions --- docs/beginner/Functions.md | 817 +++++++++++++++++++++++++++++++++ docs/images/stack-diagrams.PNG | Bin 0 -> 14250 bytes docs/questions/questions.md | 14 +- 3 files changed, 830 insertions(+), 1 deletion(-) create mode 100644 docs/beginner/Functions.md create mode 100644 docs/images/stack-diagrams.PNG diff --git a/docs/beginner/Functions.md b/docs/beginner/Functions.md new file mode 100644 index 0000000..3e27618 --- /dev/null +++ b/docs/beginner/Functions.md @@ -0,0 +1,817 @@ +## Function Calls + +In the context of programming, a function is a named sequence of statements that +performs a computation. When you define a function, you specify the name and the +sequence of statements. Later, you can “call” the function by name. We have already seen +one example of a function call: + +```python +>>> type(32) + +``` + +The name of the function is type. The expression in parentheses is called the argument +of the function. The result, for this function, is the type of the argument. +It is common to say that a function “takes” an argument and “returns” a result. The result +is called the return value. + + +### Type Conversion Functions + +Python provides built-in functions that convert values from one type to another. The +int function takes any value and converts it to an integer, if it can, or complains +otherwise: + +```python +>>> int('32') +32 +>>> int('Hello') +ValueError: invalid literal for int(): Hello +``` + +int can convert floating-point values to integers, but it doesn’t round off; it chops off +the fraction part: + +```python +>>> int(3.99999) +3 +>>> int(-2.3) +-2 +``` + +float converts integers and strings to floating-point numbers: + + +```python +>>> float(32) +32.0 +>>> float('3.14159') +3.14159 +``` + +Finally, str converts its argument to a string: + +```python +>>> str(32) +'32' +>>> str(3.14159) +'3.14159' +``` + +### Adding New Functions + +So far, we have only been using the functions that come with Python, but it is also possible +to add new functions. A function definition specifies the name of a new function and +the sequence of statements that execute when the function is called. +Here is an example: + +```python +def print_lyrics(): + print "I'm a lumberjack, and I'm okay." + print "I sleep all night and I work all day." +``` + + +`def` is a keyword that indicates that this is a function definition. The name of the function +is print_lyrics. The rules for function names are the same as for variable names: letters, +numbers and some punctuation marks are legal, but the first character can’t be a number. +You can’t use a keyword as the name of a function, and you should avoid having a variable +and a function with the same name. +The empty parentheses after the name indicate that this function doesn’t take any +arguments. +The first line of the function definition is called the header; the rest is called the body. +The header has to end with a colon and the body has to be indented. By convention, the +indentation is always four spaces; see “Debugging” (page 33). The body can contain any +number of statements. +The strings in the print statements are enclosed in double quotes. Single quotes and +double quotes do the same thing; most people use single quotes except in cases like this +where a single quote (which is also an apostrophe) appears in the string. +If you type a function definition in interactive mode, the interpreter prints ellipses (...) +to let you know that the definition isn’t complete: + + +```python +def print_lyrics(): + print "I'm a lumberjack, and I'm okay." + print "I sleep all night and I work all day." +``` +To end the function, you have to enter an empty line (this is not necessary in a script). +Defining a function creates a variable with the same name. + +```python +>>> print print_lyrics + +>>> type(print_lyrics) + +``` +The value of print_lyrics is a function object, which has type 'function'. +The syntax for calling the new function is the same as for built-in functions: +```python +>>> print_lyrics() +I'm a lumberjack, and I'm okay. +I sleep all night and I work all day. +``` + +Once you have defined a function, you can use it inside another function. For example, +to repeat the previous refrain, we could write a function called repeat_lyrics: +```python +def repeat_lyrics(): + print_lyrics() + print_lyrics() +``` +And then call repeat_lyrics: +```python +>>> repeat_lyrics() +I'm a lumberjack, and I'm okay. +I sleep all night and I work all day. +I'm a lumberjack, and I'm okay. +I sleep all night and I work all day. +``` +But that’s not really how the song goes. + +### Definitions and Uses +Pulling together the code fragments from the previous section, the whole program looks +like this: +```python +def print_lyrics(): + print "I'm a lumberjack, and I'm okay." + print "I sleep all night and I work all day." +def repeat_lyrics(): + print_lyrics() + print_lyrics() + +repeat_lyrics() +``` + +This program contains two function definitions: print_lyrics and repeat_lyrics. +Function definitions get executed just like other statements, but the result creates func +tion objects. The statements inside the function do not get executed until the function +is called, and the function definition generates no output. +As you might expect, you have to create a function before you can execute it. In other +words, the function definition has to be executed before the function is called the first +time. + + + +### Flow of Execution + +In order to ensure that a function is defined before its first use, you have to know the +order in which statements are executed, which is called the flow of execution. +Execution always begins at the first statement of the program. Statements are executed +one at a time, in order, from top to bottom. + + +Function definitions do not alter the flow of execution of the program, but remember +that statements inside the function are not executed until the function is called. +A function call is like a detour in the flow of execution. Instead of going to the next +statement, the flow jumps to the body of the function, executes all the statements there, +and then comes back to pick up where it left off. +That sounds simple enough, until you remember that one function can call another. +While in the middle of one function, the program might have to execute the statements +in another function. But while executing that new function, the program might have to +execute yet another function! +Fortunately, Python is good at keeping track of where it is, so each time a function +completes, the program picks up where it left off in the function that called it. When it +gets to the end of the program, it terminates. +What’s the moral of this sordid tale? When you read a program, you don’t always want +to read from top to bottom. Sometimes it makes more sense if you follow the flow of +execution. + +### Parameters and Arguments + +Some of the built-in functions we have seen require arguments. For example, when you +call math.sin you pass a number as an argument. Some functions take more than one +argument: `math.pow` takes two, the base and the exponent. +Inside the function, the arguments are assigned to variables called parameters. Here is +an example of a user-defined function that takes an argument: + +```python + def print_twice(bruce): + print bruce + print bruce +``` + +This function assigns the argument to a parameter named bruce. When the function is +called, it prints the value of the parameter (whatever it is) twice. +This function works with any value that can be printed. + + +```python +>>> print_twice('Spam') +Spam +Spam +>>> print_twice(17) +17 +17 +>>> print_twice(math.pi) +3.14159265359 +3.14159265359 +``` + +The same rules of composition that apply to built-in functions also apply to user-defined +functions, so we can use any kind of expression as an argument for `print_twice`: + +```python +>>> print_twice('Spam '*4) +Spam Spam Spam Spam +Spam Spam Spam Spam +>>> print_twice(math.cos(math.pi)) +-1.0 +-1.0 +``` + +The argument is evaluated before the function is called, so in the examples the expres +sions 'Spam '*4 and math.cos(math.pi) are only evaluated once. +You can also use a variable as an argument: + + +```python +>>> michael = 'Eric, the half a bee.' +>>> print_twice(michael) +Eric, the half a bee. +Eric, the half a bee. +``` +The name of the variable we pass as an argument (michael) has nothing to do with the +name of the parameter (bruce). It doesn’t matter what the value was called back home +(in the caller); here in print_twice, we call everybody bruce. + + +### Variables and Parameters Are Local + +When you create a variable inside a function, it is local, which means that it only exists +inside the function. For example: + +```python +def cat_twice(part1, part2): + cat = part1 + part2 + print_twice(cat) +``` + +This function takes two arguments, concatenates them, and prints the result twice. Here +is an example that uses it: +```python +>>> line1 = 'Bing tiddle ' +>>> line2 = 'tiddle bang.' +>>> cat_twice(line1, line2) +Bing tiddle tiddle bang. +Bing tiddle tiddle bang. +``` +When cat_twice terminates, the variable cat is destroyed. If we try to print it, we get +an exception: +```python +>>> print cat +NameError: name 'cat' is not defined +``` +Parameters are also local. For example, outside print_twice, there is no such thing as +bruce. + +### Stack Diagrams +To keep track of which variables can be used where, it is sometimes useful to draw a +stack diagram. Like state diagrams, stack diagrams show the value of each variable, but +they also show the function each variable belongs to. +Each function is represented by a frame. A frame is a box with the name of a function +beside it and the parameters and variables of the function inside it. The stack diagram +for the previous example is shown in Figure 3-1. + +![ex1.py.](../images/stack-diagrams.PNG) + +The frames are arranged in a stack that indicates which function called which, and so +on. In this example, print_twice was called by cat_twice, and cat_twice was called +by `\__main\__`, which is a special name for the topmost frame. When you create a variable +outside of any function, it belongs to `\__main\__`. + + + +Each parameter refers to the same value as its corresponding argument. So, part1 has +the same value as line1, part2 has the same value as line2, and bruce has the same +value as cat. +If an error occurs during a function call, Python prints the name of the function, and +the name of the function that called it, and the name of the function that called that, all +the way back to `\__main__\`. + +For example, if you try to access cat from within print_twice, you get a NameError: + +```python +Traceback (innermost last): + File "test.py", line 13, in __main__ + cat_twice(line1, line2) + File "test.py", line 5, in cat_twice + print_twice(cat) + File "test.py", line 9, in print_twice + print cat + NameError: name 'cat' is not defined +``` + +This list of functions is called a traceback. It tells you what program file the error oc +curred in, and what line, and what functions were executing at the time. It also shows +the line of code that caused the error. +The order of the functions in the traceback is the same as the order of the frames in the +stack diagram. The function that is currently running is listed at the bottom. + +### Fruitful Functions and Void Functions +Some of the functions we are using, such as the math functions, yield results; for lack of +a better name, I call them fruitful functions. Other functions, like print_twice, per +form an action but don’t return a value. They are called void functions. +When you call a fruitful function, you almost always want to do something with the +result; for example, you might assign it to a variable or use it as part of an expression: +```python +x = math.cos(radians) +golden = (math.sqrt(5) + 1) / 2 +``` +When you call a function in interactive mode, Python displays the result: +```python +>>> math.sqrt(5) +2.2360679774997898 +``` +But in a script, if you call a fruitful function all by itself, the return value is lost forever! +```python +math.sqrt(5) +``` + +This script computes the square root of 5, but since it doesn’t store or display the result, +it is not very useful. +Void functions might display something on the screen or have some other effect, but +they don’t have a return value. If you try to assign the result to a variable, you get a special +value called None. + +```python +>>> result = print_twice('Bing') +Bing +Bing +>>> print result +None +``` +The value None is not the same as the string 'None'. It is a special value that has its own +type: + + +```python +>>> print type(None) + +``` + +The functions we have written so far are all void. We will start writing fruitful functions +in a few chapters. + + +### Why Functions? + +It may not be clear why it is worth the trouble to divide a program into functions. There +are several reasons: +- Creating a new function gives you an opportunity to name a group of statements, +which makes your program easier to read and debug. +- Functions can make a program smaller by eliminating repetitive code. Later, if you +make a change, you only have to make it in one place. +- Dividing a long program into functions allows you to debug the parts one at a time +and then assemble them into a working whole. +- Well-designed functions are often useful for many programs. Once you write and +debug one, you can reuse it. + +> **Source:** +> :fa-book: **Think Python** by Allen B. Downey - 2012 + +## Functions by by Mark Lutz (Learning Python, Fourth Edition) + +### Function Basics + + +In Part III, we looked at basic procedural statements in Python. Here, we’ll move on to +explore a set of additional statements that we can use to create functions of our own. +In simple terms, a function is a device that groups a set of statements so they can be run +more than once in a program. Functions also can compute a result value and let us +specify parameters that serve as function inputs, which may differ each time the code +is run. Coding an operation as a function makes it a generally useful tool, which we +can use in a variety of contexts. +More fundamentally, functions are the alternative to programming by cutting and +pasting—rather than having multiple redundant copies of an operation’s code, we can +factor it into a single function. In so doing, we reduce our future work radically: if the +operation must be changed later, we only have one copy to update, not many. +Functions are the most basic program structure Python provides for maximizing code +reuse and minimizing code redundancy. As we’ll see, functions are also a design tool +that lets us split complex systems into manageable parts. Table 16-1 summarizes the +primary function-related tools we’ll study in this part of the book. + + + Statement | Examples | +------|------| +**Calls** | **myfunc('spam', 'eggs', meat=ham)**| +**def, return**| def adder(a, b=1, *c): return a + b + c[0]| +**global**| def changer():global x; x = 'new' | +**nonlocal**| def changer():nonlocal x; x = 'new'| +**yield**| def squares(x):for i in range(x): yield i ** 2 | +**lambda**| funcs = [lambda x: x**2, lambda x: x*3] + + +### Why Use Functions? + +Before we get into the details, let’s establish a clear picture of what functions are all +about. Functions are a nearly universal program-structuring device. You may have +come across them before in other languages, where they may have been called subroutines +or procedures. As a brief introduction, functions serve two primary development +roles: + +**Maximizing code reuse and minimizing redundancy** +As in most programming languages, Python functions are the simplest way to +package logic you may wish to use in more than one place and more than one time. +Up until now, all the code we’ve been writing has run immediately. Functions allow +us to group and generalize code to be used arbitrarily many times later. Because +they allow us to code an operation in a single place and use it in many places, +Python functions are the most basic factoring tool in the language: they allow us +to reduce code redundancy in our programs, and thereby reduce maintenance +effort. + +**Procedural decomposition** +Functions also provide a tool for splitting systems into pieces that have well-defined +roles. For instance, to make a pizza from scratch, you would start by mixing the +dough, rolling it out, adding toppings, baking it, and so on. If you were programming +a pizza-making robot, functions would help you divide the overall “make +pizza” task into chunks—one function for each subtask in the process. It’s easier +to implement the smaller tasks in isolation than it is to implement the entire process +at once. In general, functions are about procedure—how to do something, rather +than what you’re doing it to. We’ll see why this distinction matters in Part VI, when +we start making new object with classes. + + +------- +In this part of the book, we’ll explore the tools used to code functions in Python: function +basics, scope rules, and argument passing, along with a few related concepts such +as generators and functional tools. Because its importance begins to become more apparent +at this level of coding, we’ll also revisit the notion of polymorphism introduced +earlier in the book. As you’ll see, functions don’t imply much new syntax, but they do +lead us to some bigger programming ideas. + + +### Coding Functions + +Although it wasn’t made very formal, we’ve already used some functions in earlier +chapters. For instance, to make a file object, we called the built-in open function; similarly, +we used the len built-in function to ask for the number of items in a collection +object. +In this chapter, we will explore how to write new functions in Python. Functions we +write behave the same way as the built-ins we’ve already seen: they are called in expressions, are passed values, and return results. But writing new functions requires +the application of a few additional ideas that haven’t yet been introduced. Moreover, +functions behave very differently in Python than they do in compiled languages like C. +Here is a brief introduction to the main concepts behind Python functions, all of which +we will study in this part of the book: + +- `def is executable code.` Python functions are written with a new statement, the +def. Unlike functions in compiled languages such as C, def is an executable statement— +your function does not exist until Python reaches and runs the def. In fact, +it’s legal (and even occasionally useful) to nest def statements inside if statements, +while loops, and even other defs. In typical operation, def statements are coded in +module files and are naturally run to generate functions when a module file is first +imported. +- `def creates an object and assigns it to a name.` When Python reaches and runs +a def statement, it generates a new function object and assigns it to the function’s +name. As with all assignments, the function name becomes a reference to the function +object. There’s nothing magic about the name of a function—as you’ll see, +the function object can be assigned to other names, stored in a list, and so on. +Function objects may also have arbitrary user-defined attributes attached to them +to record data. + +- `lambda creates an object but returns it as a result.` Functions may also be created +with the lambda expression, a feature that allows us to in-line function definitions +in places where a def statement won’t work syntactically + +- `return sends a result object back to the caller.` When a function is called, the +caller stops until the function finishes its work and returns control to the caller. +Functions that compute a value send it back to the caller with a return statement; +the returned value becomes the result of the function call. + +- `yield sends a result object back to the caller, but remembers where it left +off.` Functions known as generators may also use the yield statement to send back +a value and suspend their state such that they may be resumed later, to produce a +series of results over time. This is another advanced topic covered later in this part +of the book. + +- `global declares module-level variables that are to be assigned.` By default, all +names assigned in a function are local to that function and exist only while the +function runs. To assign a name in the enclosing module, functions need to list it +in a global statement. More generally, names are always looked up in scopes— +places where variables are stored—and assignments bind names to scopes. + +- `nonlocal declares enclosing function variables that are to be assigned.` Similarly, +the nonlocal statement added in Python 3.0 allows a function to assign a +name that exists in the scope of a syntactically enclosing def statement. This allows +enclosing functions to serve as a place to retain state—information remembered +when a function is called—without using shared global names. + +- `Arguments are passed by assignment (object reference).` In Python, arguments +are passed to functions by assignment (which, as we’ve learned, means by object +reference). As you’ll see, in Python’s model the caller and function share objects +by references, but there is no name aliasing. Changing an argument name within +a function does not also change the corresponding name in the caller, but changing +passed-in mutable objects can change objects shared by the caller. + +- `Arguments, return values, and variables are not declared.` As with everything +in Python, there are no type constraints on functions. In fact, nothing about a +function needs to be declared ahead of time: you can pass in arguments of any type, +return any kind of object, and so on. As one consequence, a single function can +often be applied to a variety of object types—any objects that sport a compatible +interface (methods and expressions) will do, regardless of their specific types. + + +If some of the preceding words didn’t sink in, don’t worry—we’ll explore all of these +concepts with real code in this part of the book. Let’s get started by expanding on some +of these ideas and looking at a few examples. + +### def Statements +The def statement creates a function object and assigns it to a name. Its general format +is as follows: +```python +def (arg1, arg2,... argN): + +``` + +As with all compound Python statements, def consists of a header line followed by a +block of statements, usually indented (or a simple statement after the colon). The +statement block becomes the function’s body—that is, the code Python executes each +time the function is called. +The def header line specifies a function name that is assigned the function object, along +with a list of zero or more arguments (sometimes called parameters) in parentheses. +The argument names in the header are assigned to the objects passed in parentheses at +the point of call. + + +Function bodies often contain a return statement: +```python +def (arg1, arg2,... argN): + ... + return +``` +The Python return statement can show up anywhere in a function body; it ends the +function call and sends a result back to the caller. The return statement consists of an +object expression that gives the function’s result. The return statement is optional; if +it’s not present, the function exits when the control flow falls off the end of the function +body. Technically, a function without a return statement returns the None object automatically, +but this return value is usually ignored. + +### def Executes at Runtime +The Python def is a true executable statement: when it runs, it creates a new function +object and assigns it to a name. (Remember, all we have in Python is runtime; there is +no such thing as a separate compile time.) Because it’s a statement, a def can appear +anywhere a statement can—even nested in other statements. For instance, although +defs normally are run when the module enclosing them is imported, it’s also completely +legal to nest a function def inside an if statement to select between alternative +definitions: + +```python +if test: + def func(): # Define func this way +... +else: + def func(): # Or else this way + ... + ... +func() # Call the version selected and built +``` + + +One way to understand this code is to realize that the def is much like an = statement: +it simply assigns a name at runtime. Unlike in compiled languages such as C, Python +functions do not need to be fully defined before the program runs. More generally, +defs are not evaluated until they are reached and run, and the code inside defs is not +evaluated until the functions are later called. +Because function definition happens at runtime, there’s nothing special about the +function name. What’s important is the object to which it refers: +```python +othername = func # Assign function object +othername() # Call func again +``` + +Here, the function was assigned to a different name and called through the new name. +Like everything else in Python, functions are just objects; they are recorded explicitly +in memory at program execution time. In fact, besides calls, functions allow arbitrary +attributes to be attached to record information for later use: + + +```python +def func(): ... # Create function object +func() # Call object +func.attr = value # Attach attributes +``` + +### A First Example: Definitions and Calls +Apart from such runtime concepts (which tend to seem most unique to programmers +with backgrounds in traditional compiled languages), Python functions are straightforward +to use. Let’s code a first real example to demonstrate the basics. As you’ll see, +there are two sides to the function picture: a definition (the def that creates a function) +and a call (an expression that tells Python to run the function’s body). + +#### Definition +Here’s a definition typed interactively that defines a function called times, which returns +the product of its two arguments: +```python +>>> def times(x, y): # Create and assign function +... return x * y # Body executed when called +... +``` +When Python reaches and runs this def, it creates a new function object that packages +the function’s code and assigns the object to the name times. Typically, such a statement +is coded in a module file and runs when the enclosing file is imported; for something +this small, though, the interactive prompt suffices. + +#### Calls +After the def has run, you can call (run) the function in your program by adding +parentheses after the function’s name. The parentheses may optionally contain one or +more object arguments, to be passed (assigned) to the names in the function’s header: +```python +>>> times(2, 4) # Arguments in parentheses +8 +``` +This expression passes two arguments to times. As mentioned previously, arguments +are passed by assignment, so in this case the name x in the function header is assigned +the value 2, y is assigned the value 4, and the function’s body is run. For this function, +the body is just a return statement that sends back the result as the value of the call +expression. The returned object was printed here interactively (as in most languages, +2 * 4 is 8 in Python), but if we needed to use it later we could instead assign it to a +variable. For example: + +```python +>>> x = times(3.14, 4) # Save the result object +>>> x +12.56 +``` +Now, watch what happens when the function is called a third time, with very different +kinds of objects passed in: + +```python +>>> times('Ni', 4) # Functions are "typeless" +'NiNiNiNi' +``` +This time, our function means something completely different (Monty Python reference +again intended). In this third call, a string and an integer are passed to x and y, instead +of two numbers. Recall that * works on both numbers and sequences; because we never +declare the types of variables, arguments, or return values in Python, we can use +times to either multiply numbers or repeat sequences. +In other words, what our times function means and does depends on what we pass into +it. This is a core idea in Python (and perhaps the key to using the language well), which +we’ll explore in the next section. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +> **Source:** +> :fa-book: **Learning Python, Fourth Edition** by Mark Lutz - 2009 + + +## Prefer Exceptions to Returning None + +When writing utility functions, there’s a draw for Python programmers to give special +meaning to the return value of None. It seems to makes sense in some cases. For example, +say you want a helper function that divides one number by another. In the case of dividing +by zero, returning None seems natural because the result is undefined. + +```python +def divide(a, b): + try: + return a / b + except ZeroDivisionError: + return None +``` +Code using this function can interpret the return value accordingly. +```python +result = divide(x, y) +if result is None: + print(‘Invalid inputs’) +``` +What happens when the numerator is zero? That will cause the return value to also be zero +(if the denominator is non-zero). This can cause problems when you evaluate the result in +a condition like an if statement. You may accidentally look for any False equivalent +value to indicate errors instead of only looking for None. + +```python +x, y = 0, 5 +result = divide(x, y) +if not result: + print(‘Invalid inputs’) # This is wrong! +``` + +This is a common mistake in Python code when None has special meaning. This is why +returning None from a function is error prone. There are two ways to reduce the chance of +such errors. + +The first way is to split the return value into a two-tuple. The first part of the tuple +indicates that the operation was a success or failure. The second part is the actual result +that was computed. + +```python +def divide(a, b): + try: + return True, a / b + except ZeroDivisionError: + return False, None +``` +Callers of this function have to unpack the tuple. That forces them to consider the status +part of the tuple instead of just looking at the result of division. + +```python +success, result = divide(x, y) +if not success: + print(‘Invalid inputs’) +``` + +The problem is that callers can easily ignore the first part of the tuple (using the +underscore variable name, a Python convention for unused variables). The resulting code +doesn’t look wrong at first glance. This is as bad as just returning None. + +```python +_, result = divide(x, y) +if not result: + print(‘Invalid inputs’) +``` +The second, better way to reduce these errors is to never return None at all. Instead, raise +an exception up to the caller and make them deal with it. Here, I turn a +ZeroDivisionError into a ValueError to indicate to the caller that the input +values are bad: + +```python +def divide(a, b): + try: + return a / b + except ZeroDivisionError as e: + raise ValueError(‘Invalid inputs’) from e +``` +Now the caller should handle the exception for the invalid input case. +The caller no longer requires a condition on the return value of the function. If the +function didn’t raise an exception, then the return value must be good. The outcome of +exception handling is clear. + +```python +x, y = 5, 2 +try: + result = divide(x, y) +except ValueError: + print(‘Invalid inputs’) +else: + print(‘Result is %.1f’ % result) +>>> +Result is 2.5 +``` + +### Things to Remember + +- Functions that return None to indicate special meaning are error prone because +None and other values (e.g., zero, the empty string) all evaluate to False in +conditional expressions. +- Raise exceptions to indicate special situations instead of returning None. Expect the +calling code to handle exceptions properly when they’re documented. + +> **Source:** +> :fa-book: **Effective Python** by Brett Slatkin \ No newline at end of file diff --git a/docs/images/stack-diagrams.PNG b/docs/images/stack-diagrams.PNG new file mode 100644 index 0000000000000000000000000000000000000000..f0b1a8b1267576565c50a55b0a8222901f700c2c GIT binary patch literal 14250 zcmd6u2|Seh`}aGiQ_(_HO16-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>%7bqJIY+#iY2OvkK4gA zW-s#Ijo%?UBQBn6QlHAPO-(}^0+z>3PrA*8BCJ?(-}s#jrsTY$)3geT$rNdG4s3Jn zhxY6qf_eDo_o120c|N53?15ICL4)|fB4oFQKQDrX(6B@G`Xz*&_X1A)o+DnTx3$cDCAr?M>H0o$p_?wBn@vN!f%jUb+ z0sBG-bEll5qH2Ssb0%gyyuO{~Ydt=zY z>UD2E3(cIpw9Q@0@{{dryi){b^ literal 0 HcmV?d00001 diff --git a/docs/questions/questions.md b/docs/questions/questions.md index df27730..42f81a9 100644 --- a/docs/questions/questions.md +++ b/docs/questions/questions.md @@ -145,4 +145,16 @@ https://stackoverflow.com/questions/472000/usage-of-slots ## what means name mangling in python http://radek.io/2011/07/21/private-protected-and-public-in-python/ ### answers from stackoverflow : -https://stackoverflow.com/questions/7456807/python-name-mangling \ No newline at end of file +https://stackoverflow.com/questions/7456807/python-name-mangling + + +## Python - dir() - how can I differentiate between functions/method and simple attributes? + +To show a list of the defined names in a module, for example the math module, and their types you could do: +```python +[(name,type(getattr(math,name))) for name in dir(math)] +``` +getattr(math,name) returns the object (function, or otherwise) from the math module, named by the value of the string in the variable "name". For example type(getattr(math,'pi')) is 'float' + +> **Source:** +> :fa-link: https://stackoverflow.com/questions/26818007/python-dir-how-can-i-differentiate-between-functions-method-and-simple-att \ No newline at end of file From b2983a7adc8c8af97c03a7da2f3e21e80b373104 Mon Sep 17 00:00:00 2001 From: Goga Patarkatsishvili Date: Thu, 7 Sep 2017 16:07:46 +0400 Subject: [PATCH 28/39] .. --- README.md | 2 + docs/beginner/Functions.md | 437 ++++++++++++++++++++++++++++++++++++- docs/beginner/Scopes.md | 117 ++++++++++ docs/index.md | 2 + mkdocs.yml | 1 + 5 files changed, 558 insertions(+), 1 deletion(-) create mode 100644 docs/beginner/Scopes.md diff --git a/README.md b/README.md index 33dde06..66275d7 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ So, You can start study from here: - [Data Types In Python 3](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Data_Types_In_Python_3) - [Variables and Assignment](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Variables_And_Assignment) - ... + - [Functions](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Functions) + - ... - Intermediate - ... - Advanced diff --git a/docs/beginner/Functions.md b/docs/beginner/Functions.md index 3e27618..f4385fe 100644 --- a/docs/beginner/Functions.md +++ b/docs/beginner/Functions.md @@ -652,63 +652,498 @@ we’ll explore in the next section. +> **Source:** +> :fa-book: **Learning Python, Fourth Edition** by Mark Lutz - 2009 + +## How To Define Functions in Python 3 + + +A function is a block of instructions that performs an action and, once defined, can be reused. Functions make code more modular, allowing you to use the same code over and over again. + +Python has a number of built-in functions that you may be familiar with, including: + + +- print() which will print an object to the terminal +- int() which will convert a string or number data type to an integer data type +- len() which returns the length of an object + + + + +Function names include parentheses and may include parameters. + +In this tutorial, we’ll go over how to define your own functions to use in your coding projects. + + +### Defining a Function + +Let’s start with turning the classic “Hello, World!” program into a function. + +We’ll create a new text file in our text editor of choice, and call the program hello.py. Then, we’ll define the function. + +A function is defined by using the def keyword, followed by a name of your choosing, followed by a set of parentheses which hold any parameters the function will take (they can be empty), and ending with a colon. + +In this case, we’ll define a function named hello(): +```python +def hello(): +``` + + +This sets up the initial statement for creating a function. + +From here, we’ll add a second line with a 4-space indent to provide the instructions for what the function does. In this case, we’ll be printing Hello, World! to the console: + + +```python +def hello(): + print("Hello, World!") +``` +Our function is now fully defined, but if we run the program at this point, nothing will happen since we didn’t call the function. + +So, outside of our defined function block, let’s call the function with hello(): +```python +def hello(): + print("Hello, World!") + +hello() +``` +Now, let’s run the program: +```python +python hello.py +``` + + +You should receive the following output: + +```python +Hello, World! +``` +Functions can be more complicated than the `hello()` function we defined above. For example, we can use for loops, conditional statements, and more within our function block. + +For example, the function defined below utilizes a conditional statement to check if the input for the name variable contains a vowel, then uses a `for` loop to iterate over the letters in the `name` string. + +```python +# Define function names() +def names(): + # Set up name variable with input + name = str(input('Enter your name: ')) + # Check whether name has a vowel + if set('aeiou').intersection(name.lower()): + print('Your name contains a vowel.') + else: + print('Your name does not contain a vowel.') + + # Iterate over name + for letter in name: + print(letter) + +# Call the function +names() +``` +The `names()` function we defined above sets up a conditional statement and a for loop, showing how code can be organized within a function definition. However, depending on what we intend with our program and how we want to set up our code, we may want to define the conditional statement and the for loop as two separate functions. +Defining functions within a program makes our code modular and reusable so that we can call the same functions without rewriting them. +### Working with Parameters +So far we have looked at functions with empty parentheses that do not take arguments, but we can define parameters in function definitions within their parentheses. +A parameter is a named entity in a function definition, specifying an argument that the function can accept. +Let’s create a small program that takes in parameters x, y, and z. We’ll create a function that adds the parameters together in different configurations. The sums of these will be printed by the function. Then we’ll call the function and pass numbers into the function. +```python +def add_numbers(x, y, z): + a = x + y + b = x + z + c = y + z + print(a, b, c) +add_numbers(1, 2, 3) +``` +We passed the number 1 in for the x parameter, 2 in for the y parameter, and 3 in for the z parameter. These values correspond with each parameter in the order they are given. +The program is essentially doing the following math based on the values we passed to the parameters: +```python +a = 1 + 2 +b = 1 + 3 +c = 2 + 3 +``` +The function also prints a, b, and c, and based on the math above we would expect a to be equal to 3, b to be 4, and c to be 5. Let’s run the program: +```python +python add_numbers.py +Output : 3 4 5 +``` + +When we pass 1, 2, and 3 as parameters to the add_numbers() function, we receive the expected output. + +Parameters are arguments that are typically defined as variables within function definitions. They can be assigned values when you run the method, passing the arguments into the function. +### Keyword Arguments +In addition to calling parameters in order, you can use `keyword arguments` in a function call, in which the caller identifies the arguments by the parameter name. +When you use keyword arguments, you can use parameters out of order because the Python interpreter will use the keywords provided to match the values to the parameters. +Let’s create a function that will show us profile information for a user. We’ll pass parameters to it in the form of `username` (intended as a string), and `followers` (intended as an integer). +```python +# Define function with parameters +def profile_info(username, followers): + print("Username: " + username) + print("Followers: " + str(followers)) +``` +Within the function definition statement, `username` and `followers` are contained in the parentheses of the profile_info() function. The block of the function prints out information about the user as strings, making use of the two parameters. +Now, we can call the function and assign parameters to it: + +```python +def profile_info(username, followers): + print("Username: " + username) + print("Followers: " + str(followers)) + +# Call function with parameters assigned as above +profile_info("sammyshark", 945) + +# Call function with keyword arguments +profile_info(username="AlexAnglerfish", followers=342) +``` + +In the first function call, we have filled in the information with a username of sammyshark and followers being 945, in the second function call we used keyword arguments, assigning values to the argument variables. + +Let’s run the program: + +```python +python profile.py +Output : +Username: sammyshark +Followers: 945 +Username: AlexAnglerfish +Followers: 342 +``` +The output shows us the usernames and numbers of followers for both users. +This also permits us to modify the order of the parameters, as in this example of the same program with a different call: +```python +def profile_info(username, followers): + print("Username: " + username) + print("Followers: " + str(followers)) +# Change order of parameters +profile_info(followers=820, username="cameron-catfish") +``` +When we run the program again with the python profile.py command, we’ll receive the following output: +```python +Output: +Username: cameron-catfish +Followers: 820 +``` +Because the function definition maintains the same order of print() statements, if we use keyword arguments, it does not matter which order we pass them into the function call. +### Default Argument Values +We can also provide default values for one or both of the parameters. Let’s create a default value for the `followers` parameter with a value of 1: +```python +def profile_info(username, followers=1): + print("Username: " + username) + print("Followers: " + str(followers)) +``` +Now, we can run the function with only the username function assigned, and the number of followers will automatically default to 1. We can also still change the number of followers if we would like. +```python +def profile_info(username, followers=1): + print("Username: " + username) + print("Followers: " + str(followers)) +profile_info(username="JOctopus") +profile_info(username="sammyshark", followers=945) +``` +When we run the program with the python profile.py command, we’ll receive the following output: +```python +Output: +Username: JOctopus +Followers: 1 +Username: sammyshark +Followers: 945 +``` +Providing default parameters with values can let us skip defining values for each argument that already has a default. +### Returning a Value +You can pass a parameter value into a function, and a function can also produce a value. +A function can produce a value with the return statement, which will exit a function and optionally pass an expression back to the caller. If you use a return statement with no arguments, the function will return None. +So far, we have used the print() statement instead of the return statement in our functions. Let’s create a program that instead of printing will return a variable. +In a new text file called square.py, we’ll create a program that squares the parameter x and returns the variable y. We issue a call to print the result variable, which is formed by running the square() function with 3 passed into it. +```python +def square(x): + y = x ** 2 + return y +result = square(3) +print(result) +``` +We can run the program and see the output: +```python +python square.py +Output: +9 +``` +The integer 9 is returned as output, which is what we would expect by asking Python to find the square of 3. +To further understand how the `return` statement works, we can comment out the `return` statement in the program: +```python +def square(x): + y = x ** 2 + # return y +result = square(3) +print(result) +``` +Now, let’s run the program again: +```python +python square.py +Output: +None +``` +Without using the `return` statement here, the program cannot return a value so the value defaults to None. +As another example, in the `add_numbers.py` program above, we could swap out the `print()` statement for a return statement. + +```python +def add_numbers(x, y, z): + a = x + y + b = x + z + c = y + z + return a, b, c + +sums = add_numbers(1, 2, 3) +print(sums) + +``` + +Outside of the function, we set the variable sums equal to the result of the function taking in 1, 2, and 3 as we did above. Then we called a print of the sums variable. + +Let’s run the program again now that it has the return statement: + +```python +Output: +(3, 4, 5) + +``` +We receive the same numbers 3, 4, and 5 as output that we received previously by using the print() statement in the function. This time it is delivered as a tuple because the return statement’s expression list has at least one comma. + +Functions exit immediately when they hit a return statement, whether or not they’re returning a value. +```python +def loop_five(): + for x in range(0, 25): + print(x) + if x == 5: + # Stop function at x == 5 + return + print("This line will not execute.") + +loop_five() +``` + +Using the `return` statement within the `for` loop ends the function, so the line that is outside of the loop will not run. If, instead, we had used a `break` statement, only the loop would have exited at that time, and the last print() line would run. + +The `return` statement exits a function, and may return a value when issued with a parameter. + +### Using `main()` as a Function + +Although in Python you can call the function at the bottom of your program and it will run (as we have done in the examples above), many programming languages (like C++ and Java) require a main function in order to execute. Including a main() function, though not required, can structure our Python programs in a logical way that puts the most important components of the program into one function. It can also make our programs easier for non-Python programmers to read. + +We’ll start with adding a main() function to the hello.py program above. We’ll keep our hello() function, and then define a main() function: + + +```python +def hello(): + print("Hello, World!") + +def main(): +``` +Within the main() function, let’s include a print() statement to let us know that we’re in the main() function. Additionally, let’s call the hello() function within the main() function: +```python +def hello(): + print("Hello, World!") + + +def main(): + print("This is the main function") + hello() +``` +Finally, at the bottom of the program we’ll call the main() function: +```python +def hello(): + print("Hello, World!") + +def main(): + print("This is the main function.") + hello() + +main() + +``` + +At this point, we can run our program: +```python +python hello.py +Output: +This is the main function. +Hello, World! +``` + +Because we called the `hello()` function within main() and then only called `main()` to run, the `Hello, World!` text printed only once, after the string that told us we were in the main function. + +Next we’re going to be working with multiple functions, so it is worth reviewing the variable scope of global and local variables. If you define a variable within a function block, you’ll only be able to use that variable within that function. If you would like to use variables across functions it may be better to declare a global variable. + +In Python, '\__main\__' is the name of the scope where top-level code will execute. When a program is run from standard input, a script, or from an interactive prompt, its \__name\__ is set equal to '\__main\__'. + +Because of this, there is a convention to use the following construction: + +```python +if __name__ == '__main__': + # Code to run when this is the main program here +``` +This lets program files be used either: +- as the main program and run what follows the if statement +- as a module and not run what follows the if statement. + +Any code that is not contained within this statement will be executed upon running. If you’re using your program file as a module, the code that is not in this statement will also execute upon its import while running the secondary file. + +Let’s expand on our names.py program above, and create a new file called more_names.py. In this program we’ll declare a global variable and modify our original names() function so that the instructions are in two discrete functions. + +The first function, `has_vowel()` will check to see if the name string contains a vowel. + +The second function `print_letters()` will print each letter of the `name` string. + +```python +# Declare global variable name for use in all functions +name = str(input('Enter your name: ')) + + +# Define function to check if name contains a vowel +def has_vowel(): + if set('aeiou').intersection(name.lower()): + print('Your name contains a vowel.') + else: + print('Your name does not contain a vowel.') + + +# Iterate over letters in name string +def print_letters(): + for letter in name: + print(letter) +``` + +With this set up, let’s define the main() function which will contain a call to both the has_vowel() and the print_letters() functions. + +```python +# Declare global variable name for use in all functions +name = str(input('Enter your name: ')) + + +# Define function to check if name contains a vowel +def has_vowel(): + if set('aeiou').intersection(name.lower()): + print('Your name contains a vowel.') + else: + print('Your name does not contain a vowel.') + + +# Iterate over letters in name string +def print_letters(): + for letter in name: + print(letter) + + +# Define main method that calls other functions +def main(): + has_vowel() + print_letters() +``` +Finally, we’ll add the `if \__name\__ == '\__main\__':` construction at the bottom of the file. For our purposes, since we have put all the functions we would like to do in the `main()` function, we’ll call the `main()` function following this if statement. + + +```python +# Declare global variable name for use in all functions +name = str(input('Enter your name: ')) + + +# Define function to check if name contains a vowel +def has_vowel(): + if set('aeiou').intersection(name.lower()): + print('Your name contains a vowel.') + else: + print('Your name does not contain a vowel.') + + +# Iterate over letters in name string +def print_letters(): + for letter in name: + print(letter) + + +# Define main method that calls other functions +def main(): + has_vowel() + print_letters() + + +# Execute main() function +if __name__ == '__main__': + main() +``` +We can now run the program: +```python +python more_names.py +``` +The program will show the same output as the names.py program, but here the code is more organized and can be used in a modular way without modification. + +If you did not want to declare a main() function, you alternatively could have ended the program like this: +```python +if __name__ == '__main__': + has_vowel() + print_letters() +``` +Using `main()` as a function and the if \__name\__ == '\__main\__': statement can organize your code in a logical way, making it more readable and modular. + + +### Conclusion +Functions are code blocks of instructions that perform actions within a program, helping to make our code reusable and modular. + +To learn more about how to make your code more modular, you can read our guide on [How To Write Modules in Python 3.](https://www.digitalocean.com/community/tutorials/how-to-write-modules-in-python-3) > **Source:** -> :fa-book: **Learning Python, Fourth Edition** by Mark Lutz - 2009 +> :fa-link: https://stackoverflow.com/questions/1909512/what-is-python-used-for ## Prefer Exceptions to Returning None diff --git a/docs/beginner/Scopes.md b/docs/beginner/Scopes.md new file mode 100644 index 0000000..afb4119 --- /dev/null +++ b/docs/beginner/Scopes.md @@ -0,0 +1,117 @@ +### Scopes - Python Scope Basics + +Now that you’re ready to start writing your own functions, we need to get more formal +about what names mean in Python. When you use a name in a program, Python creates, +changes, or looks up the name in what is known as a namespace—a place where names +live. When we talk about the search for a name’s value in relation to code, the term +scope refers to a namespace: that is, the location of a name’s assignment in your code +determines the scope of the name’s visibility to your code. +Just about everything related to names, including scope classification, happens at assignment +time in Python. As we’ve seen, names in Python spring into existence when +they are first assigned values, and they must be assigned before they are used. Because +names are not declared ahead of time, Python uses the location of the assignment of a +name to associate it with (i.e., bind it to) a particular namespace. In other words, the +place where you assign a name in your source code determines the namespace it will +live in, and hence its scope of visibility. +Besides packaging code, functions add an extra namespace layer to your programs— +by default, all names assigned inside a function are associated with that function’s +namespace, and no other. This means that: + + +- Names defined inside a def can only be seen by the code within that def. You cannot +even refer to such names from outside the function. +- Names defined inside a def do not clash with variables outside the def, even if the +same names are used elsewhere. A name X assigned outside a given def (i.e., in a +different def or at the top level of a module file) is a completely different variable +from a name X assigned inside that def. + + +In all cases, the scope of a variable (where it can be used) is always determined by where +it is assigned in your source code and has nothing to do with which functions call which. +In fact, as we’ll learn in this chapter, variables may be assigned in three different places, +corresponding to three different scopes: +- If a variable is assigned inside a def, it is local to that function. +- If a variable is assigned in an enclosing def, it is nonlocal to nested functions. +- If a variable is assigned outside all defs, it is global to the entire file. +We call this lexical scoping because variable scopes are determined entirely by the locations +of the variables in the source code of your program files, not by function calls. +For example, in the following module file, the X = 99 assignment creates a global variable +named X (visible everywhere in this file), but the X = 88 assignment creates a +local variable X (visible only within the def statement): + +```python +X = 99 +def func(): + X = 88 +``` + +Even though both variables are named X, their scopes make them different. The net +effect is that function scopes help to avoid name clashes in your programs and help to +make functions more self-contained program units. + +#### Scope Rules + Before we started writing functions, all the code we wrote was at the top level of a +module (i.e., not nested in a def), so the names we used either lived in the module itself +or were built-ins predefined by Python (e.g., open). Functions provide nested namespaces +(scopes) that localize the names they use, such that names inside a function +won’t clash with those outside it (in a module or another function). Again, functions +define a local scope, and modules define a global scope. The two scopes are related as +follows: +- `The enclosing module is a global scope.` Each module is a global scope—that +is, a namespace in which variables created (assigned) at the top level of the module +file live. Global variables become attributes of a module object to the outside world +but can be used as simple variables within a module file. +- `The global scope spans a single file only.` Don’t be fooled by the word “global” +here—names at the top level of a file are only global to code within that single file. +There is really no notion of a single, all-encompassing global file-based scope in Python. Instead, names are partitioned into modules, and you must always import +a module explicitly if you want to be able to use the names its file defines. When +you hear “global” in Python, think “module.” +- `Each call to a function creates a new local scope.` Every time you call a function, +you create a new local scope—that is, a namespace in which the names created +inside that function will usually live. You can think of each def statement (and +lambda expression) as defining a new local scope, but because Python allows functions +to call themselves to loop (an advanced technique known as recursion), the +local scope in fact technically corresponds to a function call—in other words, each +call creates a new local namespace. Recursion is useful when processing structures +whose shapes can’t be predicted ahead of time. +- `Assigned names are local unless declared global or nonlocal.` By default, all +the names assigned inside a function definition are put in the local scope (the +namespace associated with the function call). If you need to assign a name that +lives at the top level of the module enclosing the function, you can do so by declaring +it in a global statement inside the function. If you need to assign a name +that lives in an enclosing def, as of Python 3.0 you can do so by declaring it in a +nonlocal statement. +- `All other names are enclosing function locals, globals, or built-ins.` Names +not assigned a value in the function definition are assumed to be enclosing scope +locals (in an enclosing def), globals (in the enclosing module’s namespace), or builtins +(in the predefined __builtin__ module Python provides). + + +There are a few subtleties to note here. First, keep in mind that code typed at the +interactive command prompt follows these same rules. You may not know it yet, but +code run interactively is really entered into a built-in module called __main__; this +module works just like a module file, but results are echoed as you go. Because of this, +interactively created names live in a module, too, and thus follow the normal scope +rules: they are global to the interactive session. You’ll learn more about modules in the +next part of this book. + +Also note that any type of assignment within a function classifies a name as local. This +includes = statements, module names in import, function names in def, function argument +names, and so on. If you assign a name in any way within a def, it will become a +local to that function. + +Conversely, in-place changes to objects do not classify names as locals; only actual name +assignments do. For instance, if the name L is assigned to a list at the top level of a +module, a statement L = X within a function will classify L as a local, but L.append(X) +will not. In the latter case, we are changing the list object that L references, not L itself— +L is found in the global scope as usual, and Python happily modifies it without requiring +a global (or nonlocal) declaration. As usual, it helps to keep the distinction between +names and objects clear: changing an object is not an assignment to a name. + + + + + + +> **Source:** +> :fa-book: **Learning Python, Fourth Edition** by Mark Lutz - 2009 \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index a98720b..458e209 100644 --- a/docs/index.md +++ b/docs/index.md @@ -18,6 +18,8 @@ Of course, it needs plenty of time to organize best resources based on the topic - [Data Types In Python 3](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Data_Types_In_Python_3) - [Variables and Assignment](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Variables_And_Assignment) - ... + - [Functions](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Functions) + - ... - Intermediate - ... - Advanced diff --git a/mkdocs.yml b/mkdocs.yml index aac3b05..a060a68 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -18,6 +18,7 @@ pages: - Start Coding With Python : beginner/Start_Coding_With_Python.md - Data Types in Python 3 : beginner/Data_Types_In_Python_3.md - Variables and Assignment : beginner/Variables_And_Assignment.md + - Functions : beginner/Functions.md - Advanced: - Python Metaclasses : advanced/Python_Metaclasses.md - About: About.md From fae6803c1365daa22b0301254144aa9fd9b36666 Mon Sep 17 00:00:00 2001 From: Goga Patarkatsishvili Date: Thu, 7 Sep 2017 16:11:36 +0400 Subject: [PATCH 29/39] generate built version --- site/404.html | 12 + site/About/index.html | 12 + site/advanced/Python_Metaclasses/index.html | 16 +- .../Data_Types_In_Python_3/index.html | 12 + site/beginner/Functions/index.html | 2080 +++++++++++++++++ site/beginner/Python_Installation/index.html | 12 + .../Python_Programming_Lanuage/index.html | 12 + .../Start_Coding_With_Python/index.html | 12 + .../Variables_And_Assignment/index.html | 16 +- site/images/stack-diagrams.PNG | Bin 0 -> 14250 bytes site/index.html | 14 + site/mkdocs/search_index.json | 700 +++--- site/sitemap.xml | 22 +- 13 files changed, 2633 insertions(+), 287 deletions(-) create mode 100644 site/beginner/Functions/index.html create mode 100644 site/images/stack-diagrams.PNG diff --git a/site/404.html b/site/404.html index aedf1af..117e89b 100644 --- a/site/404.html +++ b/site/404.html @@ -271,6 +271,18 @@ + + + + + + + + diff --git a/site/About/index.html b/site/About/index.html index 7498274..952e33c 100644 --- a/site/About/index.html +++ b/site/About/index.html @@ -273,6 +273,18 @@ + + + + + +
      13. + + Functions + +
      14. + + diff --git a/site/advanced/Python_Metaclasses/index.html b/site/advanced/Python_Metaclasses/index.html index bba0e37..68d061d 100644 --- a/site/advanced/Python_Metaclasses/index.html +++ b/site/advanced/Python_Metaclasses/index.html @@ -277,6 +277,18 @@ + + + + + +
      15. + + Functions + +
      16. + + @@ -1214,7 +1226,7 @@

        The method signatures

        diff --git a/site/beginner/Data_Types_In_Python_3/index.html b/site/beginner/Data_Types_In_Python_3/index.html index 189833a..595f542 100644 --- a/site/beginner/Data_Types_In_Python_3/index.html +++ b/site/beginner/Data_Types_In_Python_3/index.html @@ -459,6 +459,18 @@ + + + + + +
      17. + + Functions + +
      18. + + diff --git a/site/beginner/Functions/index.html b/site/beginner/Functions/index.html new file mode 100644 index 0000000..79120b0 --- /dev/null +++ b/site/beginner/Functions/index.html @@ -0,0 +1,2080 @@ + + + + + + + + + + + + + + + + + + + + + + + Functions - Python Synopsis + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + +
        + +
        + + +
        +
        + + +
        +
        +
        + +
        +
        +
        + + + + + +
        +
        + + + +

        Functions

        + +

        Function Calls

        +

        In the context of programming, a function is a named sequence of statements that +performs a computation. When you define a function, you specify the name and the +sequence of statements. Later, you can “call” the function by name. We have already seen +one example of a function call:

        +
        >>> type(32)
        +<type 'int'>
        +
        + + +

        The name of the function is type. The expression in parentheses is called the argument +of the function. The result, for this function, is the type of the argument.
        +It is common to say that a function “takes” an argument and “returns” a result. The result +is called the return value.

        +

        Type Conversion Functions

        +

        Python provides built-in functions that convert values from one type to another. The +int function takes any value and converts it to an integer, if it can, or complains +otherwise:

        +
        >>> int('32')
        +32
        +>>> int('Hello')
        +ValueError: invalid literal for int(): Hello
        +
        + + +

        int can convert floating-point values to integers, but it doesn’t round off; it chops off +the fraction part:

        +
        >>> int(3.99999)
        +3
        +>>> int(-2.3)
        +-2
        +
        + + +

        float converts integers and strings to floating-point numbers:

        +
        >>> float(32)
        +32.0
        +>>> float('3.14159')
        +3.14159
        +
        + + +

        Finally, str converts its argument to a string:

        +
        >>> str(32)
        +'32'
        +>>> str(3.14159)
        +'3.14159'
        +
        + + +

        Adding New Functions

        +

        So far, we have only been using the functions that come with Python, but it is also possible +to add new functions. A function definition specifies the name of a new function and +the sequence of statements that execute when the function is called.
        +Here is an example:

        +
        def print_lyrics():
        +    print "I'm a lumberjack, and I'm okay."
        +    print "I sleep all night and I work all day."
        +
        + + +

        def is a keyword that indicates that this is a function definition. The name of the function +is print_lyrics. The rules for function names are the same as for variable names: letters, +numbers and some punctuation marks are legal, but the first character can’t be a number. +You can’t use a keyword as the name of a function, and you should avoid having a variable +and a function with the same name.
        +The empty parentheses after the name indicate that this function doesn’t take any +arguments.
        +The first line of the function definition is called the header; the rest is called the body. +The header has to end with a colon and the body has to be indented. By convention, the +indentation is always four spaces; see “Debugging” (page 33). The body can contain any +number of statements.
        +The strings in the print statements are enclosed in double quotes. Single quotes and +double quotes do the same thing; most people use single quotes except in cases like this +where a single quote (which is also an apostrophe) appears in the string. +If you type a function definition in interactive mode, the interpreter prints ellipses (...) +to let you know that the definition isn’t complete:

        +
        def print_lyrics():
        +    print "I'm a lumberjack, and I'm okay."
        +    print "I sleep all night and I work all day."
        +
        + + +

        To end the function, you have to enter an empty line (this is not necessary in a script). +Defining a function creates a variable with the same name.

        +
        >>> print print_lyrics
        +<function print_lyrics at 0xb7e99e9c>
        +>>> type(print_lyrics)
        +<type 'function'>
        +
        + + +

        The value of print_lyrics is a function object, which has type 'function'. +The syntax for calling the new function is the same as for built-in functions:

        +
        >>> print_lyrics()
        +I'm a lumberjack, and I'm okay.
        +I sleep all night and I work all day.
        +
        + + +

        Once you have defined a function, you can use it inside another function. For example, +to repeat the previous refrain, we could write a function called repeat_lyrics:

        +
        def repeat_lyrics():
        +    print_lyrics()
        +    print_lyrics()
        +
        + + +

        And then call repeat_lyrics:

        +
        >>> repeat_lyrics()
        +I'm a lumberjack, and I'm okay.
        +I sleep all night and I work all day.
        +I'm a lumberjack, and I'm okay.
        +I sleep all night and I work all day.
        +
        + + +

        But that’s not really how the song goes.

        +

        Definitions and Uses

        +

        Pulling together the code fragments from the previous section, the whole program looks +like this:

        +
        def print_lyrics():
        +    print "I'm a lumberjack, and I'm okay."
        +    print "I sleep all night and I work all day."
        +def repeat_lyrics():
        +    print_lyrics()
        +    print_lyrics()  
        +
        +repeat_lyrics()
        +
        + + +

        This program contains two function definitions: print_lyrics and repeat_lyrics. +Function definitions get executed just like other statements, but the result creates func +tion objects. The statements inside the function do not get executed until the function +is called, and the function definition generates no output.
        +As you might expect, you have to create a function before you can execute it. In other +words, the function definition has to be executed before the function is called the first +time.

        +

        Flow of Execution

        +

        In order to ensure that a function is defined before its first use, you have to know the +order in which statements are executed, which is called the flow of execution.
        +Execution always begins at the first statement of the program. Statements are executed +one at a time, in order, from top to bottom.

        +

        Function definitions do not alter the flow of execution of the program, but remember +that statements inside the function are not executed until the function is called. +A function call is like a detour in the flow of execution. Instead of going to the next +statement, the flow jumps to the body of the function, executes all the statements there, +and then comes back to pick up where it left off.
        +That sounds simple enough, until you remember that one function can call another. +While in the middle of one function, the program might have to execute the statements +in another function. But while executing that new function, the program might have to +execute yet another function!
        +Fortunately, Python is good at keeping track of where it is, so each time a function +completes, the program picks up where it left off in the function that called it. When it +gets to the end of the program, it terminates.
        +What’s the moral of this sordid tale? When you read a program, you don’t always want +to read from top to bottom. Sometimes it makes more sense if you follow the flow of +execution.

        +

        Parameters and Arguments

        +

        Some of the built-in functions we have seen require arguments. For example, when you +call math.sin you pass a number as an argument. Some functions take more than one +argument: math.pow takes two, the base and the exponent. +Inside the function, the arguments are assigned to variables called parameters. Here is +an example of a user-defined function that takes an argument:

        +
         def print_twice(bruce):
        +    print bruce
        +    print bruce
        +
        + + +

        This function assigns the argument to a parameter named bruce. When the function is +called, it prints the value of the parameter (whatever it is) twice.
        +This function works with any value that can be printed.

        +
        >>> print_twice('Spam')
        +Spam
        +Spam
        +>>> print_twice(17)
        +17
        +17
        +>>> print_twice(math.pi)
        +3.14159265359
        +3.14159265359 
        +
        + + +

        The same rules of composition that apply to built-in functions also apply to user-defined +functions, so we can use any kind of expression as an argument for print_twice:

        +
        >>> print_twice('Spam '*4)
        +Spam Spam Spam Spam
        +Spam Spam Spam Spam
        +>>> print_twice(math.cos(math.pi))
        +-1.0
        +-1.0
        +
        + + +

        The argument is evaluated before the function is called, so in the examples the expres +sions 'Spam '*4 and math.cos(math.pi) are only evaluated once.
        +You can also use a variable as an argument:

        +
        >>> michael = 'Eric, the half a bee.'
        +>>> print_twice(michael)
        +Eric, the half a bee.
        +Eric, the half a bee.
        +
        + + +

        The name of the variable we pass as an argument (michael) has nothing to do with the +name of the parameter (bruce). It doesn’t matter what the value was called back home +(in the caller); here in print_twice, we call everybody bruce.

        +

        Variables and Parameters Are Local

        +

        When you create a variable inside a function, it is local, which means that it only exists +inside the function. For example:

        +
        def cat_twice(part1, part2):
        +    cat = part1 + part2
        +    print_twice(cat)
        +
        + + +

        This function takes two arguments, concatenates them, and prints the result twice. Here +is an example that uses it:

        +
        >>> line1 = 'Bing tiddle '
        +>>> line2 = 'tiddle bang.'
        +>>> cat_twice(line1, line2)
        +Bing tiddle tiddle bang.
        +Bing tiddle tiddle bang.
        +
        + + +

        When cat_twice terminates, the variable cat is destroyed. If we try to print it, we get +an exception:

        +
        >>> print cat
        +NameError: name 'cat' is not defined
        +
        + + +

        Parameters are also local. For example, outside print_twice, there is no such thing as +bruce.

        +

        Stack Diagrams

        +

        To keep track of which variables can be used where, it is sometimes useful to draw a +stack diagram. Like state diagrams, stack diagrams show the value of each variable, but +they also show the function each variable belongs to.
        +Each function is represented by a frame. A frame is a box with the name of a function +beside it and the parameters and variables of the function inside it. The stack diagram +for the previous example is shown in Figure 3-1.

        +

        ex1.py.

        +

        The frames are arranged in a stack that indicates which function called which, and so +on. In this example, print_twice was called by cat_twice, and cat_twice was called +by \__main\__, which is a special name for the topmost frame. When you create a variable +outside of any function, it belongs to \__main\__.

        +

        Each parameter refers to the same value as its corresponding argument. So, part1 has +the same value as line1, part2 has the same value as line2, and bruce has the same +value as cat. +If an error occurs during a function call, Python prints the name of the function, and +the name of the function that called it, and the name of the function that called that, all +the way back to \__main__\.

        +

        For example, if you try to access cat from within print_twice, you get a NameError:

        +
        Traceback (innermost last):
        +    File "test.py", line 13, in __main__
        +        cat_twice(line1, line2)
        +    File "test.py", line 5, in cat_twice
        +        print_twice(cat)
        +    File "test.py", line 9, in print_twice
        +        print cat
        +    NameError: name 'cat' is not defined
        +
        + + +

        This list of functions is called a traceback. It tells you what program file the error oc +curred in, and what line, and what functions were executing at the time. It also shows +the line of code that caused the error. +The order of the functions in the traceback is the same as the order of the frames in the +stack diagram. The function that is currently running is listed at the bottom.

        +

        Fruitful Functions and Void Functions

        +

        Some of the functions we are using, such as the math functions, yield results; for lack of +a better name, I call them fruitful functions. Other functions, like print_twice, per +form an action but don’t return a value. They are called void functions. +When you call a fruitful function, you almost always want to do something with the +result; for example, you might assign it to a variable or use it as part of an expression:

        +
        x = math.cos(radians)
        +golden = (math.sqrt(5) + 1) / 2
        +
        + + +

        When you call a function in interactive mode, Python displays the result:

        +
        >>> math.sqrt(5)
        +2.2360679774997898
        +
        + + +

        But in a script, if you call a fruitful function all by itself, the return value is lost forever!

        +
        math.sqrt(5)
        +
        + + +

        This script computes the square root of 5, but since it doesn’t store or display the result, +it is not very useful. +Void functions might display something on the screen or have some other effect, but +they don’t have a return value. If you try to assign the result to a variable, you get a special +value called None.

        +
        >>> result = print_twice('Bing')
        +Bing
        +Bing
        +>>> print result
        +None
        +
        + + +

        The value None is not the same as the string 'None'. It is a special value that has its own +type:

        +
        >>> print type(None)
        +<type 'NoneType'>
        +
        + + +

        The functions we have written so far are all void. We will start writing fruitful functions +in a few chapters.

        +

        Why Functions?

        +

        It may not be clear why it is worth the trouble to divide a program into functions. There +are several reasons:
        +- Creating a new function gives you an opportunity to name a group of statements, +which makes your program easier to read and debug. +- Functions can make a program smaller by eliminating repetitive code. Later, if you +make a change, you only have to make it in one place. +- Dividing a long program into functions allows you to debug the parts one at a time +and then assemble them into a working whole. +- Well-designed functions are often useful for many programs. Once you write and +debug one, you can reuse it.

        +
        +

        Source:
        + Think Python by Allen B. Downey - 2012

        +
        +

        Functions by by Mark Lutz (Learning Python, Fourth Edition)

        +

        Function Basics

        +

        In Part III, we looked at basic procedural statements in Python. Here, we’ll move on to +explore a set of additional statements that we can use to create functions of our own.
        +In simple terms, a function is a device that groups a set of statements so they can be run +more than once in a program. Functions also can compute a result value and let us +specify parameters that serve as function inputs, which may differ each time the code +is run. Coding an operation as a function makes it a generally useful tool, which we +can use in a variety of contexts.
        +More fundamentally, functions are the alternative to programming by cutting and +pasting—rather than having multiple redundant copies of an operation’s code, we can +factor it into a single function. In so doing, we reduce our future work radically: if the +operation must be changed later, we only have one copy to update, not many.
        +Functions are the most basic program structure Python provides for maximizing code +reuse and minimizing code redundancy. As we’ll see, functions are also a design tool +that lets us split complex systems into manageable parts. Table 16-1 summarizes the +primary function-related tools we’ll study in this part of the book.

        +
        Statement  | Examples |
        +
        + + +

        ------|------| +Calls | myfunc('spam', 'eggs', meat=ham)| +def, return| def adder(a, b=1, c): return a + b + c[0]| +global| def changer():global x; x = 'new' | +nonlocal| def changer():nonlocal x; x = 'new'| +yield| def squares(x):for i in range(x): yield i 2 | +lambda| funcs = [lambda x: x2, lambda x: x3]

        +

        Why Use Functions?

        +

        Before we get into the details, let’s establish a clear picture of what functions are all +about. Functions are a nearly universal program-structuring device. You may have +come across them before in other languages, where they may have been called subroutines +or procedures. As a brief introduction, functions serve two primary development +roles:

        +

        Maximizing code reuse and minimizing redundancy +As in most programming languages, Python functions are the simplest way to +package logic you may wish to use in more than one place and more than one time. +Up until now, all the code we’ve been writing has run immediately. Functions allow +us to group and generalize code to be used arbitrarily many times later. Because +they allow us to code an operation in a single place and use it in many places, +Python functions are the most basic factoring tool in the language: they allow us +to reduce code redundancy in our programs, and thereby reduce maintenance +effort.

        +

        Procedural decomposition +Functions also provide a tool for splitting systems into pieces that have well-defined +roles. For instance, to make a pizza from scratch, you would start by mixing the +dough, rolling it out, adding toppings, baking it, and so on. If you were programming +a pizza-making robot, functions would help you divide the overall “make +pizza” task into chunks—one function for each subtask in the process. It’s easier +to implement the smaller tasks in isolation than it is to implement the entire process +at once. In general, functions are about procedure—how to do something, rather +than what you’re doing it to. We’ll see why this distinction matters in Part VI, when +we start making new object with classes.

        +
        +

        In this part of the book, we’ll explore the tools used to code functions in Python: function +basics, scope rules, and argument passing, along with a few related concepts such +as generators and functional tools. Because its importance begins to become more apparent +at this level of coding, we’ll also revisit the notion of polymorphism introduced +earlier in the book. As you’ll see, functions don’t imply much new syntax, but they do +lead us to some bigger programming ideas.

        +

        Coding Functions

        +

        Although it wasn’t made very formal, we’ve already used some functions in earlier +chapters. For instance, to make a file object, we called the built-in open function; similarly, +we used the len built-in function to ask for the number of items in a collection +object.
        +In this chapter, we will explore how to write new functions in Python. Functions we +write behave the same way as the built-ins we’ve already seen: they are called in expressions, are passed values, and return results. But writing new functions requires +the application of a few additional ideas that haven’t yet been introduced. Moreover, +functions behave very differently in Python than they do in compiled languages like C. +Here is a brief introduction to the main concepts behind Python functions, all of which +we will study in this part of the book:

        +
          +
        • def is executable code. Python functions are written with a new statement, the +def. Unlike functions in compiled languages such as C, def is an executable statement— +your function does not exist until Python reaches and runs the def. In fact, +it’s legal (and even occasionally useful) to nest def statements inside if statements, +while loops, and even other defs. In typical operation, def statements are coded in +module files and are naturally run to generate functions when a module file is first +imported.
        • +
        • +

          def creates an object and assigns it to a name. When Python reaches and runs +a def statement, it generates a new function object and assigns it to the function’s +name. As with all assignments, the function name becomes a reference to the function +object. There’s nothing magic about the name of a function—as you’ll see, +the function object can be assigned to other names, stored in a list, and so on. +Function objects may also have arbitrary user-defined attributes attached to them +to record data.

          +
        • +
        • +

          lambda creates an object but returns it as a result. Functions may also be created +with the lambda expression, a feature that allows us to in-line function definitions +in places where a def statement won’t work syntactically

          +
        • +
        • +

          return sends a result object back to the caller. When a function is called, the +caller stops until the function finishes its work and returns control to the caller. +Functions that compute a value send it back to the caller with a return statement; +the returned value becomes the result of the function call.

          +
        • +
        • +

          yield sends a result object back to the caller, but remembers where it left +off. Functions known as generators may also use the yield statement to send back +a value and suspend their state such that they may be resumed later, to produce a +series of results over time. This is another advanced topic covered later in this part +of the book.

          +
        • +
        • +

          global declares module-level variables that are to be assigned. By default, all +names assigned in a function are local to that function and exist only while the +function runs. To assign a name in the enclosing module, functions need to list it +in a global statement. More generally, names are always looked up in scopes— +places where variables are stored—and assignments bind names to scopes.

          +
        • +
        • +

          nonlocal declares enclosing function variables that are to be assigned. Similarly, +the nonlocal statement added in Python 3.0 allows a function to assign a +name that exists in the scope of a syntactically enclosing def statement. This allows +enclosing functions to serve as a place to retain state—information remembered +when a function is called—without using shared global names.

          +
        • +
        • +

          Arguments are passed by assignment (object reference). In Python, arguments +are passed to functions by assignment (which, as we’ve learned, means by object +reference). As you’ll see, in Python’s model the caller and function share objects +by references, but there is no name aliasing. Changing an argument name within +a function does not also change the corresponding name in the caller, but changing +passed-in mutable objects can change objects shared by the caller.

          +
        • +
        • +

          Arguments, return values, and variables are not declared. As with everything +in Python, there are no type constraints on functions. In fact, nothing about a +function needs to be declared ahead of time: you can pass in arguments of any type, +return any kind of object, and so on. As one consequence, a single function can +often be applied to a variety of object types—any objects that sport a compatible +interface (methods and expressions) will do, regardless of their specific types.

          +
        • +
        +

        If some of the preceding words didn’t sink in, don’t worry—we’ll explore all of these +concepts with real code in this part of the book. Let’s get started by expanding on some +of these ideas and looking at a few examples.

        +

        def Statements

        +

        The def statement creates a function object and assigns it to a name. Its general format +is as follows:

        +
        def <name>(arg1, arg2,... argN):
        +    <statements>
        +
        + + +

        As with all compound Python statements, def consists of a header line followed by a +block of statements, usually indented (or a simple statement after the colon). The +statement block becomes the function’s body—that is, the code Python executes each +time the function is called.
        +The def header line specifies a function name that is assigned the function object, along +with a list of zero or more arguments (sometimes called parameters) in parentheses. +The argument names in the header are assigned to the objects passed in parentheses at +the point of call.

        +

        Function bodies often contain a return statement:

        +
        def <name>(arg1, arg2,... argN):
        +    ...
        +    return <value>
        +
        + + +

        The Python return statement can show up anywhere in a function body; it ends the +function call and sends a result back to the caller. The return statement consists of an +object expression that gives the function’s result. The return statement is optional; if +it’s not present, the function exits when the control flow falls off the end of the function +body. Technically, a function without a return statement returns the None object automatically, +but this return value is usually ignored.

        +

        def Executes at Runtime

        +

        The Python def is a true executable statement: when it runs, it creates a new function +object and assigns it to a name. (Remember, all we have in Python is runtime; there is +no such thing as a separate compile time.) Because it’s a statement, a def can appear +anywhere a statement can—even nested in other statements. For instance, although +defs normally are run when the module enclosing them is imported, it’s also completely +legal to nest a function def inside an if statement to select between alternative +definitions:

        +
        if test:
        +    def func(): # Define func this way
        +...
        +else:
        +    def func(): # Or else this way
        +    ...
        +    ...
        +func() # Call the version selected and built
        +
        + + +

        One way to understand this code is to realize that the def is much like an = statement: +it simply assigns a name at runtime. Unlike in compiled languages such as C, Python +functions do not need to be fully defined before the program runs. More generally, +defs are not evaluated until they are reached and run, and the code inside defs is not +evaluated until the functions are later called. +Because function definition happens at runtime, there’s nothing special about the +function name. What’s important is the object to which it refers:

        +
        othername = func # Assign function object
        +othername() # Call func again
        +
        + + +

        Here, the function was assigned to a different name and called through the new name. +Like everything else in Python, functions are just objects; they are recorded explicitly +in memory at program execution time. In fact, besides calls, functions allow arbitrary +attributes to be attached to record information for later use:

        +
        def func(): ... # Create function object
        +func() # Call object
        +func.attr = value # Attach attributes
        +
        + + +

        A First Example: Definitions and Calls

        +

        Apart from such runtime concepts (which tend to seem most unique to programmers +with backgrounds in traditional compiled languages), Python functions are straightforward +to use. Let’s code a first real example to demonstrate the basics. As you’ll see, +there are two sides to the function picture: a definition (the def that creates a function) +and a call (an expression that tells Python to run the function’s body).

        +

        Definition

        +

        Here’s a definition typed interactively that defines a function called times, which returns +the product of its two arguments:

        +
        >>> def times(x, y): # Create and assign function
        +... return x * y # Body executed when called
        +...
        +
        + + +

        When Python reaches and runs this def, it creates a new function object that packages +the function’s code and assigns the object to the name times. Typically, such a statement +is coded in a module file and runs when the enclosing file is imported; for something +this small, though, the interactive prompt suffices.

        +

        Calls

        +

        After the def has run, you can call (run) the function in your program by adding +parentheses after the function’s name. The parentheses may optionally contain one or +more object arguments, to be passed (assigned) to the names in the function’s header:

        +
        >>> times(2, 4) # Arguments in parentheses
        +8
        +
        + + +

        This expression passes two arguments to times. As mentioned previously, arguments +are passed by assignment, so in this case the name x in the function header is assigned +the value 2, y is assigned the value 4, and the function’s body is run. For this function, +the body is just a return statement that sends back the result as the value of the call +expression. The returned object was printed here interactively (as in most languages, +2 * 4 is 8 in Python), but if we needed to use it later we could instead assign it to a +variable. For example:

        +
        >>> x = times(3.14, 4) # Save the result object
        +>>> x
        +12.56
        +
        + + +

        Now, watch what happens when the function is called a third time, with very different +kinds of objects passed in:

        +
        >>> times('Ni', 4) # Functions are "typeless"
        +'NiNiNiNi'
        +
        + + +

        This time, our function means something completely different (Monty Python reference +again intended). In this third call, a string and an integer are passed to x and y, instead +of two numbers. Recall that * works on both numbers and sequences; because we never +declare the types of variables, arguments, or return values in Python, we can use +times to either multiply numbers or repeat sequences.
        +In other words, what our times function means and does depends on what we pass into +it. This is a core idea in Python (and perhaps the key to using the language well), which +we’ll explore in the next section.

        +
        +

        Source:
        + Learning Python, Fourth Edition by Mark Lutz - 2009

        +
        +

        How To Define Functions in Python 3

        +

        A function is a block of instructions that performs an action and, once defined, can be reused. Functions make code more modular, allowing you to use the same code over and over again.

        +

        Python has a number of built-in functions that you may be familiar with, including:

        +
          +
        • print() which will print an object to the terminal
        • +
        • int() which will convert a string or number data type to an integer data type
        • +
        • len() which returns the length of an object
        • +
        +

        Function names include parentheses and may include parameters.

        +

        In this tutorial, we’ll go over how to define your own functions to use in your coding projects.

        +

        Defining a Function

        +

        Let’s start with turning the classic “Hello, World!” program into a function.

        +

        We’ll create a new text file in our text editor of choice, and call the program hello.py. Then, we’ll define the function.

        +

        A function is defined by using the def keyword, followed by a name of your choosing, followed by a set of parentheses which hold any parameters the function will take (they can be empty), and ending with a colon.

        +

        In this case, we’ll define a function named hello():

        +
        def hello():
        +
        + + +

        This sets up the initial statement for creating a function.

        +

        From here, we’ll add a second line with a 4-space indent to provide the instructions for what the function does. In this case, we’ll be printing Hello, World! to the console:

        +
        def hello():
        +    print("Hello, World!")
        +
        + + +

        Our function is now fully defined, but if we run the program at this point, nothing will happen since we didn’t call the function.

        +

        So, outside of our defined function block, let’s call the function with hello():

        +
        def hello():
        +    print("Hello, World!")
        +
        +hello()
        +
        + + +

        Now, let’s run the program:

        +
        python hello.py
        +
        + + +

        You should receive the following output:

        +
        Hello, World!
        +
        + + +

        Functions can be more complicated than the hello() function we defined above. For example, we can use for loops, conditional statements, and more within our function block.

        +

        For example, the function defined below utilizes a conditional statement to check if the input for the name variable contains a vowel, then uses a for loop to iterate over the letters in the name string.

        +
        # Define function names()
        +def names():
        +    # Set up name variable with input
        +    name = str(input('Enter your name: '))
        +    # Check whether name has a vowel
        +    if set('aeiou').intersection(name.lower()):
        +        print('Your name contains a vowel.')
        +    else:
        +        print('Your name does not contain a vowel.')
        +
        +    # Iterate over name
        +    for letter in name:
        +        print(letter)
        +
        +# Call the function
        +names()
        +
        + + +

        The names() function we defined above sets up a conditional statement and a for loop, showing how code can be organized within a function definition. However, depending on what we intend with our program and how we want to set up our code, we may want to define the conditional statement and the for loop as two separate functions.

        +

        Defining functions within a program makes our code modular and reusable so that we can call the same functions without rewriting them.

        +

        Working with Parameters

        +

        So far we have looked at functions with empty parentheses that do not take arguments, but we can define parameters in function definitions within their parentheses.

        +

        A parameter is a named entity in a function definition, specifying an argument that the function can accept.

        +

        Let’s create a small program that takes in parameters x, y, and z. We’ll create a function that adds the parameters together in different configurations. The sums of these will be printed by the function. Then we’ll call the function and pass numbers into the function.

        +
        def add_numbers(x, y, z):
        +    a = x + y
        +    b = x + z
        +    c = y + z
        +    print(a, b, c)
        +
        +add_numbers(1, 2, 3)
        +
        + + +

        We passed the number 1 in for the x parameter, 2 in for the y parameter, and 3 in for the z parameter. These values correspond with each parameter in the order they are given.

        +

        The program is essentially doing the following math based on the values we passed to the parameters:

        +
        a = 1 + 2
        +b = 1 + 3
        +c = 2 + 3
        +
        + + +

        The function also prints a, b, and c, and based on the math above we would expect a to be equal to 3, b to be 4, and c to be 5. Let’s run the program:

        +
        python add_numbers.py
        +Output : 3 4 5
        +
        + + +

        When we pass 1, 2, and 3 as parameters to the add_numbers() function, we receive the expected output.

        +

        Parameters are arguments that are typically defined as variables within function definitions. They can be assigned values when you run the method, passing the arguments into the function.

        +

        Keyword Arguments

        +

        In addition to calling parameters in order, you can use keyword arguments in a function call, in which the caller identifies the arguments by the parameter name.

        +

        When you use keyword arguments, you can use parameters out of order because the Python interpreter will use the keywords provided to match the values to the parameters.

        +

        Let’s create a function that will show us profile information for a user. We’ll pass parameters to it in the form of username (intended as a string), and followers (intended as an integer).

        +
        # Define function with parameters
        +def profile_info(username, followers):
        +    print("Username: " + username)
        +    print("Followers: " + str(followers)) 
        +
        + + +

        Within the function definition statement, username and followers are contained in the parentheses of the profile_info() function. The block of the function prints out information about the user as strings, making use of the two parameters.

        +

        Now, we can call the function and assign parameters to it:

        +
        def profile_info(username, followers):
        +    print("Username: " + username)
        +    print("Followers: " + str(followers))
        +
        +# Call function with parameters assigned as above
        +profile_info("sammyshark", 945)
        +
        +# Call function with keyword arguments
        +profile_info(username="AlexAnglerfish", followers=342)
        +
        + + +

        In the first function call, we have filled in the information with a username of sammyshark and followers being 945, in the second function call we used keyword arguments, assigning values to the argument variables.

        +

        Let’s run the program:

        +
        python profile.py
        +Output : 
        +Username: sammyshark
        +Followers: 945
        +Username: AlexAnglerfish
        +Followers: 342
        +
        + + +

        The output shows us the usernames and numbers of followers for both users.

        +

        This also permits us to modify the order of the parameters, as in this example of the same program with a different call:

        +
        def profile_info(username, followers):
        +    print("Username: " + username)
        +    print("Followers: " + str(followers))
        +
        +# Change order of parameters
        +profile_info(followers=820, username="cameron-catfish")
        +
        + + +

        When we run the program again with the python profile.py command, we’ll receive the following output:

        +
        Output:
        +Username: cameron-catfish
        +Followers: 820
        +
        + + +

        Because the function definition maintains the same order of print() statements, if we use keyword arguments, it does not matter which order we pass them into the function call.

        +

        Default Argument Values

        +

        We can also provide default values for one or both of the parameters. Let’s create a default value for the followers parameter with a value of 1:

        +
        def profile_info(username, followers=1):
        +    print("Username: " + username)
        +    print("Followers: " + str(followers))
        +
        + + +

        Now, we can run the function with only the username function assigned, and the number of followers will automatically default to 1. We can also still change the number of followers if we would like.

        +
        def profile_info(username, followers=1):
        +    print("Username: " + username)
        +    print("Followers: " + str(followers))
        +
        +profile_info(username="JOctopus")
        +profile_info(username="sammyshark", followers=945)
        +
        + + +

        When we run the program with the python profile.py command, we’ll receive the following output:

        +
        Output:
        +Username: JOctopus
        +Followers: 1
        +Username: sammyshark
        +Followers: 945
        +
        + + +

        Providing default parameters with values can let us skip defining values for each argument that already has a default.

        +

        Returning a Value

        +

        You can pass a parameter value into a function, and a function can also produce a value.

        +

        A function can produce a value with the return statement, which will exit a function and optionally pass an expression back to the caller. If you use a return statement with no arguments, the function will return None.

        +

        So far, we have used the print() statement instead of the return statement in our functions. Let’s create a program that instead of printing will return a variable.

        +

        In a new text file called square.py, we’ll create a program that squares the parameter x and returns the variable y. We issue a call to print the result variable, which is formed by running the square() function with 3 passed into it.

        +
        def square(x):
        +    y = x ** 2
        +    return y
        +
        +result = square(3)
        +print(result)
        +
        + + +

        We can run the program and see the output:

        +
        python square.py
        +Output:
        +9
        +
        + + +

        The integer 9 is returned as output, which is what we would expect by asking Python to find the square of 3.

        +

        To further understand how the return statement works, we can comment out the return statement in the program:

        +
        def square(x):
        +    y = x ** 2
        +    # return y
        +
        +result = square(3)
        +print(result)
        +
        + + +

        Now, let’s run the program again:

        +
        python square.py
        +Output:
        +None
        +
        + + +

        Without using the return statement here, the program cannot return a value so the value defaults to None.

        +

        As another example, in the add_numbers.py program above, we could swap out the print() statement for a return statement.

        +
        def add_numbers(x, y, z):
        +    a = x + y
        +    b = x + z
        +    c = y + z
        +    return a, b, c
        +
        +sums = add_numbers(1, 2, 3)
        +print(sums)
        +
        + + +

        Outside of the function, we set the variable sums equal to the result of the function taking in 1, 2, and 3 as we did above. Then we called a print of the sums variable.

        +

        Let’s run the program again now that it has the return statement:

        +
        Output:
        +(3, 4, 5)
        +
        + + +

        We receive the same numbers 3, 4, and 5 as output that we received previously by using the print() statement in the function. This time it is delivered as a tuple because the return statement’s expression list has at least one comma.

        +

        Functions exit immediately when they hit a return statement, whether or not they’re returning a value.

        +
        def loop_five():
        +    for x in range(0, 25):
        +        print(x)
        +        if x == 5:
        +            # Stop function at x == 5
        +            return
        +    print("This line will not execute.")
        +
        +loop_five()
        +
        + + +

        Using the return statement within the for loop ends the function, so the line that is outside of the loop will not run. If, instead, we had used a break statement, only the loop would have exited at that time, and the last print() line would run.

        +

        The return statement exits a function, and may return a value when issued with a parameter.

        +

        Using main() as a Function

        +

        Although in Python you can call the function at the bottom of your program and it will run (as we have done in the examples above), many programming languages (like C++ and Java) require a main function in order to execute. Including a main() function, though not required, can structure our Python programs in a logical way that puts the most important components of the program into one function. It can also make our programs easier for non-Python programmers to read.

        +

        We’ll start with adding a main() function to the hello.py program above. We’ll keep our hello() function, and then define a main() function:

        +
        def hello():
        +    print("Hello, World!")
        +
        +def main():
        +
        + + +

        Within the main() function, let’s include a print() statement to let us know that we’re in the main() function. Additionally, let’s call the hello() function within the main() function:

        +
        def hello():
        +    print("Hello, World!")
        +
        +
        +def main():
        +    print("This is the main function")
        +    hello()
        +
        + + +

        Finally, at the bottom of the program we’ll call the main() function:

        +
        def hello():
        +    print("Hello, World!")
        +
        +def main():
        +    print("This is the main function.")
        +    hello()
        +
        +main()
        +
        + + +

        At this point, we can run our program:

        +
        python hello.py
        +Output:
        +This is the main function.
        +Hello, World!
        +
        + + +

        Because we called the hello() function within main() and then only called main() to run, the Hello, World! text printed only once, after the string that told us we were in the main function.

        +

        Next we’re going to be working with multiple functions, so it is worth reviewing the variable scope of global and local variables. If you define a variable within a function block, you’ll only be able to use that variable within that function. If you would like to use variables across functions it may be better to declare a global variable.

        +

        In Python, '_main_' is the name of the scope where top-level code will execute. When a program is run from standard input, a script, or from an interactive prompt, its _name_ is set equal to '_main_'.

        +

        Because of this, there is a convention to use the following construction:

        +
        if __name__ == '__main__':
        +    # Code to run when this is the main program here
        +
        + + +

        This lets program files be used either: +- as the main program and run what follows the if statement +- as a module and not run what follows the if statement.

        +

        Any code that is not contained within this statement will be executed upon running. If you’re using your program file as a module, the code that is not in this statement will also execute upon its import while running the secondary file.

        +

        Let’s expand on our names.py program above, and create a new file called more_names.py. In this program we’ll declare a global variable and modify our original names() function so that the instructions are in two discrete functions.

        +

        The first function, has_vowel() will check to see if the name string contains a vowel.

        +

        The second function print_letters() will print each letter of the name string.

        +
        # Declare global variable name for use in all functions
        +name = str(input('Enter your name: '))
        +
        +
        +# Define function to check if name contains a vowel
        +def has_vowel():
        +    if set('aeiou').intersection(name.lower()):
        +        print('Your name contains a vowel.')
        +    else:
        +        print('Your name does not contain a vowel.')
        +
        +
        +# Iterate over letters in name string
        +def print_letters():
        +    for letter in name:
        +        print(letter)
        +
        + + +

        With this set up, let’s define the main() function which will contain a call to both the has_vowel() and the print_letters() functions.

        +
        # Declare global variable name for use in all functions
        +name = str(input('Enter your name: '))
        +
        +
        +# Define function to check if name contains a vowel
        +def has_vowel():
        +    if set('aeiou').intersection(name.lower()):
        +        print('Your name contains a vowel.')
        +    else:
        +        print('Your name does not contain a vowel.')
        +
        +
        +# Iterate over letters in name string
        +def print_letters():
        +    for letter in name:
        +        print(letter)
        +
        +
        +# Define main method that calls other functions
        +def main():
        +    has_vowel()
        +    print_letters()
        +
        + + +

        Finally, we’ll add the if \__name\__ == '\__main\__': construction at the bottom of the file. For our purposes, since we have put all the functions we would like to do in the main() function, we’ll call the main() function following this if statement.

        +
        # Declare global variable name for use in all functions
        +name = str(input('Enter your name: '))
        +
        +
        +# Define function to check if name contains a vowel
        +def has_vowel():
        +    if set('aeiou').intersection(name.lower()):
        +        print('Your name contains a vowel.')
        +    else:
        +        print('Your name does not contain a vowel.')
        +
        +
        +# Iterate over letters in name string
        +def print_letters():
        +    for letter in name:
        +        print(letter)
        +
        +
        +# Define main method that calls other functions
        +def main():
        +    has_vowel()
        +    print_letters()
        +
        +
        +# Execute main() function
        +if __name__ == '__main__':
        +    main()
        +
        + + +

        We can now run the program:

        +
        python more_names.py
        +
        + + +

        The program will show the same output as the names.py program, but here the code is more organized and can be used in a modular way without modification.

        +

        If you did not want to declare a main() function, you alternatively could have ended the program like this:

        +
        if __name__ == '__main__':
        +    has_vowel()
        +    print_letters()
        +
        + + +

        Using main() as a function and the if _name_ == '_main_': statement can organize your code in a logical way, making it more readable and modular.

        +

        Conclusion

        +

        Functions are code blocks of instructions that perform actions within a program, helping to make our code reusable and modular.

        +

        To learn more about how to make your code more modular, you can read our guide on How To Write Modules in Python 3.

        +
        +

        Source:
        + https://stackoverflow.com/questions/1909512/what-is-python-used-for

        +
        +

        Prefer Exceptions to Returning None

        +

        When writing utility functions, there’s a draw for Python programmers to give special +meaning to the return value of None. It seems to makes sense in some cases. For example, +say you want a helper function that divides one number by another. In the case of dividing +by zero, returning None seems natural because the result is undefined.

        +
        def divide(a, b):
        +    try:
        +        return a / b
        +    except ZeroDivisionError:
        +        return None
        +
        + + +

        Code using this function can interpret the return value accordingly.

        +
        result = divide(x, y)
        +if result is None:
        +    print(Invalid inputs)
        +
        + + +

        What happens when the numerator is zero? That will cause the return value to also be zero +(if the denominator is non-zero). This can cause problems when you evaluate the result in +a condition like an if statement. You may accidentally look for any False equivalent +value to indicate errors instead of only looking for None.

        +
        x, y = 0, 5
        +result = divide(x, y)
        +if not result:
        +    print(Invalid inputs) # This is wrong!
        +
        + + +

        This is a common mistake in Python code when None has special meaning. This is why +returning None from a function is error prone. There are two ways to reduce the chance of +such errors.

        +

        The first way is to split the return value into a two-tuple. The first part of the tuple +indicates that the operation was a success or failure. The second part is the actual result +that was computed.

        +
        def divide(a, b):
        +    try:
        +        return True, a / b
        +    except ZeroDivisionError:
        +        return False, None
        +
        + + +

        Callers of this function have to unpack the tuple. That forces them to consider the status +part of the tuple instead of just looking at the result of division.

        +
        success, result = divide(x, y)
        +if not success:
        +    print(Invalid inputs)
        +
        + + +

        The problem is that callers can easily ignore the first part of the tuple (using the +underscore variable name, a Python convention for unused variables). The resulting code +doesn’t look wrong at first glance. This is as bad as just returning None.

        +
        _, result = divide(x, y)
        +if not result:
        +    print(Invalid inputs)
        +
        + + +

        The second, better way to reduce these errors is to never return None at all. Instead, raise +an exception up to the caller and make them deal with it. Here, I turn a +ZeroDivisionError into a ValueError to indicate to the caller that the input +values are bad:

        +
        def divide(a, b):
        +    try:
        +        return a / b
        +    except ZeroDivisionError as e:
        +        raise ValueError(Invalid inputs) from e
        +
        + + +

        Now the caller should handle the exception for the invalid input case. +The caller no longer requires a condition on the return value of the function. If the +function didn’t raise an exception, then the return value must be good. The outcome of +exception handling is clear.

        +
        x, y = 5, 2
        +try:
        +    result = divide(x, y)
        +except ValueError:
        +    print(Invalid inputs)
        +else:
        +    print(Result is %.1f % result)
        +>>>
        +Result is 2.5
        +
        + + +

        Things to Remember

        +
          +
        • Functions that return None to indicate special meaning are error prone because +None and other values (e.g., zero, the empty string) all evaluate to False in +conditional expressions.
        • +
        • Raise exceptions to indicate special situations instead of returning None. Expect the +calling code to handle exceptions properly when they’re documented.
        • +
        +
        +

        Source:
        + Effective Python by Brett Slatkin

        +
        + + + + + + + +
        +
        +
        +
        + + + + +
        + + + + + + + + + + + + \ No newline at end of file diff --git a/site/beginner/Python_Installation/index.html b/site/beginner/Python_Installation/index.html index d4dbe9e..02905d6 100644 --- a/site/beginner/Python_Installation/index.html +++ b/site/beginner/Python_Installation/index.html @@ -338,6 +338,18 @@ + + + + + +
      19. + + Functions + +
      20. + + diff --git a/site/beginner/Python_Programming_Lanuage/index.html b/site/beginner/Python_Programming_Lanuage/index.html index c749647..588add3 100644 --- a/site/beginner/Python_Programming_Lanuage/index.html +++ b/site/beginner/Python_Programming_Lanuage/index.html @@ -403,6 +403,18 @@ + + + + + +
      21. + + Functions + +
      22. + + diff --git a/site/beginner/Start_Coding_With_Python/index.html b/site/beginner/Start_Coding_With_Python/index.html index 2d07b6a..715980d 100644 --- a/site/beginner/Start_Coding_With_Python/index.html +++ b/site/beginner/Start_Coding_With_Python/index.html @@ -433,6 +433,18 @@ + + + + + +
      23. + + Functions + +
      24. + + diff --git a/site/beginner/Variables_And_Assignment/index.html b/site/beginner/Variables_And_Assignment/index.html index afe955c..c229563 100644 --- a/site/beginner/Variables_And_Assignment/index.html +++ b/site/beginner/Variables_And_Assignment/index.html @@ -376,6 +376,18 @@ + + + + + +
      25. + + Functions + +
      26. + + @@ -1046,13 +1058,13 @@

        Conclusion

        -
        ml?qIQ#tnE;{@Fu zVIyh12}~RZR0@*!@ttTl21lO?aijMfuDfwAY++)8&*O9&ELzzh#9qbv=-X=$;`b|) z&GjqVk8}O93ye%Qt5z*LL~pRcN5#F88lVjmzz66OdXP@i3yC3P#yVOKv- z0GmB^c{HMeWBB2=n3vfy0Ma_SF+24Qum5qL3D3d^mO}2iP)`cVqnBFar9d3vacg}P zquE&|WwBqcOaCwiEEpPFr$l(u&UT3E^*!q*A|DxFj^U~Ih5{nJnLksSh%(*pJ8*;B z&%tFKDwo+3ijx{-V&b*r=dqSi!tV&`a=RAu792Nc%`wR9o2;4ps;ARF>AlwPZMP1D zhC7AL?My(qWMgvh1A9^8{+;2i8)S1U-MU=vFU1*`R*;jJ>Mkd53D$K-1dY`7cbWxStOF?&h5qvKU5AZk zV;}GH%2a;->X%{@E*!};a5A(*==4fXkB4Z0v*iq^*8^Rd->>Q3)q)>NMtiQjxs>Ih z=w>-2#tO)Xo`HLPs8jfBTMnfNH%zu2?fT;$RTZul!cMY`s2%X6Vly`mPjDfUH2s(f)L+Gp<2yHD> z@o?GFU%G4%L*PfXseZYZVA!hPh)Km!YDE&ZlWe{50FV-g>H$StQtlN8ou}LpBeZnX|WEv z$BNX7FP;HkA}ZYwQ+AA_!>0i17MvZOi#I03f6dUD1WG%+zTT{&xb>RQRN0Lp*$#A< z1B+U#F34Ofl*P8j!>A<9^4z}Z11xFFS{ax>hzFGUuZsS@pn|oKY13!L!s^rJMMC%P zrd^6zHVVq7K)`W1m%8|n2?g8Z;-vlqm8JKs2IQtH%n=viXAa_5&-`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I3g{7D(|Q$R zqxA9tOkU_}QqxkQQk^Mat&c}sf8!pUHdk7TYd#F;Wv^2b8uzl@HWjXOb8n2ZHk`-2Le;T%gEyyr z-i!Qh-suUH98lXDO;kCrGE5^9dI<7M{uj*!>*iOrH&UN8me6frb8}C z%?=Eq09p{T zBy(9KHF3rrT%Q*?)zI&q`acuy(@LbrMj(i|u-!^#w60#7qu2CyS{lii%=g$xzi$=5 zdK%a`X5{WpAwdQd$wY6j4{$ep4Zt@iY3PC|hCOC6e*Y!CmO~|KZz#ldltq&3PoYy? zxv86G74xgu4Z)Zmr$PnrS@#^3hvjHb0xm76XJXJyQoCI)-l!1AbqmZLODmTBaD=l~ zurV#g;UJ5vJ%0)!HXpPo;u$i-mr|j2j(OZL!0Ou+shAMpj!*B<_YqX(EICK@Oi%K3Z}rt+iNwJf#N;2gHl z&n)VS#<%`$_w6d%u%+L5Ne0s@94bPf|zC0gxv9ufe^^Ke}OGz53_WHNb zX&s-20Y%bFSpxe(N2mJQhsm7mt3YxXK3$TJ@{f^%W5$ab>%7bqJIY+#iY2OvkK4gA zW-s#Ijo%?UBQBn6QlHAPO-(}^0+z>3PrA*8BCJ?(-}s#jrsTY$)3geT$rNdG4s3Jn zhxY6qf_eDo_o120c|N53?15ICL4)|fB4oFQKQDrX(6B@G`Xz*&_X1A)o+DnTx3$cDCAr?M>H0o$p_?wBn@vN!f%jUb+ z0sBG-bEll5qH2Ssb0%gyyuO{~Ydt=zY z>UD2E3(cIpw9Q@0@{{dryi){b^ literal 0 HcmV?d00001 diff --git a/site/index.html b/site/index.html index 23ba29d..7c1d2a2 100644 --- a/site/index.html +++ b/site/index.html @@ -309,6 +309,18 @@ + + + + + + + + @@ -418,6 +430,8 @@

        Python Study Guide

      27. Data Types In Python 3
      28. Variables and Assignment
      29. ...
      30. +
      31. Functions
      32. +
      33. ...
      34. Intermediate
          diff --git a/site/mkdocs/search_index.json b/site/mkdocs/search_index.json index cc8b1e5..53cc131 100644 --- a/site/mkdocs/search_index.json +++ b/site/mkdocs/search_index.json @@ -1,463 +1,613 @@ { "docs": [ { - "location": "/", - "text": "Welcome to Python Synopsis!\n\n\nPython Study Guide\n\n\nIn this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate \nbooks, articles, answers from Stackoverflow, online courses, videos from py conferences\n and etc. \n\n\nSo, after all I decided to share \ntop resources\n for everyone about each topic, that you need to know about python, if you want to be senior python \nSoftware Engineer\n. \n\n\nOf course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than \n30-40\n chapters.\n\n\n\n\nBeginner\n\n\nThe Python Programming Language, Implementation and Adventages\n\n\nPython Installation\n\n\nStart Coding With Python\n\n\nData Types In Python 3\n\n\nVariables and Assignment\n\n\n...\n\n\n\n\n\n\nIntermediate\n\n\n... \n\n\n\n\n\n\nAdvanced\n\n\n...\n\n\nPython Metaclasses\n\n\n...", + "location": "/", + "text": "Welcome to Python Synopsis!\n\n\nPython Study Guide\n\n\nIn this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate \nbooks, articles, answers from Stackoverflow, online courses, videos from py conferences\n and etc. \n\n\nSo, after all I decided to share \ntop resources\n for everyone about each topic, that you need to know about python, if you want to be senior python \nSoftware Engineer\n. \n\n\nOf course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than \n30-40\n chapters.\n\n\n\n\nBeginner\n\n\nThe Python Programming Language, Implementation and Adventages\n\n\nPython Installation\n\n\nStart Coding With Python\n\n\nData Types In Python 3\n\n\nVariables and Assignment\n\n\n...\n\n\nFunctions\n\n\n...\n\n\n\n\n\n\nIntermediate\n\n\n... \n\n\n\n\n\n\nAdvanced\n\n\n...\n\n\nPython Metaclasses\n\n\n...", "title": "Home" - }, + }, { - "location": "/#welcome-to-python-synopsis", - "text": "", + "location": "/#welcome-to-python-synopsis", + "text": "", "title": "Welcome to Python Synopsis!" - }, + }, { - "location": "/#python-study-guide", - "text": "In this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate books, articles, answers from Stackoverflow, online courses, videos from py conferences and etc. So, after all I decided to share top resources for everyone about each topic, that you need to know about python, if you want to be senior python Software Engineer . Of course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than 30-40 chapters. Beginner The Python Programming Language, Implementation and Adventages Python Installation Start Coding With Python Data Types In Python 3 Variables and Assignment ... Intermediate ... Advanced ... Python Metaclasses ...", + "location": "/#python-study-guide", + "text": "In this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate books, articles, answers from Stackoverflow, online courses, videos from py conferences and etc. So, after all I decided to share top resources for everyone about each topic, that you need to know about python, if you want to be senior python Software Engineer . Of course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than 30-40 chapters. Beginner The Python Programming Language, Implementation and Adventages Python Installation Start Coding With Python Data Types In Python 3 Variables and Assignment ... Functions ... Intermediate ... Advanced ... Python Metaclasses ...", "title": "Python Study Guide" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/", - "text": "The Python Programming Language\n\n\n\n\nThe programming language you will learn is Python. Python is an example of a highlevel\nlanguage; other high-level languages you might have heard of are \nC, C++, Perl,\n\nand \nJava\n.\nThere are also low-level languages, sometimes referred to as \n\u201cmachine languages\u201d\n or\n\n\u201cassembly languages.\u201d\n Loosely speaking, computers can only run programs written in\nlow-level languages. So programs written in a high-level language have to be processed\nbefore they can run. This extra processing takes some time, which is a small disadvantage\nof high-level languages.\n\n\nThe advantages are enormous. First, it is much easier to program in a high-level lan\nguage. Programs written in a high-level language take less time to write, they are shorter\nand easier to read, and they are more likely to be correct. Second, high-level languages\nare portable, meaning that they can run on different kinds of computers with few or no\nmodifications. Low-level programs can run on only one kind of computer and have to\nbe rewritten to run on another.\n\n\nDue to these advantages, almost all programs are written in high-level languages. Lowlevel\nlanguages are used only for a few specialized applications.\n\n\nTwo kinds of programs process high-level languages into low-level languages:\ninterpreters and compilers. An interpreter reads a high-level program and executes it,\nmeaning that it does what the program says. It processes the program a little at a time,\nalternately reading lines and performing computations. Figure 1-1 shows the structure\nof an interpreter.\n\n\n \n\n\nA compiler reads the program and translates it completely before the program starts\nrunning. In this context, the high-level program is called the source code, and the\ntranslated program is called the object code or the executable. Once a program is com\npiled, you can execute it repeatedly without further translation. Figure 1-2 shows the\nstructure of a compiler.\n\n\n\n\nPython is considered an interpreted language because Python programs are executed\nby an interpreter. There are two ways to use the interpreter: \ninteractive\n mode and \nscript mode\n. In interactive mode, you type Python programs and the interpreter displays the\nresult:\n>\n 1 + 1\n2\nThe chevron, \n, is the prompt the interpreter uses to indicate that it is ready. If you\ntype 1 + 1, the interpreter replies 2.\n\n\nAlternatively, you can store code in a file and use the interpreter to execute the contents\nof the file, which is called a script. By convention, Python scripts have names that end\nwith .py.\nTo execute the script, you have to tell the interpreter the name of the file. If you have a\nscript named dinsdale.py and you are working in a UNIX command window, you type\npython dinsdale.py. In other development environments, the details of executing\nscripts are different. You can find instructions for your environment at the Python web\nsite http://python.org.\nWorking in interactive mode is convenient for testing small pieces of code because you\ncan type and execute them immediately. But for anything more than a few lines, you\nshould save your code as a script so you can modify and execute it in the future.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nPython\u2019s View\n\n\nThe brief description in the prior section is fairly standard for scripting languages, and\nit\u2019s usually all that most Python programmers need to know. You type code into text\nfiles, and you run those files through the interpreter. Under the hood, though, a bit\nmore happens when you tell Python to \u201cgo.\u201d Although knowledge of Python internals\nis not strictly required for Python programming, a basic understanding of the runtime\nstructure of Python can help you grasp the bigger picture of program execution.\nWhen you instruct Python to run your script, there are a few steps that Python carries\nout before your code actually starts crunching away. Specifically, it\u2019s first compiled to\nsomething called \u201cbyte code\u201d and then routed to something called a \u201cvirtual machine.\u201d\n\n\nByte code compilation\n\n\nInternally, and almost completely hidden from you, when you execute a program\nPython first compiles your source code (the statements in your file) into a format known\nas byte code. Compilation is simply a translation step, and byte code is a lower-level,\nplatform-independent representation of your source code. Roughly, Python translates\neach of your source statements into a group of byte code instructions by decomposing\nthem into individual steps. This byte code translation is performed to speed\nexecution\u2014byte code can be run much more quickly than the original source code\nstatements in your text file.\nYou\u2019ll notice that the prior paragraph said that this is almost completely hidden from\nyou. If the Python process has write access on your machine, it will store the byte code\nof your programs in files that end with a .pyc extension (\u201c.pyc\u201d means compiled \u201c.py\u201d\nsource). You will see these files show up on your computer after you\u2019ve run a few\nprograms alongside the corresponding source code files (that is, in the same\ndirectories).\nPython saves byte code like this as a startup speed optimization. The next time you run\nyour program, Python will load the .pyc files and skip the compilation step, as long as\nyou haven\u2019t changed your source code since the byte code was last saved. Python automatically\nchecks the timestamps of source and byte code files to know when it must\nrecompile\u2014if you resave your source code, byte code is automatically re-created the\nnext time your program is run.\nIf Python cannot write the byte code files to your machine, your program still works\u2014\nthe byte code is generated in memory and simply discarded on program exit.* However,\nbecause .pyc files speed startup time, you\u2019ll want to make sure they are written for larger\nprograms. Byte code files are also one way to ship Python programs\u2014Python is happy\nto run a program if all it can find are .pyc files, even if the original .py source files are\nabsent.\n\n\nThe Python Virtual Machine (PVM)\n\n\nOnce your program has been compiled to byte code (or the byte code has been loaded\nfrom existing .pyc files), it is shipped off for execution to something generally known\nas the Python Virtual Machine (PVM, for the more acronym-inclined among you). The\nPVM sounds more impressive than it is; really, it\u2019s not a separate program, and it need\nnot be installed by itself. In fact, the PVM is just a big loop that iterates through your\nbyte code instructions, one by one, to carry out their operations. The PVM is the runtime\nengine of Python; it\u2019s always present as part of the Python system, and it\u2019s the\ncomponent that truly runs your scripts. Technically, it\u2019s just the last step of what is\ncalled the \u201cPython interpreter.\u201d\n\n\n\n\nFigure illustrates the runtime structure described here. Keep in mind that all of this\ncomplexity is deliberately hidden from Python programmers. Byte code compilation is\nautomatic, and the PVM is just part of the Python system that you have installed on\nyour machine. Again, programmers simply code and run files of statements.\n\n\nPerformance implications\n\n\nReaders with a background in fully compiled languages such as C and C++ might notice\na few differences in the Python model. For one thing, there is usually no build or \u201cmake\u201d\nstep in Python work: code runs immediately after it is written. For another, Python byte\ncode is not binary machine code (e.g., instructions for an Intel chip). Byte code is a\nPython-specific representation.\n\n\nThis is why some Python code may not run as fast as C or C++ code, as described in\nChapter 1\u2014the PVM loop, not the CPU chip, still must interpret the byte code, and\nbyte code instructions require more work than CPU instructions. On the other hand,\nunlike in classic interpreters, there is still an internal compile step\u2014Python does not\nneed to reanalyze and reparse each source statement repeatedly. The net effect is that\npure Python code runs at speeds somewhere between those of a traditional compiled\nlanguage and a traditional interpreted language. See Chapter 1 for more on Python\nperformance tradeoffs.\n\n\n\n\nSource:\n \n\n\n \nLearning Python, Fourth Edition\n by Mark Lutz - 2009\n\n\n\n\nPython Implementation Alternatives\n\n\nReally, as this book is being written, there are three primary implementations of the\nPython language\u2014CPython, Jython, and IronPython\u2014along with a handful of secondary\nimplementations such as Stackless Python. In brief, CPython is the standard implementation;\nall the others have very specific purposes and roles. All implement the\nsame Python language but execute programs in different ways.\n\n\nCPython\n\n\nThe original, and standard, implementation of Python is usually called CPython, when\nyou want to contrast it with the other two. Its name comes from the fact that it is coded\nin portable ANSI C language code. This is the Python that you fetch from http://www\n.python.org, get with the ActivePython distribution, and have automatically on most\nLinux and Mac OS X machines. If you\u2019ve found a preinstalled version of Python on\nyour machine, it\u2019s probably CPython, unless your company is using Python in very\nspecialized ways.\nUnless you want to script Java or .NET applications with Python, you probably want\nto use the standard CPython system. Because it is the reference implementation of the\nlanguage, it tends to run the fastest, be the most complete, and be more robust than\nthe alternative systems. Figure 1-3 reflects CPython\u2019s runtime architecture.\n\n\nJython\n\n\nThe Jython system (originally known as JPython) is an alternative implementation of\nthe Python language, targeted for integration with the Java programming language.\nJython consists of Java classes that compile Python source code to Java byte code and\nthen route the resulting byte code to the Java Virtual Machine (JVM). Programmers\nstill code Python statements in .py text files as usual; the Jython system essentially just\nreplaces the rightmost two bubbles in Figure 1-3 with Java-based equivalents.\nJython\u2019s goal is to allow Python code to script Java applications, much as CPython\nallows Python to script C and C++ components. Its integration with Java is remarkably\nseamless. Because Python code is translated to Java byte code, it looks and feels like a\ntrue Java program at runtime. Jython scripts can serve as web applets and servlets, build\nJava-based GUIs, and so on. Moreover, Jython includes integration support that allows\nPython code to import and use Java classes as though they were coded in Python.\nBecause Jython is slower and less robust than CPython, though, it is usually seen as a\ntool of interest primarily to Java developers looking for a scripting language to be a\nfrontend to Java code.\n\n\nIronPython\n\n\nA third implementation of Python, and newer than both CPython and Jython,\nIronPython is designed to allow Python programs to integrate with applications coded\nto work with Microsoft\u2019s .NET Framework for Windows, as well as the Mono open\nsource equivalent for Linux. .NET and its C# programming language runtime system\nare designed to be a language-neutral object communication layer, in the spirit of Microsoft\u2019s\nearlier COM model. IronPython allows Python programs to act as both client\nand server components, accessible from other .NET languages.\nBy implementation, IronPython is very much like Jython (and, in fact, was developed\nby the same creator)\u2014it replaces the last two bubbles in Figure 1-3 with equivalents\nfor execution in the .NET environment. Also, like Jython, IronPython has a special\nfocus\u2014it is primarily of interest to developers integrating Python with .NET components.\nBecause it is being developed by Microsoft, though, IronPython might also be\nable to leverage some important optimization tools for better performance.\nIronPython\u2019s scope is still evolving as I write this; for more details, consult the Python\nonline resources or search the Web.\n\n\n\n\nSource:\n \n\n\n \nLearning Python, Fourth Edition\n by Mark Lutz - 2009\n\n\n\n\nPython Programming Language Advantages\n\n\nPython is a dynamic, strongly typed, object oriented, multipurpose programming language, designed to be quick (to learn, to use, and to understand), and to enforce a clean and uniform syntax.\n\n\n\n\nPython is dynamically typed: it means that you don't declare a type (e.g. 'integer') for a variable name, and then assign something of that type (and only that type). Instead, you have variable names, and you bind them to entities whose type stays with the entity itself. a = 5 makes the variable name a to refer to the integer 5. Later, a = \"hello\" makes the variable name a to refer to a string containing \"hello\". Static typed languages would have you declare int a and then a = 5, but assigning a = \"hello\" would have been a compile time error. On one hand, this makes everything more unpredictable (you don't know what a refers to). On the other hand, it makes very easy to achieve some results a static typed languages makes very difficult.\n\n\nPython is strongly typed. It means that if a = \"5\" (the string whose value is '5') will remain a string, and never coerced to a number if the context requires so. Every type conversion in python must be done explicitly. This is different from, for example, Perl or Javascript, where you have weak typing, and can write things like \"hello\" + 5 to get \"hello5\".\n\n\nPython is object oriented, with class-based inheritance. Everything is an object (including classes, functions, modules, etc), in the sense that they can be passed around as arguments, have methods and attributes, and so on. \n\n\nPython is multipurpose: it is not specialised to a specific target of users (like R for statistics, or PHP for web programming). It is extended through modules and libraries, that hook very easily into the C programming language.\n\n\nPython enforces correct indentation of the code by making the indentation part of the syntax. There are no control braces in Python. Blocks of code are identified by the level of indentation. Although a big turn off for many programmers not used to this, it is precious as it gives a very uniform style and results in code that is visually pleasant to read.\n\n\nThe code is compiled into byte code and then executed in a virtual machine. This means that precompiled code is portable between platforms.\n\n\n\n\nPython can be used for any programming task, from GUI programming to web programming with everything else in between. It's quite efficient, as much of its activity is done at the C level. Python is just a layer on top of C. There are libraries for everything you can think of: game programming and openGL, GUI interfaces, web frameworks, semantic web, scientific computing...\n\n\n\n\nSource:\n \n\n\n https://stackoverflow.com/questions/1909512/what-is-python-used-for\n\n\n\n\nAdventages again\n\n\n\n\nEasy Syntax\n\nPython's syntax is easy to learn, so both non-programmers and programmers can start programming right away.\n\n\nReadability\n\nPython's syntax is very clear, so it is easy to understand program code. (Python is often referred to as \"executable pseudo-code\" because its syntax mostly follows the conventions used by programmers to outline their ideas without the formal verbosity of code in most programming languages; in other words syntax of Python is almost identical to the simplified \"pseudo-code\" used by many programmers to prototype and describe their solution to other programmers. Thus Python can be used to prototype and test code which is later to be implemented in other programming languages).[citation needed]\n\n\nHigh-Level Language\n\nPython looks more like a readable, human language than like a low-level language. This gives you the ability to program at a faster rate than a low-level language will allow you.\n\n\nObject oriented programming\n\nObject-oriented programming allows you to create data structures that can be re-used, which reduces the amount of repetitive work that you'll need to do. Programming languages usually define objects with namespaces, like class or def, and objects can edit themselves by using keyword, like this or self. Most modern programming languages are object-oriented (such as Java, C++, and C#) or have support for OOP features (such as Perl version 5 and later). Additionally object-oriented techniques can be used in the design of almost any non-trivial software and implemented in almost any programming or scripting language. (For example a number of Linux kernel features are \"objects\" which implement their own encapsulation of behavior and data structive via pointers, specifically pointers to functions, in the C programming language).[citation needed] Python's support for object-oriented programming is one of its greatest benefits to new programmers because they will be encountering the same concepts and terminology in their work environment. If you ever decide to switch languages, or use any other for that fact, you'll have a significant chance that you'll be working with object-oriented programming.[1]\n\n\nIt's Free\n\nPython is both free and open-source. The Python Software Foundation distributes pre-made binaries that are freely available for use on all major operating systems called CPython. You can get CPython's source-code, too. Plus, you can modify the source code and distribute as allowed by CPython's license. [2] (Luckily, CPython has a permissive free software license attitude.)\n\n\nCross-platform\n\nPython runs on all major operating systems like Microsoft Windows, Linux, and Mac OS X.\n\n\nWidely Supported\n\nPython has an active support community with many web sites, mailing lists, and USENET \"netnews\" groups that attract a large number of knowledgeable and helpful contributes.\n\n\nIt's Safe\n\nPython doesn't have pointers like other C-based languages, making it much more reliable. Along with that, errors never pass silently unless they're explicitly silenced. This allows you to see and read why the program crashed and where to correct your error.\n\n\nBatteries Included\n\nPython is famous for being the \"batteries are included\" language.[3] There are over 300 standard library modules which contain modules and classes for a wide variety of programming tasks.[citation needed] For example the standard library contains modules for safely creating temporary files (named or anonymous), mapping files into memory (including use of shared and anonymous memory mappings), spawning and controlling sub-processes, compressing and decompressing files (compatible with gzip or PK-zip) and archives files (such as Unix/Linux \"tar\"), accessing indexed \"DBM\" (database) files, interfacing to various graphical user interfaces (such as the TK toolkit and the popular WxWindows multi-platform windowing system), parsing and maintaining CSV (comma-separated values) and \".cfg\" or \".ini\" configuration files (similar in syntax to the venerable WIN.INI files from MS-DOS and MS-Windows), for sending e-mail, fetching and parsing web pages, etc. It's possible, for example, to create a custom web server in Python using less than a dozen lines of code, and one of the standard libraries, of course.\n\n\nExtensible\n\nIn addition to the standard libraries there are extensive collections of freely available add-on modules, libraries, frameworks, and tool-kits. These generally conform to similar standards and conventions; for example almost all of the database adapters (to talk to almost any client-server RDBMS engine such as MySQL, Postgres, Oracle, etc) conform to the Python DBAPI and thus can mostly be accessed using the same code. So it's usually easy to modify a Python program to support any database engine.\n\n\n\n\n\n\nSource:\n \n\n\n https://en.wikiversity.org/wiki/Python_Concepts/Why_learn_Python\n\n\n\n\nWho Uses Python Today ?\n\n\nHere are links to just a few of the organizations that use python:\n\n- \n https://wiki.python.org/moin/OrganizationsUsingPython\n\n\nPython Success Stories :\n\n- \n https://www.python.org/about/success", + "location": "/beginner/Python_Programming_Lanuage/", + "text": "The Python Programming Language\n\n\n\n\nThe programming language you will learn is Python. Python is an example of a highlevel\nlanguage; other high-level languages you might have heard of are \nC, C++, Perl,\n\nand \nJava\n.\nThere are also low-level languages, sometimes referred to as \n\u201cmachine languages\u201d\n or\n\n\u201cassembly languages.\u201d\n Loosely speaking, computers can only run programs written in\nlow-level languages. So programs written in a high-level language have to be processed\nbefore they can run. This extra processing takes some time, which is a small disadvantage\nof high-level languages.\n\n\nThe advantages are enormous. First, it is much easier to program in a high-level lan\nguage. Programs written in a high-level language take less time to write, they are shorter\nand easier to read, and they are more likely to be correct. Second, high-level languages\nare portable, meaning that they can run on different kinds of computers with few or no\nmodifications. Low-level programs can run on only one kind of computer and have to\nbe rewritten to run on another.\n\n\nDue to these advantages, almost all programs are written in high-level languages. Lowlevel\nlanguages are used only for a few specialized applications.\n\n\nTwo kinds of programs process high-level languages into low-level languages:\ninterpreters and compilers. An interpreter reads a high-level program and executes it,\nmeaning that it does what the program says. It processes the program a little at a time,\nalternately reading lines and performing computations. Figure 1-1 shows the structure\nof an interpreter.\n\n\n \n\n\nA compiler reads the program and translates it completely before the program starts\nrunning. In this context, the high-level program is called the source code, and the\ntranslated program is called the object code or the executable. Once a program is com\npiled, you can execute it repeatedly without further translation. Figure 1-2 shows the\nstructure of a compiler.\n\n\n\n\nPython is considered an interpreted language because Python programs are executed\nby an interpreter. There are two ways to use the interpreter: \ninteractive\n mode and \nscript mode\n. In interactive mode, you type Python programs and the interpreter displays the\nresult:\n>\n 1 + 1\n2\nThe chevron, \n, is the prompt the interpreter uses to indicate that it is ready. If you\ntype 1 + 1, the interpreter replies 2.\n\n\nAlternatively, you can store code in a file and use the interpreter to execute the contents\nof the file, which is called a script. By convention, Python scripts have names that end\nwith .py.\nTo execute the script, you have to tell the interpreter the name of the file. If you have a\nscript named dinsdale.py and you are working in a UNIX command window, you type\npython dinsdale.py. In other development environments, the details of executing\nscripts are different. You can find instructions for your environment at the Python web\nsite http://python.org.\nWorking in interactive mode is convenient for testing small pieces of code because you\ncan type and execute them immediately. But for anything more than a few lines, you\nshould save your code as a script so you can modify and execute it in the future.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nPython\u2019s View\n\n\nThe brief description in the prior section is fairly standard for scripting languages, and\nit\u2019s usually all that most Python programmers need to know. You type code into text\nfiles, and you run those files through the interpreter. Under the hood, though, a bit\nmore happens when you tell Python to \u201cgo.\u201d Although knowledge of Python internals\nis not strictly required for Python programming, a basic understanding of the runtime\nstructure of Python can help you grasp the bigger picture of program execution.\nWhen you instruct Python to run your script, there are a few steps that Python carries\nout before your code actually starts crunching away. Specifically, it\u2019s first compiled to\nsomething called \u201cbyte code\u201d and then routed to something called a \u201cvirtual machine.\u201d\n\n\nByte code compilation\n\n\nInternally, and almost completely hidden from you, when you execute a program\nPython first compiles your source code (the statements in your file) into a format known\nas byte code. Compilation is simply a translation step, and byte code is a lower-level,\nplatform-independent representation of your source code. Roughly, Python translates\neach of your source statements into a group of byte code instructions by decomposing\nthem into individual steps. This byte code translation is performed to speed\nexecution\u2014byte code can be run much more quickly than the original source code\nstatements in your text file.\nYou\u2019ll notice that the prior paragraph said that this is almost completely hidden from\nyou. If the Python process has write access on your machine, it will store the byte code\nof your programs in files that end with a .pyc extension (\u201c.pyc\u201d means compiled \u201c.py\u201d\nsource). You will see these files show up on your computer after you\u2019ve run a few\nprograms alongside the corresponding source code files (that is, in the same\ndirectories).\nPython saves byte code like this as a startup speed optimization. The next time you run\nyour program, Python will load the .pyc files and skip the compilation step, as long as\nyou haven\u2019t changed your source code since the byte code was last saved. Python automatically\nchecks the timestamps of source and byte code files to know when it must\nrecompile\u2014if you resave your source code, byte code is automatically re-created the\nnext time your program is run.\nIf Python cannot write the byte code files to your machine, your program still works\u2014\nthe byte code is generated in memory and simply discarded on program exit.* However,\nbecause .pyc files speed startup time, you\u2019ll want to make sure they are written for larger\nprograms. Byte code files are also one way to ship Python programs\u2014Python is happy\nto run a program if all it can find are .pyc files, even if the original .py source files are\nabsent.\n\n\nThe Python Virtual Machine (PVM)\n\n\nOnce your program has been compiled to byte code (or the byte code has been loaded\nfrom existing .pyc files), it is shipped off for execution to something generally known\nas the Python Virtual Machine (PVM, for the more acronym-inclined among you). The\nPVM sounds more impressive than it is; really, it\u2019s not a separate program, and it need\nnot be installed by itself. In fact, the PVM is just a big loop that iterates through your\nbyte code instructions, one by one, to carry out their operations. The PVM is the runtime\nengine of Python; it\u2019s always present as part of the Python system, and it\u2019s the\ncomponent that truly runs your scripts. Technically, it\u2019s just the last step of what is\ncalled the \u201cPython interpreter.\u201d\n\n\n\n\nFigure illustrates the runtime structure described here. Keep in mind that all of this\ncomplexity is deliberately hidden from Python programmers. Byte code compilation is\nautomatic, and the PVM is just part of the Python system that you have installed on\nyour machine. Again, programmers simply code and run files of statements.\n\n\nPerformance implications\n\n\nReaders with a background in fully compiled languages such as C and C++ might notice\na few differences in the Python model. For one thing, there is usually no build or \u201cmake\u201d\nstep in Python work: code runs immediately after it is written. For another, Python byte\ncode is not binary machine code (e.g., instructions for an Intel chip). Byte code is a\nPython-specific representation.\n\n\nThis is why some Python code may not run as fast as C or C++ code, as described in\nChapter 1\u2014the PVM loop, not the CPU chip, still must interpret the byte code, and\nbyte code instructions require more work than CPU instructions. On the other hand,\nunlike in classic interpreters, there is still an internal compile step\u2014Python does not\nneed to reanalyze and reparse each source statement repeatedly. The net effect is that\npure Python code runs at speeds somewhere between those of a traditional compiled\nlanguage and a traditional interpreted language. See Chapter 1 for more on Python\nperformance tradeoffs.\n\n\n\n\nSource:\n \n\n\n \nLearning Python, Fourth Edition\n by Mark Lutz - 2009\n\n\n\n\nPython Implementation Alternatives\n\n\nReally, as this book is being written, there are three primary implementations of the\nPython language\u2014CPython, Jython, and IronPython\u2014along with a handful of secondary\nimplementations such as Stackless Python. In brief, CPython is the standard implementation;\nall the others have very specific purposes and roles. All implement the\nsame Python language but execute programs in different ways.\n\n\nCPython\n\n\nThe original, and standard, implementation of Python is usually called CPython, when\nyou want to contrast it with the other two. Its name comes from the fact that it is coded\nin portable ANSI C language code. This is the Python that you fetch from http://www\n.python.org, get with the ActivePython distribution, and have automatically on most\nLinux and Mac OS X machines. If you\u2019ve found a preinstalled version of Python on\nyour machine, it\u2019s probably CPython, unless your company is using Python in very\nspecialized ways.\nUnless you want to script Java or .NET applications with Python, you probably want\nto use the standard CPython system. Because it is the reference implementation of the\nlanguage, it tends to run the fastest, be the most complete, and be more robust than\nthe alternative systems. Figure 1-3 reflects CPython\u2019s runtime architecture.\n\n\nJython\n\n\nThe Jython system (originally known as JPython) is an alternative implementation of\nthe Python language, targeted for integration with the Java programming language.\nJython consists of Java classes that compile Python source code to Java byte code and\nthen route the resulting byte code to the Java Virtual Machine (JVM). Programmers\nstill code Python statements in .py text files as usual; the Jython system essentially just\nreplaces the rightmost two bubbles in Figure 1-3 with Java-based equivalents.\nJython\u2019s goal is to allow Python code to script Java applications, much as CPython\nallows Python to script C and C++ components. Its integration with Java is remarkably\nseamless. Because Python code is translated to Java byte code, it looks and feels like a\ntrue Java program at runtime. Jython scripts can serve as web applets and servlets, build\nJava-based GUIs, and so on. Moreover, Jython includes integration support that allows\nPython code to import and use Java classes as though they were coded in Python.\nBecause Jython is slower and less robust than CPython, though, it is usually seen as a\ntool of interest primarily to Java developers looking for a scripting language to be a\nfrontend to Java code.\n\n\nIronPython\n\n\nA third implementation of Python, and newer than both CPython and Jython,\nIronPython is designed to allow Python programs to integrate with applications coded\nto work with Microsoft\u2019s .NET Framework for Windows, as well as the Mono open\nsource equivalent for Linux. .NET and its C# programming language runtime system\nare designed to be a language-neutral object communication layer, in the spirit of Microsoft\u2019s\nearlier COM model. IronPython allows Python programs to act as both client\nand server components, accessible from other .NET languages.\nBy implementation, IronPython is very much like Jython (and, in fact, was developed\nby the same creator)\u2014it replaces the last two bubbles in Figure 1-3 with equivalents\nfor execution in the .NET environment. Also, like Jython, IronPython has a special\nfocus\u2014it is primarily of interest to developers integrating Python with .NET components.\nBecause it is being developed by Microsoft, though, IronPython might also be\nable to leverage some important optimization tools for better performance.\nIronPython\u2019s scope is still evolving as I write this; for more details, consult the Python\nonline resources or search the Web.\n\n\n\n\nSource:\n \n\n\n \nLearning Python, Fourth Edition\n by Mark Lutz - 2009\n\n\n\n\nPython Programming Language Advantages\n\n\nPython is a dynamic, strongly typed, object oriented, multipurpose programming language, designed to be quick (to learn, to use, and to understand), and to enforce a clean and uniform syntax.\n\n\n\n\nPython is dynamically typed: it means that you don't declare a type (e.g. 'integer') for a variable name, and then assign something of that type (and only that type). Instead, you have variable names, and you bind them to entities whose type stays with the entity itself. a = 5 makes the variable name a to refer to the integer 5. Later, a = \"hello\" makes the variable name a to refer to a string containing \"hello\". Static typed languages would have you declare int a and then a = 5, but assigning a = \"hello\" would have been a compile time error. On one hand, this makes everything more unpredictable (you don't know what a refers to). On the other hand, it makes very easy to achieve some results a static typed languages makes very difficult.\n\n\nPython is strongly typed. It means that if a = \"5\" (the string whose value is '5') will remain a string, and never coerced to a number if the context requires so. Every type conversion in python must be done explicitly. This is different from, for example, Perl or Javascript, where you have weak typing, and can write things like \"hello\" + 5 to get \"hello5\".\n\n\nPython is object oriented, with class-based inheritance. Everything is an object (including classes, functions, modules, etc), in the sense that they can be passed around as arguments, have methods and attributes, and so on. \n\n\nPython is multipurpose: it is not specialised to a specific target of users (like R for statistics, or PHP for web programming). It is extended through modules and libraries, that hook very easily into the C programming language.\n\n\nPython enforces correct indentation of the code by making the indentation part of the syntax. There are no control braces in Python. Blocks of code are identified by the level of indentation. Although a big turn off for many programmers not used to this, it is precious as it gives a very uniform style and results in code that is visually pleasant to read.\n\n\nThe code is compiled into byte code and then executed in a virtual machine. This means that precompiled code is portable between platforms.\n\n\n\n\nPython can be used for any programming task, from GUI programming to web programming with everything else in between. It's quite efficient, as much of its activity is done at the C level. Python is just a layer on top of C. There are libraries for everything you can think of: game programming and openGL, GUI interfaces, web frameworks, semantic web, scientific computing...\n\n\n\n\nSource:\n \n\n\n https://stackoverflow.com/questions/1909512/what-is-python-used-for\n\n\n\n\nAdventages again\n\n\n\n\nEasy Syntax\n\nPython's syntax is easy to learn, so both non-programmers and programmers can start programming right away.\n\n\nReadability\n\nPython's syntax is very clear, so it is easy to understand program code. (Python is often referred to as \"executable pseudo-code\" because its syntax mostly follows the conventions used by programmers to outline their ideas without the formal verbosity of code in most programming languages; in other words syntax of Python is almost identical to the simplified \"pseudo-code\" used by many programmers to prototype and describe their solution to other programmers. Thus Python can be used to prototype and test code which is later to be implemented in other programming languages).[citation needed]\n\n\nHigh-Level Language\n\nPython looks more like a readable, human language than like a low-level language. This gives you the ability to program at a faster rate than a low-level language will allow you.\n\n\nObject oriented programming\n\nObject-oriented programming allows you to create data structures that can be re-used, which reduces the amount of repetitive work that you'll need to do. Programming languages usually define objects with namespaces, like class or def, and objects can edit themselves by using keyword, like this or self. Most modern programming languages are object-oriented (such as Java, C++, and C#) or have support for OOP features (such as Perl version 5 and later). Additionally object-oriented techniques can be used in the design of almost any non-trivial software and implemented in almost any programming or scripting language. (For example a number of Linux kernel features are \"objects\" which implement their own encapsulation of behavior and data structive via pointers, specifically pointers to functions, in the C programming language).[citation needed] Python's support for object-oriented programming is one of its greatest benefits to new programmers because they will be encountering the same concepts and terminology in their work environment. If you ever decide to switch languages, or use any other for that fact, you'll have a significant chance that you'll be working with object-oriented programming.[1]\n\n\nIt's Free\n\nPython is both free and open-source. The Python Software Foundation distributes pre-made binaries that are freely available for use on all major operating systems called CPython. You can get CPython's source-code, too. Plus, you can modify the source code and distribute as allowed by CPython's license. [2] (Luckily, CPython has a permissive free software license attitude.)\n\n\nCross-platform\n\nPython runs on all major operating systems like Microsoft Windows, Linux, and Mac OS X.\n\n\nWidely Supported\n\nPython has an active support community with many web sites, mailing lists, and USENET \"netnews\" groups that attract a large number of knowledgeable and helpful contributes.\n\n\nIt's Safe\n\nPython doesn't have pointers like other C-based languages, making it much more reliable. Along with that, errors never pass silently unless they're explicitly silenced. This allows you to see and read why the program crashed and where to correct your error.\n\n\nBatteries Included\n\nPython is famous for being the \"batteries are included\" language.[3] There are over 300 standard library modules which contain modules and classes for a wide variety of programming tasks.[citation needed] For example the standard library contains modules for safely creating temporary files (named or anonymous), mapping files into memory (including use of shared and anonymous memory mappings), spawning and controlling sub-processes, compressing and decompressing files (compatible with gzip or PK-zip) and archives files (such as Unix/Linux \"tar\"), accessing indexed \"DBM\" (database) files, interfacing to various graphical user interfaces (such as the TK toolkit and the popular WxWindows multi-platform windowing system), parsing and maintaining CSV (comma-separated values) and \".cfg\" or \".ini\" configuration files (similar in syntax to the venerable WIN.INI files from MS-DOS and MS-Windows), for sending e-mail, fetching and parsing web pages, etc. It's possible, for example, to create a custom web server in Python using less than a dozen lines of code, and one of the standard libraries, of course.\n\n\nExtensible\n\nIn addition to the standard libraries there are extensive collections of freely available add-on modules, libraries, frameworks, and tool-kits. These generally conform to similar standards and conventions; for example almost all of the database adapters (to talk to almost any client-server RDBMS engine such as MySQL, Postgres, Oracle, etc) conform to the Python DBAPI and thus can mostly be accessed using the same code. So it's usually easy to modify a Python program to support any database engine.\n\n\n\n\n\n\nSource:\n \n\n\n https://en.wikiversity.org/wiki/Python_Concepts/Why_learn_Python\n\n\n\n\nWho Uses Python Today ?\n\n\nHere are links to just a few of the organizations that use python:\n\n- \n https://wiki.python.org/moin/OrganizationsUsingPython\n\n\nPython Success Stories :\n\n- \n https://www.python.org/about/success", "title": "The Python Programming Language, Implementation and Adventages" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#the-python-programming-language", - "text": "The programming language you will learn is Python. Python is an example of a highlevel\nlanguage; other high-level languages you might have heard of are C, C++, Perl, \nand Java .\nThere are also low-level languages, sometimes referred to as \u201cmachine languages\u201d or \u201cassembly languages.\u201d Loosely speaking, computers can only run programs written in\nlow-level languages. So programs written in a high-level language have to be processed\nbefore they can run. This extra processing takes some time, which is a small disadvantage\nof high-level languages. The advantages are enormous. First, it is much easier to program in a high-level lan\nguage. Programs written in a high-level language take less time to write, they are shorter\nand easier to read, and they are more likely to be correct. Second, high-level languages\nare portable, meaning that they can run on different kinds of computers with few or no\nmodifications. Low-level programs can run on only one kind of computer and have to\nbe rewritten to run on another. Due to these advantages, almost all programs are written in high-level languages. Lowlevel\nlanguages are used only for a few specialized applications. Two kinds of programs process high-level languages into low-level languages:\ninterpreters and compilers. An interpreter reads a high-level program and executes it,\nmeaning that it does what the program says. It processes the program a little at a time,\nalternately reading lines and performing computations. Figure 1-1 shows the structure\nof an interpreter. A compiler reads the program and translates it completely before the program starts\nrunning. In this context, the high-level program is called the source code, and the\ntranslated program is called the object code or the executable. Once a program is com\npiled, you can execute it repeatedly without further translation. Figure 1-2 shows the\nstructure of a compiler. Python is considered an interpreted language because Python programs are executed\nby an interpreter. There are two ways to use the interpreter: interactive mode and script mode . In interactive mode, you type Python programs and the interpreter displays the\nresult:\n> 1 + 1\n2\nThe chevron, , is the prompt the interpreter uses to indicate that it is ready. If you\ntype 1 + 1, the interpreter replies 2. Alternatively, you can store code in a file and use the interpreter to execute the contents\nof the file, which is called a script. By convention, Python scripts have names that end\nwith .py.\nTo execute the script, you have to tell the interpreter the name of the file. If you have a\nscript named dinsdale.py and you are working in a UNIX command window, you type\npython dinsdale.py. In other development environments, the details of executing\nscripts are different. You can find instructions for your environment at the Python web\nsite http://python.org.\nWorking in interactive mode is convenient for testing small pieces of code because you\ncan type and execute them immediately. But for anything more than a few lines, you\nshould save your code as a script so you can modify and execute it in the future. Source: Think Python by Allen B. Downey - 2012", + "location": "/beginner/Python_Programming_Lanuage/#the-python-programming-language", + "text": "The programming language you will learn is Python. Python is an example of a highlevel\nlanguage; other high-level languages you might have heard of are C, C++, Perl, \nand Java .\nThere are also low-level languages, sometimes referred to as \u201cmachine languages\u201d or \u201cassembly languages.\u201d Loosely speaking, computers can only run programs written in\nlow-level languages. So programs written in a high-level language have to be processed\nbefore they can run. This extra processing takes some time, which is a small disadvantage\nof high-level languages. The advantages are enormous. First, it is much easier to program in a high-level lan\nguage. Programs written in a high-level language take less time to write, they are shorter\nand easier to read, and they are more likely to be correct. Second, high-level languages\nare portable, meaning that they can run on different kinds of computers with few or no\nmodifications. Low-level programs can run on only one kind of computer and have to\nbe rewritten to run on another. Due to these advantages, almost all programs are written in high-level languages. Lowlevel\nlanguages are used only for a few specialized applications. Two kinds of programs process high-level languages into low-level languages:\ninterpreters and compilers. An interpreter reads a high-level program and executes it,\nmeaning that it does what the program says. It processes the program a little at a time,\nalternately reading lines and performing computations. Figure 1-1 shows the structure\nof an interpreter. A compiler reads the program and translates it completely before the program starts\nrunning. In this context, the high-level program is called the source code, and the\ntranslated program is called the object code or the executable. Once a program is com\npiled, you can execute it repeatedly without further translation. Figure 1-2 shows the\nstructure of a compiler. Python is considered an interpreted language because Python programs are executed\nby an interpreter. There are two ways to use the interpreter: interactive mode and script mode . In interactive mode, you type Python programs and the interpreter displays the\nresult:\n> 1 + 1\n2\nThe chevron, , is the prompt the interpreter uses to indicate that it is ready. If you\ntype 1 + 1, the interpreter replies 2. Alternatively, you can store code in a file and use the interpreter to execute the contents\nof the file, which is called a script. By convention, Python scripts have names that end\nwith .py.\nTo execute the script, you have to tell the interpreter the name of the file. If you have a\nscript named dinsdale.py and you are working in a UNIX command window, you type\npython dinsdale.py. In other development environments, the details of executing\nscripts are different. You can find instructions for your environment at the Python web\nsite http://python.org.\nWorking in interactive mode is convenient for testing small pieces of code because you\ncan type and execute them immediately. But for anything more than a few lines, you\nshould save your code as a script so you can modify and execute it in the future. Source: Think Python by Allen B. Downey - 2012", "title": "The Python Programming Language" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#pythons-view", - "text": "The brief description in the prior section is fairly standard for scripting languages, and\nit\u2019s usually all that most Python programmers need to know. You type code into text\nfiles, and you run those files through the interpreter. Under the hood, though, a bit\nmore happens when you tell Python to \u201cgo.\u201d Although knowledge of Python internals\nis not strictly required for Python programming, a basic understanding of the runtime\nstructure of Python can help you grasp the bigger picture of program execution.\nWhen you instruct Python to run your script, there are a few steps that Python carries\nout before your code actually starts crunching away. Specifically, it\u2019s first compiled to\nsomething called \u201cbyte code\u201d and then routed to something called a \u201cvirtual machine.\u201d", + "location": "/beginner/Python_Programming_Lanuage/#pythons-view", + "text": "The brief description in the prior section is fairly standard for scripting languages, and\nit\u2019s usually all that most Python programmers need to know. You type code into text\nfiles, and you run those files through the interpreter. Under the hood, though, a bit\nmore happens when you tell Python to \u201cgo.\u201d Although knowledge of Python internals\nis not strictly required for Python programming, a basic understanding of the runtime\nstructure of Python can help you grasp the bigger picture of program execution.\nWhen you instruct Python to run your script, there are a few steps that Python carries\nout before your code actually starts crunching away. Specifically, it\u2019s first compiled to\nsomething called \u201cbyte code\u201d and then routed to something called a \u201cvirtual machine.\u201d", "title": "Python\u2019s View" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#byte-code-compilation", - "text": "Internally, and almost completely hidden from you, when you execute a program\nPython first compiles your source code (the statements in your file) into a format known\nas byte code. Compilation is simply a translation step, and byte code is a lower-level,\nplatform-independent representation of your source code. Roughly, Python translates\neach of your source statements into a group of byte code instructions by decomposing\nthem into individual steps. This byte code translation is performed to speed\nexecution\u2014byte code can be run much more quickly than the original source code\nstatements in your text file.\nYou\u2019ll notice that the prior paragraph said that this is almost completely hidden from\nyou. If the Python process has write access on your machine, it will store the byte code\nof your programs in files that end with a .pyc extension (\u201c.pyc\u201d means compiled \u201c.py\u201d\nsource). You will see these files show up on your computer after you\u2019ve run a few\nprograms alongside the corresponding source code files (that is, in the same\ndirectories).\nPython saves byte code like this as a startup speed optimization. The next time you run\nyour program, Python will load the .pyc files and skip the compilation step, as long as\nyou haven\u2019t changed your source code since the byte code was last saved. Python automatically\nchecks the timestamps of source and byte code files to know when it must\nrecompile\u2014if you resave your source code, byte code is automatically re-created the\nnext time your program is run.\nIf Python cannot write the byte code files to your machine, your program still works\u2014\nthe byte code is generated in memory and simply discarded on program exit.* However,\nbecause .pyc files speed startup time, you\u2019ll want to make sure they are written for larger\nprograms. Byte code files are also one way to ship Python programs\u2014Python is happy\nto run a program if all it can find are .pyc files, even if the original .py source files are\nabsent.", + "location": "/beginner/Python_Programming_Lanuage/#byte-code-compilation", + "text": "Internally, and almost completely hidden from you, when you execute a program\nPython first compiles your source code (the statements in your file) into a format known\nas byte code. Compilation is simply a translation step, and byte code is a lower-level,\nplatform-independent representation of your source code. Roughly, Python translates\neach of your source statements into a group of byte code instructions by decomposing\nthem into individual steps. This byte code translation is performed to speed\nexecution\u2014byte code can be run much more quickly than the original source code\nstatements in your text file.\nYou\u2019ll notice that the prior paragraph said that this is almost completely hidden from\nyou. If the Python process has write access on your machine, it will store the byte code\nof your programs in files that end with a .pyc extension (\u201c.pyc\u201d means compiled \u201c.py\u201d\nsource). You will see these files show up on your computer after you\u2019ve run a few\nprograms alongside the corresponding source code files (that is, in the same\ndirectories).\nPython saves byte code like this as a startup speed optimization. The next time you run\nyour program, Python will load the .pyc files and skip the compilation step, as long as\nyou haven\u2019t changed your source code since the byte code was last saved. Python automatically\nchecks the timestamps of source and byte code files to know when it must\nrecompile\u2014if you resave your source code, byte code is automatically re-created the\nnext time your program is run.\nIf Python cannot write the byte code files to your machine, your program still works\u2014\nthe byte code is generated in memory and simply discarded on program exit.* However,\nbecause .pyc files speed startup time, you\u2019ll want to make sure they are written for larger\nprograms. Byte code files are also one way to ship Python programs\u2014Python is happy\nto run a program if all it can find are .pyc files, even if the original .py source files are\nabsent.", "title": "Byte code compilation" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#the-python-virtual-machine-pvm", - "text": "Once your program has been compiled to byte code (or the byte code has been loaded\nfrom existing .pyc files), it is shipped off for execution to something generally known\nas the Python Virtual Machine (PVM, for the more acronym-inclined among you). The\nPVM sounds more impressive than it is; really, it\u2019s not a separate program, and it need\nnot be installed by itself. In fact, the PVM is just a big loop that iterates through your\nbyte code instructions, one by one, to carry out their operations. The PVM is the runtime\nengine of Python; it\u2019s always present as part of the Python system, and it\u2019s the\ncomponent that truly runs your scripts. Technically, it\u2019s just the last step of what is\ncalled the \u201cPython interpreter.\u201d Figure illustrates the runtime structure described here. Keep in mind that all of this\ncomplexity is deliberately hidden from Python programmers. Byte code compilation is\nautomatic, and the PVM is just part of the Python system that you have installed on\nyour machine. Again, programmers simply code and run files of statements.", + "location": "/beginner/Python_Programming_Lanuage/#the-python-virtual-machine-pvm", + "text": "Once your program has been compiled to byte code (or the byte code has been loaded\nfrom existing .pyc files), it is shipped off for execution to something generally known\nas the Python Virtual Machine (PVM, for the more acronym-inclined among you). The\nPVM sounds more impressive than it is; really, it\u2019s not a separate program, and it need\nnot be installed by itself. In fact, the PVM is just a big loop that iterates through your\nbyte code instructions, one by one, to carry out their operations. The PVM is the runtime\nengine of Python; it\u2019s always present as part of the Python system, and it\u2019s the\ncomponent that truly runs your scripts. Technically, it\u2019s just the last step of what is\ncalled the \u201cPython interpreter.\u201d Figure illustrates the runtime structure described here. Keep in mind that all of this\ncomplexity is deliberately hidden from Python programmers. Byte code compilation is\nautomatic, and the PVM is just part of the Python system that you have installed on\nyour machine. Again, programmers simply code and run files of statements.", "title": "The Python Virtual Machine (PVM)" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#performance-implications", - "text": "Readers with a background in fully compiled languages such as C and C++ might notice\na few differences in the Python model. For one thing, there is usually no build or \u201cmake\u201d\nstep in Python work: code runs immediately after it is written. For another, Python byte\ncode is not binary machine code (e.g., instructions for an Intel chip). Byte code is a\nPython-specific representation. This is why some Python code may not run as fast as C or C++ code, as described in\nChapter 1\u2014the PVM loop, not the CPU chip, still must interpret the byte code, and\nbyte code instructions require more work than CPU instructions. On the other hand,\nunlike in classic interpreters, there is still an internal compile step\u2014Python does not\nneed to reanalyze and reparse each source statement repeatedly. The net effect is that\npure Python code runs at speeds somewhere between those of a traditional compiled\nlanguage and a traditional interpreted language. See Chapter 1 for more on Python\nperformance tradeoffs. Source: Learning Python, Fourth Edition by Mark Lutz - 2009", + "location": "/beginner/Python_Programming_Lanuage/#performance-implications", + "text": "Readers with a background in fully compiled languages such as C and C++ might notice\na few differences in the Python model. For one thing, there is usually no build or \u201cmake\u201d\nstep in Python work: code runs immediately after it is written. For another, Python byte\ncode is not binary machine code (e.g., instructions for an Intel chip). Byte code is a\nPython-specific representation. This is why some Python code may not run as fast as C or C++ code, as described in\nChapter 1\u2014the PVM loop, not the CPU chip, still must interpret the byte code, and\nbyte code instructions require more work than CPU instructions. On the other hand,\nunlike in classic interpreters, there is still an internal compile step\u2014Python does not\nneed to reanalyze and reparse each source statement repeatedly. The net effect is that\npure Python code runs at speeds somewhere between those of a traditional compiled\nlanguage and a traditional interpreted language. See Chapter 1 for more on Python\nperformance tradeoffs. Source: Learning Python, Fourth Edition by Mark Lutz - 2009", "title": "Performance implications" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#python-implementation-alternatives", - "text": "Really, as this book is being written, there are three primary implementations of the\nPython language\u2014CPython, Jython, and IronPython\u2014along with a handful of secondary\nimplementations such as Stackless Python. In brief, CPython is the standard implementation;\nall the others have very specific purposes and roles. All implement the\nsame Python language but execute programs in different ways.", + "location": "/beginner/Python_Programming_Lanuage/#python-implementation-alternatives", + "text": "Really, as this book is being written, there are three primary implementations of the\nPython language\u2014CPython, Jython, and IronPython\u2014along with a handful of secondary\nimplementations such as Stackless Python. In brief, CPython is the standard implementation;\nall the others have very specific purposes and roles. All implement the\nsame Python language but execute programs in different ways.", "title": "Python Implementation Alternatives" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#cpython", - "text": "The original, and standard, implementation of Python is usually called CPython, when\nyou want to contrast it with the other two. Its name comes from the fact that it is coded\nin portable ANSI C language code. This is the Python that you fetch from http://www\n.python.org, get with the ActivePython distribution, and have automatically on most\nLinux and Mac OS X machines. If you\u2019ve found a preinstalled version of Python on\nyour machine, it\u2019s probably CPython, unless your company is using Python in very\nspecialized ways.\nUnless you want to script Java or .NET applications with Python, you probably want\nto use the standard CPython system. Because it is the reference implementation of the\nlanguage, it tends to run the fastest, be the most complete, and be more robust than\nthe alternative systems. Figure 1-3 reflects CPython\u2019s runtime architecture.", + "location": "/beginner/Python_Programming_Lanuage/#cpython", + "text": "The original, and standard, implementation of Python is usually called CPython, when\nyou want to contrast it with the other two. Its name comes from the fact that it is coded\nin portable ANSI C language code. This is the Python that you fetch from http://www\n.python.org, get with the ActivePython distribution, and have automatically on most\nLinux and Mac OS X machines. If you\u2019ve found a preinstalled version of Python on\nyour machine, it\u2019s probably CPython, unless your company is using Python in very\nspecialized ways.\nUnless you want to script Java or .NET applications with Python, you probably want\nto use the standard CPython system. Because it is the reference implementation of the\nlanguage, it tends to run the fastest, be the most complete, and be more robust than\nthe alternative systems. Figure 1-3 reflects CPython\u2019s runtime architecture.", "title": "CPython" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#jython", - "text": "The Jython system (originally known as JPython) is an alternative implementation of\nthe Python language, targeted for integration with the Java programming language.\nJython consists of Java classes that compile Python source code to Java byte code and\nthen route the resulting byte code to the Java Virtual Machine (JVM). Programmers\nstill code Python statements in .py text files as usual; the Jython system essentially just\nreplaces the rightmost two bubbles in Figure 1-3 with Java-based equivalents.\nJython\u2019s goal is to allow Python code to script Java applications, much as CPython\nallows Python to script C and C++ components. Its integration with Java is remarkably\nseamless. Because Python code is translated to Java byte code, it looks and feels like a\ntrue Java program at runtime. Jython scripts can serve as web applets and servlets, build\nJava-based GUIs, and so on. Moreover, Jython includes integration support that allows\nPython code to import and use Java classes as though they were coded in Python.\nBecause Jython is slower and less robust than CPython, though, it is usually seen as a\ntool of interest primarily to Java developers looking for a scripting language to be a\nfrontend to Java code.", + "location": "/beginner/Python_Programming_Lanuage/#jython", + "text": "The Jython system (originally known as JPython) is an alternative implementation of\nthe Python language, targeted for integration with the Java programming language.\nJython consists of Java classes that compile Python source code to Java byte code and\nthen route the resulting byte code to the Java Virtual Machine (JVM). Programmers\nstill code Python statements in .py text files as usual; the Jython system essentially just\nreplaces the rightmost two bubbles in Figure 1-3 with Java-based equivalents.\nJython\u2019s goal is to allow Python code to script Java applications, much as CPython\nallows Python to script C and C++ components. Its integration with Java is remarkably\nseamless. Because Python code is translated to Java byte code, it looks and feels like a\ntrue Java program at runtime. Jython scripts can serve as web applets and servlets, build\nJava-based GUIs, and so on. Moreover, Jython includes integration support that allows\nPython code to import and use Java classes as though they were coded in Python.\nBecause Jython is slower and less robust than CPython, though, it is usually seen as a\ntool of interest primarily to Java developers looking for a scripting language to be a\nfrontend to Java code.", "title": "Jython" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#ironpython", - "text": "A third implementation of Python, and newer than both CPython and Jython,\nIronPython is designed to allow Python programs to integrate with applications coded\nto work with Microsoft\u2019s .NET Framework for Windows, as well as the Mono open\nsource equivalent for Linux. .NET and its C# programming language runtime system\nare designed to be a language-neutral object communication layer, in the spirit of Microsoft\u2019s\nearlier COM model. IronPython allows Python programs to act as both client\nand server components, accessible from other .NET languages.\nBy implementation, IronPython is very much like Jython (and, in fact, was developed\nby the same creator)\u2014it replaces the last two bubbles in Figure 1-3 with equivalents\nfor execution in the .NET environment. Also, like Jython, IronPython has a special\nfocus\u2014it is primarily of interest to developers integrating Python with .NET components.\nBecause it is being developed by Microsoft, though, IronPython might also be\nable to leverage some important optimization tools for better performance.\nIronPython\u2019s scope is still evolving as I write this; for more details, consult the Python\nonline resources or search the Web. Source: Learning Python, Fourth Edition by Mark Lutz - 2009", + "location": "/beginner/Python_Programming_Lanuage/#ironpython", + "text": "A third implementation of Python, and newer than both CPython and Jython,\nIronPython is designed to allow Python programs to integrate with applications coded\nto work with Microsoft\u2019s .NET Framework for Windows, as well as the Mono open\nsource equivalent for Linux. .NET and its C# programming language runtime system\nare designed to be a language-neutral object communication layer, in the spirit of Microsoft\u2019s\nearlier COM model. IronPython allows Python programs to act as both client\nand server components, accessible from other .NET languages.\nBy implementation, IronPython is very much like Jython (and, in fact, was developed\nby the same creator)\u2014it replaces the last two bubbles in Figure 1-3 with equivalents\nfor execution in the .NET environment. Also, like Jython, IronPython has a special\nfocus\u2014it is primarily of interest to developers integrating Python with .NET components.\nBecause it is being developed by Microsoft, though, IronPython might also be\nable to leverage some important optimization tools for better performance.\nIronPython\u2019s scope is still evolving as I write this; for more details, consult the Python\nonline resources or search the Web. Source: Learning Python, Fourth Edition by Mark Lutz - 2009", "title": "IronPython" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#python-programming-language-advantages", - "text": "Python is a dynamic, strongly typed, object oriented, multipurpose programming language, designed to be quick (to learn, to use, and to understand), and to enforce a clean and uniform syntax. Python is dynamically typed: it means that you don't declare a type (e.g. 'integer') for a variable name, and then assign something of that type (and only that type). Instead, you have variable names, and you bind them to entities whose type stays with the entity itself. a = 5 makes the variable name a to refer to the integer 5. Later, a = \"hello\" makes the variable name a to refer to a string containing \"hello\". Static typed languages would have you declare int a and then a = 5, but assigning a = \"hello\" would have been a compile time error. On one hand, this makes everything more unpredictable (you don't know what a refers to). On the other hand, it makes very easy to achieve some results a static typed languages makes very difficult. Python is strongly typed. It means that if a = \"5\" (the string whose value is '5') will remain a string, and never coerced to a number if the context requires so. Every type conversion in python must be done explicitly. This is different from, for example, Perl or Javascript, where you have weak typing, and can write things like \"hello\" + 5 to get \"hello5\". Python is object oriented, with class-based inheritance. Everything is an object (including classes, functions, modules, etc), in the sense that they can be passed around as arguments, have methods and attributes, and so on. Python is multipurpose: it is not specialised to a specific target of users (like R for statistics, or PHP for web programming). It is extended through modules and libraries, that hook very easily into the C programming language. Python enforces correct indentation of the code by making the indentation part of the syntax. There are no control braces in Python. Blocks of code are identified by the level of indentation. Although a big turn off for many programmers not used to this, it is precious as it gives a very uniform style and results in code that is visually pleasant to read. The code is compiled into byte code and then executed in a virtual machine. This means that precompiled code is portable between platforms. Python can be used for any programming task, from GUI programming to web programming with everything else in between. It's quite efficient, as much of its activity is done at the C level. Python is just a layer on top of C. There are libraries for everything you can think of: game programming and openGL, GUI interfaces, web frameworks, semantic web, scientific computing... Source: https://stackoverflow.com/questions/1909512/what-is-python-used-for", + "location": "/beginner/Python_Programming_Lanuage/#python-programming-language-advantages", + "text": "Python is a dynamic, strongly typed, object oriented, multipurpose programming language, designed to be quick (to learn, to use, and to understand), and to enforce a clean and uniform syntax. Python is dynamically typed: it means that you don't declare a type (e.g. 'integer') for a variable name, and then assign something of that type (and only that type). Instead, you have variable names, and you bind them to entities whose type stays with the entity itself. a = 5 makes the variable name a to refer to the integer 5. Later, a = \"hello\" makes the variable name a to refer to a string containing \"hello\". Static typed languages would have you declare int a and then a = 5, but assigning a = \"hello\" would have been a compile time error. On one hand, this makes everything more unpredictable (you don't know what a refers to). On the other hand, it makes very easy to achieve some results a static typed languages makes very difficult. Python is strongly typed. It means that if a = \"5\" (the string whose value is '5') will remain a string, and never coerced to a number if the context requires so. Every type conversion in python must be done explicitly. This is different from, for example, Perl or Javascript, where you have weak typing, and can write things like \"hello\" + 5 to get \"hello5\". Python is object oriented, with class-based inheritance. Everything is an object (including classes, functions, modules, etc), in the sense that they can be passed around as arguments, have methods and attributes, and so on. Python is multipurpose: it is not specialised to a specific target of users (like R for statistics, or PHP for web programming). It is extended through modules and libraries, that hook very easily into the C programming language. Python enforces correct indentation of the code by making the indentation part of the syntax. There are no control braces in Python. Blocks of code are identified by the level of indentation. Although a big turn off for many programmers not used to this, it is precious as it gives a very uniform style and results in code that is visually pleasant to read. The code is compiled into byte code and then executed in a virtual machine. This means that precompiled code is portable between platforms. Python can be used for any programming task, from GUI programming to web programming with everything else in between. It's quite efficient, as much of its activity is done at the C level. Python is just a layer on top of C. There are libraries for everything you can think of: game programming and openGL, GUI interfaces, web frameworks, semantic web, scientific computing... Source: https://stackoverflow.com/questions/1909512/what-is-python-used-for", "title": "Python Programming Language Advantages" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#adventages-again", - "text": "Easy Syntax \nPython's syntax is easy to learn, so both non-programmers and programmers can start programming right away. Readability \nPython's syntax is very clear, so it is easy to understand program code. (Python is often referred to as \"executable pseudo-code\" because its syntax mostly follows the conventions used by programmers to outline their ideas without the formal verbosity of code in most programming languages; in other words syntax of Python is almost identical to the simplified \"pseudo-code\" used by many programmers to prototype and describe their solution to other programmers. Thus Python can be used to prototype and test code which is later to be implemented in other programming languages).[citation needed] High-Level Language \nPython looks more like a readable, human language than like a low-level language. This gives you the ability to program at a faster rate than a low-level language will allow you. Object oriented programming \nObject-oriented programming allows you to create data structures that can be re-used, which reduces the amount of repetitive work that you'll need to do. Programming languages usually define objects with namespaces, like class or def, and objects can edit themselves by using keyword, like this or self. Most modern programming languages are object-oriented (such as Java, C++, and C#) or have support for OOP features (such as Perl version 5 and later). Additionally object-oriented techniques can be used in the design of almost any non-trivial software and implemented in almost any programming or scripting language. (For example a number of Linux kernel features are \"objects\" which implement their own encapsulation of behavior and data structive via pointers, specifically pointers to functions, in the C programming language).[citation needed] Python's support for object-oriented programming is one of its greatest benefits to new programmers because they will be encountering the same concepts and terminology in their work environment. If you ever decide to switch languages, or use any other for that fact, you'll have a significant chance that you'll be working with object-oriented programming.[1] It's Free \nPython is both free and open-source. The Python Software Foundation distributes pre-made binaries that are freely available for use on all major operating systems called CPython. You can get CPython's source-code, too. Plus, you can modify the source code and distribute as allowed by CPython's license. [2] (Luckily, CPython has a permissive free software license attitude.) Cross-platform \nPython runs on all major operating systems like Microsoft Windows, Linux, and Mac OS X. Widely Supported \nPython has an active support community with many web sites, mailing lists, and USENET \"netnews\" groups that attract a large number of knowledgeable and helpful contributes. It's Safe \nPython doesn't have pointers like other C-based languages, making it much more reliable. Along with that, errors never pass silently unless they're explicitly silenced. This allows you to see and read why the program crashed and where to correct your error. Batteries Included \nPython is famous for being the \"batteries are included\" language.[3] There are over 300 standard library modules which contain modules and classes for a wide variety of programming tasks.[citation needed] For example the standard library contains modules for safely creating temporary files (named or anonymous), mapping files into memory (including use of shared and anonymous memory mappings), spawning and controlling sub-processes, compressing and decompressing files (compatible with gzip or PK-zip) and archives files (such as Unix/Linux \"tar\"), accessing indexed \"DBM\" (database) files, interfacing to various graphical user interfaces (such as the TK toolkit and the popular WxWindows multi-platform windowing system), parsing and maintaining CSV (comma-separated values) and \".cfg\" or \".ini\" configuration files (similar in syntax to the venerable WIN.INI files from MS-DOS and MS-Windows), for sending e-mail, fetching and parsing web pages, etc. It's possible, for example, to create a custom web server in Python using less than a dozen lines of code, and one of the standard libraries, of course. Extensible \nIn addition to the standard libraries there are extensive collections of freely available add-on modules, libraries, frameworks, and tool-kits. These generally conform to similar standards and conventions; for example almost all of the database adapters (to talk to almost any client-server RDBMS engine such as MySQL, Postgres, Oracle, etc) conform to the Python DBAPI and thus can mostly be accessed using the same code. So it's usually easy to modify a Python program to support any database engine. Source: https://en.wikiversity.org/wiki/Python_Concepts/Why_learn_Python", + "location": "/beginner/Python_Programming_Lanuage/#adventages-again", + "text": "Easy Syntax \nPython's syntax is easy to learn, so both non-programmers and programmers can start programming right away. Readability \nPython's syntax is very clear, so it is easy to understand program code. (Python is often referred to as \"executable pseudo-code\" because its syntax mostly follows the conventions used by programmers to outline their ideas without the formal verbosity of code in most programming languages; in other words syntax of Python is almost identical to the simplified \"pseudo-code\" used by many programmers to prototype and describe their solution to other programmers. Thus Python can be used to prototype and test code which is later to be implemented in other programming languages).[citation needed] High-Level Language \nPython looks more like a readable, human language than like a low-level language. This gives you the ability to program at a faster rate than a low-level language will allow you. Object oriented programming \nObject-oriented programming allows you to create data structures that can be re-used, which reduces the amount of repetitive work that you'll need to do. Programming languages usually define objects with namespaces, like class or def, and objects can edit themselves by using keyword, like this or self. Most modern programming languages are object-oriented (such as Java, C++, and C#) or have support for OOP features (such as Perl version 5 and later). Additionally object-oriented techniques can be used in the design of almost any non-trivial software and implemented in almost any programming or scripting language. (For example a number of Linux kernel features are \"objects\" which implement their own encapsulation of behavior and data structive via pointers, specifically pointers to functions, in the C programming language).[citation needed] Python's support for object-oriented programming is one of its greatest benefits to new programmers because they will be encountering the same concepts and terminology in their work environment. If you ever decide to switch languages, or use any other for that fact, you'll have a significant chance that you'll be working with object-oriented programming.[1] It's Free \nPython is both free and open-source. The Python Software Foundation distributes pre-made binaries that are freely available for use on all major operating systems called CPython. You can get CPython's source-code, too. Plus, you can modify the source code and distribute as allowed by CPython's license. [2] (Luckily, CPython has a permissive free software license attitude.) Cross-platform \nPython runs on all major operating systems like Microsoft Windows, Linux, and Mac OS X. Widely Supported \nPython has an active support community with many web sites, mailing lists, and USENET \"netnews\" groups that attract a large number of knowledgeable and helpful contributes. It's Safe \nPython doesn't have pointers like other C-based languages, making it much more reliable. Along with that, errors never pass silently unless they're explicitly silenced. This allows you to see and read why the program crashed and where to correct your error. Batteries Included \nPython is famous for being the \"batteries are included\" language.[3] There are over 300 standard library modules which contain modules and classes for a wide variety of programming tasks.[citation needed] For example the standard library contains modules for safely creating temporary files (named or anonymous), mapping files into memory (including use of shared and anonymous memory mappings), spawning and controlling sub-processes, compressing and decompressing files (compatible with gzip or PK-zip) and archives files (such as Unix/Linux \"tar\"), accessing indexed \"DBM\" (database) files, interfacing to various graphical user interfaces (such as the TK toolkit and the popular WxWindows multi-platform windowing system), parsing and maintaining CSV (comma-separated values) and \".cfg\" or \".ini\" configuration files (similar in syntax to the venerable WIN.INI files from MS-DOS and MS-Windows), for sending e-mail, fetching and parsing web pages, etc. It's possible, for example, to create a custom web server in Python using less than a dozen lines of code, and one of the standard libraries, of course. Extensible \nIn addition to the standard libraries there are extensive collections of freely available add-on modules, libraries, frameworks, and tool-kits. These generally conform to similar standards and conventions; for example almost all of the database adapters (to talk to almost any client-server RDBMS engine such as MySQL, Postgres, Oracle, etc) conform to the Python DBAPI and thus can mostly be accessed using the same code. So it's usually easy to modify a Python program to support any database engine. Source: https://en.wikiversity.org/wiki/Python_Concepts/Why_learn_Python", "title": "Adventages again" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#who-uses-python-today", - "text": "Here are links to just a few of the organizations that use python: \n- https://wiki.python.org/moin/OrganizationsUsingPython Python Success Stories : \n- https://www.python.org/about/success", + "location": "/beginner/Python_Programming_Lanuage/#who-uses-python-today", + "text": "Here are links to just a few of the organizations that use python: \n- https://wiki.python.org/moin/OrganizationsUsingPython Python Success Stories : \n- https://www.python.org/about/success", "title": "Who Uses Python Today ?" - }, + }, { - "location": "/beginner/Python_Installation/", - "text": "Python Download and Installation Instructions\n\n\nInstall Python on Windows\n\n\n\n\nInstall Python on Ubuntu\n\n\n\n\nInstall Python on Mac", + "location": "/beginner/Python_Installation/", + "text": "Python Download and Installation Instructions\n\n\nInstall Python on Windows\n\n\n\n\nInstall Python on Ubuntu\n\n\n\n\nInstall Python on Mac", "title": "Python Installation" - }, + }, { - "location": "/beginner/Python_Installation/#python-download-and-installation-instructions", - "text": "", + "location": "/beginner/Python_Installation/#python-download-and-installation-instructions", + "text": "", "title": "Python Download and Installation Instructions" - }, + }, { - "location": "/beginner/Python_Installation/#install-python-on-windows", - "text": "", + "location": "/beginner/Python_Installation/#install-python-on-windows", + "text": "", "title": "Install Python on Windows" - }, + }, { - "location": "/beginner/Python_Installation/#install-python-on-ubuntu", - "text": "", + "location": "/beginner/Python_Installation/#install-python-on-ubuntu", + "text": "", "title": "Install Python on Ubuntu" - }, + }, { - "location": "/beginner/Python_Installation/#install-python-on-mac", - "text": "", + "location": "/beginner/Python_Installation/#install-python-on-mac", + "text": "", "title": "Install Python on Mac" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/", - "text": "What Is a Program?\n\n\nA program is a sequence of instructions that specifies how to perform a computation.\nThe computation might be something mathematical, such as solving a system of equat\nions or finding the roots of a polynomial, but it can also be a symbolic computation,\nsuch as searching and replacing text in a document or (strangely enough) compiling a\nprogram.\nThe details look different in different languages, but a few basic instructions appear in\njust about every language:\n\n\ninput: \n\n\n\n\nGet data from the keyboard, a file, or some other device.\n\n\n\n\noutput:\n\n\n\n\nDisplay data on the screen or send data to a file or other device.\n\n\n\n\nmath:\n\n\n\n\nPerform basic mathematical operations like addition and\n multiplication.\n\n\n\n\nconditional execution:\n\n\n\n\nCheck for certain conditions and execute the appropriate code.\n\n\n\n\nrepetition:\n\n\n\n\nPerform some action repeatedly, usually with some variation.\n\n\n\n\nBelieve it or not, that\u2019s pretty much all there is to it. Every program you\u2019ve ever used, no\nmatter how complicated, is made up of instructions that look pretty much like these. So\nyou can think of programming as the process of breaking a large, complex task into\nsmaller and smaller subtasks until the subtasks are simple enough to be performed with\none of these basic instructions.\nThat may be a little vague, but we will come back to this topic when we talk about\nalgorithms.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nRun Python Scripts\n\n\nIf you can't execute or run a Python script, then programming is pointless. When you run a Python script, the interpreter converts a Python program into something that that the computer can understand. Executing a Python program can be done in two ways: calling the Python interpreter with a shebang line, and using the interactive Python shell.\n\n\nRun a Python Script as a File\n\n\nGenerally programmers write stand alone scripts, that are independent to live environments. Then they save it with a \".py\" extension, which indicates to the operating system and programmer that the file is actually a Python program. After the interpreter is invoked, it reads and interprets the file. The way Python scripts are run on Windows versus Unix based operating systems is very different. We'll show you the difference, and how to run a Python script on Windows and Unix platforms.\n\n\nRun a Python script under Windows with the Command Prompt\n\n\nWindows users must pass the path of the program as an argument to the Python interpreter. Such as follows:\n\n\nC:\n\\P\nython27\n\\p\nython.exe C:\n\\U\nsers\n\\U\nsername\n\\D\nesktop\n\\m\ny_python_script.py\n\n\n\n\n\nNote that you must use the full path of the Python interpreter. If you want to simply type python.exe C:\\Users\\Username\\Desktop\\my_python_script.py you must add python.exe to your PATH environmental variable.\nNote that Windows comes with two Python executables - python.exe and pythonw.exe. If you want a terminal to pop-up when you run your script, use python.exe However if you don't want any terminal pop-up, use pythonw.exe. pythonw.exe is typically used for GUI programs, where you only want to display your program, not the terminal.\n\n\nRun a Python Script Under Mac, Linux, BSD, Unix, etc\n\n\nOn platforms like Mac, BSD or Linux (Unix) you can put a \"shebang\" line as first line of the program which indicates the location of the Python interpreter on the hard drive. It's in the following format:\n\n\n#!/path/to/interpreter\n\n\n\n\n\n\nA common shebang line used for the Python interpreter is as follows:\n\n\n#!/usr/bin/env python\n\n\n\n\n\n\nYou must then make the script executable, using the following command:\n\n\nchmod +x my_python_script.py\n\n\n\n\n\nUnlike Windows, the Python interpreter is typically already in the $PATH environmental variable, so adding it is un-necessary.\n\n\nYou can then run a program by invoking the Python interpreter manually as follows:\n\n\npython firstprogram.py\n\n\n\n\n\nPython Execution with the Shell (Live Interpreter)\n\n\nAssuming that you already have Python installed and running well (if you're getting an error, see this post), open the terminal or console and type 'python' and hit the 'Enter' key. You will then be directed immediately to the Python live interpreter. Your screen will display a message something like:\n\n\nuser@hostname:~ python\nPython \n3\n.3.0 \n(\ndefault, Nov \n23\n \n2012\n, \n10\n:26:01\n)\n \n\n[\nGCC \n4\n.2.1 Compatible Apple Clang \n4\n.1 \n((\ntags/Apple/clang-421.11.66\n))]\n on darwin\nType \nhelp\n, \ncopyright\n, \ncredits\n or \nlicense\n \nfor\n more information.\n\n\n\n\n\n\n\nThe Python programmer should keep in mind one thing: that while working with the live interpreter, everything is read and interpreted in real-time. For example loops iterate immediately, unless they are part of function. So it requires some mental planning. Using the Python shell is typically used to execute code interactively. If you want to run a Python script from the interpreter, you must either import it or call the Python executable.\n\n\n\n\nSource:\n \n\n\n http://pythoncentral.io/execute-python-script-file-shell/\n\n\n\n\nA Good First Program\n\n\nType the following text into a single file named \nex1.py\n. Python works best with files ending in \n.py\n.\n\n\nprint\n \nHello World!\n\n\nprint\n \nHello Again\n\n\nprint\n \nI like typing this.\n\n\nprint\n \nThis is fun.\n\n\nprint\n \nYay! Printing.\n\n\nprint\n \nI\nd much rather you \nnot\n.\n\n\nprint\n \nI \nsaid\n do not touch this.\n\n\n\n\n\n\nYour Atom text editor should look something like this on all platforms:\n\n\n\n\nDon't worry if your editor doesn't look exactly the same, it should be close though. You may have a slightly different window header, maybe slightly different colors, and the left side of your Atom window won't say \"zedshaw\" but will instead show the directory you used for saving your files. All of those differences are fine.\n\n\nWhen you create this file, keep in mind these points:\n\n\n\n\nI did not type the line numbers on the left. Those are printed in the book so I can talk about specific lines by saying, \"See line 5...\" You do not type line numbers into Python scripts.\n\n\nI have the print at the beginning of the line and it looks exactly the same as what I have in ex1.py. Exactly means exactly, not kind of sort of the same. Every single character has to match for it to work. Color doesn't matter, only the characters you type.\n\n\n\n\nIn Terminal run the file by typing:\n\n\npython ex1.py\n\n\n\n\n\nIf you did it right then you should see the same output as I in the What You Should See section of this exercise. If not, you have done something wrong. No, the computer is not wrong.\n\n\nWhat You Should See\n\n\nOn Mac OS X in the Terminal you should see this:\n\n\nOn Windows in PowerShell you should see this:\n\n\n\nYou may see different names, before the python ex1.py command, but the important part is that you type the command and see the output is the same as mine.\n\n\n\n\n\nIf you have an error it will look like this:\n\n\n$ python ex/ex1.py\n File \nex/ex1.py\n, line \n3\n\n print \nI like typing this.\n\n\n ^\n\n\nSyntaxError: EOL while scanning string literal\n\n\n\n\n\n\nIt's important that you can read these error messages because you will be making many of these mistakes. Even I make many of these mistakes. Let's look at this line by line.\n\n\n\n\nWe ran our command in the Terminal to run the ex1.py script.\n\n\nPython tells us that the file ex1.py has an error on line 3.\n\n\nIt prints this line of code for us to see it.\n\n\nThen it puts a ^ (caret) character to point at where the problem is. Notice the missing \" (double-quote) character?\n\n\nFinally, it prints out a \"SyntaxError\" and tells us something about what might be the error. Usually these are very cryptic, but if you copy that text into a search engine, you will find someone else who's had that error and you can probably figure out how to fix it.\n\n\n\n\n\n\nSource:\n \n\n\n \nLEARN PYTHON THE HARD WAY\n by Zed A. Shaw - 2013\n\n\n\n\nDebugging and Errors\n\n\nWhat Is Debugging?\n\n\nProgramming is error-prone. For whimsical reasons, programming errors are called\n\nbugs\n and the process of tracking them down is called \ndebugging\n.\nThree kinds of errors can occur in a program: syntax errors, runtime errors, and se\nmantic errors. It is useful to distinguish between them in order to track them down more\nquickly.\n\n\nError Types :\n\n\nSyntax Errors\n\n\nPython can only execute a program if the syntax is correct; otherwise, the interpreter\ndisplays an error message. Syntax refers to the structure of a program and the rules\nabout that structure.For example, parentheses have to come in matching pairs, so\n(1 + 2) is legal, but 8) is a \nsyntax error\n.\nIn English readers can tolerate most syntax errors, which is why we can read the poetry\nof e. e. cummings without spewing error messages. Python is not so forgiving. If there\nis a single syntax error anywhere in your program, Python will display an error message\nand quit, and you will not be able to run your program. During the first few weeks of\nyour programming career, you will probably spend a lot of time tracking down syntax\nerrors. As you gain experience, you will make fewer errors and find them faster.\n\n\nRuntime Errors\n\n\nThe second type of error is a runtime error, so called because the error does not appear\nuntil after the program has started running. These errors are also called exceptions\nbecause they usually indicate that something exceptional (and bad) has happened.\nRuntime errors are rare in the simple programs you will see in the first few chapters, so\nit might be a while before you encounter one.\n\n\nSemantic Errors\n\n\nThe third type of error is the semantic error. If there is a semantic error in your program,\nit will run successfully in the sense that the computer will not generate any error mess\nages, but it will not do the right thing. It will do something else. Specifically, it will do\nwhat you told it to do.\nThe problem is that the program you wrote is not the program you wanted to write. The\nmeaning of the program (its semantics) is wrong. Identifying semantic errors can be\ntricky because it requires you to work backward by looking at the output of the program\nand trying to figure out what it is doing.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nReserved Words\n\n\nThe following list shows the Python keywords. These are reserved words and you cannot use them as constants or variables or any other identifier names. All the Python keywords contain lowercase letters only.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nand\n\n\nexec\n\n\nnot\n\n\n\n\n\n\nas\n\n\nfinally\n\n\nor\n\n\n\n\n\n\nassert\n\n\nfor\n\n\npass\n\n\n\n\n\n\nbreak\n\n\nfrom\n\n\nprint\n\n\n\n\n\n\nclass\n\n\nglobal\n\n\nraise\n\n\n\n\n\n\ncontinue\n\n\nif\n\n\nreturn\n\n\n\n\n\n\ndef\n\n\nimport\n\n\ntry\n\n\n\n\n\n\ndel\n\n\nin\n\n\nwhile\n\n\n\n\n\n\nelif\n\n\nis\n\n\nwith\n\n\n\n\n\n\nelse\n\n\nlambda\n\n\nyield\n\n\n\n\n\n\nexcept\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nSource:\n \n\n\n https://www.tutorialspoint.com", + "location": "/beginner/Start_Coding_With_Python/", + "text": "What Is a Program?\n\n\nA program is a sequence of instructions that specifies how to perform a computation.\nThe computation might be something mathematical, such as solving a system of equat\nions or finding the roots of a polynomial, but it can also be a symbolic computation,\nsuch as searching and replacing text in a document or (strangely enough) compiling a\nprogram.\nThe details look different in different languages, but a few basic instructions appear in\njust about every language:\n\n\ninput: \n\n\n\n\nGet data from the keyboard, a file, or some other device.\n\n\n\n\noutput:\n\n\n\n\nDisplay data on the screen or send data to a file or other device.\n\n\n\n\nmath:\n\n\n\n\nPerform basic mathematical operations like addition and\n multiplication.\n\n\n\n\nconditional execution:\n\n\n\n\nCheck for certain conditions and execute the appropriate code.\n\n\n\n\nrepetition:\n\n\n\n\nPerform some action repeatedly, usually with some variation.\n\n\n\n\nBelieve it or not, that\u2019s pretty much all there is to it. Every program you\u2019ve ever used, no\nmatter how complicated, is made up of instructions that look pretty much like these. So\nyou can think of programming as the process of breaking a large, complex task into\nsmaller and smaller subtasks until the subtasks are simple enough to be performed with\none of these basic instructions.\nThat may be a little vague, but we will come back to this topic when we talk about\nalgorithms.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nRun Python Scripts\n\n\nIf you can't execute or run a Python script, then programming is pointless. When you run a Python script, the interpreter converts a Python program into something that that the computer can understand. Executing a Python program can be done in two ways: calling the Python interpreter with a shebang line, and using the interactive Python shell.\n\n\nRun a Python Script as a File\n\n\nGenerally programmers write stand alone scripts, that are independent to live environments. Then they save it with a \".py\" extension, which indicates to the operating system and programmer that the file is actually a Python program. After the interpreter is invoked, it reads and interprets the file. The way Python scripts are run on Windows versus Unix based operating systems is very different. We'll show you the difference, and how to run a Python script on Windows and Unix platforms.\n\n\nRun a Python script under Windows with the Command Prompt\n\n\nWindows users must pass the path of the program as an argument to the Python interpreter. Such as follows:\n\n\nC:\n\\P\nython27\n\\p\nython.exe C:\n\\U\nsers\n\\U\nsername\n\\D\nesktop\n\\m\ny_python_script.py\n\n\n\n\n\nNote that you must use the full path of the Python interpreter. If you want to simply type python.exe C:\\Users\\Username\\Desktop\\my_python_script.py you must add python.exe to your PATH environmental variable.\nNote that Windows comes with two Python executables - python.exe and pythonw.exe. If you want a terminal to pop-up when you run your script, use python.exe However if you don't want any terminal pop-up, use pythonw.exe. pythonw.exe is typically used for GUI programs, where you only want to display your program, not the terminal.\n\n\nRun a Python Script Under Mac, Linux, BSD, Unix, etc\n\n\nOn platforms like Mac, BSD or Linux (Unix) you can put a \"shebang\" line as first line of the program which indicates the location of the Python interpreter on the hard drive. It's in the following format:\n\n\n#!/path/to/interpreter\n\n\n\n\n\n\nA common shebang line used for the Python interpreter is as follows:\n\n\n#!/usr/bin/env python\n\n\n\n\n\n\nYou must then make the script executable, using the following command:\n\n\nchmod +x my_python_script.py\n\n\n\n\n\nUnlike Windows, the Python interpreter is typically already in the $PATH environmental variable, so adding it is un-necessary.\n\n\nYou can then run a program by invoking the Python interpreter manually as follows:\n\n\npython firstprogram.py\n\n\n\n\n\nPython Execution with the Shell (Live Interpreter)\n\n\nAssuming that you already have Python installed and running well (if you're getting an error, see this post), open the terminal or console and type 'python' and hit the 'Enter' key. You will then be directed immediately to the Python live interpreter. Your screen will display a message something like:\n\n\nuser@hostname:~ python\nPython \n3\n.3.0 \n(\ndefault, Nov \n23\n \n2012\n, \n10\n:26:01\n)\n \n\n[\nGCC \n4\n.2.1 Compatible Apple Clang \n4\n.1 \n((\ntags/Apple/clang-421.11.66\n))]\n on darwin\nType \nhelp\n, \ncopyright\n, \ncredits\n or \nlicense\n \nfor\n more information.\n\n\n\n\n\n\n\nThe Python programmer should keep in mind one thing: that while working with the live interpreter, everything is read and interpreted in real-time. For example loops iterate immediately, unless they are part of function. So it requires some mental planning. Using the Python shell is typically used to execute code interactively. If you want to run a Python script from the interpreter, you must either import it or call the Python executable.\n\n\n\n\nSource:\n \n\n\n http://pythoncentral.io/execute-python-script-file-shell/\n\n\n\n\nA Good First Program\n\n\nType the following text into a single file named \nex1.py\n. Python works best with files ending in \n.py\n.\n\n\nprint\n \nHello World!\n\n\nprint\n \nHello Again\n\n\nprint\n \nI like typing this.\n\n\nprint\n \nThis is fun.\n\n\nprint\n \nYay! Printing.\n\n\nprint\n \nI\nd much rather you \nnot\n.\n\n\nprint\n \nI \nsaid\n do not touch this.\n\n\n\n\n\n\nYour Atom text editor should look something like this on all platforms:\n\n\n\n\nDon't worry if your editor doesn't look exactly the same, it should be close though. You may have a slightly different window header, maybe slightly different colors, and the left side of your Atom window won't say \"zedshaw\" but will instead show the directory you used for saving your files. All of those differences are fine.\n\n\nWhen you create this file, keep in mind these points:\n\n\n\n\nI did not type the line numbers on the left. Those are printed in the book so I can talk about specific lines by saying, \"See line 5...\" You do not type line numbers into Python scripts.\n\n\nI have the print at the beginning of the line and it looks exactly the same as what I have in ex1.py. Exactly means exactly, not kind of sort of the same. Every single character has to match for it to work. Color doesn't matter, only the characters you type.\n\n\n\n\nIn Terminal run the file by typing:\n\n\npython ex1.py\n\n\n\n\n\nIf you did it right then you should see the same output as I in the What You Should See section of this exercise. If not, you have done something wrong. No, the computer is not wrong.\n\n\nWhat You Should See\n\n\nOn Mac OS X in the Terminal you should see this:\n\n\nOn Windows in PowerShell you should see this:\n\n\n\nYou may see different names, before the python ex1.py command, but the important part is that you type the command and see the output is the same as mine.\n\n\n\n\n\nIf you have an error it will look like this:\n\n\n$ python ex/ex1.py\n File \nex/ex1.py\n, line \n3\n\n print \nI like typing this.\n\n\n ^\n\n\nSyntaxError: EOL while scanning string literal\n\n\n\n\n\n\nIt's important that you can read these error messages because you will be making many of these mistakes. Even I make many of these mistakes. Let's look at this line by line.\n\n\n\n\nWe ran our command in the Terminal to run the ex1.py script.\n\n\nPython tells us that the file ex1.py has an error on line 3.\n\n\nIt prints this line of code for us to see it.\n\n\nThen it puts a ^ (caret) character to point at where the problem is. Notice the missing \" (double-quote) character?\n\n\nFinally, it prints out a \"SyntaxError\" and tells us something about what might be the error. Usually these are very cryptic, but if you copy that text into a search engine, you will find someone else who's had that error and you can probably figure out how to fix it.\n\n\n\n\n\n\nSource:\n \n\n\n \nLEARN PYTHON THE HARD WAY\n by Zed A. Shaw - 2013\n\n\n\n\nDebugging and Errors\n\n\nWhat Is Debugging?\n\n\nProgramming is error-prone. For whimsical reasons, programming errors are called\n\nbugs\n and the process of tracking them down is called \ndebugging\n.\nThree kinds of errors can occur in a program: syntax errors, runtime errors, and se\nmantic errors. It is useful to distinguish between them in order to track them down more\nquickly.\n\n\nError Types :\n\n\nSyntax Errors\n\n\nPython can only execute a program if the syntax is correct; otherwise, the interpreter\ndisplays an error message. Syntax refers to the structure of a program and the rules\nabout that structure.For example, parentheses have to come in matching pairs, so\n(1 + 2) is legal, but 8) is a \nsyntax error\n.\nIn English readers can tolerate most syntax errors, which is why we can read the poetry\nof e. e. cummings without spewing error messages. Python is not so forgiving. If there\nis a single syntax error anywhere in your program, Python will display an error message\nand quit, and you will not be able to run your program. During the first few weeks of\nyour programming career, you will probably spend a lot of time tracking down syntax\nerrors. As you gain experience, you will make fewer errors and find them faster.\n\n\nRuntime Errors\n\n\nThe second type of error is a runtime error, so called because the error does not appear\nuntil after the program has started running. These errors are also called exceptions\nbecause they usually indicate that something exceptional (and bad) has happened.\nRuntime errors are rare in the simple programs you will see in the first few chapters, so\nit might be a while before you encounter one.\n\n\nSemantic Errors\n\n\nThe third type of error is the semantic error. If there is a semantic error in your program,\nit will run successfully in the sense that the computer will not generate any error mess\nages, but it will not do the right thing. It will do something else. Specifically, it will do\nwhat you told it to do.\nThe problem is that the program you wrote is not the program you wanted to write. The\nmeaning of the program (its semantics) is wrong. Identifying semantic errors can be\ntricky because it requires you to work backward by looking at the output of the program\nand trying to figure out what it is doing.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nReserved Words\n\n\nThe following list shows the Python keywords. These are reserved words and you cannot use them as constants or variables or any other identifier names. All the Python keywords contain lowercase letters only.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nand\n\n\nexec\n\n\nnot\n\n\n\n\n\n\nas\n\n\nfinally\n\n\nor\n\n\n\n\n\n\nassert\n\n\nfor\n\n\npass\n\n\n\n\n\n\nbreak\n\n\nfrom\n\n\nprint\n\n\n\n\n\n\nclass\n\n\nglobal\n\n\nraise\n\n\n\n\n\n\ncontinue\n\n\nif\n\n\nreturn\n\n\n\n\n\n\ndef\n\n\nimport\n\n\ntry\n\n\n\n\n\n\ndel\n\n\nin\n\n\nwhile\n\n\n\n\n\n\nelif\n\n\nis\n\n\nwith\n\n\n\n\n\n\nelse\n\n\nlambda\n\n\nyield\n\n\n\n\n\n\nexcept\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nSource:\n \n\n\n https://www.tutorialspoint.com", "title": "Start Coding With Python" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#what-is-a-program", - "text": "A program is a sequence of instructions that specifies how to perform a computation.\nThe computation might be something mathematical, such as solving a system of equat\nions or finding the roots of a polynomial, but it can also be a symbolic computation,\nsuch as searching and replacing text in a document or (strangely enough) compiling a\nprogram.\nThe details look different in different languages, but a few basic instructions appear in\njust about every language: input: Get data from the keyboard, a file, or some other device. output: Display data on the screen or send data to a file or other device. math: Perform basic mathematical operations like addition and\n multiplication. conditional execution: Check for certain conditions and execute the appropriate code. repetition: Perform some action repeatedly, usually with some variation. Believe it or not, that\u2019s pretty much all there is to it. Every program you\u2019ve ever used, no\nmatter how complicated, is made up of instructions that look pretty much like these. So\nyou can think of programming as the process of breaking a large, complex task into\nsmaller and smaller subtasks until the subtasks are simple enough to be performed with\none of these basic instructions.\nThat may be a little vague, but we will come back to this topic when we talk about\nalgorithms. Source: Think Python by Allen B. Downey - 2012", + "location": "/beginner/Start_Coding_With_Python/#what-is-a-program", + "text": "A program is a sequence of instructions that specifies how to perform a computation.\nThe computation might be something mathematical, such as solving a system of equat\nions or finding the roots of a polynomial, but it can also be a symbolic computation,\nsuch as searching and replacing text in a document or (strangely enough) compiling a\nprogram.\nThe details look different in different languages, but a few basic instructions appear in\njust about every language: input: Get data from the keyboard, a file, or some other device. output: Display data on the screen or send data to a file or other device. math: Perform basic mathematical operations like addition and\n multiplication. conditional execution: Check for certain conditions and execute the appropriate code. repetition: Perform some action repeatedly, usually with some variation. Believe it or not, that\u2019s pretty much all there is to it. Every program you\u2019ve ever used, no\nmatter how complicated, is made up of instructions that look pretty much like these. So\nyou can think of programming as the process of breaking a large, complex task into\nsmaller and smaller subtasks until the subtasks are simple enough to be performed with\none of these basic instructions.\nThat may be a little vague, but we will come back to this topic when we talk about\nalgorithms. Source: Think Python by Allen B. Downey - 2012", "title": "What Is a Program?" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#run-python-scripts", - "text": "If you can't execute or run a Python script, then programming is pointless. When you run a Python script, the interpreter converts a Python program into something that that the computer can understand. Executing a Python program can be done in two ways: calling the Python interpreter with a shebang line, and using the interactive Python shell.", + "location": "/beginner/Start_Coding_With_Python/#run-python-scripts", + "text": "If you can't execute or run a Python script, then programming is pointless. When you run a Python script, the interpreter converts a Python program into something that that the computer can understand. Executing a Python program can be done in two ways: calling the Python interpreter with a shebang line, and using the interactive Python shell.", "title": "Run Python Scripts" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#run-a-python-script-as-a-file", - "text": "Generally programmers write stand alone scripts, that are independent to live environments. Then they save it with a \".py\" extension, which indicates to the operating system and programmer that the file is actually a Python program. After the interpreter is invoked, it reads and interprets the file. The way Python scripts are run on Windows versus Unix based operating systems is very different. We'll show you the difference, and how to run a Python script on Windows and Unix platforms.", + "location": "/beginner/Start_Coding_With_Python/#run-a-python-script-as-a-file", + "text": "Generally programmers write stand alone scripts, that are independent to live environments. Then they save it with a \".py\" extension, which indicates to the operating system and programmer that the file is actually a Python program. After the interpreter is invoked, it reads and interprets the file. The way Python scripts are run on Windows versus Unix based operating systems is very different. We'll show you the difference, and how to run a Python script on Windows and Unix platforms.", "title": "Run a Python Script as a File" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#run-a-python-script-under-windows-with-the-command-prompt", - "text": "Windows users must pass the path of the program as an argument to the Python interpreter. Such as follows: C: \\P ython27 \\p ython.exe C: \\U sers \\U sername \\D esktop \\m y_python_script.py Note that you must use the full path of the Python interpreter. If you want to simply type python.exe C:\\Users\\Username\\Desktop\\my_python_script.py you must add python.exe to your PATH environmental variable.\nNote that Windows comes with two Python executables - python.exe and pythonw.exe. If you want a terminal to pop-up when you run your script, use python.exe However if you don't want any terminal pop-up, use pythonw.exe. pythonw.exe is typically used for GUI programs, where you only want to display your program, not the terminal.", + "location": "/beginner/Start_Coding_With_Python/#run-a-python-script-under-windows-with-the-command-prompt", + "text": "Windows users must pass the path of the program as an argument to the Python interpreter. Such as follows: C: \\P ython27 \\p ython.exe C: \\U sers \\U sername \\D esktop \\m y_python_script.py Note that you must use the full path of the Python interpreter. If you want to simply type python.exe C:\\Users\\Username\\Desktop\\my_python_script.py you must add python.exe to your PATH environmental variable.\nNote that Windows comes with two Python executables - python.exe and pythonw.exe. If you want a terminal to pop-up when you run your script, use python.exe However if you don't want any terminal pop-up, use pythonw.exe. pythonw.exe is typically used for GUI programs, where you only want to display your program, not the terminal.", "title": "Run a Python script under Windows with the Command Prompt" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#run-a-python-script-under-mac-linux-bsd-unix-etc", - "text": "On platforms like Mac, BSD or Linux (Unix) you can put a \"shebang\" line as first line of the program which indicates the location of the Python interpreter on the hard drive. It's in the following format: #!/path/to/interpreter A common shebang line used for the Python interpreter is as follows: #!/usr/bin/env python You must then make the script executable, using the following command: chmod +x my_python_script.py Unlike Windows, the Python interpreter is typically already in the $PATH environmental variable, so adding it is un-necessary. You can then run a program by invoking the Python interpreter manually as follows: python firstprogram.py", + "location": "/beginner/Start_Coding_With_Python/#run-a-python-script-under-mac-linux-bsd-unix-etc", + "text": "On platforms like Mac, BSD or Linux (Unix) you can put a \"shebang\" line as first line of the program which indicates the location of the Python interpreter on the hard drive. It's in the following format: #!/path/to/interpreter A common shebang line used for the Python interpreter is as follows: #!/usr/bin/env python You must then make the script executable, using the following command: chmod +x my_python_script.py Unlike Windows, the Python interpreter is typically already in the $PATH environmental variable, so adding it is un-necessary. You can then run a program by invoking the Python interpreter manually as follows: python firstprogram.py", "title": "Run a Python Script Under Mac, Linux, BSD, Unix, etc" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#python-execution-with-the-shell-live-interpreter", - "text": "Assuming that you already have Python installed and running well (if you're getting an error, see this post), open the terminal or console and type 'python' and hit the 'Enter' key. You will then be directed immediately to the Python live interpreter. Your screen will display a message something like: user@hostname:~ python\nPython 3 .3.0 ( default, Nov 23 2012 , 10 :26:01 ) [ GCC 4 .2.1 Compatible Apple Clang 4 .1 (( tags/Apple/clang-421.11.66 ))] on darwin\nType help , copyright , credits or license for more information. The Python programmer should keep in mind one thing: that while working with the live interpreter, everything is read and interpreted in real-time. For example loops iterate immediately, unless they are part of function. So it requires some mental planning. Using the Python shell is typically used to execute code interactively. If you want to run a Python script from the interpreter, you must either import it or call the Python executable. Source: http://pythoncentral.io/execute-python-script-file-shell/", + "location": "/beginner/Start_Coding_With_Python/#python-execution-with-the-shell-live-interpreter", + "text": "Assuming that you already have Python installed and running well (if you're getting an error, see this post), open the terminal or console and type 'python' and hit the 'Enter' key. You will then be directed immediately to the Python live interpreter. Your screen will display a message something like: user@hostname:~ python\nPython 3 .3.0 ( default, Nov 23 2012 , 10 :26:01 ) [ GCC 4 .2.1 Compatible Apple Clang 4 .1 (( tags/Apple/clang-421.11.66 ))] on darwin\nType help , copyright , credits or license for more information. The Python programmer should keep in mind one thing: that while working with the live interpreter, everything is read and interpreted in real-time. For example loops iterate immediately, unless they are part of function. So it requires some mental planning. Using the Python shell is typically used to execute code interactively. If you want to run a Python script from the interpreter, you must either import it or call the Python executable. Source: http://pythoncentral.io/execute-python-script-file-shell/", "title": "Python Execution with the Shell (Live Interpreter)" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#a-good-first-program", - "text": "Type the following text into a single file named ex1.py . Python works best with files ending in .py . print Hello World! print Hello Again print I like typing this. print This is fun. print Yay! Printing. print I d much rather you not . print I said do not touch this. Your Atom text editor should look something like this on all platforms: Don't worry if your editor doesn't look exactly the same, it should be close though. You may have a slightly different window header, maybe slightly different colors, and the left side of your Atom window won't say \"zedshaw\" but will instead show the directory you used for saving your files. All of those differences are fine. When you create this file, keep in mind these points: I did not type the line numbers on the left. Those are printed in the book so I can talk about specific lines by saying, \"See line 5...\" You do not type line numbers into Python scripts. I have the print at the beginning of the line and it looks exactly the same as what I have in ex1.py. Exactly means exactly, not kind of sort of the same. Every single character has to match for it to work. Color doesn't matter, only the characters you type. In Terminal run the file by typing: python ex1.py If you did it right then you should see the same output as I in the What You Should See section of this exercise. If not, you have done something wrong. No, the computer is not wrong.", + "location": "/beginner/Start_Coding_With_Python/#a-good-first-program", + "text": "Type the following text into a single file named ex1.py . Python works best with files ending in .py . print Hello World! print Hello Again print I like typing this. print This is fun. print Yay! Printing. print I d much rather you not . print I said do not touch this. Your Atom text editor should look something like this on all platforms: Don't worry if your editor doesn't look exactly the same, it should be close though. You may have a slightly different window header, maybe slightly different colors, and the left side of your Atom window won't say \"zedshaw\" but will instead show the directory you used for saving your files. All of those differences are fine. When you create this file, keep in mind these points: I did not type the line numbers on the left. Those are printed in the book so I can talk about specific lines by saying, \"See line 5...\" You do not type line numbers into Python scripts. I have the print at the beginning of the line and it looks exactly the same as what I have in ex1.py. Exactly means exactly, not kind of sort of the same. Every single character has to match for it to work. Color doesn't matter, only the characters you type. In Terminal run the file by typing: python ex1.py If you did it right then you should see the same output as I in the What You Should See section of this exercise. If not, you have done something wrong. No, the computer is not wrong.", "title": "A Good First Program" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#what-you-should-see", - "text": "On Mac OS X in the Terminal you should see this: \nOn Windows in PowerShell you should see this: You may see different names, before the python ex1.py command, but the important part is that you type the command and see the output is the same as mine. If you have an error it will look like this: $ python ex/ex1.py\n File ex/ex1.py , line 3 \n print I like typing this. ^ SyntaxError: EOL while scanning string literal It's important that you can read these error messages because you will be making many of these mistakes. Even I make many of these mistakes. Let's look at this line by line. We ran our command in the Terminal to run the ex1.py script. Python tells us that the file ex1.py has an error on line 3. It prints this line of code for us to see it. Then it puts a ^ (caret) character to point at where the problem is. Notice the missing \" (double-quote) character? Finally, it prints out a \"SyntaxError\" and tells us something about what might be the error. Usually these are very cryptic, but if you copy that text into a search engine, you will find someone else who's had that error and you can probably figure out how to fix it. Source: LEARN PYTHON THE HARD WAY by Zed A. Shaw - 2013", + "location": "/beginner/Start_Coding_With_Python/#what-you-should-see", + "text": "On Mac OS X in the Terminal you should see this: \nOn Windows in PowerShell you should see this: You may see different names, before the python ex1.py command, but the important part is that you type the command and see the output is the same as mine. If you have an error it will look like this: $ python ex/ex1.py\n File ex/ex1.py , line 3 \n print I like typing this. ^ SyntaxError: EOL while scanning string literal It's important that you can read these error messages because you will be making many of these mistakes. Even I make many of these mistakes. Let's look at this line by line. We ran our command in the Terminal to run the ex1.py script. Python tells us that the file ex1.py has an error on line 3. It prints this line of code for us to see it. Then it puts a ^ (caret) character to point at where the problem is. Notice the missing \" (double-quote) character? Finally, it prints out a \"SyntaxError\" and tells us something about what might be the error. Usually these are very cryptic, but if you copy that text into a search engine, you will find someone else who's had that error and you can probably figure out how to fix it. Source: LEARN PYTHON THE HARD WAY by Zed A. Shaw - 2013", "title": "What You Should See" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#debugging-and-errors", - "text": "", + "location": "/beginner/Start_Coding_With_Python/#debugging-and-errors", + "text": "", "title": "Debugging and Errors" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#what-is-debugging", - "text": "Programming is error-prone. For whimsical reasons, programming errors are called bugs and the process of tracking them down is called debugging .\nThree kinds of errors can occur in a program: syntax errors, runtime errors, and se\nmantic errors. It is useful to distinguish between them in order to track them down more\nquickly.", + "location": "/beginner/Start_Coding_With_Python/#what-is-debugging", + "text": "Programming is error-prone. For whimsical reasons, programming errors are called bugs and the process of tracking them down is called debugging .\nThree kinds of errors can occur in a program: syntax errors, runtime errors, and se\nmantic errors. It is useful to distinguish between them in order to track them down more\nquickly.", "title": "What Is Debugging?" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#error-types", - "text": "", + "location": "/beginner/Start_Coding_With_Python/#error-types", + "text": "", "title": "Error Types :" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#syntax-errors", - "text": "Python can only execute a program if the syntax is correct; otherwise, the interpreter\ndisplays an error message. Syntax refers to the structure of a program and the rules\nabout that structure.For example, parentheses have to come in matching pairs, so\n(1 + 2) is legal, but 8) is a syntax error .\nIn English readers can tolerate most syntax errors, which is why we can read the poetry\nof e. e. cummings without spewing error messages. Python is not so forgiving. If there\nis a single syntax error anywhere in your program, Python will display an error message\nand quit, and you will not be able to run your program. During the first few weeks of\nyour programming career, you will probably spend a lot of time tracking down syntax\nerrors. As you gain experience, you will make fewer errors and find them faster.", + "location": "/beginner/Start_Coding_With_Python/#syntax-errors", + "text": "Python can only execute a program if the syntax is correct; otherwise, the interpreter\ndisplays an error message. Syntax refers to the structure of a program and the rules\nabout that structure.For example, parentheses have to come in matching pairs, so\n(1 + 2) is legal, but 8) is a syntax error .\nIn English readers can tolerate most syntax errors, which is why we can read the poetry\nof e. e. cummings without spewing error messages. Python is not so forgiving. If there\nis a single syntax error anywhere in your program, Python will display an error message\nand quit, and you will not be able to run your program. During the first few weeks of\nyour programming career, you will probably spend a lot of time tracking down syntax\nerrors. As you gain experience, you will make fewer errors and find them faster.", "title": "Syntax Errors" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#runtime-errors", - "text": "The second type of error is a runtime error, so called because the error does not appear\nuntil after the program has started running. These errors are also called exceptions\nbecause they usually indicate that something exceptional (and bad) has happened.\nRuntime errors are rare in the simple programs you will see in the first few chapters, so\nit might be a while before you encounter one.", + "location": "/beginner/Start_Coding_With_Python/#runtime-errors", + "text": "The second type of error is a runtime error, so called because the error does not appear\nuntil after the program has started running. These errors are also called exceptions\nbecause they usually indicate that something exceptional (and bad) has happened.\nRuntime errors are rare in the simple programs you will see in the first few chapters, so\nit might be a while before you encounter one.", "title": "Runtime Errors" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#semantic-errors", - "text": "The third type of error is the semantic error. If there is a semantic error in your program,\nit will run successfully in the sense that the computer will not generate any error mess\nages, but it will not do the right thing. It will do something else. Specifically, it will do\nwhat you told it to do.\nThe problem is that the program you wrote is not the program you wanted to write. The\nmeaning of the program (its semantics) is wrong. Identifying semantic errors can be\ntricky because it requires you to work backward by looking at the output of the program\nand trying to figure out what it is doing. Source: Think Python by Allen B. Downey - 2012", + "location": "/beginner/Start_Coding_With_Python/#semantic-errors", + "text": "The third type of error is the semantic error. If there is a semantic error in your program,\nit will run successfully in the sense that the computer will not generate any error mess\nages, but it will not do the right thing. It will do something else. Specifically, it will do\nwhat you told it to do.\nThe problem is that the program you wrote is not the program you wanted to write. The\nmeaning of the program (its semantics) is wrong. Identifying semantic errors can be\ntricky because it requires you to work backward by looking at the output of the program\nand trying to figure out what it is doing. Source: Think Python by Allen B. Downey - 2012", "title": "Semantic Errors" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#reserved-words", - "text": "The following list shows the Python keywords. These are reserved words and you cannot use them as constants or variables or any other identifier names. All the Python keywords contain lowercase letters only. and exec not as finally or assert for pass break from print class global raise continue if return def import try del in while elif is with else lambda yield except Source: https://www.tutorialspoint.com", + "location": "/beginner/Start_Coding_With_Python/#reserved-words", + "text": "The following list shows the Python keywords. These are reserved words and you cannot use them as constants or variables or any other identifier names. All the Python keywords contain lowercase letters only. and exec not as finally or assert for pass break from print class global raise continue if return def import try del in while elif is with else lambda yield except Source: https://www.tutorialspoint.com", "title": "Reserved Words" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/", - "text": "Data Types in Python 3\n\n\nUnderstanding Data Types in Python 3\n\n\nIntroduction\n\n\nIn Python, like in all programming languages, data types are used to classify one particular type of data. This is important because the specific data type you use will determine what values you can assign to it and what you can do to it (including what operations you can perform on it).\n\n\nIn this tutorial, we will go over the important data types native to Python. This is not an exhaustive investigation of data types, but will help you become familiar with what options you have available to you in Python.\n\n\nBackground\n\n\nOne way to think about data types is to consider the different types of data that we use in the real world. An example of data in the real world are numbers: we may use whole numbers (0, 1, 2, \u2026), integers (\u2026, -1, 0, 1, \u2026), and irrational numbers (\u03c0), for example.\n\n\nUsually, in math, we can combine numbers from different types, and get some kind of an answer. We may want to add 5 to \u03c0, for example:\n\n\n5 + \u03c0\n\n\nWe can either keep the equation as the answer to account for the irrational number, or round \u03c0 to a number with a brief number of decimal places, and then add the numbers together:\n\n\n5 + \u03c0 = 5 + 3.14 = 8.14\n\n\nBut, if we start to try to evaluate numbers with another data type, such as words, things start to make less sense. How would we solve for the following equation?\n\n\nsky + 8\n\n\nFor computers, each data type can be thought of as being quite different, like words and numbers, so we will have to be careful about how we use them to assign values and how we manipulate them through operations.\n\n\nNumbers\n\n\nAny \nnumber\n you enter in Python will be interpreted as a number; you are not required to declare what kind of data type you are entering. Python will consider any number written without decimals as an \ninteger\n (as in \n138\n) and any number written with decimals as a \nfloat\n (as in \n138.0\n).\n\n\nIntegers\n\n\nLike in \nmath\n, \nintegers\n in computer programming are whole numbers that can be positive, negative, or 0 (\u2026, \n-1\n, \n0\n, \n1\n, \u2026). An integer can also be known as an \nint\n. As with other programming languages, you should not use commas in numbers of four digits or more, so when you write 1,000 in your program, write it as \n1000\n.\n\n\nWe can print out an integer in a simple way like this:\n\n\nprint\n(\n-\n25\n)\n\n\n\n#Output : -25\n\n\n\n\n\n\nOr, we can declare a \nvariable\n, which in this case is essentially a symbol of the number we are using or manipulating, like so:\n\n\nmy_int\n \n=\n \n-\n25\n\n\nprint\n(\nmy_int\n)\n\n\n\n#Output : -25\n\n\n\n\n\n\nWe can do math with integers in Python, too:\n\n\nint_ans\n \n=\n \n116\n \n-\n \n68\n\n\nprint\n(\nint_ans\n)\n\n\n\n#Output : 48\n\n\n\n\n\n\nIntegers can be used in many ways within Python programs, and as you continue to learn more about the language you will have a lot of opportunities to work with integers and understand more about this data type.\n\n\nFloating-Point Numbers\n\n\nA \nfloating-point number\n or a \nfloat\n is a real number, meaning that it can be either a rational or an irrational number. Because of this, floating-point numbers can be numbers that can contain a fractional part, such as \n9.0\n or \n-116.42\n. Simply speaking, for the purposes of thinking of a \nfloat\n in a Python program, it is a number that contains a decimal point.\n\n\nLike we did with the integer, we can print out a floating-point number in a simple way like this:\n\n\nprint\n(\n17.3\n)\n\n\n\n#Output : 17.3\n\n\n\n\n\n\nWe can also declare a variable that stands in for a float, like so:\n\n\nmy_flt\n \n=\n \n17.3\n\n\nprint\n(\nmy_flt\n)\n\n\n\n#Output : 17.3\n\n\n\n\n\n\nAnd, just like with integers, we can do math with floats in Python, too:\n\n\nflt_ans\n \n=\n \n564.0\n \n+\n \n365.24\n\n\nprint\n(\nflt_ans\n)\n\n\n\n#Output : 929.24\n\n\n\n\n\n\nWith integers and floating-point numbers, it is important to keep in mind that 3 \u2260 3.0, as \n3\n refers to an integer while \n3.0\n refers to a float.\n\n\nBooleans\n\n\nThe \nBoolean\n data type can be one of two values, either \nTrue\n or \nFalse\n. Booleans are used to represent the truth values that are associated with the logic branch of mathematics, which informs algorithms in computer science.\n\n\nWhenever you see the data type Boolean, it will start with a capitalized B because it is named for the mathematician George Boole. The values \nTrue\n and \nFalse\n will also always be with a capital T and F respectively, as they are special values in Python.\n\n\nMany operations in math give us answers that evaluate to either True or False:\n\n\n*\n \n**\ngreater\n \nthan\n**\n\n \n*\n \n500\n \n \n100\n \n`True`\n\n \n*\n \n1\n \n \n5\n \n`False`\n\n\n*\n \n**\nless\n \nthan\n**\n\n \n*\n \n200\n \n \n400\n \n`True`\n\n \n*\n \n4\n \n \n2\n \n`False`\n\n\n*\n \n**\nequal\n**\n\n \n*\n \n5\n \n=\n \n5\n \n`True`\n\n \n*\n \n500\n \n=\n \n400\n \n`False`\n\n\n\n\n\n\nLike with numbers, we can store a Boolean value in a variable:\n\n\nmy_bool\n \n=\n \n5\n \n \n8\n\n\n\n\n\n\nWe can then print the Boolean value with a call to the \nprint()\n function:\n\n\nprint\n(\nmy_bool\n)\n\n\n\n\n\n\nSince 5 is not greater than 8, we will receive the following #Output : :\n\n\n#Output : False\n\n\n\n\n\n\nAs you write more programs in Python, you will become more familiar with how Booleans work and how different functions and operations evaluating to either True or False can change the course of the program.\n\n\nStrings\n\n\nA \nstring\n is a sequence of one or more characters (letters, numbers, symbols) that can be either a constant or a variable. Strings exist within either single quotes \n'\n or double quotes \n\"\n in Python, so to create a string, enclose a sequence of characters in quotes:\n\n\nThis is a string in single quotes.\n\n\n\nThis is a string in double quotes.\n\n\n\n\n\n\nYou can choose to use either single quotes or double quotes, but whichever you decide on you should be consistent within a program.\n\n\nThe simple program \u201c\nHello, World!\n\u201d demonstrates how a string can be used in computer programming, as the characters that make up the phrase \nHello, World!\n are a string.\n\n\nprint\n(\nHello, World!\n)\n\n\n\n\n\n\nAs with other data types, we can store strings in variables:\n\n\nhw\n \n=\n \nHello, World!\n\n\n\n\n\n\nAnd print out the string by calling the variable:\n\n\nprint\n(\nhw\n)\n\n\n\n#Ouput : Hello, World!\n\n\n\n\n\n\nLike numbers, there are many operations that we can perform on strings within our programs in order to manipulate them to achieve the results we are seeking. Strings are important for communicating information to the user, and for the user to communicate information back to the program.\n\n\nLists\n\n\nA \nlist\n is a mutable, or changeable, ordered sequence of elements. Each element or value that is inside of a list is called an \nitem\n. Just as strings are defined as characters between quotes, lists are defined by having values between square brackets \n[ ]\n.\n\n\nA list of integers looks like this:\n\n\n[\n-\n3\n,\n \n-\n2\n,\n \n-\n1\n,\n \n0\n,\n \n1\n,\n \n2\n,\n \n3\n]\n\n\n\n\n\n\nA list of floats looks like this:\n\n\n[\n3.14\n,\n \n9.23\n,\n \n111.11\n,\n \n312.12\n,\n \n1.05\n]\n\n\n\n\n\n\nA list of strings:\n\n\n[\nshark\n,\n \ncuttlefish\n,\n \nsquid\n,\n \nmantis shrimp\n]\n\n\n\n\n\n\nIf we define our string list as \nsea_creatures\n:\n\n\nsea_creatures\n \n=\n \n[\nshark\n,\n \ncuttlefish\n,\n \nsquid\n,\n \nmantis shrimp\n]\n\n\n\n\n\n\nWe can print them out by calling the variable:\n\n\nprint\n(\nsea_creatures\n)\n\n\n\n\n\n\nAnd we see that the #Output : looks exactly like the list that we created:\n\n\n#Output : [\nshark\n, \ncuttlefish\n, \nsquid\n, \nmantis shrimp\n]\n\n\n\n\n\n\nLists are a very flexible data type because they are mutable in that they can have values added, removed, and changed. There is a data type that is similar to lists but that can\u2019t be changed, and that is called a tuple.\n\n\nTuples\n\n\nA \ntuple\n is used for grouping data. It is an immutable, or unchangeable, ordered sequence of elements.\n\n\nTuples are very similar to lists, but they use parentheses \n( )\n instead of square brackets and because they are immutable their values cannot be modified.\n\n\nA tuple looks like this:\n\n\n(\nblue coral\n,\n \nstaghorn coral\n,\n \npillar coral\n)\n\n\n\n\n\n\nWe can store a tuple in a variable and print it out:\n\n\ncoral\n \n=\n \n(\nblue coral\n,\n \nstaghorn coral\n,\n \npillar coral\n)\n\n\nprint\n(\ncoral\n)\n\n\n\nOuput\n(\nblue coral\n,\n \nstaghorn coral\n,\n \npillar coral\n)\n\n\n\n\n\n\nLike in the other data types, Python prints out the tuple just as we had typed it, with parentheses containing a sequence of values.\n\n\nDictionaries\n\n\nThe \ndictionary\n is Python\u2019s built-in \nmapping\n type. This means that dictionaries map \nkeys\n to \nvalues\n and these key-value pairs are a useful way to store data in Python. A dictionary is constructed with curly braces on either side \n{ }\n.\n\n\nTypically used to hold data that are related, such as the information contained in an ID, a dictionary looks like this:\n\n\n{\nname\n:\n \nSammy\n,\n \nanimal\n:\n \nshark\n,\n \ncolor\n:\n \nblue\n,\n \nlocation\n:\n \nocean\n}\n\n\n\n\n\n\nYou will notice that in addition to the curly braces, there are also colons throughout the dictionary. The words to the left of the colons are the keys. Keys can be made up of any immutable data type. The keys in the dictionary above are: \n'name', 'animal', 'color', 'location'\n.\n\n\nThe words to the right of the colons are the values. Values can be comprised of any data type. The values in the dictionary above are: \n'Sammy', 'shark', 'blue', 'ocean'\n.\n\n\nLike the other data types, let\u2019s store the dictionary inside a variable, and print it out:\n\n\nsammy\n \n=\n \n{\nname\n:\n \nSammy\n,\n \nanimal\n:\n \nshark\n,\n \ncolor\n:\n \nblue\n,\n \nlocation\n:\n \nocean\n}\n\n\n#Ouput : {\ncolor\n: \nblue\n, \nanimal\n: \nshark\n, \nname\n: \nSammy\n, \nlocation\n: \nocean\n}\n\n\n\n\n\n\nIf we want to isolate Sammy\u2019s color, we can do so by calling \nsammy['color']\n. Let\u2019s print that out:\n\n\nprint\n(\nsammy\n[\ncolor\n])\n\n\n\n#Output : blue\n\n\n\n\n\n\nAs dictionaries offer key-value pairs for storing data, they can be important elements in your Python program.\n\n\nConclusion\n\n\nAt this point, you should have a better understanding of some of the major data types that are available for you to use in Python. Each of these data types will become important as you develop programming projects in the Python language.\n\n\nYou can learn about each of the data types above in more detail by reading the following specific tutorials:\n\n\n\n\nNumbers\n\n\nBooleans\n\n\nStrings\n\n\nLists\n\n\nTuples\n\n\nDictionaries\n\n\n\n\nOnce you have a solid grasp of data types available to you in Python, you can learn how to \nconvert data types\n.\n\n\n\n\nSource:\n \n\n\n https://www.digitalocean.com/community/tutorials/understanding-data-types-in-python-3\n\n\n\n\n\n\nNative Datatypes By Dive Into Python 3\n\n\n\n\n\n\nSource:\n \n\n\n \nDive into Python 3\n by Mark Pilgrim \n\n\n\n\nStandard Data Types By Tutorialspoint\n\n\nThe data stored in memory can be of many types. For example, a person's age is stored as a numeric value and his or her address is stored as alphanumeric characters. Python has various standard data types that are used to define the operations possible on them and the storage method for each of them.\n\n\nPython has five standard data types : \n\n\n\n\n\n\nNumbers\n\n\n\n\n\n\nString\n\n\n\n\n\n\nList\n\n\n\n\n\n\nTuple\n\n\n\n\n\n\nDictionary\n\n\n\n\n\n\nPython Numbers\n\n\nNumber data types store numeric values. Number objects are created when you assign a value to them. For example \u2212\n\n\nvar1\n \n=\n \n1\n\n\nvar2\n \n=\n \n10\n\n\n\n\n\n\nYou can also delete the reference to a number object by using the del statement. The syntax of the del statement is \u2212\n\n\ndel\n \nvar1\n[,\nvar2\n[,\nvar3\n[\n....\n,\nvarN\n]]]]\n\n\n\n\n\n\nYou can delete a single object or multiple objects by using the del statement.\n\n\nFor example \u2212\n\n\ndel\n \nvar\n\n\ndel\n \nvar_a\n,\n \nvar_b\n\n\n\n\n\n\nPython supports three different numerical types \u2212\n- int (signed integers)\n\n\n\n\n\n\nfloat (floating point real values)\n\n\n\n\n\n\ncomplex (complex numbers)\n\n\n\n\n\n\nAll integers in Python3 are represented as long integers. Hence, there is no separate number type as long.\n\n\n\n\n\n\n\n\nint\n\n\nfloat\n\n\ncomplex\n\n\n\n\n\n\n\n\n\n\n10\n\n\n0.0\n\n\n3.14j\n\n\n\n\n\n\n100\n\n\n15.20\n\n\n45.j\n\n\n\n\n\n\n-786\n\n\n-21.9\n\n\n9.322e-36j\n\n\n\n\n\n\n\n\nA complex number consists of an ordered pair of real floating-point numbers denoted by x + yj, where x and y are real numbers and j is the imaginary unit.\n\n\nPython Strings\n\n\nStrings in Python are identified as a contiguous set of characters represented in the quotation marks. Python allows either pair of single or double quotes. Subsets of strings can be taken using the slice operator ([ ] and [:] ) with indexes starting at 0 in the beginning of the string and working their way from -1 to the end.\n\n\nThe plus (+) sign is the string concatenation operator and the asterisk (*) is the repetition operator. For example \u2212\n\n\n#!/usr/bin/python3\n\n\n\nstr\n \n=\n \nHello World!\n\n\n\nprint\n \n(\nstr\n)\n \n# Prints complete string\n\n\nprint\n \n(\nstr\n[\n0\n])\n \n# Prints first character of the string\n\n\nprint\n \n(\nstr\n[\n2\n:\n5\n])\n \n# Prints characters starting from 3rd to 5th\n\n\nprint\n \n(\nstr\n[\n2\n:])\n \n# Prints string starting from 3rd character\n\n\nprint\n \n(\nstr\n \n*\n \n2\n)\n \n# Prints string two times\n\n\nprint\n \n(\nstr\n \n+\n \nTEST\n)\n \n# Prints concatenated string\n\n\n\n\n\n\nThis will produce the following result \u2212\n\n\nHello\n \nWorld\n!\n\n\nH\n\n\nllo\n\n\nllo\n \nWorld\n!\n\n\nHello\n \nWorld\n!\nHello\n \nWorld\n!\n\n\nHello\n \nWorld\n!\nTEST\n\n\n\n\n\n\nPython Lists\n\n\nLists are the most versatile of Python's compound data types. A list contains items separated by commas and enclosed within square brackets ([]). To some extent, lists are similar to arrays in C. One of the differences between them is that all the items belonging to a list can be of different data type.\n\n\nThe values stored in a list can be accessed using the slice operator ([ ] and [:]) with indexes starting at 0 in the beginning of the list and working their way to end -1. The plus (+) sign is the list concatenation operator, and the asterisk (*) is the repetition operator. For example \u2212\n\n\n#!/usr/bin/python3\n\n\n\nlist\n \n=\n \n[\n \nabcd\n,\n \n786\n \n,\n \n2.23\n,\n \njohn\n,\n \n70.2\n \n]\n\n\ntinylist\n \n=\n \n[\n123\n,\n \njohn\n]\n\n\n\nprint\n \n(\nlist\n)\n \n# Prints complete list\n\n\nprint\n \n(\nlist\n[\n0\n])\n \n# Prints first element of the list\n\n\nprint\n \n(\nlist\n[\n1\n:\n3\n])\n \n# Prints elements starting from 2nd till 3rd \n\n\nprint\n \n(\nlist\n[\n2\n:])\n \n# Prints elements starting from 3rd element\n\n\nprint\n \n(\ntinylist\n \n*\n \n2\n)\n \n# Prints list two times\n\n\nprint\n \n(\nlist\n \n+\n \ntinylist\n)\n \n# Prints concatenated lists\n\n\n\n\n\n\nThis produces the following result \u2212\n\n\n[\nabcd\n,\n \n786\n,\n \n2.23\n,\n \njohn\n,\n \n70.200000000000003\n]\n\n\nabcd\n\n\n[\n786\n,\n \n2.23\n]\n\n\n[\n2.23\n,\n \njohn\n,\n \n70.200000000000003\n]\n\n\n[\n123\n,\n \njohn\n,\n \n123\n,\n \njohn\n]\n\n\n[\nabcd\n,\n \n786\n,\n \n2.23\n,\n \njohn\n,\n \n70.200000000000003\n,\n \n123\n,\n \njohn\n]\n\n\n\n\n\n\nPython Tuples\n\n\nA tuple is another sequence data type that is similar to the list. A tuple consists of a number of values separated by commas. Unlike lists, however, tuples are enclosed within parenthesis.\n\n\nThe main difference between lists and tuples are \u2212 Lists are enclosed in brackets ( [ ] ) and their elements and size can be changed, while tuples are enclosed in parentheses ( ( ) ) and cannot be updated. Tuples can be thought of as read-only lists. For example \u2212\n\n\n#!/usr/bin/python3\n\n\n\ntuple\n \n=\n \n(\n \nabcd\n,\n \n786\n \n,\n \n2.23\n,\n \njohn\n,\n \n70.2\n \n)\n\n\ntinytuple\n \n=\n \n(\n123\n,\n \njohn\n)\n\n\n\nprint\n \n(\ntuple\n)\n \n# Prints complete tuple\n\n\nprint\n \n(\ntuple\n[\n0\n])\n \n# Prints first element of the tuple\n\n\nprint\n \n(\ntuple\n[\n1\n:\n3\n])\n \n# Prints elements starting from 2nd till 3rd \n\n\nprint\n \n(\ntuple\n[\n2\n:])\n \n# Prints elements starting from 3rd element\n\n\nprint\n \n(\ntinytuple\n \n*\n \n2\n)\n \n# Prints tuple two times\n\n\nprint\n \n(\ntuple\n \n+\n \ntinytuple\n)\n \n# Prints concatenated tuple\n\n\n\n\n\n\nThis produces the following result \u2212\n\n\n(\nabcd\n,\n \n786\n,\n \n2.23\n,\n \njohn\n,\n \n70.200000000000003\n)\n\n\nabcd\n\n\n(\n786\n,\n \n2.23\n)\n\n\n(\n2.23\n,\n \njohn\n,\n \n70.200000000000003\n)\n\n\n(\n123\n,\n \njohn\n,\n \n123\n,\n \njohn\n)\n\n\n(\nabcd\n,\n \n786\n,\n \n2.23\n,\n \njohn\n,\n \n70.200000000000003\n,\n \n123\n,\n \njohn\n)\n\n\n\n\n\n\nThe following code is invalid with tuple, because we attempted to update a tuple, which is not allowed. Similar case is possible with lists \u2212\n\n\n#!/usr/bin/python3\n\n\n\ntuple\n \n=\n \n(\n \nabcd\n,\n \n786\n \n,\n \n2.23\n,\n \njohn\n,\n \n70.2\n \n)\n\n\nlist\n \n=\n \n[\n \nabcd\n,\n \n786\n \n,\n \n2.23\n,\n \njohn\n,\n \n70.2\n \n]\n\n\ntuple\n[\n2\n]\n \n=\n \n1000\n \n# Invalid syntax with tuple\n\n\nlist\n[\n2\n]\n \n=\n \n1000\n \n# Valid syntax with list\n\n\n\n\n\n\nPython Dictionary\n\n\nPython's dictionaries are kind of hash-table type. They work like associative arrays or hashes found in Perl and consist of key-value pairs. A dictionary key can be almost any Python type, but are usually numbers or strings. Values, on the other hand, can be any arbitrary Python object.\n\n\nDictionaries are enclosed by curly braces ({ }) and values can be assigned and accessed using square braces ([]). For example \u2212\n\n\n#!/usr/bin/python3\n\n\n\ndict\n \n=\n \n{}\n\n\ndict\n[\none\n]\n \n=\n \nThis is one\n\n\ndict\n[\n2\n]\n \n=\n \nThis is two\n\n\n\ntinydict\n \n=\n \n{\nname\n:\n \njohn\n,\ncode\n:\n6734\n,\n \ndept\n:\n \nsales\n}\n\n\n\n\nprint\n \n(\ndict\n[\none\n])\n \n# Prints value for \none\n key\n\n\nprint\n \n(\ndict\n[\n2\n])\n \n# Prints value for 2 key\n\n\nprint\n \n(\ntinydict\n)\n \n# Prints complete dictionary\n\n\nprint\n \n(\ntinydict\n.\nkeys\n())\n \n# Prints all the keys\n\n\nprint\n \n(\ntinydict\n.\nvalues\n())\n \n# Prints all the values\n\n\n\n\n\n\nThis produces the following result \u2212\n\n\nThis\n \nis\n \none\n\n\nThis\n \nis\n \ntwo\n\n\n{\nname\n:\n \njohn\n,\n \ndept\n:\n \nsales\n,\n \ncode\n:\n \n6734\n}\n\n\ndict_keys\n([\nname\n,\n \ndept\n,\n \ncode\n])\n\n\ndict_values\n([\njohn\n,\n \nsales\n,\n \n6734\n])\n\n\n\n\n\n\nDictionaries have no concept of order among the elements. It is incorrect to say that the elements are \"out of order\"; they are simply unordered.\n\n\n\n\nSource:\n \n\n\n https://www.tutorialspoint.com/python3/python_variable_types.htm", + "location": "/beginner/Data_Types_In_Python_3/", + "text": "Data Types in Python 3\n\n\nUnderstanding Data Types in Python 3\n\n\nIntroduction\n\n\nIn Python, like in all programming languages, data types are used to classify one particular type of data. This is important because the specific data type you use will determine what values you can assign to it and what you can do to it (including what operations you can perform on it).\n\n\nIn this tutorial, we will go over the important data types native to Python. This is not an exhaustive investigation of data types, but will help you become familiar with what options you have available to you in Python.\n\n\nBackground\n\n\nOne way to think about data types is to consider the different types of data that we use in the real world. An example of data in the real world are numbers: we may use whole numbers (0, 1, 2, \u2026), integers (\u2026, -1, 0, 1, \u2026), and irrational numbers (\u03c0), for example.\n\n\nUsually, in math, we can combine numbers from different types, and get some kind of an answer. We may want to add 5 to \u03c0, for example:\n\n\n5 + \u03c0\n\n\nWe can either keep the equation as the answer to account for the irrational number, or round \u03c0 to a number with a brief number of decimal places, and then add the numbers together:\n\n\n5 + \u03c0 = 5 + 3.14 = 8.14\n\n\nBut, if we start to try to evaluate numbers with another data type, such as words, things start to make less sense. How would we solve for the following equation?\n\n\nsky + 8\n\n\nFor computers, each data type can be thought of as being quite different, like words and numbers, so we will have to be careful about how we use them to assign values and how we manipulate them through operations.\n\n\nNumbers\n\n\nAny \nnumber\n you enter in Python will be interpreted as a number; you are not required to declare what kind of data type you are entering. Python will consider any number written without decimals as an \ninteger\n (as in \n138\n) and any number written with decimals as a \nfloat\n (as in \n138.0\n).\n\n\nIntegers\n\n\nLike in \nmath\n, \nintegers\n in computer programming are whole numbers that can be positive, negative, or 0 (\u2026, \n-1\n, \n0\n, \n1\n, \u2026). An integer can also be known as an \nint\n. As with other programming languages, you should not use commas in numbers of four digits or more, so when you write 1,000 in your program, write it as \n1000\n.\n\n\nWe can print out an integer in a simple way like this:\n\n\nprint\n(\n-\n25\n)\n\n\n\n#Output : -25\n\n\n\n\n\n\nOr, we can declare a \nvariable\n, which in this case is essentially a symbol of the number we are using or manipulating, like so:\n\n\nmy_int\n \n=\n \n-\n25\n\n\nprint\n(\nmy_int\n)\n\n\n\n#Output : -25\n\n\n\n\n\n\nWe can do math with integers in Python, too:\n\n\nint_ans\n \n=\n \n116\n \n-\n \n68\n\n\nprint\n(\nint_ans\n)\n\n\n\n#Output : 48\n\n\n\n\n\n\nIntegers can be used in many ways within Python programs, and as you continue to learn more about the language you will have a lot of opportunities to work with integers and understand more about this data type.\n\n\nFloating-Point Numbers\n\n\nA \nfloating-point number\n or a \nfloat\n is a real number, meaning that it can be either a rational or an irrational number. Because of this, floating-point numbers can be numbers that can contain a fractional part, such as \n9.0\n or \n-116.42\n. Simply speaking, for the purposes of thinking of a \nfloat\n in a Python program, it is a number that contains a decimal point.\n\n\nLike we did with the integer, we can print out a floating-point number in a simple way like this:\n\n\nprint\n(\n17.3\n)\n\n\n\n#Output : 17.3\n\n\n\n\n\n\nWe can also declare a variable that stands in for a float, like so:\n\n\nmy_flt\n \n=\n \n17.3\n\n\nprint\n(\nmy_flt\n)\n\n\n\n#Output : 17.3\n\n\n\n\n\n\nAnd, just like with integers, we can do math with floats in Python, too:\n\n\nflt_ans\n \n=\n \n564.0\n \n+\n \n365.24\n\n\nprint\n(\nflt_ans\n)\n\n\n\n#Output : 929.24\n\n\n\n\n\n\nWith integers and floating-point numbers, it is important to keep in mind that 3 \u2260 3.0, as \n3\n refers to an integer while \n3.0\n refers to a float.\n\n\nBooleans\n\n\nThe \nBoolean\n data type can be one of two values, either \nTrue\n or \nFalse\n. Booleans are used to represent the truth values that are associated with the logic branch of mathematics, which informs algorithms in computer science.\n\n\nWhenever you see the data type Boolean, it will start with a capitalized B because it is named for the mathematician George Boole. The values \nTrue\n and \nFalse\n will also always be with a capital T and F respectively, as they are special values in Python.\n\n\nMany operations in math give us answers that evaluate to either True or False:\n\n\n*\n \n**\ngreater\n \nthan\n**\n\n \n*\n \n500\n \n \n100\n \n`True`\n\n \n*\n \n1\n \n \n5\n \n`False`\n\n\n*\n \n**\nless\n \nthan\n**\n\n \n*\n \n200\n \n \n400\n \n`True`\n\n \n*\n \n4\n \n \n2\n \n`False`\n\n\n*\n \n**\nequal\n**\n\n \n*\n \n5\n \n=\n \n5\n \n`True`\n\n \n*\n \n500\n \n=\n \n400\n \n`False`\n\n\n\n\n\n\nLike with numbers, we can store a Boolean value in a variable:\n\n\nmy_bool\n \n=\n \n5\n \n \n8\n\n\n\n\n\n\nWe can then print the Boolean value with a call to the \nprint()\n function:\n\n\nprint\n(\nmy_bool\n)\n\n\n\n\n\n\nSince 5 is not greater than 8, we will receive the following #Output : :\n\n\n#Output : False\n\n\n\n\n\n\nAs you write more programs in Python, you will become more familiar with how Booleans work and how different functions and operations evaluating to either True or False can change the course of the program.\n\n\nStrings\n\n\nA \nstring\n is a sequence of one or more characters (letters, numbers, symbols) that can be either a constant or a variable. Strings exist within either single quotes \n'\n or double quotes \n\"\n in Python, so to create a string, enclose a sequence of characters in quotes:\n\n\nThis is a string in single quotes.\n\n\n\nThis is a string in double quotes.\n\n\n\n\n\n\nYou can choose to use either single quotes or double quotes, but whichever you decide on you should be consistent within a program.\n\n\nThe simple program \u201c\nHello, World!\n\u201d demonstrates how a string can be used in computer programming, as the characters that make up the phrase \nHello, World!\n are a string.\n\n\nprint\n(\nHello, World!\n)\n\n\n\n\n\n\nAs with other data types, we can store strings in variables:\n\n\nhw\n \n=\n \nHello, World!\n\n\n\n\n\n\nAnd print out the string by calling the variable:\n\n\nprint\n(\nhw\n)\n\n\n\n#Ouput : Hello, World!\n\n\n\n\n\n\nLike numbers, there are many operations that we can perform on strings within our programs in order to manipulate them to achieve the results we are seeking. Strings are important for communicating information to the user, and for the user to communicate information back to the program.\n\n\nLists\n\n\nA \nlist\n is a mutable, or changeable, ordered sequence of elements. Each element or value that is inside of a list is called an \nitem\n. Just as strings are defined as characters between quotes, lists are defined by having values between square brackets \n[ ]\n.\n\n\nA list of integers looks like this:\n\n\n[\n-\n3\n,\n \n-\n2\n,\n \n-\n1\n,\n \n0\n,\n \n1\n,\n \n2\n,\n \n3\n]\n\n\n\n\n\n\nA list of floats looks like this:\n\n\n[\n3.14\n,\n \n9.23\n,\n \n111.11\n,\n \n312.12\n,\n \n1.05\n]\n\n\n\n\n\n\nA list of strings:\n\n\n[\nshark\n,\n \ncuttlefish\n,\n \nsquid\n,\n \nmantis shrimp\n]\n\n\n\n\n\n\nIf we define our string list as \nsea_creatures\n:\n\n\nsea_creatures\n \n=\n \n[\nshark\n,\n \ncuttlefish\n,\n \nsquid\n,\n \nmantis shrimp\n]\n\n\n\n\n\n\nWe can print them out by calling the variable:\n\n\nprint\n(\nsea_creatures\n)\n\n\n\n\n\n\nAnd we see that the #Output : looks exactly like the list that we created:\n\n\n#Output : [\nshark\n, \ncuttlefish\n, \nsquid\n, \nmantis shrimp\n]\n\n\n\n\n\n\nLists are a very flexible data type because they are mutable in that they can have values added, removed, and changed. There is a data type that is similar to lists but that can\u2019t be changed, and that is called a tuple.\n\n\nTuples\n\n\nA \ntuple\n is used for grouping data. It is an immutable, or unchangeable, ordered sequence of elements.\n\n\nTuples are very similar to lists, but they use parentheses \n( )\n instead of square brackets and because they are immutable their values cannot be modified.\n\n\nA tuple looks like this:\n\n\n(\nblue coral\n,\n \nstaghorn coral\n,\n \npillar coral\n)\n\n\n\n\n\n\nWe can store a tuple in a variable and print it out:\n\n\ncoral\n \n=\n \n(\nblue coral\n,\n \nstaghorn coral\n,\n \npillar coral\n)\n\n\nprint\n(\ncoral\n)\n\n\n\nOuput\n(\nblue coral\n,\n \nstaghorn coral\n,\n \npillar coral\n)\n\n\n\n\n\n\nLike in the other data types, Python prints out the tuple just as we had typed it, with parentheses containing a sequence of values.\n\n\nDictionaries\n\n\nThe \ndictionary\n is Python\u2019s built-in \nmapping\n type. This means that dictionaries map \nkeys\n to \nvalues\n and these key-value pairs are a useful way to store data in Python. A dictionary is constructed with curly braces on either side \n{ }\n.\n\n\nTypically used to hold data that are related, such as the information contained in an ID, a dictionary looks like this:\n\n\n{\nname\n:\n \nSammy\n,\n \nanimal\n:\n \nshark\n,\n \ncolor\n:\n \nblue\n,\n \nlocation\n:\n \nocean\n}\n\n\n\n\n\n\nYou will notice that in addition to the curly braces, there are also colons throughout the dictionary. The words to the left of the colons are the keys. Keys can be made up of any immutable data type. The keys in the dictionary above are: \n'name', 'animal', 'color', 'location'\n.\n\n\nThe words to the right of the colons are the values. Values can be comprised of any data type. The values in the dictionary above are: \n'Sammy', 'shark', 'blue', 'ocean'\n.\n\n\nLike the other data types, let\u2019s store the dictionary inside a variable, and print it out:\n\n\nsammy\n \n=\n \n{\nname\n:\n \nSammy\n,\n \nanimal\n:\n \nshark\n,\n \ncolor\n:\n \nblue\n,\n \nlocation\n:\n \nocean\n}\n\n\n#Ouput : {\ncolor\n: \nblue\n, \nanimal\n: \nshark\n, \nname\n: \nSammy\n, \nlocation\n: \nocean\n}\n\n\n\n\n\n\nIf we want to isolate Sammy\u2019s color, we can do so by calling \nsammy['color']\n. Let\u2019s print that out:\n\n\nprint\n(\nsammy\n[\ncolor\n])\n\n\n\n#Output : blue\n\n\n\n\n\n\nAs dictionaries offer key-value pairs for storing data, they can be important elements in your Python program.\n\n\nConclusion\n\n\nAt this point, you should have a better understanding of some of the major data types that are available for you to use in Python. Each of these data types will become important as you develop programming projects in the Python language.\n\n\nYou can learn about each of the data types above in more detail by reading the following specific tutorials:\n\n\n\n\nNumbers\n\n\nBooleans\n\n\nStrings\n\n\nLists\n\n\nTuples\n\n\nDictionaries\n\n\n\n\nOnce you have a solid grasp of data types available to you in Python, you can learn how to \nconvert data types\n.\n\n\n\n\nSource:\n \n\n\n https://www.digitalocean.com/community/tutorials/understanding-data-types-in-python-3\n\n\n\n\n\n\nNative Datatypes By Dive Into Python 3\n\n\n\n\n\n\nSource:\n \n\n\n \nDive into Python 3\n by Mark Pilgrim \n\n\n\n\nStandard Data Types By Tutorialspoint\n\n\nThe data stored in memory can be of many types. For example, a person's age is stored as a numeric value and his or her address is stored as alphanumeric characters. Python has various standard data types that are used to define the operations possible on them and the storage method for each of them.\n\n\nPython has five standard data types : \n\n\n\n\n\n\nNumbers\n\n\n\n\n\n\nString\n\n\n\n\n\n\nList\n\n\n\n\n\n\nTuple\n\n\n\n\n\n\nDictionary\n\n\n\n\n\n\nPython Numbers\n\n\nNumber data types store numeric values. Number objects are created when you assign a value to them. For example \u2212\n\n\nvar1\n \n=\n \n1\n\n\nvar2\n \n=\n \n10\n\n\n\n\n\n\nYou can also delete the reference to a number object by using the del statement. The syntax of the del statement is \u2212\n\n\ndel\n \nvar1\n[,\nvar2\n[,\nvar3\n[\n....\n,\nvarN\n]]]]\n\n\n\n\n\n\nYou can delete a single object or multiple objects by using the del statement.\n\n\nFor example \u2212\n\n\ndel\n \nvar\n\n\ndel\n \nvar_a\n,\n \nvar_b\n\n\n\n\n\n\nPython supports three different numerical types \u2212\n- int (signed integers)\n\n\n\n\n\n\nfloat (floating point real values)\n\n\n\n\n\n\ncomplex (complex numbers)\n\n\n\n\n\n\nAll integers in Python3 are represented as long integers. Hence, there is no separate number type as long.\n\n\n\n\n\n\n\n\nint\n\n\nfloat\n\n\ncomplex\n\n\n\n\n\n\n\n\n\n\n10\n\n\n0.0\n\n\n3.14j\n\n\n\n\n\n\n100\n\n\n15.20\n\n\n45.j\n\n\n\n\n\n\n-786\n\n\n-21.9\n\n\n9.322e-36j\n\n\n\n\n\n\n\n\nA complex number consists of an ordered pair of real floating-point numbers denoted by x + yj, where x and y are real numbers and j is the imaginary unit.\n\n\nPython Strings\n\n\nStrings in Python are identified as a contiguous set of characters represented in the quotation marks. Python allows either pair of single or double quotes. Subsets of strings can be taken using the slice operator ([ ] and [:] ) with indexes starting at 0 in the beginning of the string and working their way from -1 to the end.\n\n\nThe plus (+) sign is the string concatenation operator and the asterisk (*) is the repetition operator. For example \u2212\n\n\n#!/usr/bin/python3\n\n\n\nstr\n \n=\n \nHello World!\n\n\n\nprint\n \n(\nstr\n)\n \n# Prints complete string\n\n\nprint\n \n(\nstr\n[\n0\n])\n \n# Prints first character of the string\n\n\nprint\n \n(\nstr\n[\n2\n:\n5\n])\n \n# Prints characters starting from 3rd to 5th\n\n\nprint\n \n(\nstr\n[\n2\n:])\n \n# Prints string starting from 3rd character\n\n\nprint\n \n(\nstr\n \n*\n \n2\n)\n \n# Prints string two times\n\n\nprint\n \n(\nstr\n \n+\n \nTEST\n)\n \n# Prints concatenated string\n\n\n\n\n\n\nThis will produce the following result \u2212\n\n\nHello\n \nWorld\n!\n\n\nH\n\n\nllo\n\n\nllo\n \nWorld\n!\n\n\nHello\n \nWorld\n!\nHello\n \nWorld\n!\n\n\nHello\n \nWorld\n!\nTEST\n\n\n\n\n\n\nPython Lists\n\n\nLists are the most versatile of Python's compound data types. A list contains items separated by commas and enclosed within square brackets ([]). To some extent, lists are similar to arrays in C. One of the differences between them is that all the items belonging to a list can be of different data type.\n\n\nThe values stored in a list can be accessed using the slice operator ([ ] and [:]) with indexes starting at 0 in the beginning of the list and working their way to end -1. The plus (+) sign is the list concatenation operator, and the asterisk (*) is the repetition operator. For example \u2212\n\n\n#!/usr/bin/python3\n\n\n\nlist\n \n=\n \n[\n \nabcd\n,\n \n786\n \n,\n \n2.23\n,\n \njohn\n,\n \n70.2\n \n]\n\n\ntinylist\n \n=\n \n[\n123\n,\n \njohn\n]\n\n\n\nprint\n \n(\nlist\n)\n \n# Prints complete list\n\n\nprint\n \n(\nlist\n[\n0\n])\n \n# Prints first element of the list\n\n\nprint\n \n(\nlist\n[\n1\n:\n3\n])\n \n# Prints elements starting from 2nd till 3rd \n\n\nprint\n \n(\nlist\n[\n2\n:])\n \n# Prints elements starting from 3rd element\n\n\nprint\n \n(\ntinylist\n \n*\n \n2\n)\n \n# Prints list two times\n\n\nprint\n \n(\nlist\n \n+\n \ntinylist\n)\n \n# Prints concatenated lists\n\n\n\n\n\n\nThis produces the following result \u2212\n\n\n[\nabcd\n,\n \n786\n,\n \n2.23\n,\n \njohn\n,\n \n70.200000000000003\n]\n\n\nabcd\n\n\n[\n786\n,\n \n2.23\n]\n\n\n[\n2.23\n,\n \njohn\n,\n \n70.200000000000003\n]\n\n\n[\n123\n,\n \njohn\n,\n \n123\n,\n \njohn\n]\n\n\n[\nabcd\n,\n \n786\n,\n \n2.23\n,\n \njohn\n,\n \n70.200000000000003\n,\n \n123\n,\n \njohn\n]\n\n\n\n\n\n\nPython Tuples\n\n\nA tuple is another sequence data type that is similar to the list. A tuple consists of a number of values separated by commas. Unlike lists, however, tuples are enclosed within parenthesis.\n\n\nThe main difference between lists and tuples are \u2212 Lists are enclosed in brackets ( [ ] ) and their elements and size can be changed, while tuples are enclosed in parentheses ( ( ) ) and cannot be updated. Tuples can be thought of as read-only lists. For example \u2212\n\n\n#!/usr/bin/python3\n\n\n\ntuple\n \n=\n \n(\n \nabcd\n,\n \n786\n \n,\n \n2.23\n,\n \njohn\n,\n \n70.2\n \n)\n\n\ntinytuple\n \n=\n \n(\n123\n,\n \njohn\n)\n\n\n\nprint\n \n(\ntuple\n)\n \n# Prints complete tuple\n\n\nprint\n \n(\ntuple\n[\n0\n])\n \n# Prints first element of the tuple\n\n\nprint\n \n(\ntuple\n[\n1\n:\n3\n])\n \n# Prints elements starting from 2nd till 3rd \n\n\nprint\n \n(\ntuple\n[\n2\n:])\n \n# Prints elements starting from 3rd element\n\n\nprint\n \n(\ntinytuple\n \n*\n \n2\n)\n \n# Prints tuple two times\n\n\nprint\n \n(\ntuple\n \n+\n \ntinytuple\n)\n \n# Prints concatenated tuple\n\n\n\n\n\n\nThis produces the following result \u2212\n\n\n(\nabcd\n,\n \n786\n,\n \n2.23\n,\n \njohn\n,\n \n70.200000000000003\n)\n\n\nabcd\n\n\n(\n786\n,\n \n2.23\n)\n\n\n(\n2.23\n,\n \njohn\n,\n \n70.200000000000003\n)\n\n\n(\n123\n,\n \njohn\n,\n \n123\n,\n \njohn\n)\n\n\n(\nabcd\n,\n \n786\n,\n \n2.23\n,\n \njohn\n,\n \n70.200000000000003\n,\n \n123\n,\n \njohn\n)\n\n\n\n\n\n\nThe following code is invalid with tuple, because we attempted to update a tuple, which is not allowed. Similar case is possible with lists \u2212\n\n\n#!/usr/bin/python3\n\n\n\ntuple\n \n=\n \n(\n \nabcd\n,\n \n786\n \n,\n \n2.23\n,\n \njohn\n,\n \n70.2\n \n)\n\n\nlist\n \n=\n \n[\n \nabcd\n,\n \n786\n \n,\n \n2.23\n,\n \njohn\n,\n \n70.2\n \n]\n\n\ntuple\n[\n2\n]\n \n=\n \n1000\n \n# Invalid syntax with tuple\n\n\nlist\n[\n2\n]\n \n=\n \n1000\n \n# Valid syntax with list\n\n\n\n\n\n\nPython Dictionary\n\n\nPython's dictionaries are kind of hash-table type. They work like associative arrays or hashes found in Perl and consist of key-value pairs. A dictionary key can be almost any Python type, but are usually numbers or strings. Values, on the other hand, can be any arbitrary Python object.\n\n\nDictionaries are enclosed by curly braces ({ }) and values can be assigned and accessed using square braces ([]). For example \u2212\n\n\n#!/usr/bin/python3\n\n\n\ndict\n \n=\n \n{}\n\n\ndict\n[\none\n]\n \n=\n \nThis is one\n\n\ndict\n[\n2\n]\n \n=\n \nThis is two\n\n\n\ntinydict\n \n=\n \n{\nname\n:\n \njohn\n,\ncode\n:\n6734\n,\n \ndept\n:\n \nsales\n}\n\n\n\n\nprint\n \n(\ndict\n[\none\n])\n \n# Prints value for \none\n key\n\n\nprint\n \n(\ndict\n[\n2\n])\n \n# Prints value for 2 key\n\n\nprint\n \n(\ntinydict\n)\n \n# Prints complete dictionary\n\n\nprint\n \n(\ntinydict\n.\nkeys\n())\n \n# Prints all the keys\n\n\nprint\n \n(\ntinydict\n.\nvalues\n())\n \n# Prints all the values\n\n\n\n\n\n\nThis produces the following result \u2212\n\n\nThis\n \nis\n \none\n\n\nThis\n \nis\n \ntwo\n\n\n{\nname\n:\n \njohn\n,\n \ndept\n:\n \nsales\n,\n \ncode\n:\n \n6734\n}\n\n\ndict_keys\n([\nname\n,\n \ndept\n,\n \ncode\n])\n\n\ndict_values\n([\njohn\n,\n \nsales\n,\n \n6734\n])\n\n\n\n\n\n\nDictionaries have no concept of order among the elements. It is incorrect to say that the elements are \"out of order\"; they are simply unordered.\n\n\n\n\nSource:\n \n\n\n https://www.tutorialspoint.com/python3/python_variable_types.htm", "title": "Data Types in Python 3" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#data-types-in-python-3", - "text": "", + "location": "/beginner/Data_Types_In_Python_3/#data-types-in-python-3", + "text": "", "title": "Data Types in Python 3" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#understanding-data-types-in-python-3", - "text": "", + "location": "/beginner/Data_Types_In_Python_3/#understanding-data-types-in-python-3", + "text": "", "title": "Understanding Data Types in Python 3" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#introduction", - "text": "In Python, like in all programming languages, data types are used to classify one particular type of data. This is important because the specific data type you use will determine what values you can assign to it and what you can do to it (including what operations you can perform on it). In this tutorial, we will go over the important data types native to Python. This is not an exhaustive investigation of data types, but will help you become familiar with what options you have available to you in Python.", + "location": "/beginner/Data_Types_In_Python_3/#introduction", + "text": "In Python, like in all programming languages, data types are used to classify one particular type of data. This is important because the specific data type you use will determine what values you can assign to it and what you can do to it (including what operations you can perform on it). In this tutorial, we will go over the important data types native to Python. This is not an exhaustive investigation of data types, but will help you become familiar with what options you have available to you in Python.", "title": "Introduction" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#background", - "text": "One way to think about data types is to consider the different types of data that we use in the real world. An example of data in the real world are numbers: we may use whole numbers (0, 1, 2, \u2026), integers (\u2026, -1, 0, 1, \u2026), and irrational numbers (\u03c0), for example. Usually, in math, we can combine numbers from different types, and get some kind of an answer. We may want to add 5 to \u03c0, for example: 5 + \u03c0 We can either keep the equation as the answer to account for the irrational number, or round \u03c0 to a number with a brief number of decimal places, and then add the numbers together: 5 + \u03c0 = 5 + 3.14 = 8.14 But, if we start to try to evaluate numbers with another data type, such as words, things start to make less sense. How would we solve for the following equation? sky + 8 For computers, each data type can be thought of as being quite different, like words and numbers, so we will have to be careful about how we use them to assign values and how we manipulate them through operations.", + "location": "/beginner/Data_Types_In_Python_3/#background", + "text": "One way to think about data types is to consider the different types of data that we use in the real world. An example of data in the real world are numbers: we may use whole numbers (0, 1, 2, \u2026), integers (\u2026, -1, 0, 1, \u2026), and irrational numbers (\u03c0), for example. Usually, in math, we can combine numbers from different types, and get some kind of an answer. We may want to add 5 to \u03c0, for example: 5 + \u03c0 We can either keep the equation as the answer to account for the irrational number, or round \u03c0 to a number with a brief number of decimal places, and then add the numbers together: 5 + \u03c0 = 5 + 3.14 = 8.14 But, if we start to try to evaluate numbers with another data type, such as words, things start to make less sense. How would we solve for the following equation? sky + 8 For computers, each data type can be thought of as being quite different, like words and numbers, so we will have to be careful about how we use them to assign values and how we manipulate them through operations.", "title": "Background" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#numbers", - "text": "Any number you enter in Python will be interpreted as a number; you are not required to declare what kind of data type you are entering. Python will consider any number written without decimals as an integer (as in 138 ) and any number written with decimals as a float (as in 138.0 ).", + "location": "/beginner/Data_Types_In_Python_3/#numbers", + "text": "Any number you enter in Python will be interpreted as a number; you are not required to declare what kind of data type you are entering. Python will consider any number written without decimals as an integer (as in 138 ) and any number written with decimals as a float (as in 138.0 ).", "title": "Numbers" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#integers", - "text": "Like in math , integers in computer programming are whole numbers that can be positive, negative, or 0 (\u2026, -1 , 0 , 1 , \u2026). An integer can also be known as an int . As with other programming languages, you should not use commas in numbers of four digits or more, so when you write 1,000 in your program, write it as 1000 . We can print out an integer in a simple way like this: print ( - 25 ) #Output : -25 Or, we can declare a variable , which in this case is essentially a symbol of the number we are using or manipulating, like so: my_int = - 25 print ( my_int ) #Output : -25 We can do math with integers in Python, too: int_ans = 116 - 68 print ( int_ans ) #Output : 48 Integers can be used in many ways within Python programs, and as you continue to learn more about the language you will have a lot of opportunities to work with integers and understand more about this data type.", + "location": "/beginner/Data_Types_In_Python_3/#integers", + "text": "Like in math , integers in computer programming are whole numbers that can be positive, negative, or 0 (\u2026, -1 , 0 , 1 , \u2026). An integer can also be known as an int . As with other programming languages, you should not use commas in numbers of four digits or more, so when you write 1,000 in your program, write it as 1000 . We can print out an integer in a simple way like this: print ( - 25 ) #Output : -25 Or, we can declare a variable , which in this case is essentially a symbol of the number we are using or manipulating, like so: my_int = - 25 print ( my_int ) #Output : -25 We can do math with integers in Python, too: int_ans = 116 - 68 print ( int_ans ) #Output : 48 Integers can be used in many ways within Python programs, and as you continue to learn more about the language you will have a lot of opportunities to work with integers and understand more about this data type.", "title": "Integers" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#floating-point-numbers", - "text": "A floating-point number or a float is a real number, meaning that it can be either a rational or an irrational number. Because of this, floating-point numbers can be numbers that can contain a fractional part, such as 9.0 or -116.42 . Simply speaking, for the purposes of thinking of a float in a Python program, it is a number that contains a decimal point. Like we did with the integer, we can print out a floating-point number in a simple way like this: print ( 17.3 ) #Output : 17.3 We can also declare a variable that stands in for a float, like so: my_flt = 17.3 print ( my_flt ) #Output : 17.3 And, just like with integers, we can do math with floats in Python, too: flt_ans = 564.0 + 365.24 print ( flt_ans ) #Output : 929.24 With integers and floating-point numbers, it is important to keep in mind that 3 \u2260 3.0, as 3 refers to an integer while 3.0 refers to a float.", + "location": "/beginner/Data_Types_In_Python_3/#floating-point-numbers", + "text": "A floating-point number or a float is a real number, meaning that it can be either a rational or an irrational number. Because of this, floating-point numbers can be numbers that can contain a fractional part, such as 9.0 or -116.42 . Simply speaking, for the purposes of thinking of a float in a Python program, it is a number that contains a decimal point. Like we did with the integer, we can print out a floating-point number in a simple way like this: print ( 17.3 ) #Output : 17.3 We can also declare a variable that stands in for a float, like so: my_flt = 17.3 print ( my_flt ) #Output : 17.3 And, just like with integers, we can do math with floats in Python, too: flt_ans = 564.0 + 365.24 print ( flt_ans ) #Output : 929.24 With integers and floating-point numbers, it is important to keep in mind that 3 \u2260 3.0, as 3 refers to an integer while 3.0 refers to a float.", "title": "Floating-Point Numbers" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#booleans", - "text": "The Boolean data type can be one of two values, either True or False . Booleans are used to represent the truth values that are associated with the logic branch of mathematics, which informs algorithms in computer science. Whenever you see the data type Boolean, it will start with a capitalized B because it is named for the mathematician George Boole. The values True and False will also always be with a capital T and F respectively, as they are special values in Python. Many operations in math give us answers that evaluate to either True or False: * ** greater than ** \n * 500 100 `True` \n * 1 5 `False` * ** less than ** \n * 200 400 `True` \n * 4 2 `False` * ** equal ** \n * 5 = 5 `True` \n * 500 = 400 `False` Like with numbers, we can store a Boolean value in a variable: my_bool = 5 8 We can then print the Boolean value with a call to the print() function: print ( my_bool ) Since 5 is not greater than 8, we will receive the following #Output : : #Output : False As you write more programs in Python, you will become more familiar with how Booleans work and how different functions and operations evaluating to either True or False can change the course of the program.", + "location": "/beginner/Data_Types_In_Python_3/#booleans", + "text": "The Boolean data type can be one of two values, either True or False . Booleans are used to represent the truth values that are associated with the logic branch of mathematics, which informs algorithms in computer science. Whenever you see the data type Boolean, it will start with a capitalized B because it is named for the mathematician George Boole. The values True and False will also always be with a capital T and F respectively, as they are special values in Python. Many operations in math give us answers that evaluate to either True or False: * ** greater than ** \n * 500 100 `True` \n * 1 5 `False` * ** less than ** \n * 200 400 `True` \n * 4 2 `False` * ** equal ** \n * 5 = 5 `True` \n * 500 = 400 `False` Like with numbers, we can store a Boolean value in a variable: my_bool = 5 8 We can then print the Boolean value with a call to the print() function: print ( my_bool ) Since 5 is not greater than 8, we will receive the following #Output : : #Output : False As you write more programs in Python, you will become more familiar with how Booleans work and how different functions and operations evaluating to either True or False can change the course of the program.", "title": "Booleans" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#strings", - "text": "A string is a sequence of one or more characters (letters, numbers, symbols) that can be either a constant or a variable. Strings exist within either single quotes ' or double quotes \" in Python, so to create a string, enclose a sequence of characters in quotes: This is a string in single quotes. This is a string in double quotes. You can choose to use either single quotes or double quotes, but whichever you decide on you should be consistent within a program. The simple program \u201c Hello, World! \u201d demonstrates how a string can be used in computer programming, as the characters that make up the phrase Hello, World! are a string. print ( Hello, World! ) As with other data types, we can store strings in variables: hw = Hello, World! And print out the string by calling the variable: print ( hw ) #Ouput : Hello, World! Like numbers, there are many operations that we can perform on strings within our programs in order to manipulate them to achieve the results we are seeking. Strings are important for communicating information to the user, and for the user to communicate information back to the program.", + "location": "/beginner/Data_Types_In_Python_3/#strings", + "text": "A string is a sequence of one or more characters (letters, numbers, symbols) that can be either a constant or a variable. Strings exist within either single quotes ' or double quotes \" in Python, so to create a string, enclose a sequence of characters in quotes: This is a string in single quotes. This is a string in double quotes. You can choose to use either single quotes or double quotes, but whichever you decide on you should be consistent within a program. The simple program \u201c Hello, World! \u201d demonstrates how a string can be used in computer programming, as the characters that make up the phrase Hello, World! are a string. print ( Hello, World! ) As with other data types, we can store strings in variables: hw = Hello, World! And print out the string by calling the variable: print ( hw ) #Ouput : Hello, World! Like numbers, there are many operations that we can perform on strings within our programs in order to manipulate them to achieve the results we are seeking. Strings are important for communicating information to the user, and for the user to communicate information back to the program.", "title": "Strings" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#lists", - "text": "A list is a mutable, or changeable, ordered sequence of elements. Each element or value that is inside of a list is called an item . Just as strings are defined as characters between quotes, lists are defined by having values between square brackets [ ] . A list of integers looks like this: [ - 3 , - 2 , - 1 , 0 , 1 , 2 , 3 ] A list of floats looks like this: [ 3.14 , 9.23 , 111.11 , 312.12 , 1.05 ] A list of strings: [ shark , cuttlefish , squid , mantis shrimp ] If we define our string list as sea_creatures : sea_creatures = [ shark , cuttlefish , squid , mantis shrimp ] We can print them out by calling the variable: print ( sea_creatures ) And we see that the #Output : looks exactly like the list that we created: #Output : [ shark , cuttlefish , squid , mantis shrimp ] Lists are a very flexible data type because they are mutable in that they can have values added, removed, and changed. There is a data type that is similar to lists but that can\u2019t be changed, and that is called a tuple.", + "location": "/beginner/Data_Types_In_Python_3/#lists", + "text": "A list is a mutable, or changeable, ordered sequence of elements. Each element or value that is inside of a list is called an item . Just as strings are defined as characters between quotes, lists are defined by having values between square brackets [ ] . A list of integers looks like this: [ - 3 , - 2 , - 1 , 0 , 1 , 2 , 3 ] A list of floats looks like this: [ 3.14 , 9.23 , 111.11 , 312.12 , 1.05 ] A list of strings: [ shark , cuttlefish , squid , mantis shrimp ] If we define our string list as sea_creatures : sea_creatures = [ shark , cuttlefish , squid , mantis shrimp ] We can print them out by calling the variable: print ( sea_creatures ) And we see that the #Output : looks exactly like the list that we created: #Output : [ shark , cuttlefish , squid , mantis shrimp ] Lists are a very flexible data type because they are mutable in that they can have values added, removed, and changed. There is a data type that is similar to lists but that can\u2019t be changed, and that is called a tuple.", "title": "Lists" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#tuples", - "text": "A tuple is used for grouping data. It is an immutable, or unchangeable, ordered sequence of elements. Tuples are very similar to lists, but they use parentheses ( ) instead of square brackets and because they are immutable their values cannot be modified. A tuple looks like this: ( blue coral , staghorn coral , pillar coral ) We can store a tuple in a variable and print it out: coral = ( blue coral , staghorn coral , pillar coral ) print ( coral ) Ouput ( blue coral , staghorn coral , pillar coral ) Like in the other data types, Python prints out the tuple just as we had typed it, with parentheses containing a sequence of values.", + "location": "/beginner/Data_Types_In_Python_3/#tuples", + "text": "A tuple is used for grouping data. It is an immutable, or unchangeable, ordered sequence of elements. Tuples are very similar to lists, but they use parentheses ( ) instead of square brackets and because they are immutable their values cannot be modified. A tuple looks like this: ( blue coral , staghorn coral , pillar coral ) We can store a tuple in a variable and print it out: coral = ( blue coral , staghorn coral , pillar coral ) print ( coral ) Ouput ( blue coral , staghorn coral , pillar coral ) Like in the other data types, Python prints out the tuple just as we had typed it, with parentheses containing a sequence of values.", "title": "Tuples" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#dictionaries", - "text": "The dictionary is Python\u2019s built-in mapping type. This means that dictionaries map keys to values and these key-value pairs are a useful way to store data in Python. A dictionary is constructed with curly braces on either side { } . Typically used to hold data that are related, such as the information contained in an ID, a dictionary looks like this: { name : Sammy , animal : shark , color : blue , location : ocean } You will notice that in addition to the curly braces, there are also colons throughout the dictionary. The words to the left of the colons are the keys. Keys can be made up of any immutable data type. The keys in the dictionary above are: 'name', 'animal', 'color', 'location' . The words to the right of the colons are the values. Values can be comprised of any data type. The values in the dictionary above are: 'Sammy', 'shark', 'blue', 'ocean' . Like the other data types, let\u2019s store the dictionary inside a variable, and print it out: sammy = { name : Sammy , animal : shark , color : blue , location : ocean } #Ouput : { color : blue , animal : shark , name : Sammy , location : ocean } If we want to isolate Sammy\u2019s color, we can do so by calling sammy['color'] . Let\u2019s print that out: print ( sammy [ color ]) #Output : blue As dictionaries offer key-value pairs for storing data, they can be important elements in your Python program.", + "location": "/beginner/Data_Types_In_Python_3/#dictionaries", + "text": "The dictionary is Python\u2019s built-in mapping type. This means that dictionaries map keys to values and these key-value pairs are a useful way to store data in Python. A dictionary is constructed with curly braces on either side { } . Typically used to hold data that are related, such as the information contained in an ID, a dictionary looks like this: { name : Sammy , animal : shark , color : blue , location : ocean } You will notice that in addition to the curly braces, there are also colons throughout the dictionary. The words to the left of the colons are the keys. Keys can be made up of any immutable data type. The keys in the dictionary above are: 'name', 'animal', 'color', 'location' . The words to the right of the colons are the values. Values can be comprised of any data type. The values in the dictionary above are: 'Sammy', 'shark', 'blue', 'ocean' . Like the other data types, let\u2019s store the dictionary inside a variable, and print it out: sammy = { name : Sammy , animal : shark , color : blue , location : ocean } #Ouput : { color : blue , animal : shark , name : Sammy , location : ocean } If we want to isolate Sammy\u2019s color, we can do so by calling sammy['color'] . Let\u2019s print that out: print ( sammy [ color ]) #Output : blue As dictionaries offer key-value pairs for storing data, they can be important elements in your Python program.", "title": "Dictionaries" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#conclusion", - "text": "At this point, you should have a better understanding of some of the major data types that are available for you to use in Python. Each of these data types will become important as you develop programming projects in the Python language. You can learn about each of the data types above in more detail by reading the following specific tutorials: Numbers Booleans Strings Lists Tuples Dictionaries Once you have a solid grasp of data types available to you in Python, you can learn how to convert data types . Source: https://www.digitalocean.com/community/tutorials/understanding-data-types-in-python-3", + "location": "/beginner/Data_Types_In_Python_3/#conclusion", + "text": "At this point, you should have a better understanding of some of the major data types that are available for you to use in Python. Each of these data types will become important as you develop programming projects in the Python language. You can learn about each of the data types above in more detail by reading the following specific tutorials: Numbers Booleans Strings Lists Tuples Dictionaries Once you have a solid grasp of data types available to you in Python, you can learn how to convert data types . Source: https://www.digitalocean.com/community/tutorials/understanding-data-types-in-python-3", "title": "Conclusion" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#native-datatypes-by-dive-into-python-3", - "text": "Source: Dive into Python 3 by Mark Pilgrim", + "location": "/beginner/Data_Types_In_Python_3/#native-datatypes-by-dive-into-python-3", + "text": "Source: Dive into Python 3 by Mark Pilgrim", "title": "Native Datatypes By Dive Into Python 3" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#standard-data-types-by-tutorialspoint", - "text": "The data stored in memory can be of many types. For example, a person's age is stored as a numeric value and his or her address is stored as alphanumeric characters. Python has various standard data types that are used to define the operations possible on them and the storage method for each of them. Python has five standard data types : Numbers String List Tuple Dictionary", + "location": "/beginner/Data_Types_In_Python_3/#standard-data-types-by-tutorialspoint", + "text": "The data stored in memory can be of many types. For example, a person's age is stored as a numeric value and his or her address is stored as alphanumeric characters. Python has various standard data types that are used to define the operations possible on them and the storage method for each of them. Python has five standard data types : Numbers String List Tuple Dictionary", "title": "Standard Data Types By Tutorialspoint" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#python-numbers", - "text": "Number data types store numeric values. Number objects are created when you assign a value to them. For example \u2212 var1 = 1 var2 = 10 You can also delete the reference to a number object by using the del statement. The syntax of the del statement is \u2212 del var1 [, var2 [, var3 [ .... , varN ]]]] You can delete a single object or multiple objects by using the del statement. For example \u2212 del var del var_a , var_b Python supports three different numerical types \u2212\n- int (signed integers) float (floating point real values) complex (complex numbers) All integers in Python3 are represented as long integers. Hence, there is no separate number type as long. int float complex 10 0.0 3.14j 100 15.20 45.j -786 -21.9 9.322e-36j A complex number consists of an ordered pair of real floating-point numbers denoted by x + yj, where x and y are real numbers and j is the imaginary unit.", + "location": "/beginner/Data_Types_In_Python_3/#python-numbers", + "text": "Number data types store numeric values. Number objects are created when you assign a value to them. For example \u2212 var1 = 1 var2 = 10 You can also delete the reference to a number object by using the del statement. The syntax of the del statement is \u2212 del var1 [, var2 [, var3 [ .... , varN ]]]] You can delete a single object or multiple objects by using the del statement. For example \u2212 del var del var_a , var_b Python supports three different numerical types \u2212\n- int (signed integers) float (floating point real values) complex (complex numbers) All integers in Python3 are represented as long integers. Hence, there is no separate number type as long. int float complex 10 0.0 3.14j 100 15.20 45.j -786 -21.9 9.322e-36j A complex number consists of an ordered pair of real floating-point numbers denoted by x + yj, where x and y are real numbers and j is the imaginary unit.", "title": "Python Numbers" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#python-strings", - "text": "Strings in Python are identified as a contiguous set of characters represented in the quotation marks. Python allows either pair of single or double quotes. Subsets of strings can be taken using the slice operator ([ ] and [:] ) with indexes starting at 0 in the beginning of the string and working their way from -1 to the end. The plus (+) sign is the string concatenation operator and the asterisk (*) is the repetition operator. For example \u2212 #!/usr/bin/python3 str = Hello World! print ( str ) # Prints complete string print ( str [ 0 ]) # Prints first character of the string print ( str [ 2 : 5 ]) # Prints characters starting from 3rd to 5th print ( str [ 2 :]) # Prints string starting from 3rd character print ( str * 2 ) # Prints string two times print ( str + TEST ) # Prints concatenated string This will produce the following result \u2212 Hello World ! H llo llo World ! Hello World ! Hello World ! Hello World ! TEST", + "location": "/beginner/Data_Types_In_Python_3/#python-strings", + "text": "Strings in Python are identified as a contiguous set of characters represented in the quotation marks. Python allows either pair of single or double quotes. Subsets of strings can be taken using the slice operator ([ ] and [:] ) with indexes starting at 0 in the beginning of the string and working their way from -1 to the end. The plus (+) sign is the string concatenation operator and the asterisk (*) is the repetition operator. For example \u2212 #!/usr/bin/python3 str = Hello World! print ( str ) # Prints complete string print ( str [ 0 ]) # Prints first character of the string print ( str [ 2 : 5 ]) # Prints characters starting from 3rd to 5th print ( str [ 2 :]) # Prints string starting from 3rd character print ( str * 2 ) # Prints string two times print ( str + TEST ) # Prints concatenated string This will produce the following result \u2212 Hello World ! H llo llo World ! Hello World ! Hello World ! Hello World ! TEST", "title": "Python Strings" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#python-lists", - "text": "Lists are the most versatile of Python's compound data types. A list contains items separated by commas and enclosed within square brackets ([]). To some extent, lists are similar to arrays in C. One of the differences between them is that all the items belonging to a list can be of different data type. The values stored in a list can be accessed using the slice operator ([ ] and [:]) with indexes starting at 0 in the beginning of the list and working their way to end -1. The plus (+) sign is the list concatenation operator, and the asterisk (*) is the repetition operator. For example \u2212 #!/usr/bin/python3 list = [ abcd , 786 , 2.23 , john , 70.2 ] tinylist = [ 123 , john ] print ( list ) # Prints complete list print ( list [ 0 ]) # Prints first element of the list print ( list [ 1 : 3 ]) # Prints elements starting from 2nd till 3rd print ( list [ 2 :]) # Prints elements starting from 3rd element print ( tinylist * 2 ) # Prints list two times print ( list + tinylist ) # Prints concatenated lists This produces the following result \u2212 [ abcd , 786 , 2.23 , john , 70.200000000000003 ] abcd [ 786 , 2.23 ] [ 2.23 , john , 70.200000000000003 ] [ 123 , john , 123 , john ] [ abcd , 786 , 2.23 , john , 70.200000000000003 , 123 , john ]", + "location": "/beginner/Data_Types_In_Python_3/#python-lists", + "text": "Lists are the most versatile of Python's compound data types. A list contains items separated by commas and enclosed within square brackets ([]). To some extent, lists are similar to arrays in C. One of the differences between them is that all the items belonging to a list can be of different data type. The values stored in a list can be accessed using the slice operator ([ ] and [:]) with indexes starting at 0 in the beginning of the list and working their way to end -1. The plus (+) sign is the list concatenation operator, and the asterisk (*) is the repetition operator. For example \u2212 #!/usr/bin/python3 list = [ abcd , 786 , 2.23 , john , 70.2 ] tinylist = [ 123 , john ] print ( list ) # Prints complete list print ( list [ 0 ]) # Prints first element of the list print ( list [ 1 : 3 ]) # Prints elements starting from 2nd till 3rd print ( list [ 2 :]) # Prints elements starting from 3rd element print ( tinylist * 2 ) # Prints list two times print ( list + tinylist ) # Prints concatenated lists This produces the following result \u2212 [ abcd , 786 , 2.23 , john , 70.200000000000003 ] abcd [ 786 , 2.23 ] [ 2.23 , john , 70.200000000000003 ] [ 123 , john , 123 , john ] [ abcd , 786 , 2.23 , john , 70.200000000000003 , 123 , john ]", "title": "Python Lists" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#python-tuples", - "text": "A tuple is another sequence data type that is similar to the list. A tuple consists of a number of values separated by commas. Unlike lists, however, tuples are enclosed within parenthesis. The main difference between lists and tuples are \u2212 Lists are enclosed in brackets ( [ ] ) and their elements and size can be changed, while tuples are enclosed in parentheses ( ( ) ) and cannot be updated. Tuples can be thought of as read-only lists. For example \u2212 #!/usr/bin/python3 tuple = ( abcd , 786 , 2.23 , john , 70.2 ) tinytuple = ( 123 , john ) print ( tuple ) # Prints complete tuple print ( tuple [ 0 ]) # Prints first element of the tuple print ( tuple [ 1 : 3 ]) # Prints elements starting from 2nd till 3rd print ( tuple [ 2 :]) # Prints elements starting from 3rd element print ( tinytuple * 2 ) # Prints tuple two times print ( tuple + tinytuple ) # Prints concatenated tuple This produces the following result \u2212 ( abcd , 786 , 2.23 , john , 70.200000000000003 ) abcd ( 786 , 2.23 ) ( 2.23 , john , 70.200000000000003 ) ( 123 , john , 123 , john ) ( abcd , 786 , 2.23 , john , 70.200000000000003 , 123 , john ) The following code is invalid with tuple, because we attempted to update a tuple, which is not allowed. Similar case is possible with lists \u2212 #!/usr/bin/python3 tuple = ( abcd , 786 , 2.23 , john , 70.2 ) list = [ abcd , 786 , 2.23 , john , 70.2 ] tuple [ 2 ] = 1000 # Invalid syntax with tuple list [ 2 ] = 1000 # Valid syntax with list", + "location": "/beginner/Data_Types_In_Python_3/#python-tuples", + "text": "A tuple is another sequence data type that is similar to the list. A tuple consists of a number of values separated by commas. Unlike lists, however, tuples are enclosed within parenthesis. The main difference between lists and tuples are \u2212 Lists are enclosed in brackets ( [ ] ) and their elements and size can be changed, while tuples are enclosed in parentheses ( ( ) ) and cannot be updated. Tuples can be thought of as read-only lists. For example \u2212 #!/usr/bin/python3 tuple = ( abcd , 786 , 2.23 , john , 70.2 ) tinytuple = ( 123 , john ) print ( tuple ) # Prints complete tuple print ( tuple [ 0 ]) # Prints first element of the tuple print ( tuple [ 1 : 3 ]) # Prints elements starting from 2nd till 3rd print ( tuple [ 2 :]) # Prints elements starting from 3rd element print ( tinytuple * 2 ) # Prints tuple two times print ( tuple + tinytuple ) # Prints concatenated tuple This produces the following result \u2212 ( abcd , 786 , 2.23 , john , 70.200000000000003 ) abcd ( 786 , 2.23 ) ( 2.23 , john , 70.200000000000003 ) ( 123 , john , 123 , john ) ( abcd , 786 , 2.23 , john , 70.200000000000003 , 123 , john ) The following code is invalid with tuple, because we attempted to update a tuple, which is not allowed. Similar case is possible with lists \u2212 #!/usr/bin/python3 tuple = ( abcd , 786 , 2.23 , john , 70.2 ) list = [ abcd , 786 , 2.23 , john , 70.2 ] tuple [ 2 ] = 1000 # Invalid syntax with tuple list [ 2 ] = 1000 # Valid syntax with list", "title": "Python Tuples" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#python-dictionary", - "text": "Python's dictionaries are kind of hash-table type. They work like associative arrays or hashes found in Perl and consist of key-value pairs. A dictionary key can be almost any Python type, but are usually numbers or strings. Values, on the other hand, can be any arbitrary Python object. Dictionaries are enclosed by curly braces ({ }) and values can be assigned and accessed using square braces ([]). For example \u2212 #!/usr/bin/python3 dict = {} dict [ one ] = This is one dict [ 2 ] = This is two tinydict = { name : john , code : 6734 , dept : sales } print ( dict [ one ]) # Prints value for one key print ( dict [ 2 ]) # Prints value for 2 key print ( tinydict ) # Prints complete dictionary print ( tinydict . keys ()) # Prints all the keys print ( tinydict . values ()) # Prints all the values This produces the following result \u2212 This is one This is two { name : john , dept : sales , code : 6734 } dict_keys ([ name , dept , code ]) dict_values ([ john , sales , 6734 ]) Dictionaries have no concept of order among the elements. It is incorrect to say that the elements are \"out of order\"; they are simply unordered. Source: https://www.tutorialspoint.com/python3/python_variable_types.htm", + "location": "/beginner/Data_Types_In_Python_3/#python-dictionary", + "text": "Python's dictionaries are kind of hash-table type. They work like associative arrays or hashes found in Perl and consist of key-value pairs. A dictionary key can be almost any Python type, but are usually numbers or strings. Values, on the other hand, can be any arbitrary Python object. Dictionaries are enclosed by curly braces ({ }) and values can be assigned and accessed using square braces ([]). For example \u2212 #!/usr/bin/python3 dict = {} dict [ one ] = This is one dict [ 2 ] = This is two tinydict = { name : john , code : 6734 , dept : sales } print ( dict [ one ]) # Prints value for one key print ( dict [ 2 ]) # Prints value for 2 key print ( tinydict ) # Prints complete dictionary print ( tinydict . keys ()) # Prints all the keys print ( tinydict . values ()) # Prints all the values This produces the following result \u2212 This is one This is two { name : john , dept : sales , code : 6734 } dict_keys ([ name , dept , code ]) dict_values ([ john , sales , 6734 ]) Dictionaries have no concept of order among the elements. It is incorrect to say that the elements are \"out of order\"; they are simply unordered. Source: https://www.tutorialspoint.com/python3/python_variable_types.htm", "title": "Python Dictionary" - }, + }, { - "location": "/beginner/Variables_And_Assignment/", - "text": "Variables and Assignment\n\n\nVariables are named locations which are used to store references to the object stored in memory. The names we choose for variables and functions are commonly known as Identifiers. In python Identifiers must obey the following rules.\n\n\n\n\nAll identifiers must start with letter or underscore ( _ ) , you\n can\u2019t use digits. For e.g my_var is valid identifier while 1digit \n is not.\n\n\nIdentifiers can contain letters, digits and underscores ( _ ). \n\n\nThey can be of any length.\n\n\n\n\nIdentifier can\u2019t be a keyword (keywords are reserved words that\n Python uses for special purpose).Following are Keywords in python 3.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nand\n\n\nexec\n\n\nnot\n\n\n\n\n\n\nas\n\n\nfinally\n\n\nor\n\n\n\n\n\n\nassert\n\n\nfor\n\n\npass\n\n\n\n\n\n\nbreak\n\n\nfrom\n\n\nprint\n\n\n\n\n\n\nclass\n\n\nglobal\n\n\nraise\n\n\n\n\n\n\ncontinue\n\n\nif\n\n\nreturn\n\n\n\n\n\n\ndef\n\n\nimport\n\n\ntry\n\n\n\n\n\n\ndel\n\n\nin\n\n\nwhile\n\n\n\n\n\n\nelif\n\n\nis\n\n\nwith\n\n\n\n\n\n\nelse\n\n\nlambda\n\n\nyield\n\n\n\n\n\n\nexcept\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nAssigning Values to Variables\n\n\nValues are basic things that programs works with. For e.g 1 , 11 , 3.14 , \"hello\" are all values. In programming terminology they are also commonly known as literals. Literals can be of different type for e.g 1 , 11 are of type int , 3.14 is float and \"hello\" is string . Remember in python everything is object even basic data types like int, float, string, we will elaborate more on this in later chapters.\n\n\nIn python you don\u2019t need to declare types of variable ahead of time. Interpreter automatically detects the type of the variable by the data it contains. To assign value to a variable equal sign ( = ) is used. = is also known as assignment operator.\n\n\nFollowing are some examples of variable declaration:\n\n\nx\n \n=\n \n100\n \n# x is integer\n\n\npi\n \n=\n \n3.14\n \n# pi is float\n\n\nempname\n \n=\n \npython is great\n \n# empname is string\n\n\n\na\n \n=\n \nb\n \n=\n \nc\n \n=\n \n100\n \n# this statement assign 100 to c, b and a.\n\n\n\n\n\n\n\n\nNote:\n\nIn the above code x stores reference to the 100 ( which is an int object ) , x don\u2019t store 100 itself.\n\n\n\n\nIn Python comments are preceded by a pound sign ( # ). Comments are not programming statements that python interpreter executes while running the program. Comments are used by programmers to remind themselves how the program works. They are also used to write program documentation.\n\n\n#display hello world\n\n\nprint\n(\nhello world\n)\n\n\n\n\n\n\nSimultaneous Assignments\n\n\nPython allow simultaneous assignment syntax like this:\n\n\nvar1\n,\n \nvar2\n,\n \n...\n,\n \nvarn\n \n=\n \nexp1\n,\n \nexp2\n,\n \n...\n,\n \nexpn\n\n\n\n\n\n\nthis statements tells the python to evaluate all the expression on the right and assign them to the corresponding variables on the left. Simultaneous Assignments is helpful to swap values of two variables. For e.g\n\n\n \nx\n \n=\n \n1\n\n\n \ny\n \n=\n \n2\n\n\n\n \ny\n,\n \nx\n \n=\n \nx\n,\n \ny\n \n# assign y value to x and x value to y\n\n\n\n\n\n\nPython Data Types\n\n\nPython has 5 standard data types namely.\n\na) \nNumbers\n\nb) \nString\n\nc) \nList\n\nd) \nTuple\n\ne) \nDictionary\n\nf) Boolean \u2013 In Python True and False are boolean literals. But the following values are also considered as false.\n\n\n[] \u2013 empty list , () \u2013 empty tuple , {} \u2013 empty dictionary\n \n\n\nReceiving input from Console\n\n\ninput() function is used to receive input from the console.\n\n\nSyntax: input([prompt]) -\n string\n\n\ninput() function accepts an optional string argument called prompt and returns a string.\n\n\n \nname\n \n=\n \ninput\n(\nEnter your name: \n)\n\n\n \nEnter\n \nyour\n \nname\n:\n \ntim\n\n\n \nname\n\n\ntim\n\n\n\n\n\n\nNote that input() returns string even if you enter a number, to convert it to an integer you can use int() or eval() .\n\n\n \nage\n \n=\n \nint\n(\ninput\n(\nEnter your age: \n))\n\n\nEnter\n \nyour\n \nage\n:\n \n22\n\n\n \nage\n\n\n22\n\n\n \ntype\n(\nage\n)\n\n\nclass\n \nint\n\n\n\n\n\n\n\n\nSource:\n \n\n\n http://thepythonguru.com\n\n\n\n\nUnderstanding Python variables and Memory Management\n\n\nHave you ever noticed any difference between variables in Python and C? For example, when you do an assignment like the following in C, it actually creates a block of memory space so that it can hold the value for that variable\n\n\nint\n \na\n \n=\n \n1\n;\n\n\n\n\n\n\nYou can think of it as putting the value assigned in a box with the variable name as shown below.\n\n\n\nAnd for all the variables you create a new box is created with the variable name to hold the value. If you change the value of the variable the box will be updated with the new value. That means doing\n\n\na\n \n=\n \n2\n;\n\n\n\n\n\n\nwill result in\n\n\n\n\nAssigning one variable to another makes a copy of the value and put that value in the new box.\n\n\nint\n \nb\n \n=\n \na\n;\n\n\n\n\n\n\n \n\n\nBut in Python variables work more like tags unlike the boxes you have seen before. When you do an assignment in Python, it tags the value with the variable name.\n\n\na\n \n=\n \n1\n\n\n\n\n\n\n\n\nand if you change the value of the varaible, it just changes the tag to the new value in memory. You dont need to do the housekeeping job of freeing the memory here. Python's Automatic Garbage Collection does it for you. When a value is without names/tags it is automatically removed from memory.\n\n\na\n \n=\n \n2\n\n\n\n\n\n\n\n\nAssigning one variable to another makes a new tag bound to the same value as show below.\n\n\nb\n \n=\n \na\n\n\n\n\n\n\n\nOther languages have 'variables'. Python has 'names'.\n\n\nA bit about Python's memory management\n\n\nAs you have seen before, a value will have only one copy in memory and all the variables having this value will refer to this memory location. For example when you have variables a, b, c having a value 10, it doesn't mean that there will be 3 copy of 10s in memory. There will be only one 10 and all the variables a, b, c will point to this value. Once a variable is updated, say you are doing a += 1 a new value 11 will be allocated in memory and a will be pointing to this.\n\n\nLet's check this behaviour with Python Interpreter. Start the Python Shell and try the following for yourselves.\n\n\n \na\n \n=\n \n10\n\n\n \nb\n \n=\n \n10\n\n\n \nc\n \n=\n \n10\n\n\n \nid\n(\na\n),\n \nid\n(\nb\n),\n \nid\n(\nc\n)\n\n\n(\n140621897573616\n,\n \n140621897573616\n,\n \n140621897573616\n)\n\n\n \na\n \n+=\n \n1\n\n\n \nid\n(\na\n)\n\n\n140621897573592\n\n\n\n\n\n\nid() will return an objects memory address (object's identity). As you have noticed, when you assign the same integer value to the variables, we see the same ids. But this assumption does not hold true all the time. See the following for example\n\n\n \nx\n \n=\n \n500\n\n\n \ny\n \n=\n \n500\n\n\n \nid\n(\nx\n)\n\n\n4338740848\n\n\n \nid\n(\ny\n)\n\n\n4338741040\n\n\n\n\n\n\nWhat happened here? Even after assigning the same integer values to different variable names, we are getting two different ids here. These are actually the effects of CPython optimization we are observing here. CPython implementation keeps an array of integer objects for all integers between -5 and 256. So when we create an integer in that range, they simply back reference to the existing object. You may refer the following \nlinks\n for more information.\n\n\nLet's take a look at strings now.\n\n\n \ns1\n \n=\n \nhello\n\n\n \ns2\n \n=\n \nhello\n\n\n \nid\n(\ns1\n),\n \nid\n(\ns2\n)\n\n\n(\n4454725888\n,\n \n4454725888\n)\n\n\n \ns1\n \n==\n \ns2\n\n\nTrue\n\n\n \ns1\n \nis\n \ns2\n\n\nTrue\n\n\n \ns3\n \n=\n \nhello, world!\n\n\n \ns4\n \n=\n \nhello, world!\n\n\n \nid\n(\ns3\n),\n \nid\n(\ns4\n)\n\n\n(\n4454721608\n,\n \n4454721664\n)\n\n\n \ns3\n \n==\n \ns4\n\n\nTrue\n\n\n \ns3\n \nis\n \ns4\n\n\nFalse\n\n\n\n\n\n\nLooks interesting, isn't it? When the string was a simple and shorter one the variable names where referring to the same object in memory. But when they became bigger, this was not the case. This is called interning, and Python does interning (to some extent) of shorter string literals (as in s1 and s2) which are created at compile time. But in general, Python string literals creates a new string object each time (as in s3 and s4). Interning is runtime dependant and is always a trade-off between memory use and the cost of checking if you are creating the same string. There's a built-in intern() function to forcefully apply interning. Read more about interning from the following links.\n\n\nStack Overflow: Does Python intern Strings?\n\n\nStack Overflow: Python String Interning\n\n\nInternals of Python String Interning\n\n\n\n\nSource:\n \n\n\n http://foobarnbaz.com/2012/07/08/understanding-python-variables/\n\n\n\n\nAssignment statements in Python are more interesting than you might think\n\n\nIn this article, we will take a deep look at three kinds of assignment statements in Python and discuss what\u2019s going on under the hood.\n\n\n \nmy_string\n \n=\n \nHello World\n \n# right hand side is a simple expression\n\n\n \nanother_string\n \n=\n \nmy_string\n \n# right hand side is another variable\n\n\n \nanother_string\n \n=\n \nanother_string\n \n+\n \n!\n \n# right hand side is an operation\n\n\n\n\n\n\nWhat we find may surprise you.\n\n\nWhat happens when the right hand side is a simple expression?\n\n\n \nmy_string\n \n=\n \nHello World\n\n\n\n\n\n\nIn simple terms, this creates a string \u201cHello World\u201d in memory and assigns the name my_string to it. If you are using CPython[1], then we can even check the memory address explicitly by using the built in function id .\n\n\n \nmy_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n \n\n \nid\n(\nmy_string\n)\n\n\n140400709562064\n\n\n\n\n\n\nThat big number 140400709562064 denotes where the data lives in the memory. It will be very useful for us in this entire discussion.\nWhat happens if we create another string with the same value?\n\n\n \nanother_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n\n\n\n\n\n\nDoes it reuse the previous \u201cHello World\u201d stored in memory or does it create an independent copy? Let\u2019s check this by querying the id function again.\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562208\n\n\n\n\n\n\nThis outputs a different id, so this must be an independent copy. We conclude that:\n\n\n\n\nNote:\n\nAssignment statements where the right hand side is a simple expression creates independent copies every time.\n\n\n\n\nWhile for everyday programming, this is the rule we should remember, there are actually some weird exceptions to this rule. Here\u2019s an example.\n\n\n \nmy_string\n \n=\n \n\u201c\nhello\n\u201d\n\n\n \nid\n(\nmy_string\n)\n\n\n140400709562016\n\n\n \nanother_string\n \n=\n \n\u201c\nhello\n\u201d\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562016\n\n\n\n\n\n\nIn this case, two consecutive assignment statements did not create independent copies. Why?\nIt gets interesting now.\nFor optimizing memory, Python treats a special set of objects differently. The string \u201chello\u201d belongs to this privileged set and has a different behavior. The exact set depends on the implementation like CPython, PyPy, Jython or IronPython. For CPython, the special rule applies to:\n\n\n\n\nStrings without whitespaces and less than 20 characters and\n\n\nIntegers from -5 to +255.\n\n\n\n\nThese objects are always reused or interned. The rationale behind doing this is as follows:\n\n\n\n\nSince programmers use these objects frequently, interning existing\n objects saves memory.\n\n\nSince immutable objects like tuples and strings cannot be modified,\n there is no risk in interning the same object.\n\n\n\n\nHowever, Python does not do this for all immutable objects because there is a runtime cost involved for this feature. For interning an object, it must first search for the object in memory, and searching takes time. This is why the special treatment only applies for small integers and strings, because finding them is not that costly.\n\n\nWhat happens when the right hand side is an existing Python variable?\n\nLet\u2019s move on to the second type of assignment statement where the right hand side is an existing Python variable.\n\n\n \nanother_string\n \n=\n \nmy_string\n\n\n\n\n\n\nIn this case, nothing is created in memory. After the assignment, both variables refer to the already existing object. It\u2019s basically like giving the object an additional nickname or alias. Let\u2019s confirm this by using the id function.\n\n\n \nmy_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n\n\n \nid\n(\nmy_string\n)\n\n\n140400709562160\n\n\n \nanother_string\n \n=\n \nmy_string\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562160\n\n\n\n\n\n\nThe natural question at this stage is : what if, instead of just giving the existing object an alias, we wanted to create an independent copy?\nFor mutable objects, this is possible. You can either use the copy module of Python (which works on all objects) or you may use copy methods specific to the class. For a list, you have several possibilities for creating copies, all of which have different runtime.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \ncopy_of_my_list\n \n=\n \nmy_list\n.\ncopy\n()\n \n# fastest, works only on latest Python versions\n\n\n \ncopy_of_my_list\n \n=\n \nmy_list\n[:]\n \n# same runtime as List.copy()\n\n\n \ncopy_of_my_list\n \n=\n \nlist\n(\nmy_list\n)\n \n# slightly slower\n\n\n \nimport\n \ncopy\n\n\n \ncopy_of_my_list\n \n=\n \ncopy\n.\ncopy\n(\nmy_list\n)\n \n# slowest\n\n\n\n\n\n\nHow can you copy an immutable object? Well\u2026you can\u2019t! At least not in a straightforward way. If you try to use the copy module or the slicing notation, you will get back the same object and not an independent copy. Here\u2019s proof.\n\n\n# Standard ways of copying lists do not apply for tuples\n\n\n\n \nmy_tuple\n \n=\n \n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n \nid\n(\nmy_tuple\n)\n\n\n140371873244816\n\n\n \nanother_tuple\n \n=\n \nmy_tuple\n[:]\n\n\n \nid\n(\nanother_tuple\n)\n\n\n140371873244816\n\n\n\n# The copy module also doesn\u2019t help\n\n\n\n \nimport\n \ncopy\n \n\n \nanother_tuple\n \n=\n \ncopy\n.\ncopy\n(\nmy_tuple\n)\n\n\n \nid\n(\nanother_tuple\n)\n\n\n140371873244816\n\n\n\n\n\n\nMore importantly, there is no reason for explicitly copying an immutable object anyway. We will see why in a moment when we discuss the third kind of assignment statement.\n\nWhat happpens when the right hand side is an operation?\n\n\nIn this case, what happens depends on the result of the operation. We will discuss two simple cases:\n\n\n\n\nadding an element to an immutable object (like a tuple) and\n\n\nadding an element to a mutable object (like a list).\n\n\n\n\nLet\u2019s start with the case of the tuple.\n\n\n \nanother_tuple\n \n+=\n \n(\n4\n,)\n\n\n\n\n\n\nWhen you add a new element to a tuple using another_tuple += (4,), this creates a new object in memory. The immutability of tuples is key to understanding this. Since tuples are immutable, any operation that leads to a changed tuple would result in an independent copy.\nThis is the reason why you don\u2019t need to explicitly copy immutable objects : it happens automatically under the hood. Here\u2019s an example.\n\n\n \nmy_tuple\n \n=\n \n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n \nanother_tuple\n \n=\n \nmy_tuple\n \n# both variables point to the same object\n\n\n \nanother_tuple\n \n+=\n \n(\n4\n,)\n \n# this statement creates a new independent object\n\n\n \nprint\n(\nanother_tuple\n)\n \n\n(\n1\n,\n \n2\n,\n \n3\n,\n \n4\n)\n\n\n \nprint\n(\nmy_tuple\n)\n \n# the old one remains unharmed\n\n\n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n\n\n\n\nThe situation is much different for mutable objects and much more confusing. Let\u2019s try the same example, but now for lists.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n \n# both variables point to the same object\n\n\n \nanother_list\n \n+=\n \n[\n4\n,]\n \n# this statement modifies the object in place\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is modified\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n\n\n\n\nMutable objects can be modified in place. Some operations modify the list in place and some operations don\u2019t. In this case, the statement another_list += [4,] calls another_list.\niadd\n([4,]) and \niadd\n modifies the existing object in place.\nTo make things doubly confusing, we would have completely different results if we used a slightly different notation.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n \n# both variables point to the same object\n\n\n \nanother_list\n \n=\n \nanother_list\n \n+\n \n[\n4\n,]\n \n# this creates an independent copy\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is unharmed\n\n\n[\n1\n,\n \n2\n,\n \n3\n]\n \n\n\n\n\n\nWoah! What\u2019s going on? What changed?\nIt turns out that when we change the third line, Python now internally calls a different function another_list.\nadd\n([4,]) instead of \niadd\n. This function returns a new copy instead of modifying the list in place.\nTo prevent this confusion, it is always better to create a true copy of the list if you wish to prevent modification to the original.\nLet\u2019s remember the list copy methods from before. They were List.copy(), [:], list() and copy.copy(). This is what we should use.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n.\ncopy\n()\n \n# this creates an independent copy\n\n\n \nanother_list\n \n+=\n \n[\n4\n,]\n \n# this statement modifies the independent copy\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is unharmed\n\n\n[\n1\n,\n \n2\n,\n \n3\n]\n \n\n\n\n\n\nThere\u2019s one last gotcha that can happen when copying lists.\nSuppose we have a list that has a nested list inside it. We copy this list using List.copy() and then modify the nested list. Unfortunately, this will modify the original list again!\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n.\ncopy\n()\n\n\n \nanother_list\n[\n0\n]\n \n+=\n \n[\n6\n,]\n\n\n \nprint\n(\nanother_list\n)\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n\n\n \nprint\n(\nmy_list\n)\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n \n\n\n\n\n\nWhy did that happen? Didn\u2019t we just copy the original list?\nThe truth is : we actually don\u2019t have a completely independent copy in this case. The copy() function generates a shallow copy. To see what it does, let\u2019s look at the ids of all the elements in my_list and the ids of all the elements in the copied list.\n\n\n# for my_list\n\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nid\n(\nmy_list\n)\n\n\n140371873277424\n\n\n \nprint\n([\nid\n(\nx\n)\n \nfor\n \nx\n \nin\n \nmy_list\n])\n\n\n[\n140371873599288\n,\n \n13820176\n,\n \n13820152\n]\n\n\n\n# for another_list obtained by my_list.copy()\n\n\n\n \nid\n(\nanother_list\n)\n\n\n140371873317016\n\n\n \nprint\n([\nid\n(\nx\n)\n \nfor\n \nx\n \nin\n \nanother_list\n])\n\n\n[\n140371873599288\n,\n \n13820176\n,\n \n13820152\n]\n\n\n\n\n\n\nWe see the ids of my_list and another_list are indeed different, indicating another_list is a copy. But the ids of the elements contained in another_list have the same ids as the elements in my_list . So the elements have not been copied!\nThis is the property of shallow copy. It creates a new copy of the object but reuses the attributes and elements of the old copy. Thus, when you modify the elements of the new copy, you are modifying the elements of the old copy too.\nTo solve this problem, we need to copy an object along with all its attributes and elements. This can be achieved by copy.deepcopy.\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nanother_list\n \n=\n \ncopy\n.\ndeepcopy\n(\nmy_list\n)\n\n\n \nanother_list\n[\n0\n]\n \n+=\n \n[\n6\n,]\n\n\n \nanother_list\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n\n\n \nmy_list\n\n\n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n\n\n\n\nDeep copy is a quite time intensive operation and can take 1o times longer to complete compared to a shallow copy. But in some situations, it is unavoidable.\n\n\nConclusion\n\n\nThis brings me to the end of this discussion. To summarize, we have talked about the different scenarios which can arise in an assignment statement in Python. We found that:\n\n\n\n\nWhen the right hand side is a simple expression, a new copy is\n created every time. There are some exceptions to this rule, which\n depend on the implementation\n\n\nWhen the right hand side is an existing Python variable, then an\n alias is created for the existing copy.\n\n\nWhen the right hand side is an operation, then the outcome depends on\n the operation. In a simple case involving a tuple, we saw that an\n independent copy was created. In the same case with lists, we saw\n that the list was modified in place in one case (when we used\n \niadd\n) and a new copy was generated in another case (when we used \nadd\n).\n\n\nList item\n\n\nMutable objects can be copied but immutable objects cannot be copied\n in a straightforward way. There is also no need to copy immutable\n objects.\n\n\nTo copy a mutable object along with all its attributes and elements,\n we need to use deep copy.\n\n\n\n\n\n\nSource:\n \n\n\n https://medium.com/broken-window/many-names-one-memory-address-122f78734cb6", + "location": "/beginner/Variables_And_Assignment/", + "text": "Variables and Assignment\n\n\nVariables are named locations which are used to store references to the object stored in memory. The names we choose for variables and functions are commonly known as Identifiers. In python Identifiers must obey the following rules.\n\n\n\n\nAll identifiers must start with letter or underscore ( _ ) , you\n can\u2019t use digits. For e.g my_var is valid identifier while 1digit \n is not.\n\n\nIdentifiers can contain letters, digits and underscores ( _ ). \n\n\nThey can be of any length.\n\n\n\n\nIdentifier can\u2019t be a keyword (keywords are reserved words that\n Python uses for special purpose).Following are Keywords in python 3.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nand\n\n\nexec\n\n\nnot\n\n\n\n\n\n\nas\n\n\nfinally\n\n\nor\n\n\n\n\n\n\nassert\n\n\nfor\n\n\npass\n\n\n\n\n\n\nbreak\n\n\nfrom\n\n\nprint\n\n\n\n\n\n\nclass\n\n\nglobal\n\n\nraise\n\n\n\n\n\n\ncontinue\n\n\nif\n\n\nreturn\n\n\n\n\n\n\ndef\n\n\nimport\n\n\ntry\n\n\n\n\n\n\ndel\n\n\nin\n\n\nwhile\n\n\n\n\n\n\nelif\n\n\nis\n\n\nwith\n\n\n\n\n\n\nelse\n\n\nlambda\n\n\nyield\n\n\n\n\n\n\nexcept\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nAssigning Values to Variables\n\n\nValues are basic things that programs works with. For e.g 1 , 11 , 3.14 , \"hello\" are all values. In programming terminology they are also commonly known as literals. Literals can be of different type for e.g 1 , 11 are of type int , 3.14 is float and \"hello\" is string . Remember in python everything is object even basic data types like int, float, string, we will elaborate more on this in later chapters.\n\n\nIn python you don\u2019t need to declare types of variable ahead of time. Interpreter automatically detects the type of the variable by the data it contains. To assign value to a variable equal sign ( = ) is used. = is also known as assignment operator.\n\n\nFollowing are some examples of variable declaration:\n\n\nx\n \n=\n \n100\n \n# x is integer\n\n\npi\n \n=\n \n3.14\n \n# pi is float\n\n\nempname\n \n=\n \npython is great\n \n# empname is string\n\n\n\na\n \n=\n \nb\n \n=\n \nc\n \n=\n \n100\n \n# this statement assign 100 to c, b and a.\n\n\n\n\n\n\n\n\nNote:\n\nIn the above code x stores reference to the 100 ( which is an int object ) , x don\u2019t store 100 itself.\n\n\n\n\nIn Python comments are preceded by a pound sign ( # ). Comments are not programming statements that python interpreter executes while running the program. Comments are used by programmers to remind themselves how the program works. They are also used to write program documentation.\n\n\n#display hello world\n\n\nprint\n(\nhello world\n)\n\n\n\n\n\n\nSimultaneous Assignments\n\n\nPython allow simultaneous assignment syntax like this:\n\n\nvar1\n,\n \nvar2\n,\n \n...\n,\n \nvarn\n \n=\n \nexp1\n,\n \nexp2\n,\n \n...\n,\n \nexpn\n\n\n\n\n\n\nthis statements tells the python to evaluate all the expression on the right and assign them to the corresponding variables on the left. Simultaneous Assignments is helpful to swap values of two variables. For e.g\n\n\n \nx\n \n=\n \n1\n\n\n \ny\n \n=\n \n2\n\n\n\n \ny\n,\n \nx\n \n=\n \nx\n,\n \ny\n \n# assign y value to x and x value to y\n\n\n\n\n\n\nPython Data Types\n\n\nPython has 5 standard data types namely.\n\na) \nNumbers\n\nb) \nString\n\nc) \nList\n\nd) \nTuple\n\ne) \nDictionary\n\nf) Boolean \u2013 In Python True and False are boolean literals. But the following values are also considered as false.\n\n\n[] \u2013 empty list , () \u2013 empty tuple , {} \u2013 empty dictionary\n \n\n\nReceiving input from Console\n\n\ninput() function is used to receive input from the console.\n\n\nSyntax: input([prompt]) -\n string\n\n\ninput() function accepts an optional string argument called prompt and returns a string.\n\n\n \nname\n \n=\n \ninput\n(\nEnter your name: \n)\n\n\n \nEnter\n \nyour\n \nname\n:\n \ntim\n\n\n \nname\n\n\ntim\n\n\n\n\n\n\nNote that input() returns string even if you enter a number, to convert it to an integer you can use int() or eval() .\n\n\n \nage\n \n=\n \nint\n(\ninput\n(\nEnter your age: \n))\n\n\nEnter\n \nyour\n \nage\n:\n \n22\n\n\n \nage\n\n\n22\n\n\n \ntype\n(\nage\n)\n\n\nclass\n \nint\n\n\n\n\n\n\n\n\nSource:\n \n\n\n http://thepythonguru.com\n\n\n\n\nUnderstanding Python variables and Memory Management\n\n\nHave you ever noticed any difference between variables in Python and C? For example, when you do an assignment like the following in C, it actually creates a block of memory space so that it can hold the value for that variable\n\n\nint\n \na\n \n=\n \n1\n;\n\n\n\n\n\n\nYou can think of it as putting the value assigned in a box with the variable name as shown below.\n\n\n\nAnd for all the variables you create a new box is created with the variable name to hold the value. If you change the value of the variable the box will be updated with the new value. That means doing\n\n\na\n \n=\n \n2\n;\n\n\n\n\n\n\nwill result in\n\n\n\n\nAssigning one variable to another makes a copy of the value and put that value in the new box.\n\n\nint\n \nb\n \n=\n \na\n;\n\n\n\n\n\n\n \n\n\nBut in Python variables work more like tags unlike the boxes you have seen before. When you do an assignment in Python, it tags the value with the variable name.\n\n\na\n \n=\n \n1\n\n\n\n\n\n\n\n\nand if you change the value of the varaible, it just changes the tag to the new value in memory. You dont need to do the housekeeping job of freeing the memory here. Python's Automatic Garbage Collection does it for you. When a value is without names/tags it is automatically removed from memory.\n\n\na\n \n=\n \n2\n\n\n\n\n\n\n\n\nAssigning one variable to another makes a new tag bound to the same value as show below.\n\n\nb\n \n=\n \na\n\n\n\n\n\n\n\nOther languages have 'variables'. Python has 'names'.\n\n\nA bit about Python's memory management\n\n\nAs you have seen before, a value will have only one copy in memory and all the variables having this value will refer to this memory location. For example when you have variables a, b, c having a value 10, it doesn't mean that there will be 3 copy of 10s in memory. There will be only one 10 and all the variables a, b, c will point to this value. Once a variable is updated, say you are doing a += 1 a new value 11 will be allocated in memory and a will be pointing to this.\n\n\nLet's check this behaviour with Python Interpreter. Start the Python Shell and try the following for yourselves.\n\n\n \na\n \n=\n \n10\n\n\n \nb\n \n=\n \n10\n\n\n \nc\n \n=\n \n10\n\n\n \nid\n(\na\n),\n \nid\n(\nb\n),\n \nid\n(\nc\n)\n\n\n(\n140621897573616\n,\n \n140621897573616\n,\n \n140621897573616\n)\n\n\n \na\n \n+=\n \n1\n\n\n \nid\n(\na\n)\n\n\n140621897573592\n\n\n\n\n\n\nid() will return an objects memory address (object's identity). As you have noticed, when you assign the same integer value to the variables, we see the same ids. But this assumption does not hold true all the time. See the following for example\n\n\n \nx\n \n=\n \n500\n\n\n \ny\n \n=\n \n500\n\n\n \nid\n(\nx\n)\n\n\n4338740848\n\n\n \nid\n(\ny\n)\n\n\n4338741040\n\n\n\n\n\n\nWhat happened here? Even after assigning the same integer values to different variable names, we are getting two different ids here. These are actually the effects of CPython optimization we are observing here. CPython implementation keeps an array of integer objects for all integers between -5 and 256. So when we create an integer in that range, they simply back reference to the existing object. You may refer the following \nlinks\n for more information.\n\n\nLet's take a look at strings now.\n\n\n \ns1\n \n=\n \nhello\n\n\n \ns2\n \n=\n \nhello\n\n\n \nid\n(\ns1\n),\n \nid\n(\ns2\n)\n\n\n(\n4454725888\n,\n \n4454725888\n)\n\n\n \ns1\n \n==\n \ns2\n\n\nTrue\n\n\n \ns1\n \nis\n \ns2\n\n\nTrue\n\n\n \ns3\n \n=\n \nhello, world!\n\n\n \ns4\n \n=\n \nhello, world!\n\n\n \nid\n(\ns3\n),\n \nid\n(\ns4\n)\n\n\n(\n4454721608\n,\n \n4454721664\n)\n\n\n \ns3\n \n==\n \ns4\n\n\nTrue\n\n\n \ns3\n \nis\n \ns4\n\n\nFalse\n\n\n\n\n\n\nLooks interesting, isn't it? When the string was a simple and shorter one the variable names where referring to the same object in memory. But when they became bigger, this was not the case. This is called interning, and Python does interning (to some extent) of shorter string literals (as in s1 and s2) which are created at compile time. But in general, Python string literals creates a new string object each time (as in s3 and s4). Interning is runtime dependant and is always a trade-off between memory use and the cost of checking if you are creating the same string. There's a built-in intern() function to forcefully apply interning. Read more about interning from the following links.\n\n\nStack Overflow: Does Python intern Strings?\n\n\nStack Overflow: Python String Interning\n\n\nInternals of Python String Interning\n\n\n\n\nSource:\n \n\n\n http://foobarnbaz.com/2012/07/08/understanding-python-variables/\n\n\n\n\nAssignment statements in Python are more interesting than you might think\n\n\nIn this article, we will take a deep look at three kinds of assignment statements in Python and discuss what\u2019s going on under the hood.\n\n\n \nmy_string\n \n=\n \nHello World\n \n# right hand side is a simple expression\n\n\n \nanother_string\n \n=\n \nmy_string\n \n# right hand side is another variable\n\n\n \nanother_string\n \n=\n \nanother_string\n \n+\n \n!\n \n# right hand side is an operation\n\n\n\n\n\n\nWhat we find may surprise you.\n\n\nWhat happens when the right hand side is a simple expression?\n\n\n \nmy_string\n \n=\n \nHello World\n\n\n\n\n\n\nIn simple terms, this creates a string \u201cHello World\u201d in memory and assigns the name my_string to it. If you are using CPython[1], then we can even check the memory address explicitly by using the built in function id .\n\n\n \nmy_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n \n\n \nid\n(\nmy_string\n)\n\n\n140400709562064\n\n\n\n\n\n\nThat big number 140400709562064 denotes where the data lives in the memory. It will be very useful for us in this entire discussion.\nWhat happens if we create another string with the same value?\n\n\n \nanother_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n\n\n\n\n\n\nDoes it reuse the previous \u201cHello World\u201d stored in memory or does it create an independent copy? Let\u2019s check this by querying the id function again.\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562208\n\n\n\n\n\n\nThis outputs a different id, so this must be an independent copy. We conclude that:\n\n\n\n\nNote:\n\nAssignment statements where the right hand side is a simple expression creates independent copies every time.\n\n\n\n\nWhile for everyday programming, this is the rule we should remember, there are actually some weird exceptions to this rule. Here\u2019s an example.\n\n\n \nmy_string\n \n=\n \n\u201c\nhello\n\u201d\n\n\n \nid\n(\nmy_string\n)\n\n\n140400709562016\n\n\n \nanother_string\n \n=\n \n\u201c\nhello\n\u201d\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562016\n\n\n\n\n\n\nIn this case, two consecutive assignment statements did not create independent copies. Why?\nIt gets interesting now.\nFor optimizing memory, Python treats a special set of objects differently. The string \u201chello\u201d belongs to this privileged set and has a different behavior. The exact set depends on the implementation like CPython, PyPy, Jython or IronPython. For CPython, the special rule applies to:\n\n\n\n\nStrings without whitespaces and less than 20 characters and\n\n\nIntegers from -5 to +255.\n\n\n\n\nThese objects are always reused or interned. The rationale behind doing this is as follows:\n\n\n\n\nSince programmers use these objects frequently, interning existing\n objects saves memory.\n\n\nSince immutable objects like tuples and strings cannot be modified,\n there is no risk in interning the same object.\n\n\n\n\nHowever, Python does not do this for all immutable objects because there is a runtime cost involved for this feature. For interning an object, it must first search for the object in memory, and searching takes time. This is why the special treatment only applies for small integers and strings, because finding them is not that costly.\n\n\nWhat happens when the right hand side is an existing Python variable?\n\nLet\u2019s move on to the second type of assignment statement where the right hand side is an existing Python variable.\n\n\n \nanother_string\n \n=\n \nmy_string\n\n\n\n\n\n\nIn this case, nothing is created in memory. After the assignment, both variables refer to the already existing object. It\u2019s basically like giving the object an additional nickname or alias. Let\u2019s confirm this by using the id function.\n\n\n \nmy_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n\n\n \nid\n(\nmy_string\n)\n\n\n140400709562160\n\n\n \nanother_string\n \n=\n \nmy_string\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562160\n\n\n\n\n\n\nThe natural question at this stage is : what if, instead of just giving the existing object an alias, we wanted to create an independent copy?\nFor mutable objects, this is possible. You can either use the copy module of Python (which works on all objects) or you may use copy methods specific to the class. For a list, you have several possibilities for creating copies, all of which have different runtime.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \ncopy_of_my_list\n \n=\n \nmy_list\n.\ncopy\n()\n \n# fastest, works only on latest Python versions\n\n\n \ncopy_of_my_list\n \n=\n \nmy_list\n[:]\n \n# same runtime as List.copy()\n\n\n \ncopy_of_my_list\n \n=\n \nlist\n(\nmy_list\n)\n \n# slightly slower\n\n\n \nimport\n \ncopy\n\n\n \ncopy_of_my_list\n \n=\n \ncopy\n.\ncopy\n(\nmy_list\n)\n \n# slowest\n\n\n\n\n\n\nHow can you copy an immutable object? Well\u2026you can\u2019t! At least not in a straightforward way. If you try to use the copy module or the slicing notation, you will get back the same object and not an independent copy. Here\u2019s proof.\n\n\n# Standard ways of copying lists do not apply for tuples\n\n\n\n \nmy_tuple\n \n=\n \n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n \nid\n(\nmy_tuple\n)\n\n\n140371873244816\n\n\n \nanother_tuple\n \n=\n \nmy_tuple\n[:]\n\n\n \nid\n(\nanother_tuple\n)\n\n\n140371873244816\n\n\n\n# The copy module also doesn\u2019t help\n\n\n\n \nimport\n \ncopy\n \n\n \nanother_tuple\n \n=\n \ncopy\n.\ncopy\n(\nmy_tuple\n)\n\n\n \nid\n(\nanother_tuple\n)\n\n\n140371873244816\n\n\n\n\n\n\nMore importantly, there is no reason for explicitly copying an immutable object anyway. We will see why in a moment when we discuss the third kind of assignment statement.\n\nWhat happpens when the right hand side is an operation?\n\n\nIn this case, what happens depends on the result of the operation. We will discuss two simple cases:\n\n\n\n\nadding an element to an immutable object (like a tuple) and\n\n\nadding an element to a mutable object (like a list).\n\n\n\n\nLet\u2019s start with the case of the tuple.\n\n\n \nanother_tuple\n \n+=\n \n(\n4\n,)\n\n\n\n\n\n\nWhen you add a new element to a tuple using another_tuple += (4,), this creates a new object in memory. The immutability of tuples is key to understanding this. Since tuples are immutable, any operation that leads to a changed tuple would result in an independent copy.\nThis is the reason why you don\u2019t need to explicitly copy immutable objects : it happens automatically under the hood. Here\u2019s an example.\n\n\n \nmy_tuple\n \n=\n \n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n \nanother_tuple\n \n=\n \nmy_tuple\n \n# both variables point to the same object\n\n\n \nanother_tuple\n \n+=\n \n(\n4\n,)\n \n# this statement creates a new independent object\n\n\n \nprint\n(\nanother_tuple\n)\n \n\n(\n1\n,\n \n2\n,\n \n3\n,\n \n4\n)\n\n\n \nprint\n(\nmy_tuple\n)\n \n# the old one remains unharmed\n\n\n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n\n\n\n\nThe situation is much different for mutable objects and much more confusing. Let\u2019s try the same example, but now for lists.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n \n# both variables point to the same object\n\n\n \nanother_list\n \n+=\n \n[\n4\n,]\n \n# this statement modifies the object in place\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is modified\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n\n\n\n\nMutable objects can be modified in place. Some operations modify the list in place and some operations don\u2019t. In this case, the statement another_list += [4,] calls another_list.\niadd\n([4,]) and \niadd\n modifies the existing object in place.\nTo make things doubly confusing, we would have completely different results if we used a slightly different notation.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n \n# both variables point to the same object\n\n\n \nanother_list\n \n=\n \nanother_list\n \n+\n \n[\n4\n,]\n \n# this creates an independent copy\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is unharmed\n\n\n[\n1\n,\n \n2\n,\n \n3\n]\n \n\n\n\n\n\nWoah! What\u2019s going on? What changed?\nIt turns out that when we change the third line, Python now internally calls a different function another_list.\nadd\n([4,]) instead of \niadd\n. This function returns a new copy instead of modifying the list in place.\nTo prevent this confusion, it is always better to create a true copy of the list if you wish to prevent modification to the original.\nLet\u2019s remember the list copy methods from before. They were List.copy(), [:], list() and copy.copy(). This is what we should use.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n.\ncopy\n()\n \n# this creates an independent copy\n\n\n \nanother_list\n \n+=\n \n[\n4\n,]\n \n# this statement modifies the independent copy\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is unharmed\n\n\n[\n1\n,\n \n2\n,\n \n3\n]\n \n\n\n\n\n\nThere\u2019s one last gotcha that can happen when copying lists.\nSuppose we have a list that has a nested list inside it. We copy this list using List.copy() and then modify the nested list. Unfortunately, this will modify the original list again!\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n.\ncopy\n()\n\n\n \nanother_list\n[\n0\n]\n \n+=\n \n[\n6\n,]\n\n\n \nprint\n(\nanother_list\n)\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n\n\n \nprint\n(\nmy_list\n)\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n \n\n\n\n\n\nWhy did that happen? Didn\u2019t we just copy the original list?\nThe truth is : we actually don\u2019t have a completely independent copy in this case. The copy() function generates a shallow copy. To see what it does, let\u2019s look at the ids of all the elements in my_list and the ids of all the elements in the copied list.\n\n\n# for my_list\n\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nid\n(\nmy_list\n)\n\n\n140371873277424\n\n\n \nprint\n([\nid\n(\nx\n)\n \nfor\n \nx\n \nin\n \nmy_list\n])\n\n\n[\n140371873599288\n,\n \n13820176\n,\n \n13820152\n]\n\n\n\n# for another_list obtained by my_list.copy()\n\n\n\n \nid\n(\nanother_list\n)\n\n\n140371873317016\n\n\n \nprint\n([\nid\n(\nx\n)\n \nfor\n \nx\n \nin\n \nanother_list\n])\n\n\n[\n140371873599288\n,\n \n13820176\n,\n \n13820152\n]\n\n\n\n\n\n\nWe see the ids of my_list and another_list are indeed different, indicating another_list is a copy. But the ids of the elements contained in another_list have the same ids as the elements in my_list . So the elements have not been copied!\nThis is the property of shallow copy. It creates a new copy of the object but reuses the attributes and elements of the old copy. Thus, when you modify the elements of the new copy, you are modifying the elements of the old copy too.\nTo solve this problem, we need to copy an object along with all its attributes and elements. This can be achieved by copy.deepcopy.\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nanother_list\n \n=\n \ncopy\n.\ndeepcopy\n(\nmy_list\n)\n\n\n \nanother_list\n[\n0\n]\n \n+=\n \n[\n6\n,]\n\n\n \nanother_list\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n\n\n \nmy_list\n\n\n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n\n\n\n\nDeep copy is a quite time intensive operation and can take 1o times longer to complete compared to a shallow copy. But in some situations, it is unavoidable.\n\n\nConclusion\n\n\nThis brings me to the end of this discussion. To summarize, we have talked about the different scenarios which can arise in an assignment statement in Python. We found that:\n\n\n\n\nWhen the right hand side is a simple expression, a new copy is\n created every time. There are some exceptions to this rule, which\n depend on the implementation\n\n\nWhen the right hand side is an existing Python variable, then an\n alias is created for the existing copy.\n\n\nWhen the right hand side is an operation, then the outcome depends on\n the operation. In a simple case involving a tuple, we saw that an\n independent copy was created. In the same case with lists, we saw\n that the list was modified in place in one case (when we used\n \niadd\n) and a new copy was generated in another case (when we used \nadd\n).\n\n\nList item\n\n\nMutable objects can be copied but immutable objects cannot be copied\n in a straightforward way. There is also no need to copy immutable\n objects.\n\n\nTo copy a mutable object along with all its attributes and elements,\n we need to use deep copy.\n\n\n\n\n\n\nSource:\n \n\n\n https://medium.com/broken-window/many-names-one-memory-address-122f78734cb6", "title": "Variables and Assignment" - }, + }, { - "location": "/beginner/Variables_And_Assignment/#variables-and-assignment", - "text": "Variables are named locations which are used to store references to the object stored in memory. The names we choose for variables and functions are commonly known as Identifiers. In python Identifiers must obey the following rules. All identifiers must start with letter or underscore ( _ ) , you\n can\u2019t use digits. For e.g my_var is valid identifier while 1digit \n is not. Identifiers can contain letters, digits and underscores ( _ ). They can be of any length. Identifier can\u2019t be a keyword (keywords are reserved words that\n Python uses for special purpose).Following are Keywords in python 3. and exec not as finally or assert for pass break from print class global raise continue if return def import try del in while elif is with else lambda yield except", + "location": "/beginner/Variables_And_Assignment/#variables-and-assignment", + "text": "Variables are named locations which are used to store references to the object stored in memory. The names we choose for variables and functions are commonly known as Identifiers. In python Identifiers must obey the following rules. All identifiers must start with letter or underscore ( _ ) , you\n can\u2019t use digits. For e.g my_var is valid identifier while 1digit \n is not. Identifiers can contain letters, digits and underscores ( _ ). They can be of any length. Identifier can\u2019t be a keyword (keywords are reserved words that\n Python uses for special purpose).Following are Keywords in python 3. and exec not as finally or assert for pass break from print class global raise continue if return def import try del in while elif is with else lambda yield except", "title": "Variables and Assignment" - }, + }, { - "location": "/beginner/Variables_And_Assignment/#assigning-values-to-variables", - "text": "Values are basic things that programs works with. For e.g 1 , 11 , 3.14 , \"hello\" are all values. In programming terminology they are also commonly known as literals. Literals can be of different type for e.g 1 , 11 are of type int , 3.14 is float and \"hello\" is string . Remember in python everything is object even basic data types like int, float, string, we will elaborate more on this in later chapters. In python you don\u2019t need to declare types of variable ahead of time. Interpreter automatically detects the type of the variable by the data it contains. To assign value to a variable equal sign ( = ) is used. = is also known as assignment operator. Following are some examples of variable declaration: x = 100 # x is integer pi = 3.14 # pi is float empname = python is great # empname is string a = b = c = 100 # this statement assign 100 to c, b and a. Note: \nIn the above code x stores reference to the 100 ( which is an int object ) , x don\u2019t store 100 itself. In Python comments are preceded by a pound sign ( # ). Comments are not programming statements that python interpreter executes while running the program. Comments are used by programmers to remind themselves how the program works. They are also used to write program documentation. #display hello world print ( hello world )", + "location": "/beginner/Variables_And_Assignment/#assigning-values-to-variables", + "text": "Values are basic things that programs works with. For e.g 1 , 11 , 3.14 , \"hello\" are all values. In programming terminology they are also commonly known as literals. Literals can be of different type for e.g 1 , 11 are of type int , 3.14 is float and \"hello\" is string . Remember in python everything is object even basic data types like int, float, string, we will elaborate more on this in later chapters. In python you don\u2019t need to declare types of variable ahead of time. Interpreter automatically detects the type of the variable by the data it contains. To assign value to a variable equal sign ( = ) is used. = is also known as assignment operator. Following are some examples of variable declaration: x = 100 # x is integer pi = 3.14 # pi is float empname = python is great # empname is string a = b = c = 100 # this statement assign 100 to c, b and a. Note: \nIn the above code x stores reference to the 100 ( which is an int object ) , x don\u2019t store 100 itself. In Python comments are preceded by a pound sign ( # ). Comments are not programming statements that python interpreter executes while running the program. Comments are used by programmers to remind themselves how the program works. They are also used to write program documentation. #display hello world print ( hello world )", "title": "Assigning Values to Variables" - }, + }, { - "location": "/beginner/Variables_And_Assignment/#simultaneous-assignments", - "text": "Python allow simultaneous assignment syntax like this: var1 , var2 , ... , varn = exp1 , exp2 , ... , expn this statements tells the python to evaluate all the expression on the right and assign them to the corresponding variables on the left. Simultaneous Assignments is helpful to swap values of two variables. For e.g x = 1 y = 2 y , x = x , y # assign y value to x and x value to y", + "location": "/beginner/Variables_And_Assignment/#simultaneous-assignments", + "text": "Python allow simultaneous assignment syntax like this: var1 , var2 , ... , varn = exp1 , exp2 , ... , expn this statements tells the python to evaluate all the expression on the right and assign them to the corresponding variables on the left. Simultaneous Assignments is helpful to swap values of two variables. For e.g x = 1 y = 2 y , x = x , y # assign y value to x and x value to y", "title": "Simultaneous Assignments" - }, + }, { - "location": "/beginner/Variables_And_Assignment/#python-data-types", - "text": "Python has 5 standard data types namely. \na) Numbers \nb) String \nc) List \nd) Tuple \ne) Dictionary \nf) Boolean \u2013 In Python True and False are boolean literals. But the following values are also considered as false. [] \u2013 empty list , () \u2013 empty tuple , {} \u2013 empty dictionary", + "location": "/beginner/Variables_And_Assignment/#python-data-types", + "text": "Python has 5 standard data types namely. \na) Numbers \nb) String \nc) List \nd) Tuple \ne) Dictionary \nf) Boolean \u2013 In Python True and False are boolean literals. But the following values are also considered as false. [] \u2013 empty list , () \u2013 empty tuple , {} \u2013 empty dictionary", "title": "Python Data Types" - }, + }, { - "location": "/beginner/Variables_And_Assignment/#receiving-input-from-console", - "text": "input() function is used to receive input from the console. Syntax: input([prompt]) - string input() function accepts an optional string argument called prompt and returns a string. name = input ( Enter your name: ) Enter your name : tim name tim Note that input() returns string even if you enter a number, to convert it to an integer you can use int() or eval() . age = int ( input ( Enter your age: )) Enter your age : 22 age 22 type ( age ) class int Source: http://thepythonguru.com", + "location": "/beginner/Variables_And_Assignment/#receiving-input-from-console", + "text": "input() function is used to receive input from the console. Syntax: input([prompt]) - string input() function accepts an optional string argument called prompt and returns a string. name = input ( Enter your name: ) Enter your name : tim name tim Note that input() returns string even if you enter a number, to convert it to an integer you can use int() or eval() . age = int ( input ( Enter your age: )) Enter your age : 22 age 22 type ( age ) class int Source: http://thepythonguru.com", "title": "Receiving input from Console" - }, + }, { - "location": "/beginner/Variables_And_Assignment/#understanding-python-variables-and-memory-management", - "text": "Have you ever noticed any difference between variables in Python and C? For example, when you do an assignment like the following in C, it actually creates a block of memory space so that it can hold the value for that variable int a = 1 ; You can think of it as putting the value assigned in a box with the variable name as shown below. And for all the variables you create a new box is created with the variable name to hold the value. If you change the value of the variable the box will be updated with the new value. That means doing a = 2 ; will result in Assigning one variable to another makes a copy of the value and put that value in the new box. int b = a ; But in Python variables work more like tags unlike the boxes you have seen before. When you do an assignment in Python, it tags the value with the variable name. a = 1 and if you change the value of the varaible, it just changes the tag to the new value in memory. You dont need to do the housekeeping job of freeing the memory here. Python's Automatic Garbage Collection does it for you. When a value is without names/tags it is automatically removed from memory. a = 2 Assigning one variable to another makes a new tag bound to the same value as show below. b = a \nOther languages have 'variables'. Python has 'names'.", + "location": "/beginner/Variables_And_Assignment/#understanding-python-variables-and-memory-management", + "text": "Have you ever noticed any difference between variables in Python and C? For example, when you do an assignment like the following in C, it actually creates a block of memory space so that it can hold the value for that variable int a = 1 ; You can think of it as putting the value assigned in a box with the variable name as shown below. And for all the variables you create a new box is created with the variable name to hold the value. If you change the value of the variable the box will be updated with the new value. That means doing a = 2 ; will result in Assigning one variable to another makes a copy of the value and put that value in the new box. int b = a ; But in Python variables work more like tags unlike the boxes you have seen before. When you do an assignment in Python, it tags the value with the variable name. a = 1 and if you change the value of the varaible, it just changes the tag to the new value in memory. You dont need to do the housekeeping job of freeing the memory here. Python's Automatic Garbage Collection does it for you. When a value is without names/tags it is automatically removed from memory. a = 2 Assigning one variable to another makes a new tag bound to the same value as show below. b = a \nOther languages have 'variables'. Python has 'names'.", "title": "Understanding Python variables and Memory Management" - }, + }, { - "location": "/beginner/Variables_And_Assignment/#a-bit-about-pythons-memory-management", - "text": "As you have seen before, a value will have only one copy in memory and all the variables having this value will refer to this memory location. For example when you have variables a, b, c having a value 10, it doesn't mean that there will be 3 copy of 10s in memory. There will be only one 10 and all the variables a, b, c will point to this value. Once a variable is updated, say you are doing a += 1 a new value 11 will be allocated in memory and a will be pointing to this. Let's check this behaviour with Python Interpreter. Start the Python Shell and try the following for yourselves. a = 10 b = 10 c = 10 id ( a ), id ( b ), id ( c ) ( 140621897573616 , 140621897573616 , 140621897573616 ) a += 1 id ( a ) 140621897573592 id() will return an objects memory address (object's identity). As you have noticed, when you assign the same integer value to the variables, we see the same ids. But this assumption does not hold true all the time. See the following for example x = 500 y = 500 id ( x ) 4338740848 id ( y ) 4338741040 What happened here? Even after assigning the same integer values to different variable names, we are getting two different ids here. These are actually the effects of CPython optimization we are observing here. CPython implementation keeps an array of integer objects for all integers between -5 and 256. So when we create an integer in that range, they simply back reference to the existing object. You may refer the following links for more information. Let's take a look at strings now. s1 = hello s2 = hello id ( s1 ), id ( s2 ) ( 4454725888 , 4454725888 ) s1 == s2 True s1 is s2 True s3 = hello, world! s4 = hello, world! id ( s3 ), id ( s4 ) ( 4454721608 , 4454721664 ) s3 == s4 True s3 is s4 False Looks interesting, isn't it? When the string was a simple and shorter one the variable names where referring to the same object in memory. But when they became bigger, this was not the case. This is called interning, and Python does interning (to some extent) of shorter string literals (as in s1 and s2) which are created at compile time. But in general, Python string literals creates a new string object each time (as in s3 and s4). Interning is runtime dependant and is always a trade-off between memory use and the cost of checking if you are creating the same string. There's a built-in intern() function to forcefully apply interning. Read more about interning from the following links. Stack Overflow: Does Python intern Strings? Stack Overflow: Python String Interning Internals of Python String Interning Source: http://foobarnbaz.com/2012/07/08/understanding-python-variables/", + "location": "/beginner/Variables_And_Assignment/#a-bit-about-pythons-memory-management", + "text": "As you have seen before, a value will have only one copy in memory and all the variables having this value will refer to this memory location. For example when you have variables a, b, c having a value 10, it doesn't mean that there will be 3 copy of 10s in memory. There will be only one 10 and all the variables a, b, c will point to this value. Once a variable is updated, say you are doing a += 1 a new value 11 will be allocated in memory and a will be pointing to this. Let's check this behaviour with Python Interpreter. Start the Python Shell and try the following for yourselves. a = 10 b = 10 c = 10 id ( a ), id ( b ), id ( c ) ( 140621897573616 , 140621897573616 , 140621897573616 ) a += 1 id ( a ) 140621897573592 id() will return an objects memory address (object's identity). As you have noticed, when you assign the same integer value to the variables, we see the same ids. But this assumption does not hold true all the time. See the following for example x = 500 y = 500 id ( x ) 4338740848 id ( y ) 4338741040 What happened here? Even after assigning the same integer values to different variable names, we are getting two different ids here. These are actually the effects of CPython optimization we are observing here. CPython implementation keeps an array of integer objects for all integers between -5 and 256. So when we create an integer in that range, they simply back reference to the existing object. You may refer the following links for more information. Let's take a look at strings now. s1 = hello s2 = hello id ( s1 ), id ( s2 ) ( 4454725888 , 4454725888 ) s1 == s2 True s1 is s2 True s3 = hello, world! s4 = hello, world! id ( s3 ), id ( s4 ) ( 4454721608 , 4454721664 ) s3 == s4 True s3 is s4 False Looks interesting, isn't it? When the string was a simple and shorter one the variable names where referring to the same object in memory. But when they became bigger, this was not the case. This is called interning, and Python does interning (to some extent) of shorter string literals (as in s1 and s2) which are created at compile time. But in general, Python string literals creates a new string object each time (as in s3 and s4). Interning is runtime dependant and is always a trade-off between memory use and the cost of checking if you are creating the same string. There's a built-in intern() function to forcefully apply interning. Read more about interning from the following links. Stack Overflow: Does Python intern Strings? Stack Overflow: Python String Interning Internals of Python String Interning Source: http://foobarnbaz.com/2012/07/08/understanding-python-variables/", "title": "A bit about Python's memory management" - }, + }, { - "location": "/beginner/Variables_And_Assignment/#assignment-statements-in-python-are-more-interesting-than-you-might-think", - "text": "In this article, we will take a deep look at three kinds of assignment statements in Python and discuss what\u2019s going on under the hood. my_string = Hello World # right hand side is a simple expression another_string = my_string # right hand side is another variable another_string = another_string + ! # right hand side is an operation What we find may surprise you. What happens when the right hand side is a simple expression? my_string = Hello World In simple terms, this creates a string \u201cHello World\u201d in memory and assigns the name my_string to it. If you are using CPython[1], then we can even check the memory address explicitly by using the built in function id . my_string = \u201c Hello World \u201d id ( my_string ) 140400709562064 That big number 140400709562064 denotes where the data lives in the memory. It will be very useful for us in this entire discussion.\nWhat happens if we create another string with the same value? another_string = \u201c Hello World \u201d Does it reuse the previous \u201cHello World\u201d stored in memory or does it create an independent copy? Let\u2019s check this by querying the id function again. id ( another_string ) 140400709562208 This outputs a different id, so this must be an independent copy. We conclude that: Note: \nAssignment statements where the right hand side is a simple expression creates independent copies every time. While for everyday programming, this is the rule we should remember, there are actually some weird exceptions to this rule. Here\u2019s an example. my_string = \u201c hello \u201d id ( my_string ) 140400709562016 another_string = \u201c hello \u201d id ( another_string ) 140400709562016 In this case, two consecutive assignment statements did not create independent copies. Why?\nIt gets interesting now.\nFor optimizing memory, Python treats a special set of objects differently. The string \u201chello\u201d belongs to this privileged set and has a different behavior. The exact set depends on the implementation like CPython, PyPy, Jython or IronPython. For CPython, the special rule applies to: Strings without whitespaces and less than 20 characters and Integers from -5 to +255. These objects are always reused or interned. The rationale behind doing this is as follows: Since programmers use these objects frequently, interning existing\n objects saves memory. Since immutable objects like tuples and strings cannot be modified,\n there is no risk in interning the same object. However, Python does not do this for all immutable objects because there is a runtime cost involved for this feature. For interning an object, it must first search for the object in memory, and searching takes time. This is why the special treatment only applies for small integers and strings, because finding them is not that costly. What happens when the right hand side is an existing Python variable? \nLet\u2019s move on to the second type of assignment statement where the right hand side is an existing Python variable. another_string = my_string In this case, nothing is created in memory. After the assignment, both variables refer to the already existing object. It\u2019s basically like giving the object an additional nickname or alias. Let\u2019s confirm this by using the id function. my_string = \u201c Hello World \u201d id ( my_string ) 140400709562160 another_string = my_string id ( another_string ) 140400709562160 The natural question at this stage is : what if, instead of just giving the existing object an alias, we wanted to create an independent copy?\nFor mutable objects, this is possible. You can either use the copy module of Python (which works on all objects) or you may use copy methods specific to the class. For a list, you have several possibilities for creating copies, all of which have different runtime. my_list = [ 1 , 2 , 3 ] copy_of_my_list = my_list . copy () # fastest, works only on latest Python versions copy_of_my_list = my_list [:] # same runtime as List.copy() copy_of_my_list = list ( my_list ) # slightly slower import copy copy_of_my_list = copy . copy ( my_list ) # slowest How can you copy an immutable object? Well\u2026you can\u2019t! At least not in a straightforward way. If you try to use the copy module or the slicing notation, you will get back the same object and not an independent copy. Here\u2019s proof. # Standard ways of copying lists do not apply for tuples my_tuple = ( 1 , 2 , 3 ) id ( my_tuple ) 140371873244816 another_tuple = my_tuple [:] id ( another_tuple ) 140371873244816 # The copy module also doesn\u2019t help import copy another_tuple = copy . copy ( my_tuple ) id ( another_tuple ) 140371873244816 More importantly, there is no reason for explicitly copying an immutable object anyway. We will see why in a moment when we discuss the third kind of assignment statement. What happpens when the right hand side is an operation? In this case, what happens depends on the result of the operation. We will discuss two simple cases: adding an element to an immutable object (like a tuple) and adding an element to a mutable object (like a list). Let\u2019s start with the case of the tuple. another_tuple += ( 4 ,) When you add a new element to a tuple using another_tuple += (4,), this creates a new object in memory. The immutability of tuples is key to understanding this. Since tuples are immutable, any operation that leads to a changed tuple would result in an independent copy.\nThis is the reason why you don\u2019t need to explicitly copy immutable objects : it happens automatically under the hood. Here\u2019s an example. my_tuple = ( 1 , 2 , 3 ) another_tuple = my_tuple # both variables point to the same object another_tuple += ( 4 ,) # this statement creates a new independent object print ( another_tuple ) ( 1 , 2 , 3 , 4 ) print ( my_tuple ) # the old one remains unharmed ( 1 , 2 , 3 ) The situation is much different for mutable objects and much more confusing. Let\u2019s try the same example, but now for lists. my_list = [ 1 , 2 , 3 ] another_list = my_list # both variables point to the same object another_list += [ 4 ,] # this statement modifies the object in place print ( another_list ) [ 1 , 2 , 3 , 4 ] print ( my_list ) # the original list is modified [ 1 , 2 , 3 , 4 ] Mutable objects can be modified in place. Some operations modify the list in place and some operations don\u2019t. In this case, the statement another_list += [4,] calls another_list. iadd ([4,]) and iadd modifies the existing object in place.\nTo make things doubly confusing, we would have completely different results if we used a slightly different notation. my_list = [ 1 , 2 , 3 ] another_list = my_list # both variables point to the same object another_list = another_list + [ 4 ,] # this creates an independent copy print ( another_list ) [ 1 , 2 , 3 , 4 ] print ( my_list ) # the original list is unharmed [ 1 , 2 , 3 ] Woah! What\u2019s going on? What changed?\nIt turns out that when we change the third line, Python now internally calls a different function another_list. add ([4,]) instead of iadd . This function returns a new copy instead of modifying the list in place.\nTo prevent this confusion, it is always better to create a true copy of the list if you wish to prevent modification to the original.\nLet\u2019s remember the list copy methods from before. They were List.copy(), [:], list() and copy.copy(). This is what we should use. my_list = [ 1 , 2 , 3 ] another_list = my_list . copy () # this creates an independent copy another_list += [ 4 ,] # this statement modifies the independent copy print ( another_list ) [ 1 , 2 , 3 , 4 ] print ( my_list ) # the original list is unharmed [ 1 , 2 , 3 ] There\u2019s one last gotcha that can happen when copying lists.\nSuppose we have a list that has a nested list inside it. We copy this list using List.copy() and then modify the nested list. Unfortunately, this will modify the original list again! my_list = [[ 1 , 2 , 3 ], 4 , 5 ] another_list = my_list . copy () another_list [ 0 ] += [ 6 ,] print ( another_list ) [[ 1 , 2 , 3 , 6 ], 4 , 5 ] print ( my_list ) [[ 1 , 2 , 3 , 6 ], 4 , 5 ] Why did that happen? Didn\u2019t we just copy the original list?\nThe truth is : we actually don\u2019t have a completely independent copy in this case. The copy() function generates a shallow copy. To see what it does, let\u2019s look at the ids of all the elements in my_list and the ids of all the elements in the copied list. # for my_list my_list = [[ 1 , 2 , 3 ], 4 , 5 ] id ( my_list ) 140371873277424 print ([ id ( x ) for x in my_list ]) [ 140371873599288 , 13820176 , 13820152 ] # for another_list obtained by my_list.copy() id ( another_list ) 140371873317016 print ([ id ( x ) for x in another_list ]) [ 140371873599288 , 13820176 , 13820152 ] We see the ids of my_list and another_list are indeed different, indicating another_list is a copy. But the ids of the elements contained in another_list have the same ids as the elements in my_list . So the elements have not been copied!\nThis is the property of shallow copy. It creates a new copy of the object but reuses the attributes and elements of the old copy. Thus, when you modify the elements of the new copy, you are modifying the elements of the old copy too.\nTo solve this problem, we need to copy an object along with all its attributes and elements. This can be achieved by copy.deepcopy. my_list = [[ 1 , 2 , 3 ], 4 , 5 ] another_list = copy . deepcopy ( my_list ) another_list [ 0 ] += [ 6 ,] another_list [[ 1 , 2 , 3 , 6 ], 4 , 5 ] my_list [[ 1 , 2 , 3 ], 4 , 5 ] Deep copy is a quite time intensive operation and can take 1o times longer to complete compared to a shallow copy. But in some situations, it is unavoidable.", + "location": "/beginner/Variables_And_Assignment/#assignment-statements-in-python-are-more-interesting-than-you-might-think", + "text": "In this article, we will take a deep look at three kinds of assignment statements in Python and discuss what\u2019s going on under the hood. my_string = Hello World # right hand side is a simple expression another_string = my_string # right hand side is another variable another_string = another_string + ! # right hand side is an operation What we find may surprise you. What happens when the right hand side is a simple expression? my_string = Hello World In simple terms, this creates a string \u201cHello World\u201d in memory and assigns the name my_string to it. If you are using CPython[1], then we can even check the memory address explicitly by using the built in function id . my_string = \u201c Hello World \u201d id ( my_string ) 140400709562064 That big number 140400709562064 denotes where the data lives in the memory. It will be very useful for us in this entire discussion.\nWhat happens if we create another string with the same value? another_string = \u201c Hello World \u201d Does it reuse the previous \u201cHello World\u201d stored in memory or does it create an independent copy? Let\u2019s check this by querying the id function again. id ( another_string ) 140400709562208 This outputs a different id, so this must be an independent copy. We conclude that: Note: \nAssignment statements where the right hand side is a simple expression creates independent copies every time. While for everyday programming, this is the rule we should remember, there are actually some weird exceptions to this rule. Here\u2019s an example. my_string = \u201c hello \u201d id ( my_string ) 140400709562016 another_string = \u201c hello \u201d id ( another_string ) 140400709562016 In this case, two consecutive assignment statements did not create independent copies. Why?\nIt gets interesting now.\nFor optimizing memory, Python treats a special set of objects differently. The string \u201chello\u201d belongs to this privileged set and has a different behavior. The exact set depends on the implementation like CPython, PyPy, Jython or IronPython. For CPython, the special rule applies to: Strings without whitespaces and less than 20 characters and Integers from -5 to +255. These objects are always reused or interned. The rationale behind doing this is as follows: Since programmers use these objects frequently, interning existing\n objects saves memory. Since immutable objects like tuples and strings cannot be modified,\n there is no risk in interning the same object. However, Python does not do this for all immutable objects because there is a runtime cost involved for this feature. For interning an object, it must first search for the object in memory, and searching takes time. This is why the special treatment only applies for small integers and strings, because finding them is not that costly. What happens when the right hand side is an existing Python variable? \nLet\u2019s move on to the second type of assignment statement where the right hand side is an existing Python variable. another_string = my_string In this case, nothing is created in memory. After the assignment, both variables refer to the already existing object. It\u2019s basically like giving the object an additional nickname or alias. Let\u2019s confirm this by using the id function. my_string = \u201c Hello World \u201d id ( my_string ) 140400709562160 another_string = my_string id ( another_string ) 140400709562160 The natural question at this stage is : what if, instead of just giving the existing object an alias, we wanted to create an independent copy?\nFor mutable objects, this is possible. You can either use the copy module of Python (which works on all objects) or you may use copy methods specific to the class. For a list, you have several possibilities for creating copies, all of which have different runtime. my_list = [ 1 , 2 , 3 ] copy_of_my_list = my_list . copy () # fastest, works only on latest Python versions copy_of_my_list = my_list [:] # same runtime as List.copy() copy_of_my_list = list ( my_list ) # slightly slower import copy copy_of_my_list = copy . copy ( my_list ) # slowest How can you copy an immutable object? Well\u2026you can\u2019t! At least not in a straightforward way. If you try to use the copy module or the slicing notation, you will get back the same object and not an independent copy. Here\u2019s proof. # Standard ways of copying lists do not apply for tuples my_tuple = ( 1 , 2 , 3 ) id ( my_tuple ) 140371873244816 another_tuple = my_tuple [:] id ( another_tuple ) 140371873244816 # The copy module also doesn\u2019t help import copy another_tuple = copy . copy ( my_tuple ) id ( another_tuple ) 140371873244816 More importantly, there is no reason for explicitly copying an immutable object anyway. We will see why in a moment when we discuss the third kind of assignment statement. What happpens when the right hand side is an operation? In this case, what happens depends on the result of the operation. We will discuss two simple cases: adding an element to an immutable object (like a tuple) and adding an element to a mutable object (like a list). Let\u2019s start with the case of the tuple. another_tuple += ( 4 ,) When you add a new element to a tuple using another_tuple += (4,), this creates a new object in memory. The immutability of tuples is key to understanding this. Since tuples are immutable, any operation that leads to a changed tuple would result in an independent copy.\nThis is the reason why you don\u2019t need to explicitly copy immutable objects : it happens automatically under the hood. Here\u2019s an example. my_tuple = ( 1 , 2 , 3 ) another_tuple = my_tuple # both variables point to the same object another_tuple += ( 4 ,) # this statement creates a new independent object print ( another_tuple ) ( 1 , 2 , 3 , 4 ) print ( my_tuple ) # the old one remains unharmed ( 1 , 2 , 3 ) The situation is much different for mutable objects and much more confusing. Let\u2019s try the same example, but now for lists. my_list = [ 1 , 2 , 3 ] another_list = my_list # both variables point to the same object another_list += [ 4 ,] # this statement modifies the object in place print ( another_list ) [ 1 , 2 , 3 , 4 ] print ( my_list ) # the original list is modified [ 1 , 2 , 3 , 4 ] Mutable objects can be modified in place. Some operations modify the list in place and some operations don\u2019t. In this case, the statement another_list += [4,] calls another_list. iadd ([4,]) and iadd modifies the existing object in place.\nTo make things doubly confusing, we would have completely different results if we used a slightly different notation. my_list = [ 1 , 2 , 3 ] another_list = my_list # both variables point to the same object another_list = another_list + [ 4 ,] # this creates an independent copy print ( another_list ) [ 1 , 2 , 3 , 4 ] print ( my_list ) # the original list is unharmed [ 1 , 2 , 3 ] Woah! What\u2019s going on? What changed?\nIt turns out that when we change the third line, Python now internally calls a different function another_list. add ([4,]) instead of iadd . This function returns a new copy instead of modifying the list in place.\nTo prevent this confusion, it is always better to create a true copy of the list if you wish to prevent modification to the original.\nLet\u2019s remember the list copy methods from before. They were List.copy(), [:], list() and copy.copy(). This is what we should use. my_list = [ 1 , 2 , 3 ] another_list = my_list . copy () # this creates an independent copy another_list += [ 4 ,] # this statement modifies the independent copy print ( another_list ) [ 1 , 2 , 3 , 4 ] print ( my_list ) # the original list is unharmed [ 1 , 2 , 3 ] There\u2019s one last gotcha that can happen when copying lists.\nSuppose we have a list that has a nested list inside it. We copy this list using List.copy() and then modify the nested list. Unfortunately, this will modify the original list again! my_list = [[ 1 , 2 , 3 ], 4 , 5 ] another_list = my_list . copy () another_list [ 0 ] += [ 6 ,] print ( another_list ) [[ 1 , 2 , 3 , 6 ], 4 , 5 ] print ( my_list ) [[ 1 , 2 , 3 , 6 ], 4 , 5 ] Why did that happen? Didn\u2019t we just copy the original list?\nThe truth is : we actually don\u2019t have a completely independent copy in this case. The copy() function generates a shallow copy. To see what it does, let\u2019s look at the ids of all the elements in my_list and the ids of all the elements in the copied list. # for my_list my_list = [[ 1 , 2 , 3 ], 4 , 5 ] id ( my_list ) 140371873277424 print ([ id ( x ) for x in my_list ]) [ 140371873599288 , 13820176 , 13820152 ] # for another_list obtained by my_list.copy() id ( another_list ) 140371873317016 print ([ id ( x ) for x in another_list ]) [ 140371873599288 , 13820176 , 13820152 ] We see the ids of my_list and another_list are indeed different, indicating another_list is a copy. But the ids of the elements contained in another_list have the same ids as the elements in my_list . So the elements have not been copied!\nThis is the property of shallow copy. It creates a new copy of the object but reuses the attributes and elements of the old copy. Thus, when you modify the elements of the new copy, you are modifying the elements of the old copy too.\nTo solve this problem, we need to copy an object along with all its attributes and elements. This can be achieved by copy.deepcopy. my_list = [[ 1 , 2 , 3 ], 4 , 5 ] another_list = copy . deepcopy ( my_list ) another_list [ 0 ] += [ 6 ,] another_list [[ 1 , 2 , 3 , 6 ], 4 , 5 ] my_list [[ 1 , 2 , 3 ], 4 , 5 ] Deep copy is a quite time intensive operation and can take 1o times longer to complete compared to a shallow copy. But in some situations, it is unavoidable.", "title": "Assignment statements in Python are more interesting than you might think" - }, + }, { - "location": "/beginner/Variables_And_Assignment/#conclusion", - "text": "This brings me to the end of this discussion. To summarize, we have talked about the different scenarios which can arise in an assignment statement in Python. We found that: When the right hand side is a simple expression, a new copy is\n created every time. There are some exceptions to this rule, which\n depend on the implementation When the right hand side is an existing Python variable, then an\n alias is created for the existing copy. When the right hand side is an operation, then the outcome depends on\n the operation. In a simple case involving a tuple, we saw that an\n independent copy was created. In the same case with lists, we saw\n that the list was modified in place in one case (when we used\n iadd ) and a new copy was generated in another case (when we used add ). List item Mutable objects can be copied but immutable objects cannot be copied\n in a straightforward way. There is also no need to copy immutable\n objects. To copy a mutable object along with all its attributes and elements,\n we need to use deep copy. Source: https://medium.com/broken-window/many-names-one-memory-address-122f78734cb6", + "location": "/beginner/Variables_And_Assignment/#conclusion", + "text": "This brings me to the end of this discussion. To summarize, we have talked about the different scenarios which can arise in an assignment statement in Python. We found that: When the right hand side is a simple expression, a new copy is\n created every time. There are some exceptions to this rule, which\n depend on the implementation When the right hand side is an existing Python variable, then an\n alias is created for the existing copy. When the right hand side is an operation, then the outcome depends on\n the operation. In a simple case involving a tuple, we saw that an\n independent copy was created. In the same case with lists, we saw\n that the list was modified in place in one case (when we used\n iadd ) and a new copy was generated in another case (when we used add ). List item Mutable objects can be copied but immutable objects cannot be copied\n in a straightforward way. There is also no need to copy immutable\n objects. To copy a mutable object along with all its attributes and elements,\n we need to use deep copy. Source: https://medium.com/broken-window/many-names-one-memory-address-122f78734cb6", "title": "Conclusion" - }, + }, + { + "location": "/beginner/Functions/", + "text": "Function Calls\n\n\nIn the context of programming, a function is a named sequence of statements that\nperforms a computation. When you define a function, you specify the name and the\nsequence of statements. Later, you can \u201ccall\u201d the function by name. We have already seen\none example of a function call:\n\n\n \ntype\n(\n32\n)\n\n\ntype\n \nint\n\n\n\n\n\n\nThe name of the function is type. The expression in parentheses is called the argument\nof the function. The result, for this function, is the type of the argument.\n\nIt is common to say that a function \u201ctakes\u201d an argument and \u201creturns\u201d a result. The result\nis called the return value.\n\n\nType Conversion Functions\n\n\nPython provides built-in functions that convert values from one type to another. The\nint function takes any value and converts it to an integer, if it can, or complains\notherwise:\n\n\n \nint\n(\n32\n)\n\n\n32\n\n\n \nint\n(\nHello\n)\n\n\nValueError\n:\n \ninvalid\n \nliteral\n \nfor\n \nint\n():\n \nHello\n\n\n\n\n\n\nint can convert floating-point values to integers, but it doesn\u2019t round off; it chops off\nthe fraction part:\n\n\n \nint\n(\n3.99999\n)\n\n\n3\n\n\n \nint\n(\n-\n2.3\n)\n\n\n-\n2\n\n\n\n\n\n\nfloat converts integers and strings to floating-point numbers:\n\n\n \nfloat\n(\n32\n)\n\n\n32.0\n\n\n \nfloat\n(\n3.14159\n)\n\n\n3.14159\n\n\n\n\n\n\nFinally, str converts its argument to a string:\n\n\n \nstr\n(\n32\n)\n\n\n32\n\n\n \nstr\n(\n3.14159\n)\n\n\n3.14159\n\n\n\n\n\n\nAdding New Functions\n\n\nSo far, we have only been using the functions that come with Python, but it is also possible\nto add new functions. A function definition specifies the name of a new function and\nthe sequence of statements that execute when the function is called.\n\nHere is an example:\n\n\ndef\n \nprint_lyrics\n():\n\n \nprint\n \nI\nm a lumberjack, and I\nm okay.\n\n \nprint\n \nI sleep all night and I work all day.\n\n\n\n\n\n\ndef\n is a keyword that indicates that this is a function definition. The name of the function\nis print_lyrics. The rules for function names are the same as for variable names: letters,\nnumbers and some punctuation marks are legal, but the first character can\u2019t be a number.\nYou can\u2019t use a keyword as the name of a function, and you should avoid having a variable\nand a function with the same name.\n\nThe empty parentheses after the name indicate that this function doesn\u2019t take any\narguments.\n\nThe first line of the function definition is called the header; the rest is called the body.\nThe header has to end with a colon and the body has to be indented. By convention, the\nindentation is always four spaces; see \u201cDebugging\u201d (page 33). The body can contain any\nnumber of statements.\n\nThe strings in the print statements are enclosed in double quotes. Single quotes and\ndouble quotes do the same thing; most people use single quotes except in cases like this\nwhere a single quote (which is also an apostrophe) appears in the string.\nIf you type a function definition in interactive mode, the interpreter prints ellipses (...)\nto let you know that the definition isn\u2019t complete:\n\n\ndef\n \nprint_lyrics\n():\n\n \nprint\n \nI\nm a lumberjack, and I\nm okay.\n\n \nprint\n \nI sleep all night and I work all day.\n\n\n\n\n\n\nTo end the function, you have to enter an empty line (this is not necessary in a script).\nDefining a function creates a variable with the same name.\n\n\n \nprint\n \nprint_lyrics\n\n\nfunction\n \nprint_lyrics\n \nat\n \n0xb7e99e9c\n\n\n \ntype\n(\nprint_lyrics\n)\n\n\ntype\n \nfunction\n\n\n\n\n\n\nThe value of print_lyrics is a function object, which has type 'function'.\nThe syntax for calling the new function is the same as for built-in functions:\n\n\n \nprint_lyrics\n()\n\n\nI\nm a lumberjack, and I\nm\n \nokay\n.\n\n\nI\n \nsleep\n \nall\n \nnight\n \nand\n \nI\n \nwork\n \nall\n \nday\n.\n\n\n\n\n\n\nOnce you have defined a function, you can use it inside another function. For example,\nto repeat the previous refrain, we could write a function called repeat_lyrics: \n\n\ndef\n \nrepeat_lyrics\n():\n\n \nprint_lyrics\n()\n\n \nprint_lyrics\n()\n\n\n\n\n\n\nAnd then call repeat_lyrics: \n\n\n \nrepeat_lyrics\n()\n\n\nI\nm a lumberjack, and I\nm\n \nokay\n.\n\n\nI\n \nsleep\n \nall\n \nnight\n \nand\n \nI\n \nwork\n \nall\n \nday\n.\n\n\nI\nm a lumberjack, and I\nm\n \nokay\n.\n\n\nI\n \nsleep\n \nall\n \nnight\n \nand\n \nI\n \nwork\n \nall\n \nday\n.\n\n\n\n\n\n\nBut that\u2019s not really how the song goes.\n\n\nDefinitions and Uses\n\n\nPulling together the code fragments from the previous section, the whole program looks\nlike this:\n\n\ndef\n \nprint_lyrics\n():\n\n \nprint\n \nI\nm a lumberjack, and I\nm okay.\n\n \nprint\n \nI sleep all night and I work all day.\n\n\ndef\n \nrepeat_lyrics\n():\n\n \nprint_lyrics\n()\n\n \nprint_lyrics\n()\n \n\n\nrepeat_lyrics\n()\n\n\n\n\n\n\nThis program contains two function definitions: print_lyrics and repeat_lyrics.\nFunction definitions get executed just like other statements, but the result creates func\ntion objects. The statements inside the function do not get executed until the function\nis called, and the function definition generates no output.\n\nAs you might expect, you have to create a function before you can execute it. In other\nwords, the function definition has to be executed before the function is called the first\ntime. \n\n\nFlow of Execution\n\n\nIn order to ensure that a function is defined before its first use, you have to know the\norder in which statements are executed, which is called the flow of execution.\n\nExecution always begins at the first statement of the program. Statements are executed\none at a time, in order, from top to bottom.\n\n\nFunction definitions do not alter the flow of execution of the program, but remember\nthat statements inside the function are not executed until the function is called.\nA function call is like a detour in the flow of execution. Instead of going to the next\nstatement, the flow jumps to the body of the function, executes all the statements there,\nand then comes back to pick up where it left off.\n\nThat sounds simple enough, until you remember that one function can call another.\nWhile in the middle of one function, the program might have to execute the statements\nin another function. But while executing that new function, the program might have to\nexecute yet another function!\n\nFortunately, Python is good at keeping track of where it is, so each time a function\ncompletes, the program picks up where it left off in the function that called it. When it\ngets to the end of the program, it terminates.\n\nWhat\u2019s the moral of this sordid tale? When you read a program, you don\u2019t always want\nto read from top to bottom. Sometimes it makes more sense if you follow the flow of\nexecution. \n\n\nParameters and Arguments\n\n\nSome of the built-in functions we have seen require arguments. For example, when you\ncall math.sin you pass a number as an argument. Some functions take more than one\nargument: \nmath.pow\n takes two, the base and the exponent.\nInside the function, the arguments are assigned to variables called parameters. Here is\nan example of a user-defined function that takes an argument:\n\n\n \ndef\n \nprint_twice\n(\nbruce\n):\n\n \nprint\n \nbruce\n\n \nprint\n \nbruce\n\n\n\n\n\n\nThis function assigns the argument to a parameter named bruce. When the function is\ncalled, it prints the value of the parameter (whatever it is) twice.\n\nThis function works with any value that can be printed.\n\n\n \nprint_twice\n(\nSpam\n)\n\n\nSpam\n\n\nSpam\n\n\n \nprint_twice\n(\n17\n)\n\n\n17\n\n\n17\n\n\n \nprint_twice\n(\nmath\n.\npi\n)\n\n\n3.14159265359\n\n\n3.14159265359\n \n\n\n\n\n\nThe same rules of composition that apply to built-in functions also apply to user-defined\nfunctions, so we can use any kind of expression as an argument for \nprint_twice\n:\n\n\n \nprint_twice\n(\nSpam \n*\n4\n)\n\n\nSpam\n \nSpam\n \nSpam\n \nSpam\n\n\nSpam\n \nSpam\n \nSpam\n \nSpam\n\n\n \nprint_twice\n(\nmath\n.\ncos\n(\nmath\n.\npi\n))\n\n\n-\n1.0\n\n\n-\n1.0\n\n\n\n\n\n\nThe argument is evaluated before the function is called, so in the examples the expres\nsions 'Spam '*4 and math.cos(math.pi) are only evaluated once.\n\nYou can also use a variable as an argument:\n\n\n \nmichael\n \n=\n \nEric, the half a bee.\n\n\n \nprint_twice\n(\nmichael\n)\n\n\nEric\n,\n \nthe\n \nhalf\n \na\n \nbee\n.\n\n\nEric\n,\n \nthe\n \nhalf\n \na\n \nbee\n.\n\n\n\n\n\n\nThe name of the variable we pass as an argument (michael) has nothing to do with the\nname of the parameter (bruce). It doesn\u2019t matter what the value was called back home\n(in the caller); here in print_twice, we call everybody bruce.\n\n\nVariables and Parameters Are Local\n\n\nWhen you create a variable inside a function, it is local, which means that it only exists\ninside the function. For example:\n\n\ndef\n \ncat_twice\n(\npart1\n,\n \npart2\n):\n\n \ncat\n \n=\n \npart1\n \n+\n \npart2\n\n \nprint_twice\n(\ncat\n)\n\n\n\n\n\n\nThis function takes two arguments, concatenates them, and prints the result twice. Here\nis an example that uses it:\n\n\n \nline1\n \n=\n \nBing tiddle \n\n\n \nline2\n \n=\n \ntiddle bang.\n\n\n \ncat_twice\n(\nline1\n,\n \nline2\n)\n\n\nBing\n \ntiddle\n \ntiddle\n \nbang\n.\n\n\nBing\n \ntiddle\n \ntiddle\n \nbang\n.\n\n\n\n\n\n\nWhen cat_twice terminates, the variable cat is destroyed. If we try to print it, we get\nan exception:\n\n\n \nprint\n \ncat\n\n\nNameError\n:\n \nname\n \ncat\n \nis\n \nnot\n \ndefined\n\n\n\n\n\n\nParameters are also local. For example, outside print_twice, there is no such thing as\nbruce.\n\n\nStack Diagrams\n\n\nTo keep track of which variables can be used where, it is sometimes useful to draw a\nstack diagram. Like state diagrams, stack diagrams show the value of each variable, but\nthey also show the function each variable belongs to.\n\nEach function is represented by a frame. A frame is a box with the name of a function\nbeside it and the parameters and variables of the function inside it. The stack diagram\nfor the previous example is shown in Figure 3-1.\n\n\n\n\nThe frames are arranged in a stack that indicates which function called which, and so\non. In this example, print_twice was called by cat_twice, and cat_twice was called\nby \n\\__main\\__\n, which is a special name for the topmost frame. When you create a variable\noutside of any function, it belongs to \n\\__main\\__\n.\n\n\nEach parameter refers to the same value as its corresponding argument. So, part1 has\nthe same value as line1, part2 has the same value as line2, and bruce has the same\nvalue as cat.\nIf an error occurs during a function call, Python prints the name of the function, and\nthe name of the function that called it, and the name of the function that called that, all\nthe way back to \n\\__main__\\\n.\n\n\nFor example, if you try to access cat from within print_twice, you get a NameError:\n\n\nTraceback\n \n(\ninnermost\n \nlast\n):\n\n \nFile\n \ntest.py\n,\n \nline\n \n13\n,\n \nin\n \n__main__\n\n \ncat_twice\n(\nline1\n,\n \nline2\n)\n\n \nFile\n \ntest.py\n,\n \nline\n \n5\n,\n \nin\n \ncat_twice\n\n \nprint_twice\n(\ncat\n)\n\n \nFile\n \ntest.py\n,\n \nline\n \n9\n,\n \nin\n \nprint_twice\n\n \nprint\n \ncat\n\n \nNameError\n:\n \nname\n \ncat\n \nis\n \nnot\n \ndefined\n\n\n\n\n\n\nThis list of functions is called a traceback. It tells you what program file the error oc\ncurred in, and what line, and what functions were executing at the time. It also shows\nthe line of code that caused the error.\nThe order of the functions in the traceback is the same as the order of the frames in the\nstack diagram. The function that is currently running is listed at the bottom.\n\n\nFruitful Functions and Void Functions\n\n\nSome of the functions we are using, such as the math functions, yield results; for lack of\na better name, I call them fruitful functions. Other functions, like print_twice, per\nform an action but don\u2019t return a value. They are called void functions.\nWhen you call a fruitful function, you almost always want to do something with the\nresult; for example, you might assign it to a variable or use it as part of an expression:\n\n\nx\n \n=\n \nmath\n.\ncos\n(\nradians\n)\n\n\ngolden\n \n=\n \n(\nmath\n.\nsqrt\n(\n5\n)\n \n+\n \n1\n)\n \n/\n \n2\n\n\n\n\n\n\nWhen you call a function in interactive mode, Python displays the result:\n\n\n \nmath\n.\nsqrt\n(\n5\n)\n\n\n2.2360679774997898\n\n\n\n\n\n\nBut in a script, if you call a fruitful function all by itself, the return value is lost forever!\n\n\nmath\n.\nsqrt\n(\n5\n)\n\n\n\n\n\n\nThis script computes the square root of 5, but since it doesn\u2019t store or display the result,\nit is not very useful.\nVoid functions might display something on the screen or have some other effect, but\nthey don\u2019t have a return value. If you try to assign the result to a variable, you get a special\nvalue called None.\n\n\n \nresult\n \n=\n \nprint_twice\n(\nBing\n)\n\n\nBing\n\n\nBing\n\n\n \nprint\n \nresult\n\n\nNone\n\n\n\n\n\n\nThe value None is not the same as the string 'None'. It is a special value that has its own\ntype:\n\n\n \nprint\n \ntype\n(\nNone\n)\n\n\ntype\n \nNoneType\n\n\n\n\n\n\nThe functions we have written so far are all void. We will start writing fruitful functions\nin a few chapters.\n\n\nWhy Functions?\n\n\nIt may not be clear why it is worth the trouble to divide a program into functions. There\nare several reasons:\n\n- Creating a new function gives you an opportunity to name a group of statements,\nwhich makes your program easier to read and debug.\n- Functions can make a program smaller by eliminating repetitive code. Later, if you\nmake a change, you only have to make it in one place.\n- Dividing a long program into functions allows you to debug the parts one at a time\nand then assemble them into a working whole.\n- Well-designed functions are often useful for many programs. Once you write and\ndebug one, you can reuse it.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nFunctions by by Mark Lutz (Learning Python, Fourth Edition)\n\n\nFunction Basics\n\n\nIn Part III, we looked at basic procedural statements in Python. Here, we\u2019ll move on to\nexplore a set of additional statements that we can use to create functions of our own.\n\nIn simple terms, a function is a device that groups a set of statements so they can be run\nmore than once in a program. Functions also can compute a result value and let us\nspecify parameters that serve as function inputs, which may differ each time the code\nis run. Coding an operation as a function makes it a generally useful tool, which we\ncan use in a variety of contexts.\n\nMore fundamentally, functions are the alternative to programming by cutting and\npasting\u2014rather than having multiple redundant copies of an operation\u2019s code, we can\nfactor it into a single function. In so doing, we reduce our future work radically: if the\noperation must be changed later, we only have one copy to update, not many.\n\nFunctions are the most basic program structure Python provides for maximizing code\nreuse and minimizing code redundancy. As we\u2019ll see, functions are also a design tool\nthat lets us split complex systems into manageable parts. Table 16-1 summarizes the\nprimary function-related tools we\u2019ll study in this part of the book.\n\n\nStatement | Examples |\n\n\n\n\n\n------|------|\n\nCalls\n | \nmyfunc('spam', 'eggs', meat=ham)\n|\n\ndef, return\n| def adder(a, b=1, \nc): return a + b + c[0]| \n\nglobal\n| def changer():global x; x = 'new' | \n\nnonlocal\n| def changer():nonlocal x; x = 'new'|\n\nyield\n| def squares(x):for i in range(x): yield i \n 2 |\n\nlambda\n| funcs = [lambda x: x\n2, lambda x: x\n3]\n\n\nWhy Use Functions?\n\n\nBefore we get into the details, let\u2019s establish a clear picture of what functions are all\nabout. Functions are a nearly universal program-structuring device. You may have\ncome across them before in other languages, where they may have been called subroutines\nor procedures. As a brief introduction, functions serve two primary development\nroles:\n\n\nMaximizing code reuse and minimizing redundancy\n\nAs in most programming languages, Python functions are the simplest way to\npackage logic you may wish to use in more than one place and more than one time.\nUp until now, all the code we\u2019ve been writing has run immediately. Functions allow\nus to group and generalize code to be used arbitrarily many times later. Because\nthey allow us to code an operation in a single place and use it in many places,\nPython functions are the most basic factoring tool in the language: they allow us\nto reduce code redundancy in our programs, and thereby reduce maintenance\neffort. \n\n\nProcedural decomposition\n\nFunctions also provide a tool for splitting systems into pieces that have well-defined\nroles. For instance, to make a pizza from scratch, you would start by mixing the\ndough, rolling it out, adding toppings, baking it, and so on. If you were programming\na pizza-making robot, functions would help you divide the overall \u201cmake\npizza\u201d task into chunks\u2014one function for each subtask in the process. It\u2019s easier\nto implement the smaller tasks in isolation than it is to implement the entire process\nat once. In general, functions are about procedure\u2014how to do something, rather\nthan what you\u2019re doing it to. We\u2019ll see why this distinction matters in Part VI, when\nwe start making new object with classes. \n\n\n\n\nIn this part of the book, we\u2019ll explore the tools used to code functions in Python: function\nbasics, scope rules, and argument passing, along with a few related concepts such\nas generators and functional tools. Because its importance begins to become more apparent\nat this level of coding, we\u2019ll also revisit the notion of polymorphism introduced\nearlier in the book. As you\u2019ll see, functions don\u2019t imply much new syntax, but they do\nlead us to some bigger programming ideas.\n\n\nCoding Functions\n\n\nAlthough it wasn\u2019t made very formal, we\u2019ve already used some functions in earlier\nchapters. For instance, to make a file object, we called the built-in open function; similarly,\nwe used the len built-in function to ask for the number of items in a collection\nobject.\n\nIn this chapter, we will explore how to write new functions in Python. Functions we\nwrite behave the same way as the built-ins we\u2019ve already seen: they are called in expressions, are passed values, and return results. But writing new functions requires\nthe application of a few additional ideas that haven\u2019t yet been introduced. Moreover,\nfunctions behave very differently in Python than they do in compiled languages like C.\nHere is a brief introduction to the main concepts behind Python functions, all of which\nwe will study in this part of the book: \n\n\n\n\ndef is executable code.\n Python functions are written with a new statement, the\ndef. Unlike functions in compiled languages such as C, def is an executable statement\u2014\nyour function does not exist until Python reaches and runs the def. In fact,\nit\u2019s legal (and even occasionally useful) to nest def statements inside if statements,\nwhile loops, and even other defs. In typical operation, def statements are coded in\nmodule files and are naturally run to generate functions when a module file is first\nimported.\n\n\n\n\ndef creates an object and assigns it to a name.\n When Python reaches and runs\na def statement, it generates a new function object and assigns it to the function\u2019s\nname. As with all assignments, the function name becomes a reference to the function\nobject. There\u2019s nothing magic about the name of a function\u2014as you\u2019ll see,\nthe function object can be assigned to other names, stored in a list, and so on.\nFunction objects may also have arbitrary user-defined attributes attached to them\nto record data.\n\n\n\n\n\n\nlambda creates an object but returns it as a result.\n Functions may also be created\nwith the lambda expression, a feature that allows us to in-line function definitions\nin places where a def statement won\u2019t work syntactically\n\n\n\n\n\n\nreturn sends a result object back to the caller.\n When a function is called, the\ncaller stops until the function finishes its work and returns control to the caller.\nFunctions that compute a value send it back to the caller with a return statement;\nthe returned value becomes the result of the function call.\n\n\n\n\n\n\nyield sends a result object back to the caller, but remembers where it left\noff.\n Functions known as generators may also use the yield statement to send back\na value and suspend their state such that they may be resumed later, to produce a\nseries of results over time. This is another advanced topic covered later in this part\nof the book.\n\n\n\n\n\n\nglobal declares module-level variables that are to be assigned.\n By default, all\nnames assigned in a function are local to that function and exist only while the\nfunction runs. To assign a name in the enclosing module, functions need to list it\nin a global statement. More generally, names are always looked up in scopes\u2014\nplaces where variables are stored\u2014and assignments bind names to scopes.\n\n\n\n\n\n\nnonlocal declares enclosing function variables that are to be assigned.\n Similarly,\nthe nonlocal statement added in Python 3.0 allows a function to assign a\nname that exists in the scope of a syntactically enclosing def statement. This allows\nenclosing functions to serve as a place to retain state\u2014information remembered\nwhen a function is called\u2014without using shared global names.\n\n\n\n\n\n\nArguments are passed by assignment (object reference).\n In Python, arguments\nare passed to functions by assignment (which, as we\u2019ve learned, means by object\nreference). As you\u2019ll see, in Python\u2019s model the caller and function share objects\nby references, but there is no name aliasing. Changing an argument name within\na function does not also change the corresponding name in the caller, but changing\npassed-in mutable objects can change objects shared by the caller.\n\n\n\n\n\n\nArguments, return values, and variables are not declared.\n As with everything\nin Python, there are no type constraints on functions. In fact, nothing about a\nfunction needs to be declared ahead of time: you can pass in arguments of any type,\nreturn any kind of object, and so on. As one consequence, a single function can\noften be applied to a variety of object types\u2014any objects that sport a compatible\ninterface (methods and expressions) will do, regardless of their specific types.\n\n\n\n\n\n\nIf some of the preceding words didn\u2019t sink in, don\u2019t worry\u2014we\u2019ll explore all of these\nconcepts with real code in this part of the book. Let\u2019s get started by expanding on some\nof these ideas and looking at a few examples.\n\n\ndef Statements\n\n\nThe def statement creates a function object and assigns it to a name. Its general format\nis as follows:\n\n\ndef\n \nname\n(\narg1\n,\n \narg2\n,\n...\n \nargN\n):\n\n \nstatements\n\n\n\n\n\n\nAs with all compound Python statements, def consists of a header line followed by a\nblock of statements, usually indented (or a simple statement after the colon). The\nstatement block becomes the function\u2019s body\u2014that is, the code Python executes each\ntime the function is called.\n\nThe def header line specifies a function name that is assigned the function object, along\nwith a list of zero or more arguments (sometimes called parameters) in parentheses.\nThe argument names in the header are assigned to the objects passed in parentheses at\nthe point of call.\n\n\nFunction bodies often contain a return statement:\n\n\ndef\n \nname\n(\narg1\n,\n \narg2\n,\n...\n \nargN\n):\n\n \n...\n\n \nreturn\n \nvalue\n\n\n\n\n\n\nThe Python return statement can show up anywhere in a function body; it ends the\nfunction call and sends a result back to the caller. The return statement consists of an\nobject expression that gives the function\u2019s result. The return statement is optional; if\nit\u2019s not present, the function exits when the control flow falls off the end of the function\nbody. Technically, a function without a return statement returns the None object automatically,\nbut this return value is usually ignored.\n\n\ndef Executes at Runtime\n\n\nThe Python def is a true executable statement: when it runs, it creates a new function\nobject and assigns it to a name. (Remember, all we have in Python is runtime; there is\nno such thing as a separate compile time.) Because it\u2019s a statement, a def can appear\nanywhere a statement can\u2014even nested in other statements. For instance, although\ndefs normally are run when the module enclosing them is imported, it\u2019s also completely\nlegal to nest a function def inside an if statement to select between alternative\ndefinitions:\n\n\nif\n \ntest\n:\n\n \ndef\n \nfunc\n():\n \n# Define func this way\n\n\n...\n\n\nelse\n:\n\n \ndef\n \nfunc\n():\n \n# Or else this way\n\n \n...\n\n \n...\n\n\nfunc\n()\n \n# Call the version selected and built\n\n\n\n\n\n\nOne way to understand this code is to realize that the def is much like an = statement:\nit simply assigns a name at runtime. Unlike in compiled languages such as C, Python\nfunctions do not need to be fully defined before the program runs. More generally,\ndefs are not evaluated until they are reached and run, and the code inside defs is not\nevaluated until the functions are later called.\nBecause function definition happens at runtime, there\u2019s nothing special about the\nfunction name. What\u2019s important is the object to which it refers: \n\n\nothername\n \n=\n \nfunc\n \n# Assign function object\n\n\nothername\n()\n \n# Call func again\n\n\n\n\n\n\nHere, the function was assigned to a different name and called through the new name.\nLike everything else in Python, functions are just objects; they are recorded explicitly\nin memory at program execution time. In fact, besides calls, functions allow arbitrary\nattributes to be attached to record information for later use:\n\n\ndef\n \nfunc\n():\n \n...\n \n# Create function object\n\n\nfunc\n()\n \n# Call object\n\n\nfunc\n.\nattr\n \n=\n \nvalue\n \n# Attach attributes\n\n\n\n\n\n\nA First Example: Definitions and Calls\n\n\nApart from such runtime concepts (which tend to seem most unique to programmers\nwith backgrounds in traditional compiled languages), Python functions are straightforward\nto use. Let\u2019s code a first real example to demonstrate the basics. As you\u2019ll see,\nthere are two sides to the function picture: a definition (the def that creates a function)\nand a call (an expression that tells Python to run the function\u2019s body).\n\n\nDefinition\n\n\nHere\u2019s a definition typed interactively that defines a function called times, which returns\nthe product of its two arguments:\n\n\n \ndef\n \ntimes\n(\nx\n,\n \ny\n):\n \n# Create and assign function\n\n\n...\n \nreturn\n \nx\n \n*\n \ny\n \n# Body executed when called\n\n\n...\n\n\n\n\n\n\nWhen Python reaches and runs this def, it creates a new function object that packages\nthe function\u2019s code and assigns the object to the name times. Typically, such a statement\nis coded in a module file and runs when the enclosing file is imported; for something\nthis small, though, the interactive prompt suffices.\n\n\nCalls\n\n\nAfter the def has run, you can call (run) the function in your program by adding\nparentheses after the function\u2019s name. The parentheses may optionally contain one or\nmore object arguments, to be passed (assigned) to the names in the function\u2019s header:\n\n\n \ntimes\n(\n2\n,\n \n4\n)\n \n# Arguments in parentheses\n\n\n8\n\n\n\n\n\n\nThis expression passes two arguments to times. As mentioned previously, arguments\nare passed by assignment, so in this case the name x in the function header is assigned\nthe value 2, y is assigned the value 4, and the function\u2019s body is run. For this function,\nthe body is just a return statement that sends back the result as the value of the call\nexpression. The returned object was printed here interactively (as in most languages,\n2 * 4 is 8 in Python), but if we needed to use it later we could instead assign it to a\nvariable. For example:\n\n\n \nx\n \n=\n \ntimes\n(\n3.14\n,\n \n4\n)\n \n# Save the result object\n\n\n \nx\n\n\n12.56\n\n\n\n\n\n\nNow, watch what happens when the function is called a third time, with very different\nkinds of objects passed in:\n\n\n \ntimes\n(\nNi\n,\n \n4\n)\n \n# Functions are \ntypeless\n\n\nNiNiNiNi\n\n\n\n\n\n\nThis time, our function means something completely different (Monty Python reference\nagain intended). In this third call, a string and an integer are passed to x and y, instead\nof two numbers. Recall that * works on both numbers and sequences; because we never\ndeclare the types of variables, arguments, or return values in Python, we can use\ntimes to either multiply numbers or repeat sequences.\n\nIn other words, what our times function means and does depends on what we pass into\nit. This is a core idea in Python (and perhaps the key to using the language well), which\nwe\u2019ll explore in the next section.\n\n\n\n\nSource:\n \n\n\n \nLearning Python, Fourth Edition\n by Mark Lutz - 2009\n\n\n\n\nHow To Define Functions in Python 3\n\n\nA function is a block of instructions that performs an action and, once defined, can be reused. Functions make code more modular, allowing you to use the same code over and over again.\n\n\nPython has a number of built-in functions that you may be familiar with, including: \n\n\n\n\nprint() which will print an object to the terminal\n\n\nint() which will convert a string or number data type to an integer data type\n\n\nlen() which returns the length of an object\n\n\n\n\nFunction names include parentheses and may include parameters. \n\n\nIn this tutorial, we\u2019ll go over how to define your own functions to use in your coding projects.\n\n\nDefining a Function\n\n\nLet\u2019s start with turning the classic \u201cHello, World!\u201d program into a function.\n\n\nWe\u2019ll create a new text file in our text editor of choice, and call the program hello.py. Then, we\u2019ll define the function.\n\n\nA function is defined by using the def keyword, followed by a name of your choosing, followed by a set of parentheses which hold any parameters the function will take (they can be empty), and ending with a colon.\n\n\nIn this case, we\u2019ll define a function named hello():\n\n\ndef\n \nhello\n():\n\n\n\n\n\n\nThis sets up the initial statement for creating a function.\n\n\nFrom here, we\u2019ll add a second line with a 4-space indent to provide the instructions for what the function does. In this case, we\u2019ll be printing Hello, World! to the console:\n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\n\n\n\nOur function is now fully defined, but if we run the program at this point, nothing will happen since we didn\u2019t call the function.\n\n\nSo, outside of our defined function block, let\u2019s call the function with hello(): \n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\nhello\n()\n\n\n\n\n\n\nNow, let\u2019s run the program:\n\n\npython\n \nhello\n.\npy\n\n\n\n\n\n\nYou should receive the following output:\n\n\nHello\n,\n \nWorld\n!\n\n\n\n\n\n\nFunctions can be more complicated than the \nhello()\n function we defined above. For example, we can use for loops, conditional statements, and more within our function block.\n\n\nFor example, the function defined below utilizes a conditional statement to check if the input for the name variable contains a vowel, then uses a \nfor\n loop to iterate over the letters in the \nname\n string.\n\n\n# Define function names()\n\n\ndef\n \nnames\n():\n\n \n# Set up name variable with input\n\n \nname\n \n=\n \nstr\n(\ninput\n(\nEnter your name: \n))\n\n \n# Check whether name has a vowel\n\n \nif\n \nset\n(\naeiou\n)\n.\nintersection\n(\nname\n.\nlower\n()):\n\n \nprint\n(\nYour name contains a vowel.\n)\n\n \nelse\n:\n\n \nprint\n(\nYour name does not contain a vowel.\n)\n\n\n \n# Iterate over name\n\n \nfor\n \nletter\n \nin\n \nname\n:\n\n \nprint\n(\nletter\n)\n\n\n\n# Call the function\n\n\nnames\n()\n\n\n\n\n\n\nThe \nnames()\n function we defined above sets up a conditional statement and a for loop, showing how code can be organized within a function definition. However, depending on what we intend with our program and how we want to set up our code, we may want to define the conditional statement and the for loop as two separate functions.\n\n\nDefining functions within a program makes our code modular and reusable so that we can call the same functions without rewriting them.\n\n\nWorking with Parameters\n\n\nSo far we have looked at functions with empty parentheses that do not take arguments, but we can define parameters in function definitions within their parentheses.\n\n\nA parameter is a named entity in a function definition, specifying an argument that the function can accept.\n\n\nLet\u2019s create a small program that takes in parameters x, y, and z. We\u2019ll create a function that adds the parameters together in different configurations. The sums of these will be printed by the function. Then we\u2019ll call the function and pass numbers into the function.\n\n\ndef\n \nadd_numbers\n(\nx\n,\n \ny\n,\n \nz\n):\n\n \na\n \n=\n \nx\n \n+\n \ny\n\n \nb\n \n=\n \nx\n \n+\n \nz\n\n \nc\n \n=\n \ny\n \n+\n \nz\n\n \nprint\n(\na\n,\n \nb\n,\n \nc\n)\n\n\n\nadd_numbers\n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n\n\n\n\nWe passed the number 1 in for the x parameter, 2 in for the y parameter, and 3 in for the z parameter. These values correspond with each parameter in the order they are given.\n\n\nThe program is essentially doing the following math based on the values we passed to the parameters:\n\n\na\n \n=\n \n1\n \n+\n \n2\n\n\nb\n \n=\n \n1\n \n+\n \n3\n\n\nc\n \n=\n \n2\n \n+\n \n3\n\n\n\n\n\n\nThe function also prints a, b, and c, and based on the math above we would expect a to be equal to 3, b to be 4, and c to be 5. Let\u2019s run the program:\n\n\npython\n \nadd_numbers\n.\npy\n\n\nOutput\n \n:\n \n3\n \n4\n \n5\n\n\n\n\n\n\nWhen we pass 1, 2, and 3 as parameters to the add_numbers() function, we receive the expected output.\n\n\nParameters are arguments that are typically defined as variables within function definitions. They can be assigned values when you run the method, passing the arguments into the function.\n\n\nKeyword Arguments\n\n\nIn addition to calling parameters in order, you can use \nkeyword arguments\n in a function call, in which the caller identifies the arguments by the parameter name.\n\n\nWhen you use keyword arguments, you can use parameters out of order because the Python interpreter will use the keywords provided to match the values to the parameters.\n\n\nLet\u2019s create a function that will show us profile information for a user. We\u2019ll pass parameters to it in the form of \nusername\n (intended as a string), and \nfollowers\n (intended as an integer).\n\n\n# Define function with parameters\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n \n\n\n\n\n\nWithin the function definition statement, \nusername\n and \nfollowers\n are contained in the parentheses of the profile_info() function. The block of the function prints out information about the user as strings, making use of the two parameters.\n\n\nNow, we can call the function and assign parameters to it:\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n\n\n\n# Call function with parameters assigned as above\n\n\nprofile_info\n(\nsammyshark\n,\n \n945\n)\n\n\n\n# Call function with keyword arguments\n\n\nprofile_info\n(\nusername\n=\nAlexAnglerfish\n,\n \nfollowers\n=\n342\n)\n\n\n\n\n\n\nIn the first function call, we have filled in the information with a username of sammyshark and followers being 945, in the second function call we used keyword arguments, assigning values to the argument variables.\n\n\nLet\u2019s run the program:\n\n\npython\n \nprofile\n.\npy\n\n\nOutput\n \n:\n \n\nUsername\n:\n \nsammyshark\n\n\nFollowers\n:\n \n945\n\n\nUsername\n:\n \nAlexAnglerfish\n\n\nFollowers\n:\n \n342\n\n\n\n\n\n\nThe output shows us the usernames and numbers of followers for both users.\n\n\nThis also permits us to modify the order of the parameters, as in this example of the same program with a different call:\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n\n\n\n# Change order of parameters\n\n\nprofile_info\n(\nfollowers\n=\n820\n,\n \nusername\n=\ncameron-catfish\n)\n\n\n\n\n\n\nWhen we run the program again with the python profile.py command, we\u2019ll receive the following output:\n\n\nOutput\n:\n\n\nUsername\n:\n \ncameron\n-\ncatfish\n\n\nFollowers\n:\n \n820\n\n\n\n\n\n\nBecause the function definition maintains the same order of print() statements, if we use keyword arguments, it does not matter which order we pass them into the function call.\n\n\nDefault Argument Values\n\n\nWe can also provide default values for one or both of the parameters. Let\u2019s create a default value for the \nfollowers\n parameter with a value of 1:\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n=\n1\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n\n\n\n\n\n\nNow, we can run the function with only the username function assigned, and the number of followers will automatically default to 1. We can also still change the number of followers if we would like.\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n=\n1\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n\n\n\nprofile_info\n(\nusername\n=\nJOctopus\n)\n\n\nprofile_info\n(\nusername\n=\nsammyshark\n,\n \nfollowers\n=\n945\n)\n\n\n\n\n\n\nWhen we run the program with the python profile.py command, we\u2019ll receive the following output:\n\n\nOutput\n:\n\n\nUsername\n:\n \nJOctopus\n\n\nFollowers\n:\n \n1\n\n\nUsername\n:\n \nsammyshark\n\n\nFollowers\n:\n \n945\n\n\n\n\n\n\nProviding default parameters with values can let us skip defining values for each argument that already has a default.\n\n\nReturning a Value\n\n\nYou can pass a parameter value into a function, and a function can also produce a value.\n\n\nA function can produce a value with the return statement, which will exit a function and optionally pass an expression back to the caller. If you use a return statement with no arguments, the function will return None.\n\n\nSo far, we have used the print() statement instead of the return statement in our functions. Let\u2019s create a program that instead of printing will return a variable.\n\n\nIn a new text file called square.py, we\u2019ll create a program that squares the parameter x and returns the variable y. We issue a call to print the result variable, which is formed by running the square() function with 3 passed into it.\n\n\ndef\n \nsquare\n(\nx\n):\n\n \ny\n \n=\n \nx\n \n**\n \n2\n\n \nreturn\n \ny\n\n\n\nresult\n \n=\n \nsquare\n(\n3\n)\n\n\nprint\n(\nresult\n)\n\n\n\n\n\n\nWe can run the program and see the output:\n\n\npython\n \nsquare\n.\npy\n\n\nOutput\n:\n\n\n9\n\n\n\n\n\n\nThe integer 9 is returned as output, which is what we would expect by asking Python to find the square of 3.\n\n\nTo further understand how the \nreturn\n statement works, we can comment out the \nreturn\n statement in the program:\n\n\ndef\n \nsquare\n(\nx\n):\n\n \ny\n \n=\n \nx\n \n**\n \n2\n\n \n# return y\n\n\n\nresult\n \n=\n \nsquare\n(\n3\n)\n\n\nprint\n(\nresult\n)\n\n\n\n\n\n\nNow, let\u2019s run the program again:\n\n\npython\n \nsquare\n.\npy\n\n\nOutput\n:\n\n\nNone\n\n\n\n\n\n\nWithout using the \nreturn\n statement here, the program cannot return a value so the value defaults to None.\n\n\nAs another example, in the \nadd_numbers.py\n program above, we could swap out the \nprint()\n statement for a return statement.\n\n\ndef\n \nadd_numbers\n(\nx\n,\n \ny\n,\n \nz\n):\n\n \na\n \n=\n \nx\n \n+\n \ny\n\n \nb\n \n=\n \nx\n \n+\n \nz\n\n \nc\n \n=\n \ny\n \n+\n \nz\n\n \nreturn\n \na\n,\n \nb\n,\n \nc\n\n\n\nsums\n \n=\n \nadd_numbers\n(\n1\n,\n \n2\n,\n \n3\n)\n\n\nprint\n(\nsums\n)\n\n\n\n\n\n\nOutside of the function, we set the variable sums equal to the result of the function taking in 1, 2, and 3 as we did above. Then we called a print of the sums variable.\n\n\nLet\u2019s run the program again now that it has the return statement:\n\n\nOutput\n:\n\n\n(\n3\n,\n \n4\n,\n \n5\n)\n\n\n\n\n\n\nWe receive the same numbers 3, 4, and 5 as output that we received previously by using the print() statement in the function. This time it is delivered as a tuple because the return statement\u2019s expression list has at least one comma.\n\n\nFunctions exit immediately when they hit a return statement, whether or not they\u2019re returning a value.\n\n\ndef\n \nloop_five\n():\n\n \nfor\n \nx\n \nin\n \nrange\n(\n0\n,\n \n25\n):\n\n \nprint\n(\nx\n)\n\n \nif\n \nx\n \n==\n \n5\n:\n\n \n# Stop function at x == 5\n\n \nreturn\n\n \nprint\n(\nThis line will not execute.\n)\n\n\n\nloop_five\n()\n\n\n\n\n\n\nUsing the \nreturn\n statement within the \nfor\n loop ends the function, so the line that is outside of the loop will not run. If, instead, we had used a \nbreak\n statement, only the loop would have exited at that time, and the last print() line would run.\n\n\nThe \nreturn\n statement exits a function, and may return a value when issued with a parameter.\n\n\nUsing \nmain()\n as a Function\n\n\nAlthough in Python you can call the function at the bottom of your program and it will run (as we have done in the examples above), many programming languages (like C++ and Java) require a main function in order to execute. Including a main() function, though not required, can structure our Python programs in a logical way that puts the most important components of the program into one function. It can also make our programs easier for non-Python programmers to read.\n\n\nWe\u2019ll start with adding a main() function to the hello.py program above. We\u2019ll keep our hello() function, and then define a main() function:\n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\ndef\n \nmain\n():\n\n\n\n\n\n\nWithin the main() function, let\u2019s include a print() statement to let us know that we\u2019re in the main() function. Additionally, let\u2019s call the hello() function within the main() function:\n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\n\ndef\n \nmain\n():\n\n \nprint\n(\nThis is the main function\n)\n\n \nhello\n()\n\n\n\n\n\n\nFinally, at the bottom of the program we\u2019ll call the main() function:\n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\ndef\n \nmain\n():\n\n \nprint\n(\nThis is the main function.\n)\n\n \nhello\n()\n\n\n\nmain\n()\n\n\n\n\n\n\nAt this point, we can run our program:\n\n\npython\n \nhello\n.\npy\n\n\nOutput\n:\n\n\nThis\n \nis\n \nthe\n \nmain\n \nfunction\n.\n\n\nHello\n,\n \nWorld\n!\n\n\n\n\n\n\nBecause we called the \nhello()\n function within main() and then only called \nmain()\n to run, the \nHello, World!\n text printed only once, after the string that told us we were in the main function.\n\n\nNext we\u2019re going to be working with multiple functions, so it is worth reviewing the variable scope of global and local variables. If you define a variable within a function block, you\u2019ll only be able to use that variable within that function. If you would like to use variables across functions it may be better to declare a global variable.\n\n\nIn Python, '_\nmain_\n' is the name of the scope where top-level code will execute. When a program is run from standard input, a script, or from an interactive prompt, its _\nname_\n is set equal to '_\nmain_\n'.\n\n\nBecause of this, there is a convention to use the following construction:\n\n\nif\n \n__name__\n \n==\n \n__main__\n:\n\n \n# Code to run when this is the main program here\n\n\n\n\n\n\nThis lets program files be used either:\n- as the main program and run what follows the if statement\n- as a module and not run what follows the if statement.\n\n\nAny code that is not contained within this statement will be executed upon running. If you\u2019re using your program file as a module, the code that is not in this statement will also execute upon its import while running the secondary file.\n\n\nLet\u2019s expand on our names.py program above, and create a new file called more_names.py. In this program we\u2019ll declare a global variable and modify our original names() function so that the instructions are in two discrete functions.\n\n\nThe first function, \nhas_vowel()\n will check to see if the name string contains a vowel.\n\n\nThe second function \nprint_letters()\n will print each letter of the \nname\n string.\n\n\n# Declare global variable name for use in all functions\n\n\nname\n \n=\n \nstr\n(\ninput\n(\nEnter your name: \n))\n\n\n\n\n# Define function to check if name contains a vowel\n\n\ndef\n \nhas_vowel\n():\n\n \nif\n \nset\n(\naeiou\n)\n.\nintersection\n(\nname\n.\nlower\n()):\n\n \nprint\n(\nYour name contains a vowel.\n)\n\n \nelse\n:\n\n \nprint\n(\nYour name does not contain a vowel.\n)\n\n\n\n\n# Iterate over letters in name string\n\n\ndef\n \nprint_letters\n():\n\n \nfor\n \nletter\n \nin\n \nname\n:\n\n \nprint\n(\nletter\n)\n\n\n\n\n\n\nWith this set up, let\u2019s define the main() function which will contain a call to both the has_vowel() and the print_letters() functions.\n\n\n# Declare global variable name for use in all functions\n\n\nname\n \n=\n \nstr\n(\ninput\n(\nEnter your name: \n))\n\n\n\n\n# Define function to check if name contains a vowel\n\n\ndef\n \nhas_vowel\n():\n\n \nif\n \nset\n(\naeiou\n)\n.\nintersection\n(\nname\n.\nlower\n()):\n\n \nprint\n(\nYour name contains a vowel.\n)\n\n \nelse\n:\n\n \nprint\n(\nYour name does not contain a vowel.\n)\n\n\n\n\n# Iterate over letters in name string\n\n\ndef\n \nprint_letters\n():\n\n \nfor\n \nletter\n \nin\n \nname\n:\n\n \nprint\n(\nletter\n)\n\n\n\n\n# Define main method that calls other functions\n\n\ndef\n \nmain\n():\n\n \nhas_vowel\n()\n\n \nprint_letters\n()\n\n\n\n\n\n\nFinally, we\u2019ll add the \nif \\__name\\__ == '\\__main\\__':\n construction at the bottom of the file. For our purposes, since we have put all the functions we would like to do in the \nmain()\n function, we\u2019ll call the \nmain()\n function following this if statement.\n\n\n# Declare global variable name for use in all functions\n\n\nname\n \n=\n \nstr\n(\ninput\n(\nEnter your name: \n))\n\n\n\n\n# Define function to check if name contains a vowel\n\n\ndef\n \nhas_vowel\n():\n\n \nif\n \nset\n(\naeiou\n)\n.\nintersection\n(\nname\n.\nlower\n()):\n\n \nprint\n(\nYour name contains a vowel.\n)\n\n \nelse\n:\n\n \nprint\n(\nYour name does not contain a vowel.\n)\n\n\n\n\n# Iterate over letters in name string\n\n\ndef\n \nprint_letters\n():\n\n \nfor\n \nletter\n \nin\n \nname\n:\n\n \nprint\n(\nletter\n)\n\n\n\n\n# Define main method that calls other functions\n\n\ndef\n \nmain\n():\n\n \nhas_vowel\n()\n\n \nprint_letters\n()\n\n\n\n\n# Execute main() function\n\n\nif\n \n__name__\n \n==\n \n__main__\n:\n\n \nmain\n()\n\n\n\n\n\n\nWe can now run the program:\n\n\npython\n \nmore_names\n.\npy\n\n\n\n\n\n\nThe program will show the same output as the names.py program, but here the code is more organized and can be used in a modular way without modification.\n\n\nIf you did not want to declare a main() function, you alternatively could have ended the program like this:\n\n\nif\n \n__name__\n \n==\n \n__main__\n:\n\n \nhas_vowel\n()\n\n \nprint_letters\n()\n\n\n\n\n\n\nUsing \nmain()\n as a function and the if _\nname_\n == '_\nmain_\n': statement can organize your code in a logical way, making it more readable and modular.\n\n\nConclusion\n\n\nFunctions are code blocks of instructions that perform actions within a program, helping to make our code reusable and modular.\n\n\nTo learn more about how to make your code more modular, you can read our guide on \nHow To Write Modules in Python 3.\n\n\n\n\nSource:\n \n\n\n https://stackoverflow.com/questions/1909512/what-is-python-used-for\n\n\n\n\nPrefer Exceptions to Returning None\n\n\nWhen writing utility functions, there\u2019s a draw for Python programmers to give special\nmeaning to the return value of None. It seems to makes sense in some cases. For example,\nsay you want a helper function that divides one number by another. In the case of dividing\nby zero, returning None seems natural because the result is undefined.\n\n\ndef\n \ndivide\n(\na\n,\n \nb\n):\n\n \ntry\n:\n\n \nreturn\n \na\n \n/\n \nb\n\n \nexcept\n \nZeroDivisionError\n:\n\n \nreturn\n \nNone\n\n\n\n\n\n\nCode using this function can interpret the return value accordingly.\n\n\nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nif\n \nresult\n \nis\n \nNone\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n\n\n\n\n\n\nWhat happens when the numerator is zero? That will cause the return value to also be zero\n(if the denominator is non-zero). This can cause problems when you evaluate the result in\na condition like an if statement. You may accidentally look for any False equivalent\nvalue to indicate errors instead of only looking for None.\n\n\nx\n,\n \ny\n \n=\n \n0\n,\n \n5\n\n\nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nif\n \nnot\n \nresult\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n \n# This is wrong!\n\n\n\n\n\n\nThis is a common mistake in Python code when None has special meaning. This is why\nreturning None from a function is error prone. There are two ways to reduce the chance of\nsuch errors. \n\n\nThe first way is to split the return value into a two-tuple. The first part of the tuple\nindicates that the operation was a success or failure. The second part is the actual result\nthat was computed.\n\n\ndef\n \ndivide\n(\na\n,\n \nb\n):\n\n \ntry\n:\n\n \nreturn\n \nTrue\n,\n \na\n \n/\n \nb\n\n \nexcept\n \nZeroDivisionError\n:\n\n \nreturn\n \nFalse\n,\n \nNone\n\n\n\n\n\n\nCallers of this function have to unpack the tuple. That forces them to consider the status\npart of the tuple instead of just looking at the result of division.\n\n\nsuccess\n,\n \nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nif\n \nnot\n \nsuccess\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n\n\n\n\n\n\nThe problem is that callers can easily ignore the first part of the tuple (using the\nunderscore variable name, a Python convention for unused variables). The resulting code\ndoesn\u2019t look wrong at first glance. This is as bad as just returning None.\n\n\n_\n,\n \nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nif\n \nnot\n \nresult\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n\n\n\n\n\n\nThe second, better way to reduce these errors is to never return None at all. Instead, raise\nan exception up to the caller and make them deal with it. Here, I turn a\nZeroDivisionError into a ValueError to indicate to the caller that the input\nvalues are bad: \n\n\ndef\n \ndivide\n(\na\n,\n \nb\n):\n\n \ntry\n:\n\n \nreturn\n \na\n \n/\n \nb\n\n \nexcept\n \nZeroDivisionError\n \nas\n \ne\n:\n\n \nraise\n \nValueError\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n \nfrom\n \ne\n\n\n\n\n\n\nNow the caller should handle the exception for the invalid input case.\nThe caller no longer requires a condition on the return value of the function. If the\nfunction didn\u2019t raise an exception, then the return value must be good. The outcome of\nexception handling is clear.\n\n\nx\n,\n \ny\n \n=\n \n5\n,\n \n2\n\n\ntry\n:\n\n \nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nexcept\n \nValueError\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n\n\nelse\n:\n\n \nprint\n(\n\u2018\nResult\n \nis\n \n%.\n1\nf\n\u2019\n \n%\n \nresult\n)\n\n\n\n\nResult\n \nis\n \n2.5\n\n\n\n\n\n\nThings to Remember\n\n\n\n\nFunctions that return None to indicate special meaning are error prone because\nNone and other values (e.g., zero, the empty string) all evaluate to False in\nconditional expressions. \n\n\nRaise exceptions to indicate special situations instead of returning None. Expect the\ncalling code to handle exceptions properly when they\u2019re documented.\n\n\n\n\n\n\nSource:\n \n\n\n \nEffective Python\n by Brett Slatkin", + "title": "Functions" + }, + { + "location": "/beginner/Functions/#function-calls", + "text": "In the context of programming, a function is a named sequence of statements that\nperforms a computation. When you define a function, you specify the name and the\nsequence of statements. Later, you can \u201ccall\u201d the function by name. We have already seen\none example of a function call: type ( 32 ) type int The name of the function is type. The expression in parentheses is called the argument\nof the function. The result, for this function, is the type of the argument. \nIt is common to say that a function \u201ctakes\u201d an argument and \u201creturns\u201d a result. The result\nis called the return value.", + "title": "Function Calls" + }, + { + "location": "/beginner/Functions/#type-conversion-functions", + "text": "Python provides built-in functions that convert values from one type to another. The\nint function takes any value and converts it to an integer, if it can, or complains\notherwise: int ( 32 ) 32 int ( Hello ) ValueError : invalid literal for int (): Hello int can convert floating-point values to integers, but it doesn\u2019t round off; it chops off\nthe fraction part: int ( 3.99999 ) 3 int ( - 2.3 ) - 2 float converts integers and strings to floating-point numbers: float ( 32 ) 32.0 float ( 3.14159 ) 3.14159 Finally, str converts its argument to a string: str ( 32 ) 32 str ( 3.14159 ) 3.14159", + "title": "Type Conversion Functions" + }, + { + "location": "/beginner/Functions/#adding-new-functions", + "text": "So far, we have only been using the functions that come with Python, but it is also possible\nto add new functions. A function definition specifies the name of a new function and\nthe sequence of statements that execute when the function is called. \nHere is an example: def print_lyrics (): \n print I m a lumberjack, and I m okay. \n print I sleep all night and I work all day. def is a keyword that indicates that this is a function definition. The name of the function\nis print_lyrics. The rules for function names are the same as for variable names: letters,\nnumbers and some punctuation marks are legal, but the first character can\u2019t be a number.\nYou can\u2019t use a keyword as the name of a function, and you should avoid having a variable\nand a function with the same name. \nThe empty parentheses after the name indicate that this function doesn\u2019t take any\narguments. \nThe first line of the function definition is called the header; the rest is called the body.\nThe header has to end with a colon and the body has to be indented. By convention, the\nindentation is always four spaces; see \u201cDebugging\u201d (page 33). The body can contain any\nnumber of statements. \nThe strings in the print statements are enclosed in double quotes. Single quotes and\ndouble quotes do the same thing; most people use single quotes except in cases like this\nwhere a single quote (which is also an apostrophe) appears in the string.\nIf you type a function definition in interactive mode, the interpreter prints ellipses (...)\nto let you know that the definition isn\u2019t complete: def print_lyrics (): \n print I m a lumberjack, and I m okay. \n print I sleep all night and I work all day. To end the function, you have to enter an empty line (this is not necessary in a script).\nDefining a function creates a variable with the same name. print print_lyrics function print_lyrics at 0xb7e99e9c type ( print_lyrics ) type function The value of print_lyrics is a function object, which has type 'function'.\nThe syntax for calling the new function is the same as for built-in functions: print_lyrics () I m a lumberjack, and I m okay . I sleep all night and I work all day . Once you have defined a function, you can use it inside another function. For example,\nto repeat the previous refrain, we could write a function called repeat_lyrics: def repeat_lyrics (): \n print_lyrics () \n print_lyrics () And then call repeat_lyrics: repeat_lyrics () I m a lumberjack, and I m okay . I sleep all night and I work all day . I m a lumberjack, and I m okay . I sleep all night and I work all day . But that\u2019s not really how the song goes.", + "title": "Adding New Functions" + }, + { + "location": "/beginner/Functions/#definitions-and-uses", + "text": "Pulling together the code fragments from the previous section, the whole program looks\nlike this: def print_lyrics (): \n print I m a lumberjack, and I m okay. \n print I sleep all night and I work all day. def repeat_lyrics (): \n print_lyrics () \n print_lyrics () repeat_lyrics () This program contains two function definitions: print_lyrics and repeat_lyrics.\nFunction definitions get executed just like other statements, but the result creates func\ntion objects. The statements inside the function do not get executed until the function\nis called, and the function definition generates no output. \nAs you might expect, you have to create a function before you can execute it. In other\nwords, the function definition has to be executed before the function is called the first\ntime.", + "title": "Definitions and Uses" + }, + { + "location": "/beginner/Functions/#flow-of-execution", + "text": "In order to ensure that a function is defined before its first use, you have to know the\norder in which statements are executed, which is called the flow of execution. \nExecution always begins at the first statement of the program. Statements are executed\none at a time, in order, from top to bottom. Function definitions do not alter the flow of execution of the program, but remember\nthat statements inside the function are not executed until the function is called.\nA function call is like a detour in the flow of execution. Instead of going to the next\nstatement, the flow jumps to the body of the function, executes all the statements there,\nand then comes back to pick up where it left off. \nThat sounds simple enough, until you remember that one function can call another.\nWhile in the middle of one function, the program might have to execute the statements\nin another function. But while executing that new function, the program might have to\nexecute yet another function! \nFortunately, Python is good at keeping track of where it is, so each time a function\ncompletes, the program picks up where it left off in the function that called it. When it\ngets to the end of the program, it terminates. \nWhat\u2019s the moral of this sordid tale? When you read a program, you don\u2019t always want\nto read from top to bottom. Sometimes it makes more sense if you follow the flow of\nexecution.", + "title": "Flow of Execution" + }, + { + "location": "/beginner/Functions/#parameters-and-arguments", + "text": "Some of the built-in functions we have seen require arguments. For example, when you\ncall math.sin you pass a number as an argument. Some functions take more than one\nargument: math.pow takes two, the base and the exponent.\nInside the function, the arguments are assigned to variables called parameters. Here is\nan example of a user-defined function that takes an argument: def print_twice ( bruce ): \n print bruce \n print bruce This function assigns the argument to a parameter named bruce. When the function is\ncalled, it prints the value of the parameter (whatever it is) twice. \nThis function works with any value that can be printed. print_twice ( Spam ) Spam Spam print_twice ( 17 ) 17 17 print_twice ( math . pi ) 3.14159265359 3.14159265359 The same rules of composition that apply to built-in functions also apply to user-defined\nfunctions, so we can use any kind of expression as an argument for print_twice : print_twice ( Spam * 4 ) Spam Spam Spam Spam Spam Spam Spam Spam print_twice ( math . cos ( math . pi )) - 1.0 - 1.0 The argument is evaluated before the function is called, so in the examples the expres\nsions 'Spam '*4 and math.cos(math.pi) are only evaluated once. \nYou can also use a variable as an argument: michael = Eric, the half a bee. print_twice ( michael ) Eric , the half a bee . Eric , the half a bee . The name of the variable we pass as an argument (michael) has nothing to do with the\nname of the parameter (bruce). It doesn\u2019t matter what the value was called back home\n(in the caller); here in print_twice, we call everybody bruce.", + "title": "Parameters and Arguments" + }, + { + "location": "/beginner/Functions/#variables-and-parameters-are-local", + "text": "When you create a variable inside a function, it is local, which means that it only exists\ninside the function. For example: def cat_twice ( part1 , part2 ): \n cat = part1 + part2 \n print_twice ( cat ) This function takes two arguments, concatenates them, and prints the result twice. Here\nis an example that uses it: line1 = Bing tiddle line2 = tiddle bang. cat_twice ( line1 , line2 ) Bing tiddle tiddle bang . Bing tiddle tiddle bang . When cat_twice terminates, the variable cat is destroyed. If we try to print it, we get\nan exception: print cat NameError : name cat is not defined Parameters are also local. For example, outside print_twice, there is no such thing as\nbruce.", + "title": "Variables and Parameters Are Local" + }, + { + "location": "/beginner/Functions/#stack-diagrams", + "text": "To keep track of which variables can be used where, it is sometimes useful to draw a\nstack diagram. Like state diagrams, stack diagrams show the value of each variable, but\nthey also show the function each variable belongs to. \nEach function is represented by a frame. A frame is a box with the name of a function\nbeside it and the parameters and variables of the function inside it. The stack diagram\nfor the previous example is shown in Figure 3-1. The frames are arranged in a stack that indicates which function called which, and so\non. In this example, print_twice was called by cat_twice, and cat_twice was called\nby \\__main\\__ , which is a special name for the topmost frame. When you create a variable\noutside of any function, it belongs to \\__main\\__ . Each parameter refers to the same value as its corresponding argument. So, part1 has\nthe same value as line1, part2 has the same value as line2, and bruce has the same\nvalue as cat.\nIf an error occurs during a function call, Python prints the name of the function, and\nthe name of the function that called it, and the name of the function that called that, all\nthe way back to \\__main__\\ . For example, if you try to access cat from within print_twice, you get a NameError: Traceback ( innermost last ): \n File test.py , line 13 , in __main__ \n cat_twice ( line1 , line2 ) \n File test.py , line 5 , in cat_twice \n print_twice ( cat ) \n File test.py , line 9 , in print_twice \n print cat \n NameError : name cat is not defined This list of functions is called a traceback. It tells you what program file the error oc\ncurred in, and what line, and what functions were executing at the time. It also shows\nthe line of code that caused the error.\nThe order of the functions in the traceback is the same as the order of the frames in the\nstack diagram. The function that is currently running is listed at the bottom.", + "title": "Stack Diagrams" + }, + { + "location": "/beginner/Functions/#fruitful-functions-and-void-functions", + "text": "Some of the functions we are using, such as the math functions, yield results; for lack of\na better name, I call them fruitful functions. Other functions, like print_twice, per\nform an action but don\u2019t return a value. They are called void functions.\nWhen you call a fruitful function, you almost always want to do something with the\nresult; for example, you might assign it to a variable or use it as part of an expression: x = math . cos ( radians ) golden = ( math . sqrt ( 5 ) + 1 ) / 2 When you call a function in interactive mode, Python displays the result: math . sqrt ( 5 ) 2.2360679774997898 But in a script, if you call a fruitful function all by itself, the return value is lost forever! math . sqrt ( 5 ) This script computes the square root of 5, but since it doesn\u2019t store or display the result,\nit is not very useful.\nVoid functions might display something on the screen or have some other effect, but\nthey don\u2019t have a return value. If you try to assign the result to a variable, you get a special\nvalue called None. result = print_twice ( Bing ) Bing Bing print result None The value None is not the same as the string 'None'. It is a special value that has its own\ntype: print type ( None ) type NoneType The functions we have written so far are all void. We will start writing fruitful functions\nin a few chapters.", + "title": "Fruitful Functions and Void Functions" + }, + { + "location": "/beginner/Functions/#why-functions", + "text": "It may not be clear why it is worth the trouble to divide a program into functions. There\nare several reasons: \n- Creating a new function gives you an opportunity to name a group of statements,\nwhich makes your program easier to read and debug.\n- Functions can make a program smaller by eliminating repetitive code. Later, if you\nmake a change, you only have to make it in one place.\n- Dividing a long program into functions allows you to debug the parts one at a time\nand then assemble them into a working whole.\n- Well-designed functions are often useful for many programs. Once you write and\ndebug one, you can reuse it. Source: Think Python by Allen B. Downey - 2012", + "title": "Why Functions?" + }, + { + "location": "/beginner/Functions/#functions-by-by-mark-lutz-learning-python-fourth-edition", + "text": "", + "title": "Functions by by Mark Lutz (Learning Python, Fourth Edition)" + }, + { + "location": "/beginner/Functions/#function-basics", + "text": "In Part III, we looked at basic procedural statements in Python. Here, we\u2019ll move on to\nexplore a set of additional statements that we can use to create functions of our own. \nIn simple terms, a function is a device that groups a set of statements so they can be run\nmore than once in a program. Functions also can compute a result value and let us\nspecify parameters that serve as function inputs, which may differ each time the code\nis run. Coding an operation as a function makes it a generally useful tool, which we\ncan use in a variety of contexts. \nMore fundamentally, functions are the alternative to programming by cutting and\npasting\u2014rather than having multiple redundant copies of an operation\u2019s code, we can\nfactor it into a single function. In so doing, we reduce our future work radically: if the\noperation must be changed later, we only have one copy to update, not many. \nFunctions are the most basic program structure Python provides for maximizing code\nreuse and minimizing code redundancy. As we\u2019ll see, functions are also a design tool\nthat lets us split complex systems into manageable parts. Table 16-1 summarizes the\nprimary function-related tools we\u2019ll study in this part of the book. Statement | Examples | ------|------| Calls | myfunc('spam', 'eggs', meat=ham) | def, return | def adder(a, b=1, c): return a + b + c[0]| global | def changer():global x; x = 'new' | nonlocal | def changer():nonlocal x; x = 'new'| yield | def squares(x):for i in range(x): yield i 2 | lambda | funcs = [lambda x: x 2, lambda x: x 3]", + "title": "Function Basics" + }, + { + "location": "/beginner/Functions/#why-use-functions", + "text": "Before we get into the details, let\u2019s establish a clear picture of what functions are all\nabout. Functions are a nearly universal program-structuring device. You may have\ncome across them before in other languages, where they may have been called subroutines\nor procedures. As a brief introduction, functions serve two primary development\nroles: Maximizing code reuse and minimizing redundancy \nAs in most programming languages, Python functions are the simplest way to\npackage logic you may wish to use in more than one place and more than one time.\nUp until now, all the code we\u2019ve been writing has run immediately. Functions allow\nus to group and generalize code to be used arbitrarily many times later. Because\nthey allow us to code an operation in a single place and use it in many places,\nPython functions are the most basic factoring tool in the language: they allow us\nto reduce code redundancy in our programs, and thereby reduce maintenance\neffort. Procedural decomposition \nFunctions also provide a tool for splitting systems into pieces that have well-defined\nroles. For instance, to make a pizza from scratch, you would start by mixing the\ndough, rolling it out, adding toppings, baking it, and so on. If you were programming\na pizza-making robot, functions would help you divide the overall \u201cmake\npizza\u201d task into chunks\u2014one function for each subtask in the process. It\u2019s easier\nto implement the smaller tasks in isolation than it is to implement the entire process\nat once. In general, functions are about procedure\u2014how to do something, rather\nthan what you\u2019re doing it to. We\u2019ll see why this distinction matters in Part VI, when\nwe start making new object with classes. In this part of the book, we\u2019ll explore the tools used to code functions in Python: function\nbasics, scope rules, and argument passing, along with a few related concepts such\nas generators and functional tools. Because its importance begins to become more apparent\nat this level of coding, we\u2019ll also revisit the notion of polymorphism introduced\nearlier in the book. As you\u2019ll see, functions don\u2019t imply much new syntax, but they do\nlead us to some bigger programming ideas.", + "title": "Why Use Functions?" + }, + { + "location": "/beginner/Functions/#coding-functions", + "text": "Although it wasn\u2019t made very formal, we\u2019ve already used some functions in earlier\nchapters. For instance, to make a file object, we called the built-in open function; similarly,\nwe used the len built-in function to ask for the number of items in a collection\nobject. \nIn this chapter, we will explore how to write new functions in Python. Functions we\nwrite behave the same way as the built-ins we\u2019ve already seen: they are called in expressions, are passed values, and return results. But writing new functions requires\nthe application of a few additional ideas that haven\u2019t yet been introduced. Moreover,\nfunctions behave very differently in Python than they do in compiled languages like C.\nHere is a brief introduction to the main concepts behind Python functions, all of which\nwe will study in this part of the book: def is executable code. Python functions are written with a new statement, the\ndef. Unlike functions in compiled languages such as C, def is an executable statement\u2014\nyour function does not exist until Python reaches and runs the def. In fact,\nit\u2019s legal (and even occasionally useful) to nest def statements inside if statements,\nwhile loops, and even other defs. In typical operation, def statements are coded in\nmodule files and are naturally run to generate functions when a module file is first\nimported. def creates an object and assigns it to a name. When Python reaches and runs\na def statement, it generates a new function object and assigns it to the function\u2019s\nname. As with all assignments, the function name becomes a reference to the function\nobject. There\u2019s nothing magic about the name of a function\u2014as you\u2019ll see,\nthe function object can be assigned to other names, stored in a list, and so on.\nFunction objects may also have arbitrary user-defined attributes attached to them\nto record data. lambda creates an object but returns it as a result. Functions may also be created\nwith the lambda expression, a feature that allows us to in-line function definitions\nin places where a def statement won\u2019t work syntactically return sends a result object back to the caller. When a function is called, the\ncaller stops until the function finishes its work and returns control to the caller.\nFunctions that compute a value send it back to the caller with a return statement;\nthe returned value becomes the result of the function call. yield sends a result object back to the caller, but remembers where it left\noff. Functions known as generators may also use the yield statement to send back\na value and suspend their state such that they may be resumed later, to produce a\nseries of results over time. This is another advanced topic covered later in this part\nof the book. global declares module-level variables that are to be assigned. By default, all\nnames assigned in a function are local to that function and exist only while the\nfunction runs. To assign a name in the enclosing module, functions need to list it\nin a global statement. More generally, names are always looked up in scopes\u2014\nplaces where variables are stored\u2014and assignments bind names to scopes. nonlocal declares enclosing function variables that are to be assigned. Similarly,\nthe nonlocal statement added in Python 3.0 allows a function to assign a\nname that exists in the scope of a syntactically enclosing def statement. This allows\nenclosing functions to serve as a place to retain state\u2014information remembered\nwhen a function is called\u2014without using shared global names. Arguments are passed by assignment (object reference). In Python, arguments\nare passed to functions by assignment (which, as we\u2019ve learned, means by object\nreference). As you\u2019ll see, in Python\u2019s model the caller and function share objects\nby references, but there is no name aliasing. Changing an argument name within\na function does not also change the corresponding name in the caller, but changing\npassed-in mutable objects can change objects shared by the caller. Arguments, return values, and variables are not declared. As with everything\nin Python, there are no type constraints on functions. In fact, nothing about a\nfunction needs to be declared ahead of time: you can pass in arguments of any type,\nreturn any kind of object, and so on. As one consequence, a single function can\noften be applied to a variety of object types\u2014any objects that sport a compatible\ninterface (methods and expressions) will do, regardless of their specific types. If some of the preceding words didn\u2019t sink in, don\u2019t worry\u2014we\u2019ll explore all of these\nconcepts with real code in this part of the book. Let\u2019s get started by expanding on some\nof these ideas and looking at a few examples.", + "title": "Coding Functions" + }, + { + "location": "/beginner/Functions/#def-statements", + "text": "The def statement creates a function object and assigns it to a name. Its general format\nis as follows: def name ( arg1 , arg2 , ... argN ): \n statements As with all compound Python statements, def consists of a header line followed by a\nblock of statements, usually indented (or a simple statement after the colon). The\nstatement block becomes the function\u2019s body\u2014that is, the code Python executes each\ntime the function is called. \nThe def header line specifies a function name that is assigned the function object, along\nwith a list of zero or more arguments (sometimes called parameters) in parentheses.\nThe argument names in the header are assigned to the objects passed in parentheses at\nthe point of call. Function bodies often contain a return statement: def name ( arg1 , arg2 , ... argN ): \n ... \n return value The Python return statement can show up anywhere in a function body; it ends the\nfunction call and sends a result back to the caller. The return statement consists of an\nobject expression that gives the function\u2019s result. The return statement is optional; if\nit\u2019s not present, the function exits when the control flow falls off the end of the function\nbody. Technically, a function without a return statement returns the None object automatically,\nbut this return value is usually ignored.", + "title": "def Statements" + }, + { + "location": "/beginner/Functions/#def-executes-at-runtime", + "text": "The Python def is a true executable statement: when it runs, it creates a new function\nobject and assigns it to a name. (Remember, all we have in Python is runtime; there is\nno such thing as a separate compile time.) Because it\u2019s a statement, a def can appear\nanywhere a statement can\u2014even nested in other statements. For instance, although\ndefs normally are run when the module enclosing them is imported, it\u2019s also completely\nlegal to nest a function def inside an if statement to select between alternative\ndefinitions: if test : \n def func (): # Define func this way ... else : \n def func (): # Or else this way \n ... \n ... func () # Call the version selected and built One way to understand this code is to realize that the def is much like an = statement:\nit simply assigns a name at runtime. Unlike in compiled languages such as C, Python\nfunctions do not need to be fully defined before the program runs. More generally,\ndefs are not evaluated until they are reached and run, and the code inside defs is not\nevaluated until the functions are later called.\nBecause function definition happens at runtime, there\u2019s nothing special about the\nfunction name. What\u2019s important is the object to which it refers: othername = func # Assign function object othername () # Call func again Here, the function was assigned to a different name and called through the new name.\nLike everything else in Python, functions are just objects; they are recorded explicitly\nin memory at program execution time. In fact, besides calls, functions allow arbitrary\nattributes to be attached to record information for later use: def func (): ... # Create function object func () # Call object func . attr = value # Attach attributes", + "title": "def Executes at Runtime" + }, + { + "location": "/beginner/Functions/#a-first-example-definitions-and-calls", + "text": "Apart from such runtime concepts (which tend to seem most unique to programmers\nwith backgrounds in traditional compiled languages), Python functions are straightforward\nto use. Let\u2019s code a first real example to demonstrate the basics. As you\u2019ll see,\nthere are two sides to the function picture: a definition (the def that creates a function)\nand a call (an expression that tells Python to run the function\u2019s body).", + "title": "A First Example: Definitions and Calls" + }, + { + "location": "/beginner/Functions/#definition", + "text": "Here\u2019s a definition typed interactively that defines a function called times, which returns\nthe product of its two arguments: def times ( x , y ): # Create and assign function ... return x * y # Body executed when called ... When Python reaches and runs this def, it creates a new function object that packages\nthe function\u2019s code and assigns the object to the name times. Typically, such a statement\nis coded in a module file and runs when the enclosing file is imported; for something\nthis small, though, the interactive prompt suffices.", + "title": "Definition" + }, + { + "location": "/beginner/Functions/#calls", + "text": "After the def has run, you can call (run) the function in your program by adding\nparentheses after the function\u2019s name. The parentheses may optionally contain one or\nmore object arguments, to be passed (assigned) to the names in the function\u2019s header: times ( 2 , 4 ) # Arguments in parentheses 8 This expression passes two arguments to times. As mentioned previously, arguments\nare passed by assignment, so in this case the name x in the function header is assigned\nthe value 2, y is assigned the value 4, and the function\u2019s body is run. For this function,\nthe body is just a return statement that sends back the result as the value of the call\nexpression. The returned object was printed here interactively (as in most languages,\n2 * 4 is 8 in Python), but if we needed to use it later we could instead assign it to a\nvariable. For example: x = times ( 3.14 , 4 ) # Save the result object x 12.56 Now, watch what happens when the function is called a third time, with very different\nkinds of objects passed in: times ( Ni , 4 ) # Functions are typeless NiNiNiNi This time, our function means something completely different (Monty Python reference\nagain intended). In this third call, a string and an integer are passed to x and y, instead\nof two numbers. Recall that * works on both numbers and sequences; because we never\ndeclare the types of variables, arguments, or return values in Python, we can use\ntimes to either multiply numbers or repeat sequences. \nIn other words, what our times function means and does depends on what we pass into\nit. This is a core idea in Python (and perhaps the key to using the language well), which\nwe\u2019ll explore in the next section. Source: Learning Python, Fourth Edition by Mark Lutz - 2009", + "title": "Calls" + }, + { + "location": "/beginner/Functions/#how-to-define-functions-in-python-3", + "text": "A function is a block of instructions that performs an action and, once defined, can be reused. Functions make code more modular, allowing you to use the same code over and over again. Python has a number of built-in functions that you may be familiar with, including: print() which will print an object to the terminal int() which will convert a string or number data type to an integer data type len() which returns the length of an object Function names include parentheses and may include parameters. In this tutorial, we\u2019ll go over how to define your own functions to use in your coding projects.", + "title": "How To Define Functions in Python 3" + }, + { + "location": "/beginner/Functions/#defining-a-function", + "text": "Let\u2019s start with turning the classic \u201cHello, World!\u201d program into a function. We\u2019ll create a new text file in our text editor of choice, and call the program hello.py. Then, we\u2019ll define the function. A function is defined by using the def keyword, followed by a name of your choosing, followed by a set of parentheses which hold any parameters the function will take (they can be empty), and ending with a colon. In this case, we\u2019ll define a function named hello(): def hello (): This sets up the initial statement for creating a function. From here, we\u2019ll add a second line with a 4-space indent to provide the instructions for what the function does. In this case, we\u2019ll be printing Hello, World! to the console: def hello (): \n print ( Hello, World! ) Our function is now fully defined, but if we run the program at this point, nothing will happen since we didn\u2019t call the function. So, outside of our defined function block, let\u2019s call the function with hello(): def hello (): \n print ( Hello, World! ) hello () Now, let\u2019s run the program: python hello . py You should receive the following output: Hello , World ! Functions can be more complicated than the hello() function we defined above. For example, we can use for loops, conditional statements, and more within our function block. For example, the function defined below utilizes a conditional statement to check if the input for the name variable contains a vowel, then uses a for loop to iterate over the letters in the name string. # Define function names() def names (): \n # Set up name variable with input \n name = str ( input ( Enter your name: )) \n # Check whether name has a vowel \n if set ( aeiou ) . intersection ( name . lower ()): \n print ( Your name contains a vowel. ) \n else : \n print ( Your name does not contain a vowel. ) \n\n # Iterate over name \n for letter in name : \n print ( letter ) # Call the function names () The names() function we defined above sets up a conditional statement and a for loop, showing how code can be organized within a function definition. However, depending on what we intend with our program and how we want to set up our code, we may want to define the conditional statement and the for loop as two separate functions. Defining functions within a program makes our code modular and reusable so that we can call the same functions without rewriting them.", + "title": "Defining a Function" + }, + { + "location": "/beginner/Functions/#working-with-parameters", + "text": "So far we have looked at functions with empty parentheses that do not take arguments, but we can define parameters in function definitions within their parentheses. A parameter is a named entity in a function definition, specifying an argument that the function can accept. Let\u2019s create a small program that takes in parameters x, y, and z. We\u2019ll create a function that adds the parameters together in different configurations. The sums of these will be printed by the function. Then we\u2019ll call the function and pass numbers into the function. def add_numbers ( x , y , z ): \n a = x + y \n b = x + z \n c = y + z \n print ( a , b , c ) add_numbers ( 1 , 2 , 3 ) We passed the number 1 in for the x parameter, 2 in for the y parameter, and 3 in for the z parameter. These values correspond with each parameter in the order they are given. The program is essentially doing the following math based on the values we passed to the parameters: a = 1 + 2 b = 1 + 3 c = 2 + 3 The function also prints a, b, and c, and based on the math above we would expect a to be equal to 3, b to be 4, and c to be 5. Let\u2019s run the program: python add_numbers . py Output : 3 4 5 When we pass 1, 2, and 3 as parameters to the add_numbers() function, we receive the expected output. Parameters are arguments that are typically defined as variables within function definitions. They can be assigned values when you run the method, passing the arguments into the function.", + "title": "Working with Parameters" + }, + { + "location": "/beginner/Functions/#keyword-arguments", + "text": "In addition to calling parameters in order, you can use keyword arguments in a function call, in which the caller identifies the arguments by the parameter name. When you use keyword arguments, you can use parameters out of order because the Python interpreter will use the keywords provided to match the values to the parameters. Let\u2019s create a function that will show us profile information for a user. We\u2019ll pass parameters to it in the form of username (intended as a string), and followers (intended as an integer). # Define function with parameters def profile_info ( username , followers ): \n print ( Username: + username ) \n print ( Followers: + str ( followers )) Within the function definition statement, username and followers are contained in the parentheses of the profile_info() function. The block of the function prints out information about the user as strings, making use of the two parameters. Now, we can call the function and assign parameters to it: def profile_info ( username , followers ): \n print ( Username: + username ) \n print ( Followers: + str ( followers )) # Call function with parameters assigned as above profile_info ( sammyshark , 945 ) # Call function with keyword arguments profile_info ( username = AlexAnglerfish , followers = 342 ) In the first function call, we have filled in the information with a username of sammyshark and followers being 945, in the second function call we used keyword arguments, assigning values to the argument variables. Let\u2019s run the program: python profile . py Output : Username : sammyshark Followers : 945 Username : AlexAnglerfish Followers : 342 The output shows us the usernames and numbers of followers for both users. This also permits us to modify the order of the parameters, as in this example of the same program with a different call: def profile_info ( username , followers ): \n print ( Username: + username ) \n print ( Followers: + str ( followers )) # Change order of parameters profile_info ( followers = 820 , username = cameron-catfish ) When we run the program again with the python profile.py command, we\u2019ll receive the following output: Output : Username : cameron - catfish Followers : 820 Because the function definition maintains the same order of print() statements, if we use keyword arguments, it does not matter which order we pass them into the function call.", + "title": "Keyword Arguments" + }, + { + "location": "/beginner/Functions/#default-argument-values", + "text": "We can also provide default values for one or both of the parameters. Let\u2019s create a default value for the followers parameter with a value of 1: def profile_info ( username , followers = 1 ): \n print ( Username: + username ) \n print ( Followers: + str ( followers )) Now, we can run the function with only the username function assigned, and the number of followers will automatically default to 1. We can also still change the number of followers if we would like. def profile_info ( username , followers = 1 ): \n print ( Username: + username ) \n print ( Followers: + str ( followers )) profile_info ( username = JOctopus ) profile_info ( username = sammyshark , followers = 945 ) When we run the program with the python profile.py command, we\u2019ll receive the following output: Output : Username : JOctopus Followers : 1 Username : sammyshark Followers : 945 Providing default parameters with values can let us skip defining values for each argument that already has a default.", + "title": "Default Argument Values" + }, + { + "location": "/beginner/Functions/#returning-a-value", + "text": "You can pass a parameter value into a function, and a function can also produce a value. A function can produce a value with the return statement, which will exit a function and optionally pass an expression back to the caller. If you use a return statement with no arguments, the function will return None. So far, we have used the print() statement instead of the return statement in our functions. Let\u2019s create a program that instead of printing will return a variable. In a new text file called square.py, we\u2019ll create a program that squares the parameter x and returns the variable y. We issue a call to print the result variable, which is formed by running the square() function with 3 passed into it. def square ( x ): \n y = x ** 2 \n return y result = square ( 3 ) print ( result ) We can run the program and see the output: python square . py Output : 9 The integer 9 is returned as output, which is what we would expect by asking Python to find the square of 3. To further understand how the return statement works, we can comment out the return statement in the program: def square ( x ): \n y = x ** 2 \n # return y result = square ( 3 ) print ( result ) Now, let\u2019s run the program again: python square . py Output : None Without using the return statement here, the program cannot return a value so the value defaults to None. As another example, in the add_numbers.py program above, we could swap out the print() statement for a return statement. def add_numbers ( x , y , z ): \n a = x + y \n b = x + z \n c = y + z \n return a , b , c sums = add_numbers ( 1 , 2 , 3 ) print ( sums ) Outside of the function, we set the variable sums equal to the result of the function taking in 1, 2, and 3 as we did above. Then we called a print of the sums variable. Let\u2019s run the program again now that it has the return statement: Output : ( 3 , 4 , 5 ) We receive the same numbers 3, 4, and 5 as output that we received previously by using the print() statement in the function. This time it is delivered as a tuple because the return statement\u2019s expression list has at least one comma. Functions exit immediately when they hit a return statement, whether or not they\u2019re returning a value. def loop_five (): \n for x in range ( 0 , 25 ): \n print ( x ) \n if x == 5 : \n # Stop function at x == 5 \n return \n print ( This line will not execute. ) loop_five () Using the return statement within the for loop ends the function, so the line that is outside of the loop will not run. If, instead, we had used a break statement, only the loop would have exited at that time, and the last print() line would run. The return statement exits a function, and may return a value when issued with a parameter.", + "title": "Returning a Value" + }, + { + "location": "/beginner/Functions/#using-main-as-a-function", + "text": "Although in Python you can call the function at the bottom of your program and it will run (as we have done in the examples above), many programming languages (like C++ and Java) require a main function in order to execute. Including a main() function, though not required, can structure our Python programs in a logical way that puts the most important components of the program into one function. It can also make our programs easier for non-Python programmers to read. We\u2019ll start with adding a main() function to the hello.py program above. We\u2019ll keep our hello() function, and then define a main() function: def hello (): \n print ( Hello, World! ) def main (): Within the main() function, let\u2019s include a print() statement to let us know that we\u2019re in the main() function. Additionally, let\u2019s call the hello() function within the main() function: def hello (): \n print ( Hello, World! ) def main (): \n print ( This is the main function ) \n hello () Finally, at the bottom of the program we\u2019ll call the main() function: def hello (): \n print ( Hello, World! ) def main (): \n print ( This is the main function. ) \n hello () main () At this point, we can run our program: python hello . py Output : This is the main function . Hello , World ! Because we called the hello() function within main() and then only called main() to run, the Hello, World! text printed only once, after the string that told us we were in the main function. Next we\u2019re going to be working with multiple functions, so it is worth reviewing the variable scope of global and local variables. If you define a variable within a function block, you\u2019ll only be able to use that variable within that function. If you would like to use variables across functions it may be better to declare a global variable. In Python, '_ main_ ' is the name of the scope where top-level code will execute. When a program is run from standard input, a script, or from an interactive prompt, its _ name_ is set equal to '_ main_ '. Because of this, there is a convention to use the following construction: if __name__ == __main__ : \n # Code to run when this is the main program here This lets program files be used either:\n- as the main program and run what follows the if statement\n- as a module and not run what follows the if statement. Any code that is not contained within this statement will be executed upon running. If you\u2019re using your program file as a module, the code that is not in this statement will also execute upon its import while running the secondary file. Let\u2019s expand on our names.py program above, and create a new file called more_names.py. In this program we\u2019ll declare a global variable and modify our original names() function so that the instructions are in two discrete functions. The first function, has_vowel() will check to see if the name string contains a vowel. The second function print_letters() will print each letter of the name string. # Declare global variable name for use in all functions name = str ( input ( Enter your name: )) # Define function to check if name contains a vowel def has_vowel (): \n if set ( aeiou ) . intersection ( name . lower ()): \n print ( Your name contains a vowel. ) \n else : \n print ( Your name does not contain a vowel. ) # Iterate over letters in name string def print_letters (): \n for letter in name : \n print ( letter ) With this set up, let\u2019s define the main() function which will contain a call to both the has_vowel() and the print_letters() functions. # Declare global variable name for use in all functions name = str ( input ( Enter your name: )) # Define function to check if name contains a vowel def has_vowel (): \n if set ( aeiou ) . intersection ( name . lower ()): \n print ( Your name contains a vowel. ) \n else : \n print ( Your name does not contain a vowel. ) # Iterate over letters in name string def print_letters (): \n for letter in name : \n print ( letter ) # Define main method that calls other functions def main (): \n has_vowel () \n print_letters () Finally, we\u2019ll add the if \\__name\\__ == '\\__main\\__': construction at the bottom of the file. For our purposes, since we have put all the functions we would like to do in the main() function, we\u2019ll call the main() function following this if statement. # Declare global variable name for use in all functions name = str ( input ( Enter your name: )) # Define function to check if name contains a vowel def has_vowel (): \n if set ( aeiou ) . intersection ( name . lower ()): \n print ( Your name contains a vowel. ) \n else : \n print ( Your name does not contain a vowel. ) # Iterate over letters in name string def print_letters (): \n for letter in name : \n print ( letter ) # Define main method that calls other functions def main (): \n has_vowel () \n print_letters () # Execute main() function if __name__ == __main__ : \n main () We can now run the program: python more_names . py The program will show the same output as the names.py program, but here the code is more organized and can be used in a modular way without modification. If you did not want to declare a main() function, you alternatively could have ended the program like this: if __name__ == __main__ : \n has_vowel () \n print_letters () Using main() as a function and the if _ name_ == '_ main_ ': statement can organize your code in a logical way, making it more readable and modular.", + "title": "Using main() as a Function" + }, + { + "location": "/beginner/Functions/#conclusion", + "text": "Functions are code blocks of instructions that perform actions within a program, helping to make our code reusable and modular. To learn more about how to make your code more modular, you can read our guide on How To Write Modules in Python 3. Source: https://stackoverflow.com/questions/1909512/what-is-python-used-for", + "title": "Conclusion" + }, + { + "location": "/beginner/Functions/#prefer-exceptions-to-returning-none", + "text": "When writing utility functions, there\u2019s a draw for Python programmers to give special\nmeaning to the return value of None. It seems to makes sense in some cases. For example,\nsay you want a helper function that divides one number by another. In the case of dividing\nby zero, returning None seems natural because the result is undefined. def divide ( a , b ): \n try : \n return a / b \n except ZeroDivisionError : \n return None Code using this function can interpret the return value accordingly. result = divide ( x , y ) if result is None : \n print ( \u2018 Invalid inputs \u2019 ) What happens when the numerator is zero? That will cause the return value to also be zero\n(if the denominator is non-zero). This can cause problems when you evaluate the result in\na condition like an if statement. You may accidentally look for any False equivalent\nvalue to indicate errors instead of only looking for None. x , y = 0 , 5 result = divide ( x , y ) if not result : \n print ( \u2018 Invalid inputs \u2019 ) # This is wrong! This is a common mistake in Python code when None has special meaning. This is why\nreturning None from a function is error prone. There are two ways to reduce the chance of\nsuch errors. The first way is to split the return value into a two-tuple. The first part of the tuple\nindicates that the operation was a success or failure. The second part is the actual result\nthat was computed. def divide ( a , b ): \n try : \n return True , a / b \n except ZeroDivisionError : \n return False , None Callers of this function have to unpack the tuple. That forces them to consider the status\npart of the tuple instead of just looking at the result of division. success , result = divide ( x , y ) if not success : \n print ( \u2018 Invalid inputs \u2019 ) The problem is that callers can easily ignore the first part of the tuple (using the\nunderscore variable name, a Python convention for unused variables). The resulting code\ndoesn\u2019t look wrong at first glance. This is as bad as just returning None. _ , result = divide ( x , y ) if not result : \n print ( \u2018 Invalid inputs \u2019 ) The second, better way to reduce these errors is to never return None at all. Instead, raise\nan exception up to the caller and make them deal with it. Here, I turn a\nZeroDivisionError into a ValueError to indicate to the caller that the input\nvalues are bad: def divide ( a , b ): \n try : \n return a / b \n except ZeroDivisionError as e : \n raise ValueError ( \u2018 Invalid inputs \u2019 ) from e Now the caller should handle the exception for the invalid input case.\nThe caller no longer requires a condition on the return value of the function. If the\nfunction didn\u2019t raise an exception, then the return value must be good. The outcome of\nexception handling is clear. x , y = 5 , 2 try : \n result = divide ( x , y ) except ValueError : \n print ( \u2018 Invalid inputs \u2019 ) else : \n print ( \u2018 Result is %. 1 f \u2019 % result ) Result is 2.5", + "title": "Prefer Exceptions to Returning None" + }, + { + "location": "/beginner/Functions/#things-to-remember", + "text": "Functions that return None to indicate special meaning are error prone because\nNone and other values (e.g., zero, the empty string) all evaluate to False in\nconditional expressions. Raise exceptions to indicate special situations instead of returning None. Expect the\ncalling code to handle exceptions properly when they\u2019re documented. Source: Effective Python by Brett Slatkin", + "title": "Things to Remember" + }, { - "location": "/advanced/Python_Metaclasses/", - "text": "Quick Tip: What Is a Metaclass in Python\n\n\nThis quick tip gives a brief overview of what we mean by a metaclass in Python and shows some examples of the concept.\n\n\nBefore delving into this article, I should point out an important point \nabout classes in Python\n which makes it easier for us to grasp the concept of metaclasses.\n\n\nIs a Class an Object in Python?!\n\n\nIf you've used a programming language other than Python, the concept you understood about classes is most likely that it is a way used to create new objects. This is also true in Python, but Python even takes it one more step further\u2014classes are also considered objects!\n\n\nSo, if you created the following class in Python:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \npass\n\n\n\n\n\n\nThis simply means that an object with the name myClass has been created in memory. Since this object is able to create new objects, it is considered a class. This means we can apply object operations on classes in Python, as classes are objects themselves.\n\n\nWe can thus do operations on classes like assigning the class to a variable, as follows:\n\n\nclass_object\n \n=\n \nmyClass\n()\n\n\nprint\n \nclass_object\n\n\n\n\n\n\nWhich returns:\n\n\n__main__\n.\nmyClass\n \nobject\n \nat\n \n0x102623610\n\n\n\n\n\n\nYou can even pass the class \nmyClass\n as a parameter to a method, as follows:\n\n\ndef\n \nclass_object\n(\nobject\n):\n\n \nprint\n \nobject\n\n\n\nclass_object\n(\nmyClass\n)\n\n\n\n\n\n\nWhich returns the following output:\n\n\nclass\n \n__main__\n.\nmyClass\n\n\n\n\n\n\nIn addition to other operations you can normally apply on objects.\n\n\nMetaclasses\n\n\nMaybe you have come across the \ntype\n keyword in Python? You most likely used it to check the type of some object, as shown in the following examples:\n\n\nprint\n \ntype\n(\nabder\n)\n\n\nprint\n \ntype\n(\n100\n)\n\n\nprint\n \ntype\n(\n100.0\n)\n\n\nprint\n \ntype\n(\nint\n)\n\n\n\n\n\n\nIn which case you would get the following output:\n\n\ntype\n \nstr\n\n\ntype\n \nint\n\n\ntype\n \nfloat\n\n\ntype\n \ntype\n\n\n\n\n\n\nLooking at the output, everything seems pretty clear until you come to the type type. To see what this might mean, let's go back to our class we defined at the beginning of this article:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \npass\n\n\n\n\n\n\nNow, do the following:\n\n\nprint\n \ntype\n(\nmyClass\n)\n\n\n\n\n\n\nWhat would be the output of this statement? It will surprisingly be:\n\n\ntype\n \ntype\n\n\n\n\n\n\nSo, we can conclude that the type of classes in Python is \ntype\n!\n\n\nWhat is the relation between a \ntype\n and a \nmetaclass\n? Well, a \ntype\n is a \nmetaclass\n, provided that the default \nmetaclass\n is \ntype\n. I know this might be confusing, especially that type can be used to return the class of some object as shown above, but this is due to the backward compatibility in Python. So, if you write:\n\n\nprint\n \ntype\n(\ntype\n)\n\n\n\n\n\n\nYou will get:\n\n\ntype\n \ntype\n\n\n\n\n\n\nMeaning that a \ntype\n is a \ntype\n!\n\n\nThe term \nmetaclass\n simply means something used to create classes. In other words, it is the class of a class, meaning that the instance of a class in this case is a class. Thus, \ntype\n is considered a \nmetaclass\n since the instance of a \ntype\n is a class.\n\n\nFor instance, when we mentioned the following statement above:\n\n\nclass_object\n \n=\n \nmyClass\n()\n\n\n\n\n\n\nThis simply builds an object/instance of the class \nmyClass\n. In other words, we used a class to create an object. \n\n\nIn the same way, when we did the following:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \npass\n\n\n\n\n\n\nThe \nmetaclass\n was used to create the class \nmyClass\n (which is considered a \ntype\n). So, like the object being an instance of a class, a class is an instance of a \nmetaclass\n.\n\n\nUsing Metaclass to Create a Class\n\n\nIn this section, we are going to see how we can use a \nmetaclass\n to create a class, rather than using the \nclass\n statement as we saw in the classes and objects tutorial. As we saw above, the default \nmetaclass\n is \ntype\n. Thus, we can use the following statement to create a new class:\n\n\nnew_class\n \n=\n \ntype\n(\nmyClass\n,(),{})\n\n\n\n\n\n\nIf you want to make things simpler, you can assign the same class name myClass to the variable name.\n\n\nThe dictionary \n{ }\n here is used to define the attributes of the class. So, having the following statement:\n\n\nmyClass\n \n=\n \ntype\n(\nmyClass\n,(),{\na\n:\nTrue\n})\n\n\n\n\n\n\nIs similar to:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \na\n \n=\n \nTrue\n\n\n\n\n\n\nThe \nmetaclass\n Attribute\n\n\nSay that we created the class \nmyClass\n as follows:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \n__metaclass__\n \n=\n \nmyMetaClass\n\n \npass\n\n\n\n\n\n\nIn this case, class creation will occur using myMetaClass instead of type, as follows:\n\n\nmyClass\n \n=\n \nmyMetaClass\n(\nclassName\n,\n \nbases\n,\n \ndictionary\n)\n\n\n\n\n\n\nCreation and Initialization of a Metaclass\n\n\nIf you want to have control on how you create and initialize a class after its creation, you can simply use the metaclass \nnew\n method and \ninit\n constructor, respectively. So, when myMetaClass above is called, this is what will be happening behind the scenes:\n\n\nmyClass\n \n=\n \nmyMetaClass\n.\n__new__\n(\nmyMetaClass\n,\n \nname\n,\n \nbases\n,\n \ndictionary\n)\n\n\nmyMetaClass\n.\n__init__\n(\nmyClass\n,\n \nname\n,\n \nbases\n,\n \ndictionary\n)\n\n\n\n\n\n\n\n\nSource:\n \n\n\n https://code.tutsplus.com/tutorials/quick-tip-what-is-a-metaclass-in-python--cms-26016\n\n\n\n\n\n\nUnderstanding Python metaclasses from Ionelmc.ro\n\n\nA quick overview\n\n\nA high level explanation is necessary before we get down to the details.\n\n\nA class is an object, and just like any other object, it's an instance of something: a metaclass. The default metaclass is type. Unfortunately, due to backwards compatibility, type is a bit confusing: it can also be used as a function that return the class [13] of an object:\n\n\n \nclass\n \nFoobar\n:\n\n\n...\n \npass\n\n\n...\n\n\n \ntype\n(\nFoobar\n)\n\n\nclass\n \ntype\n\n\n \nfoo\n \n=\n \nFoobar\n()\n\n\n \ntype\n(\nfoo\n)\n\n\nclass\n \n__main__\n.\nFoobar\n\n\n\n\n\n\nIf you're familiar with the isinstance builtin then you'll know this:\n\n\n \nisinstance\n(\nfoo\n,\n \nFoobar\n)\n\n\nTrue\n\n\n \nisinstance\n(\nFoobar\n,\n \ntype\n)\n\n\nTrue\n\n\n\n\n\n\nTo put this in picture:\n\n\n \n\n\nBut lets go back to making classes ...\n\n\nSimple metaclass use\n\n\nWe can use type directly to make a class, without any class statement:\n\n\n \nMyClass\n \n=\n \ntype\n(\nMyClass\n,\n \n(),\n \n{})\n\n\n \nMyClass\n\n\nclass\n \n__main__\n.\nMyClass\n\n\n\n\n\n\nThe class statement isn't just syntactic sugar, it does some extra things, like setting an adequate \nqualname\n and \ndoc\n properties or calling \nprepare\n.\n\n\nWe can make a custom metaclass:\n\n\n \nclass\n \nMeta\n(\ntype\n):\n\n\n...\n \npass\n\n\n\n\n\n\nAnd then we can use it :\n\n\n \nclass\n \nComplex\n(\nmetaclass\n=\nMeta\n):\n\n\n...\n \npass\n\n\n \ntype\n(\nComplex\n)\n\n\nclass\n \n__main__\n.\nMeta\n\n\n\n\n\n\nNow we got a rough idea of what we'll be dealing with ...\n\n\nMagic methods\n\n\nOne distinctive feature of Python is magic methods: they allow the programmer to override behavior for various operators and behavior of objects. To override the call operator you'd do this:\n\n\n \nclass\n \nFunky\n:\n\n\n...\n \ndef\n \n__call__\n(\nself\n):\n\n\n...\n \nprint\n(\nLook at me, I work like a function!\n)\n\n\n \nf\n \n=\n \nFunky\n()\n\n\n \nf\n()\n\n\nLook\n \nat\n \nme\n,\n \nI\n \nwork\n \nlike\n \na\n \nfunction\n!\n\n\n\n\n\n\nMetaclasses rely on several magic methods so it's quite useful to know a bit more about them.\n\n\nThe slots\n\n\nWhen you define a magic method in your class the function will end up as a pointer in a struct that describes the class, in addition to the entry in \ndict\n. That struct [7] has a field for each magic method. For some reason these fields are called type slots.\n\n\nNow there's another feature, implemented via the \nslots\n attribute. A class with \nslots\n will create instances that don't have a \ndict\n (they use a little bit less memory). A side-effect of this is that instances cannot have other fields than what was specified in \nslots\n: if you try to set an unexpected field you'll get an exception.\n\n\nFor the scope of this article when slots are mentioned it will mean the type slots, not \nslots\n.\n\n\nObject attribute lookup\n\n\nNow this is something that's easy to get wrong because of the many slight differences to old-style objects in Python 2. \n\n\nAssuming Class is the class and instance is an instance of Class, evaluating instance.foobar roughly equates to this:\n\n\n\n\nCall the type slot for Class.\ngetattribute\n (tp_getattro). The default does this: \n\n\nDoes Class.\ndict\n have a foobar item that is a data descriptor ? \n\n\nIf yes, return the result of Class.\ndict\n['foobar'].\nget\n(instance, Class). \n\n\n\n\n\n\nDoes instance.\ndict\n have a foobar item in it? \n\n\nIf yes, return instance.\ndict\n['foobar']. \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item that is not a data descriptor ? \n\n\nIf yes, return the result of Class.\ndict\n['foobar'].\nget\n(instance, klass). \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item ? \n\n\nIf yes, return the result of Class.\ndict\n['foobar']. \n\n\n\n\n\n\n\n\n\n\nIf the attribute still wasn't found, and there's a Class.\ngetattr\n, call Class.\ngetattr\n('foobar').\n\n\n\n\nStill not clear? Perhaps a diagram normal attribute lookup helps:\n\n\n\n\n\nTo avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.\n\n\n\n\nClass attribute lookup\n\n\nBecause classes needs to be able support the classmethod and staticmethod properties [6] when you evaluate something like Class.foobar the lookup is slightly different than what would happen when you evaluate instance.foobar.\n\n\nAssuming Class is an instance of Metaclass, evaluating Class.foobar roughly equates to this:\n\n\n\n\nCall the type slot for Metaclass.\ngetattribute\n (tp_getattro). The default does this: \n\n\nDoes Metaclass.\ndict\n have a foobar item that is a data descriptor ?\n\n\nIf yes, return the result of Metaclass.\ndict\n['foobar'].\nget\n(Class, Metaclass). \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item that is a descriptor (of any kind)?\n\n\nIf yes, return the result of Class.\ndict\n['foobar'].\nget\n(None, Class). \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item in it?\n\n\nIf yes, return Class.\ndict\n['foobar'].\n\n\n\n\n\n\nDoes Metaclass.\ndict\n have a foobar item that is not a data descriptor ?\n\n\nIf yes, return the result of Metaclass.\ndict\n['foobar'].\nget\n(Class, Metaclass).\n\n\n\n\n\n\nDoes Metaclass.\ndict\n have any foobar item?\n\n\nIf yes, return Metaclass.\ndict\n['foobar'].\n\n\n\n\n\n\n\n\n\n\nIf the attribute still wasn't found, and there's a Metaclass.\ngetattr\n, call Metaclass.\ngetattr\n('foobar').\n\n\n\n\nThe whole shebang would look like this in a diagram:\n\n\n\n\n\nTo avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.\n\n\n\n\nMagic method lookup\n\n\nFor magic methods the lookup is done on the class, directly in the big struct with the slots:\n\n\n\n\nDoes the object's class have a slot for that magic method (roughly object-\nob_type-\ntp_\n in C code)? If yes, use it. If it's NULL then the operation is not supported.\n\n\n\n\n\n\nIn C internals parlance:\n - object-\nob_type is the class of the object. \n\n - ob_type-\ntp_\n is the type slot.\n\n\n\n\nThis looks much simpler, however, the type slots are filled with wrappers around your functions, so descriptors work as expected:\n\n\n \nclass\n \nMagic\n:\n\n\n...\n \n@property\n\n\n...\n \ndef\n \n__repr__\n(\nself\n):\n\n\n...\n \ndef\n \ninner\n():\n\n\n...\n \nreturn\n \nIt works!\n\n\n...\n \nreturn\n \ninner\n\n\n...\n\n\n \nrepr\n(\nMagic\n())\n\n\nIt works!\n\n\n\n\n\n\nThats it. Does that mean there are places that don't follow those rules and lookup the slot differently? Sadly yes, read on ...\n\n\nThe \nnew\n method\n\n\nOne of the most common point of confusion with both classes and metaclasses is the \nnew\n method. It has some very special conventions.\n\n\nThe \nnew\n method is the constructor (it returns the new instance) while \ninit\n is just a initializer (the instance is already created when \ninit\n is called).\n\n\nSuppose have a class like this:\n\n\nclass\n \nFoobar\n:\n\n \ndef\n \n__new__\n(\ncls\n):\n\n \nreturn\n \nsuper\n()\n.\n__new__\n(\ncls\n)\n\n\n\n\n\n\nNow if you recall the previous section, you'd expect that __new__ would be looked up on the metaclass, but alas, it wouldn't be so useful that way so it's looked up statically.\n\n\nWhen the Foobar class wants this magic method it will be looked up on the same object (the class), not on a upper level like all the other magic methods. This is very important to understand, because both the class and the metaclass can define this method:\n\n\n\n\nFoobar.__new__ is used to create instances of Foobar\n\n\ntype.__new__ is used to create the Foobar class (an instance of type in the example)\n\n\n\n\nThe \nprepare\n method\n\n\nThis method is called before the class body is executed and it must return a dictionary-like object that's used as the local namespace for all the code from the class body. It was added in Python 3.0, see \nPEP-3115\n.\n\n\nIf your __prepare__ returns an object x then this:\n\n\nclass\n \nClass\n(\nmetaclass\n=\nMeta\n):\n\n \na\n \n=\n \n1\n\n \nb\n \n=\n \n2\n\n \nc\n \n=\n \n3\n\n\n\n\n\n\nWill make the following changes to x:\n\n\nx\n[\na\n]\n \n=\n \n1\n\n\nx\n[\nb\n]\n \n=\n \n2\n\n\nx\n[\nc\n]\n \n=\n \n3\n\n\n\n\n\n\nThis x object needs to look like a dictionary. Note that this x object will end up as an argument to Metaclass.__new\n and if it's not an instance of dict you need to convert it before calling super().__new\n.\n\n\nInterestingly enough this method doesn't have __new__'s special lookup. It appears it doesn't have it's own type slot and it's looked up via the class attribute lookup, if you read back a bit. \n\n\nPutting it all together\n\n\nTo start things off, a diagram of how instances are constructed:\n\n\n\nHow to read this swim lane diagram: \n\n\n\n\nThe horizontal lanes is the place where you define the functions.\n\n\nSolid lines mean a function call.\n\n\nA line from Metaclass.__call\n to Class.__new\n means Metaclass.__call\n will call Class.__new\n.\n\n\n\n\n\n\nDashed lines means something is returned.\n\n\nClass.\nnew\n returns the instance of Class.\n\n\nMetaclass.\ncall\n returns whatever Class.\nnew\n returned (and if it returned an instance of Class it will also call Class.\ninit\n on it). \n\n\n\n\n\n\nThe number in the red circle signifies the call order.\n\n\n\n\nCreating a class is quite similar:\n\n\n\nFew more notes:\n- Metaclass.\nprepare\n just returns the namespace object (a dictionary-like object as explained before).\n- Metaclass.\nnew\n returns the Class object.\n- MetaMetaclass.\ncall\n returns whatever Metaclass.\nnew\n returned (and if it returned an instance of Metaclass it will also call Metaclass.\ninit\n on it). \n\n\nSo you see, metaclasses allow you to customize almost every part of an object life-cycle.\n\n\nMetaclasses are callables\n\n\nIf you look again at the diagrams, you'll notice that making an instance goes through Metaclass.\ncall\n. This means you can use any callable as the metaclass:\n\n\n \nclass\n \nFoo\n(\nmetaclass\n=\nprint\n):\n \n# pointless, but illustrative\n\n\n...\n \npass\n\n\n...\n\n\nFoo\n \n()\n \n{\n__module__\n:\n \n__main__\n,\n \n__qualname__\n:\n \nFoo\n}\n\n\n \nprint\n(\nFoo\n)\n\n\nNone\n\n\n\n\n\n\nIf you use a function as the metaclass then subclasses won't inherit your function metaclass, but the type of whatever that function returned.\n\n\nSubclasses inherit the metaclass\n\n\nOne advantage compared to class decorators is the fact that subclasses inherit the metaclass.\n\n\nThis is a consequence of the fact that Metaclass(...) returns an object which usually has Metaclass as the \nclass\n.\n\n\nRestrictions with multiple metaclasses\n\n\nIn the same tone of classes allowing you to have multiple baseclasses, each one of those baseclasses may have a different metaclass. But with a twist: everything has to be linear - the inheritance tree must have a single leaf.\n\n\nFor example, this is not accepted because there would be two leafs (Meta1 and Meta2):\n\n\n \nclass\n \nMeta1\n(\ntype\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nMeta2\n(\ntype\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase1\n(\nmetaclass\n=\nMeta1\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase2\n(\nmetaclass\n=\nMeta2\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nFoobar\n(\nBase1\n,\n \nBase2\n):\n\n\n...\n \npass\n\n\n...\n\n\nTraceback\n \n(\nmost\n \nrecent\n \ncall\n \nlast\n):\n\n \nFile\n \nstdin\n,\n \nline\n \n1\n,\n \nin\n \nmodule\n\n\nTypeError\n:\n \nmetaclass\n \nconflict\n:\n \nthe\n \nmetaclass\n \nof\n \na\n \nderived\n \nclass\n \nmust\n \nbe\n \na\n \n(\nnon\n-\nstrict\n)\n \nsubclass\n \nof\n \nthe\n \nmetaclasses\n \nof\n \nall\n \nits\n \nbases\n\n\n\n\n\n\nThis will work (and will use the leaf as the metaclass):\n\n\n \nclass\n \nMeta\n(\ntype\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nSubMeta\n(\nMeta\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase1\n(\nmetaclass\n=\nMeta\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase2\n(\nmetaclass\n=\nSubMeta\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nFoobar\n(\nBase1\n,\n \nBase2\n):\n\n\n...\n \npass\n\n\n...\n\n\n \ntype\n(\nFoobar\n)\n\n\nclass\n \n__main__\n.\nSubMeta\n\n\n\n\n\n\nThe method signatures\n\n\nThere are still few important details missing, like the method signatures. Lets look at class and metaclass with all the important stuff implemented.\n\n\nNote the extra **kwargs - those are the extra keywords arguments you can pass in the class statement. \n\n\n \nclass\n \nMeta\n(\ntype\n):\n\n\n...\n \n@classmethod\n\n\n...\n \ndef\n \n__prepare__\n(\nmcs\n,\n \nname\n,\n \nbases\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__prepare__(mcs=\n%s\n, name=\n%r\n, bases=\n%s\n, **\n%s\n)\n \n%\n \n(\n\n\n...\n \nmcs\n,\n \nname\n,\n \nbases\n,\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \n{}\n\n\n\n\n\n\nAs mentioned before, __prepare\n can return objects that are not dict instances, so you need to make sure your __new\n handles that.\n\n\n...\n \ndef\n \n__new__\n(\nmcs\n,\n \nname\n,\n \nbases\n,\n \nattrs\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__new__(mcs=\n%s\n, name=\n%r\n, bases=\n%s\n, attrs=[\n%s\n], **\n%s\n)\n \n%\n \n(\n\n\n...\n \nmcs\n,\n \nname\n,\n \nbases\n,\n \n, \n.\njoin\n(\nattrs\n),\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__new__\n(\nmcs\n,\n \nname\n,\n \nbases\n,\n \nattrs\n)\n\n\n\n\n\n\nIt's uncommon to see \ninit\n being implemented in a metaclass because it's not that powerful - the class is already constructed when \ninit\n is called. It roughly equates to having a class decorator with the difference that \ninit\n would get run when making subclasses, while class decorators are not called for subclasses.\n\n\n...\n \ndef\n \n__init__\n(\ncls\n,\n \nname\n,\n \nbases\n,\n \nattrs\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__init__(cls=\n%s\n, name=\n%r\n, bases=\n%s\n, attrs=[\n%s\n], **\n%s\n)\n \n%\n \n(\n\n\n...\n \ncls\n,\n \nname\n,\n \nbases\n,\n \n, \n.\njoin\n(\nattrs\n),\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__init__\n(\nname\n,\n \nbases\n,\n \nattrs\n)\n\n\n\n\n\n\nThe __call__ method will be called when you make instances of Class.\n\n\n...\n \ndef\n \n__call__\n(\ncls\n,\n \n*\nargs\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__call__(cls=\n%s\n, args=\n%s\n, kwargs=\n%s\n)\n \n%\n \n(\n\n\n...\n \ncls\n,\n \nargs\n,\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__call__\n(\n*\nargs\n,\n \n**\nkwargs\n)\n\n\n...\n\n\n\n\n\n\nUsing Meta, note the extra=1: \n\n\n \nclass\n \nClass\n(\nmetaclass\n=\nMeta\n,\n \nextra\n=\n1\n):\n\n\n...\n \ndef\n \n__new__\n(\ncls\n,\n \nmyarg\n):\n\n\n...\n \nprint\n(\n Class.__new__(cls=\n%s\n, myarg=\n%s\n)\n \n%\n \n(\n\n\n...\n \ncls\n,\n \nmyarg\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__new__\n(\ncls\n)\n\n\n...\n\n\n...\n \ndef\n \n__init__\n(\nself\n,\n \nmyarg\n):\n\n\n...\n \nprint\n(\n Class.__init__(self=\n%s\n, myarg=\n%s\n)\n \n%\n \n(\n\n\n...\n \nself\n,\n \nmyarg\n\n\n...\n \n))\n\n\n...\n \nself\n.\nmyarg\n \n=\n \nmyarg\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__init__\n()\n\n\n...\n\n\n...\n \ndef\n \n__str__\n(\nself\n):\n\n\n...\n \nreturn\n \ninstance of Class; myargs=\n%s\n \n%\n \n(\n\n\n...\n \ngetattr\n(\nself\n,\n \nmyarg\n,\n \nMISSING\n),\n\n\n...\n \n)\n\n \nMeta\n.\n__prepare__\n(\nmcs\n=\nclass\n \n__main__\n.\nMeta\n, name=\nClass\n, bases=(),\n\n \n**\n{\nextra\n:\n \n1\n})\n\n \nMeta\n.\n__new__\n(\nmcs\n=\nclass\n \n__main__\n.\nMeta\n, name=\nClass\n, bases=(),\n\n \nattrs\n=\n[\n__qualname__\n,\n \n__new__\n,\n \n__init__\n,\n \n__str__\n,\n \n__module__\n],\n\n \n**\n{\nextra\n:\n \n1\n})\n\n \nMeta\n.\n__init__\n(\ncls\n=\nclass\n \n__main__\n.\nClass\n, name=\nClass\n, bases=(),\n\n \nattrs\n=\n[\n__qualname__\n,\n \n__new__\n,\n \n__init__\n,\n \n__str__\n,\n \n__module__\n],\n\n \n**\n{\nextra\n:\n \n1\n})\n\n\n\n\n\n\nNote that Meta.__call__ is called when we make instance of Class:\n\n\n \nClass\n(\n1\n)\n\n \nMeta\n.\n__call__\n(\ncls\n=\nclass\n \n__main__\n.\nClass\n, args=(1,), kwargs={})\n\n \nClass\n.\n__new__\n(\ncls\n=\nclass\n \n__main__\n.\nClass\n, myarg=1)\n\n \nClass\n.\n__init__\n(\nself\n=\ninstance\n \nof\n \nClass\n;\n \nmyargs\n=\nMISSING\n,\n \nmyarg\n=\n1\n)\n\n\ninstance\n \nof\n \nClass\n;\n \nmyargs\n=\n1\n\n\n\n\n\n\n\n\nSource:\n \n\n\n https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/", + "location": "/advanced/Python_Metaclasses/", + "text": "Quick Tip: What Is a Metaclass in Python\n\n\nThis quick tip gives a brief overview of what we mean by a metaclass in Python and shows some examples of the concept.\n\n\nBefore delving into this article, I should point out an important point \nabout classes in Python\n which makes it easier for us to grasp the concept of metaclasses.\n\n\nIs a Class an Object in Python?!\n\n\nIf you've used a programming language other than Python, the concept you understood about classes is most likely that it is a way used to create new objects. This is also true in Python, but Python even takes it one more step further\u2014classes are also considered objects!\n\n\nSo, if you created the following class in Python:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \npass\n\n\n\n\n\n\nThis simply means that an object with the name myClass has been created in memory. Since this object is able to create new objects, it is considered a class. This means we can apply object operations on classes in Python, as classes are objects themselves.\n\n\nWe can thus do operations on classes like assigning the class to a variable, as follows:\n\n\nclass_object\n \n=\n \nmyClass\n()\n\n\nprint\n \nclass_object\n\n\n\n\n\n\nWhich returns:\n\n\n__main__\n.\nmyClass\n \nobject\n \nat\n \n0x102623610\n\n\n\n\n\n\nYou can even pass the class \nmyClass\n as a parameter to a method, as follows:\n\n\ndef\n \nclass_object\n(\nobject\n):\n\n \nprint\n \nobject\n\n\n\nclass_object\n(\nmyClass\n)\n\n\n\n\n\n\nWhich returns the following output:\n\n\nclass\n \n__main__\n.\nmyClass\n\n\n\n\n\n\nIn addition to other operations you can normally apply on objects.\n\n\nMetaclasses\n\n\nMaybe you have come across the \ntype\n keyword in Python? You most likely used it to check the type of some object, as shown in the following examples:\n\n\nprint\n \ntype\n(\nabder\n)\n\n\nprint\n \ntype\n(\n100\n)\n\n\nprint\n \ntype\n(\n100.0\n)\n\n\nprint\n \ntype\n(\nint\n)\n\n\n\n\n\n\nIn which case you would get the following output:\n\n\ntype\n \nstr\n\n\ntype\n \nint\n\n\ntype\n \nfloat\n\n\ntype\n \ntype\n\n\n\n\n\n\nLooking at the output, everything seems pretty clear until you come to the type type. To see what this might mean, let's go back to our class we defined at the beginning of this article:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \npass\n\n\n\n\n\n\nNow, do the following:\n\n\nprint\n \ntype\n(\nmyClass\n)\n\n\n\n\n\n\nWhat would be the output of this statement? It will surprisingly be:\n\n\ntype\n \ntype\n\n\n\n\n\n\nSo, we can conclude that the type of classes in Python is \ntype\n!\n\n\nWhat is the relation between a \ntype\n and a \nmetaclass\n? Well, a \ntype\n is a \nmetaclass\n, provided that the default \nmetaclass\n is \ntype\n. I know this might be confusing, especially that type can be used to return the class of some object as shown above, but this is due to the backward compatibility in Python. So, if you write:\n\n\nprint\n \ntype\n(\ntype\n)\n\n\n\n\n\n\nYou will get:\n\n\ntype\n \ntype\n\n\n\n\n\n\nMeaning that a \ntype\n is a \ntype\n!\n\n\nThe term \nmetaclass\n simply means something used to create classes. In other words, it is the class of a class, meaning that the instance of a class in this case is a class. Thus, \ntype\n is considered a \nmetaclass\n since the instance of a \ntype\n is a class.\n\n\nFor instance, when we mentioned the following statement above:\n\n\nclass_object\n \n=\n \nmyClass\n()\n\n\n\n\n\n\nThis simply builds an object/instance of the class \nmyClass\n. In other words, we used a class to create an object. \n\n\nIn the same way, when we did the following:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \npass\n\n\n\n\n\n\nThe \nmetaclass\n was used to create the class \nmyClass\n (which is considered a \ntype\n). So, like the object being an instance of a class, a class is an instance of a \nmetaclass\n.\n\n\nUsing Metaclass to Create a Class\n\n\nIn this section, we are going to see how we can use a \nmetaclass\n to create a class, rather than using the \nclass\n statement as we saw in the classes and objects tutorial. As we saw above, the default \nmetaclass\n is \ntype\n. Thus, we can use the following statement to create a new class:\n\n\nnew_class\n \n=\n \ntype\n(\nmyClass\n,(),{})\n\n\n\n\n\n\nIf you want to make things simpler, you can assign the same class name myClass to the variable name.\n\n\nThe dictionary \n{ }\n here is used to define the attributes of the class. So, having the following statement:\n\n\nmyClass\n \n=\n \ntype\n(\nmyClass\n,(),{\na\n:\nTrue\n})\n\n\n\n\n\n\nIs similar to:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \na\n \n=\n \nTrue\n\n\n\n\n\n\nThe \nmetaclass\n Attribute\n\n\nSay that we created the class \nmyClass\n as follows:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \n__metaclass__\n \n=\n \nmyMetaClass\n\n \npass\n\n\n\n\n\n\nIn this case, class creation will occur using myMetaClass instead of type, as follows:\n\n\nmyClass\n \n=\n \nmyMetaClass\n(\nclassName\n,\n \nbases\n,\n \ndictionary\n)\n\n\n\n\n\n\nCreation and Initialization of a Metaclass\n\n\nIf you want to have control on how you create and initialize a class after its creation, you can simply use the metaclass \nnew\n method and \ninit\n constructor, respectively. So, when myMetaClass above is called, this is what will be happening behind the scenes:\n\n\nmyClass\n \n=\n \nmyMetaClass\n.\n__new__\n(\nmyMetaClass\n,\n \nname\n,\n \nbases\n,\n \ndictionary\n)\n\n\nmyMetaClass\n.\n__init__\n(\nmyClass\n,\n \nname\n,\n \nbases\n,\n \ndictionary\n)\n\n\n\n\n\n\n\n\nSource:\n \n\n\n https://code.tutsplus.com/tutorials/quick-tip-what-is-a-metaclass-in-python--cms-26016\n\n\n\n\n\n\nUnderstanding Python metaclasses from Ionelmc.ro\n\n\nA quick overview\n\n\nA high level explanation is necessary before we get down to the details.\n\n\nA class is an object, and just like any other object, it's an instance of something: a metaclass. The default metaclass is type. Unfortunately, due to backwards compatibility, type is a bit confusing: it can also be used as a function that return the class [13] of an object:\n\n\n \nclass\n \nFoobar\n:\n\n\n...\n \npass\n\n\n...\n\n\n \ntype\n(\nFoobar\n)\n\n\nclass\n \ntype\n\n\n \nfoo\n \n=\n \nFoobar\n()\n\n\n \ntype\n(\nfoo\n)\n\n\nclass\n \n__main__\n.\nFoobar\n\n\n\n\n\n\nIf you're familiar with the isinstance builtin then you'll know this:\n\n\n \nisinstance\n(\nfoo\n,\n \nFoobar\n)\n\n\nTrue\n\n\n \nisinstance\n(\nFoobar\n,\n \ntype\n)\n\n\nTrue\n\n\n\n\n\n\nTo put this in picture:\n\n\n \n\n\nBut lets go back to making classes ...\n\n\nSimple metaclass use\n\n\nWe can use type directly to make a class, without any class statement:\n\n\n \nMyClass\n \n=\n \ntype\n(\nMyClass\n,\n \n(),\n \n{})\n\n\n \nMyClass\n\n\nclass\n \n__main__\n.\nMyClass\n\n\n\n\n\n\nThe class statement isn't just syntactic sugar, it does some extra things, like setting an adequate \nqualname\n and \ndoc\n properties or calling \nprepare\n.\n\n\nWe can make a custom metaclass:\n\n\n \nclass\n \nMeta\n(\ntype\n):\n\n\n...\n \npass\n\n\n\n\n\n\nAnd then we can use it :\n\n\n \nclass\n \nComplex\n(\nmetaclass\n=\nMeta\n):\n\n\n...\n \npass\n\n\n \ntype\n(\nComplex\n)\n\n\nclass\n \n__main__\n.\nMeta\n\n\n\n\n\n\nNow we got a rough idea of what we'll be dealing with ...\n\n\nMagic methods\n\n\nOne distinctive feature of Python is magic methods: they allow the programmer to override behavior for various operators and behavior of objects. To override the call operator you'd do this:\n\n\n \nclass\n \nFunky\n:\n\n\n...\n \ndef\n \n__call__\n(\nself\n):\n\n\n...\n \nprint\n(\nLook at me, I work like a function!\n)\n\n\n \nf\n \n=\n \nFunky\n()\n\n\n \nf\n()\n\n\nLook\n \nat\n \nme\n,\n \nI\n \nwork\n \nlike\n \na\n \nfunction\n!\n\n\n\n\n\n\nMetaclasses rely on several magic methods so it's quite useful to know a bit more about them.\n\n\nThe slots\n\n\nWhen you define a magic method in your class the function will end up as a pointer in a struct that describes the class, in addition to the entry in \ndict\n. That struct [7] has a field for each magic method. For some reason these fields are called type slots.\n\n\nNow there's another feature, implemented via the \nslots\n attribute. A class with \nslots\n will create instances that don't have a \ndict\n (they use a little bit less memory). A side-effect of this is that instances cannot have other fields than what was specified in \nslots\n: if you try to set an unexpected field you'll get an exception.\n\n\nFor the scope of this article when slots are mentioned it will mean the type slots, not \nslots\n.\n\n\nObject attribute lookup\n\n\nNow this is something that's easy to get wrong because of the many slight differences to old-style objects in Python 2. \n\n\nAssuming Class is the class and instance is an instance of Class, evaluating instance.foobar roughly equates to this:\n\n\n\n\nCall the type slot for Class.\ngetattribute\n (tp_getattro). The default does this: \n\n\nDoes Class.\ndict\n have a foobar item that is a data descriptor ? \n\n\nIf yes, return the result of Class.\ndict\n['foobar'].\nget\n(instance, Class). \n\n\n\n\n\n\nDoes instance.\ndict\n have a foobar item in it? \n\n\nIf yes, return instance.\ndict\n['foobar']. \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item that is not a data descriptor ? \n\n\nIf yes, return the result of Class.\ndict\n['foobar'].\nget\n(instance, klass). \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item ? \n\n\nIf yes, return the result of Class.\ndict\n['foobar']. \n\n\n\n\n\n\n\n\n\n\nIf the attribute still wasn't found, and there's a Class.\ngetattr\n, call Class.\ngetattr\n('foobar').\n\n\n\n\nStill not clear? Perhaps a diagram normal attribute lookup helps:\n\n\n\n\n\nTo avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.\n\n\n\n\nClass attribute lookup\n\n\nBecause classes needs to be able support the classmethod and staticmethod properties [6] when you evaluate something like Class.foobar the lookup is slightly different than what would happen when you evaluate instance.foobar.\n\n\nAssuming Class is an instance of Metaclass, evaluating Class.foobar roughly equates to this:\n\n\n\n\nCall the type slot for Metaclass.\ngetattribute\n (tp_getattro). The default does this: \n\n\nDoes Metaclass.\ndict\n have a foobar item that is a data descriptor ?\n\n\nIf yes, return the result of Metaclass.\ndict\n['foobar'].\nget\n(Class, Metaclass). \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item that is a descriptor (of any kind)?\n\n\nIf yes, return the result of Class.\ndict\n['foobar'].\nget\n(None, Class). \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item in it?\n\n\nIf yes, return Class.\ndict\n['foobar'].\n\n\n\n\n\n\nDoes Metaclass.\ndict\n have a foobar item that is not a data descriptor ?\n\n\nIf yes, return the result of Metaclass.\ndict\n['foobar'].\nget\n(Class, Metaclass).\n\n\n\n\n\n\nDoes Metaclass.\ndict\n have any foobar item?\n\n\nIf yes, return Metaclass.\ndict\n['foobar'].\n\n\n\n\n\n\n\n\n\n\nIf the attribute still wasn't found, and there's a Metaclass.\ngetattr\n, call Metaclass.\ngetattr\n('foobar').\n\n\n\n\nThe whole shebang would look like this in a diagram:\n\n\n\n\n\nTo avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.\n\n\n\n\nMagic method lookup\n\n\nFor magic methods the lookup is done on the class, directly in the big struct with the slots:\n\n\n\n\nDoes the object's class have a slot for that magic method (roughly object-\nob_type-\ntp_\n in C code)? If yes, use it. If it's NULL then the operation is not supported.\n\n\n\n\n\n\nIn C internals parlance:\n - object-\nob_type is the class of the object. \n\n - ob_type-\ntp_\n is the type slot.\n\n\n\n\nThis looks much simpler, however, the type slots are filled with wrappers around your functions, so descriptors work as expected:\n\n\n \nclass\n \nMagic\n:\n\n\n...\n \n@property\n\n\n...\n \ndef\n \n__repr__\n(\nself\n):\n\n\n...\n \ndef\n \ninner\n():\n\n\n...\n \nreturn\n \nIt works!\n\n\n...\n \nreturn\n \ninner\n\n\n...\n\n\n \nrepr\n(\nMagic\n())\n\n\nIt works!\n\n\n\n\n\n\nThats it. Does that mean there are places that don't follow those rules and lookup the slot differently? Sadly yes, read on ...\n\n\nThe \nnew\n method\n\n\nOne of the most common point of confusion with both classes and metaclasses is the \nnew\n method. It has some very special conventions.\n\n\nThe \nnew\n method is the constructor (it returns the new instance) while \ninit\n is just a initializer (the instance is already created when \ninit\n is called).\n\n\nSuppose have a class like this:\n\n\nclass\n \nFoobar\n:\n\n \ndef\n \n__new__\n(\ncls\n):\n\n \nreturn\n \nsuper\n()\n.\n__new__\n(\ncls\n)\n\n\n\n\n\n\nNow if you recall the previous section, you'd expect that __new__ would be looked up on the metaclass, but alas, it wouldn't be so useful that way so it's looked up statically.\n\n\nWhen the Foobar class wants this magic method it will be looked up on the same object (the class), not on a upper level like all the other magic methods. This is very important to understand, because both the class and the metaclass can define this method:\n\n\n\n\nFoobar.__new__ is used to create instances of Foobar\n\n\ntype.__new__ is used to create the Foobar class (an instance of type in the example)\n\n\n\n\nThe \nprepare\n method\n\n\nThis method is called before the class body is executed and it must return a dictionary-like object that's used as the local namespace for all the code from the class body. It was added in Python 3.0, see \nPEP-3115\n.\n\n\nIf your __prepare__ returns an object x then this:\n\n\nclass\n \nClass\n(\nmetaclass\n=\nMeta\n):\n\n \na\n \n=\n \n1\n\n \nb\n \n=\n \n2\n\n \nc\n \n=\n \n3\n\n\n\n\n\n\nWill make the following changes to x:\n\n\nx\n[\na\n]\n \n=\n \n1\n\n\nx\n[\nb\n]\n \n=\n \n2\n\n\nx\n[\nc\n]\n \n=\n \n3\n\n\n\n\n\n\nThis x object needs to look like a dictionary. Note that this x object will end up as an argument to Metaclass.__new\n and if it's not an instance of dict you need to convert it before calling super().__new\n.\n\n\nInterestingly enough this method doesn't have __new__'s special lookup. It appears it doesn't have it's own type slot and it's looked up via the class attribute lookup, if you read back a bit. \n\n\nPutting it all together\n\n\nTo start things off, a diagram of how instances are constructed:\n\n\n\nHow to read this swim lane diagram: \n\n\n\n\nThe horizontal lanes is the place where you define the functions.\n\n\nSolid lines mean a function call.\n\n\nA line from Metaclass.__call\n to Class.__new\n means Metaclass.__call\n will call Class.__new\n.\n\n\n\n\n\n\nDashed lines means something is returned.\n\n\nClass.\nnew\n returns the instance of Class.\n\n\nMetaclass.\ncall\n returns whatever Class.\nnew\n returned (and if it returned an instance of Class it will also call Class.\ninit\n on it). \n\n\n\n\n\n\nThe number in the red circle signifies the call order.\n\n\n\n\nCreating a class is quite similar:\n\n\n\nFew more notes:\n- Metaclass.\nprepare\n just returns the namespace object (a dictionary-like object as explained before).\n- Metaclass.\nnew\n returns the Class object.\n- MetaMetaclass.\ncall\n returns whatever Metaclass.\nnew\n returned (and if it returned an instance of Metaclass it will also call Metaclass.\ninit\n on it). \n\n\nSo you see, metaclasses allow you to customize almost every part of an object life-cycle.\n\n\nMetaclasses are callables\n\n\nIf you look again at the diagrams, you'll notice that making an instance goes through Metaclass.\ncall\n. This means you can use any callable as the metaclass:\n\n\n \nclass\n \nFoo\n(\nmetaclass\n=\nprint\n):\n \n# pointless, but illustrative\n\n\n...\n \npass\n\n\n...\n\n\nFoo\n \n()\n \n{\n__module__\n:\n \n__main__\n,\n \n__qualname__\n:\n \nFoo\n}\n\n\n \nprint\n(\nFoo\n)\n\n\nNone\n\n\n\n\n\n\nIf you use a function as the metaclass then subclasses won't inherit your function metaclass, but the type of whatever that function returned.\n\n\nSubclasses inherit the metaclass\n\n\nOne advantage compared to class decorators is the fact that subclasses inherit the metaclass.\n\n\nThis is a consequence of the fact that Metaclass(...) returns an object which usually has Metaclass as the \nclass\n.\n\n\nRestrictions with multiple metaclasses\n\n\nIn the same tone of classes allowing you to have multiple baseclasses, each one of those baseclasses may have a different metaclass. But with a twist: everything has to be linear - the inheritance tree must have a single leaf.\n\n\nFor example, this is not accepted because there would be two leafs (Meta1 and Meta2):\n\n\n \nclass\n \nMeta1\n(\ntype\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nMeta2\n(\ntype\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase1\n(\nmetaclass\n=\nMeta1\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase2\n(\nmetaclass\n=\nMeta2\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nFoobar\n(\nBase1\n,\n \nBase2\n):\n\n\n...\n \npass\n\n\n...\n\n\nTraceback\n \n(\nmost\n \nrecent\n \ncall\n \nlast\n):\n\n \nFile\n \nstdin\n,\n \nline\n \n1\n,\n \nin\n \nmodule\n\n\nTypeError\n:\n \nmetaclass\n \nconflict\n:\n \nthe\n \nmetaclass\n \nof\n \na\n \nderived\n \nclass\n \nmust\n \nbe\n \na\n \n(\nnon\n-\nstrict\n)\n \nsubclass\n \nof\n \nthe\n \nmetaclasses\n \nof\n \nall\n \nits\n \nbases\n\n\n\n\n\n\nThis will work (and will use the leaf as the metaclass):\n\n\n \nclass\n \nMeta\n(\ntype\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nSubMeta\n(\nMeta\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase1\n(\nmetaclass\n=\nMeta\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase2\n(\nmetaclass\n=\nSubMeta\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nFoobar\n(\nBase1\n,\n \nBase2\n):\n\n\n...\n \npass\n\n\n...\n\n\n \ntype\n(\nFoobar\n)\n\n\nclass\n \n__main__\n.\nSubMeta\n\n\n\n\n\n\nThe method signatures\n\n\nThere are still few important details missing, like the method signatures. Lets look at class and metaclass with all the important stuff implemented.\n\n\nNote the extra **kwargs - those are the extra keywords arguments you can pass in the class statement. \n\n\n \nclass\n \nMeta\n(\ntype\n):\n\n\n...\n \n@classmethod\n\n\n...\n \ndef\n \n__prepare__\n(\nmcs\n,\n \nname\n,\n \nbases\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__prepare__(mcs=\n%s\n, name=\n%r\n, bases=\n%s\n, **\n%s\n)\n \n%\n \n(\n\n\n...\n \nmcs\n,\n \nname\n,\n \nbases\n,\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \n{}\n\n\n\n\n\n\nAs mentioned before, __prepare\n can return objects that are not dict instances, so you need to make sure your __new\n handles that.\n\n\n...\n \ndef\n \n__new__\n(\nmcs\n,\n \nname\n,\n \nbases\n,\n \nattrs\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__new__(mcs=\n%s\n, name=\n%r\n, bases=\n%s\n, attrs=[\n%s\n], **\n%s\n)\n \n%\n \n(\n\n\n...\n \nmcs\n,\n \nname\n,\n \nbases\n,\n \n, \n.\njoin\n(\nattrs\n),\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__new__\n(\nmcs\n,\n \nname\n,\n \nbases\n,\n \nattrs\n)\n\n\n\n\n\n\nIt's uncommon to see \ninit\n being implemented in a metaclass because it's not that powerful - the class is already constructed when \ninit\n is called. It roughly equates to having a class decorator with the difference that \ninit\n would get run when making subclasses, while class decorators are not called for subclasses.\n\n\n...\n \ndef\n \n__init__\n(\ncls\n,\n \nname\n,\n \nbases\n,\n \nattrs\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__init__(cls=\n%s\n, name=\n%r\n, bases=\n%s\n, attrs=[\n%s\n], **\n%s\n)\n \n%\n \n(\n\n\n...\n \ncls\n,\n \nname\n,\n \nbases\n,\n \n, \n.\njoin\n(\nattrs\n),\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__init__\n(\nname\n,\n \nbases\n,\n \nattrs\n)\n\n\n\n\n\n\nThe __call__ method will be called when you make instances of Class.\n\n\n...\n \ndef\n \n__call__\n(\ncls\n,\n \n*\nargs\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__call__(cls=\n%s\n, args=\n%s\n, kwargs=\n%s\n)\n \n%\n \n(\n\n\n...\n \ncls\n,\n \nargs\n,\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__call__\n(\n*\nargs\n,\n \n**\nkwargs\n)\n\n\n...\n\n\n\n\n\n\nUsing Meta, note the extra=1: \n\n\n \nclass\n \nClass\n(\nmetaclass\n=\nMeta\n,\n \nextra\n=\n1\n):\n\n\n...\n \ndef\n \n__new__\n(\ncls\n,\n \nmyarg\n):\n\n\n...\n \nprint\n(\n Class.__new__(cls=\n%s\n, myarg=\n%s\n)\n \n%\n \n(\n\n\n...\n \ncls\n,\n \nmyarg\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__new__\n(\ncls\n)\n\n\n...\n\n\n...\n \ndef\n \n__init__\n(\nself\n,\n \nmyarg\n):\n\n\n...\n \nprint\n(\n Class.__init__(self=\n%s\n, myarg=\n%s\n)\n \n%\n \n(\n\n\n...\n \nself\n,\n \nmyarg\n\n\n...\n \n))\n\n\n...\n \nself\n.\nmyarg\n \n=\n \nmyarg\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__init__\n()\n\n\n...\n\n\n...\n \ndef\n \n__str__\n(\nself\n):\n\n\n...\n \nreturn\n \ninstance of Class; myargs=\n%s\n \n%\n \n(\n\n\n...\n \ngetattr\n(\nself\n,\n \nmyarg\n,\n \nMISSING\n),\n\n\n...\n \n)\n\n \nMeta\n.\n__prepare__\n(\nmcs\n=\nclass\n \n__main__\n.\nMeta\n, name=\nClass\n, bases=(),\n\n \n**\n{\nextra\n:\n \n1\n})\n\n \nMeta\n.\n__new__\n(\nmcs\n=\nclass\n \n__main__\n.\nMeta\n, name=\nClass\n, bases=(),\n\n \nattrs\n=\n[\n__qualname__\n,\n \n__new__\n,\n \n__init__\n,\n \n__str__\n,\n \n__module__\n],\n\n \n**\n{\nextra\n:\n \n1\n})\n\n \nMeta\n.\n__init__\n(\ncls\n=\nclass\n \n__main__\n.\nClass\n, name=\nClass\n, bases=(),\n\n \nattrs\n=\n[\n__qualname__\n,\n \n__new__\n,\n \n__init__\n,\n \n__str__\n,\n \n__module__\n],\n\n \n**\n{\nextra\n:\n \n1\n})\n\n\n\n\n\n\nNote that Meta.__call__ is called when we make instance of Class:\n\n\n \nClass\n(\n1\n)\n\n \nMeta\n.\n__call__\n(\ncls\n=\nclass\n \n__main__\n.\nClass\n, args=(1,), kwargs={})\n\n \nClass\n.\n__new__\n(\ncls\n=\nclass\n \n__main__\n.\nClass\n, myarg=1)\n\n \nClass\n.\n__init__\n(\nself\n=\ninstance\n \nof\n \nClass\n;\n \nmyargs\n=\nMISSING\n,\n \nmyarg\n=\n1\n)\n\n\ninstance\n \nof\n \nClass\n;\n \nmyargs\n=\n1\n\n\n\n\n\n\n\n\nSource:\n \n\n\n https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/", "title": "Python Metaclasses" - }, + }, { - "location": "/advanced/Python_Metaclasses/#quick-tip-what-is-a-metaclass-in-python", - "text": "This quick tip gives a brief overview of what we mean by a metaclass in Python and shows some examples of the concept. Before delving into this article, I should point out an important point about classes in Python which makes it easier for us to grasp the concept of metaclasses.", + "location": "/advanced/Python_Metaclasses/#quick-tip-what-is-a-metaclass-in-python", + "text": "This quick tip gives a brief overview of what we mean by a metaclass in Python and shows some examples of the concept. Before delving into this article, I should point out an important point about classes in Python which makes it easier for us to grasp the concept of metaclasses.", "title": "Quick Tip: What Is a Metaclass in Python" - }, + }, { - "location": "/advanced/Python_Metaclasses/#is-a-class-an-object-in-python", - "text": "If you've used a programming language other than Python, the concept you understood about classes is most likely that it is a way used to create new objects. This is also true in Python, but Python even takes it one more step further\u2014classes are also considered objects! So, if you created the following class in Python: class myClass ( object ): \n pass This simply means that an object with the name myClass has been created in memory. Since this object is able to create new objects, it is considered a class. This means we can apply object operations on classes in Python, as classes are objects themselves. We can thus do operations on classes like assigning the class to a variable, as follows: class_object = myClass () print class_object Which returns: __main__ . myClass object at 0x102623610 You can even pass the class myClass as a parameter to a method, as follows: def class_object ( object ): \n print object class_object ( myClass ) Which returns the following output: class __main__ . myClass In addition to other operations you can normally apply on objects.", + "location": "/advanced/Python_Metaclasses/#is-a-class-an-object-in-python", + "text": "If you've used a programming language other than Python, the concept you understood about classes is most likely that it is a way used to create new objects. This is also true in Python, but Python even takes it one more step further\u2014classes are also considered objects! So, if you created the following class in Python: class myClass ( object ): \n pass This simply means that an object with the name myClass has been created in memory. Since this object is able to create new objects, it is considered a class. This means we can apply object operations on classes in Python, as classes are objects themselves. We can thus do operations on classes like assigning the class to a variable, as follows: class_object = myClass () print class_object Which returns: __main__ . myClass object at 0x102623610 You can even pass the class myClass as a parameter to a method, as follows: def class_object ( object ): \n print object class_object ( myClass ) Which returns the following output: class __main__ . myClass In addition to other operations you can normally apply on objects.", "title": "Is a Class an Object in Python?!" - }, + }, { - "location": "/advanced/Python_Metaclasses/#metaclasses", - "text": "Maybe you have come across the type keyword in Python? You most likely used it to check the type of some object, as shown in the following examples: print type ( abder ) print type ( 100 ) print type ( 100.0 ) print type ( int ) In which case you would get the following output: type str type int type float type type Looking at the output, everything seems pretty clear until you come to the type type. To see what this might mean, let's go back to our class we defined at the beginning of this article: class myClass ( object ): \n pass Now, do the following: print type ( myClass ) What would be the output of this statement? It will surprisingly be: type type So, we can conclude that the type of classes in Python is type ! What is the relation between a type and a metaclass ? Well, a type is a metaclass , provided that the default metaclass is type . I know this might be confusing, especially that type can be used to return the class of some object as shown above, but this is due to the backward compatibility in Python. So, if you write: print type ( type ) You will get: type type Meaning that a type is a type ! The term metaclass simply means something used to create classes. In other words, it is the class of a class, meaning that the instance of a class in this case is a class. Thus, type is considered a metaclass since the instance of a type is a class. For instance, when we mentioned the following statement above: class_object = myClass () This simply builds an object/instance of the class myClass . In other words, we used a class to create an object. In the same way, when we did the following: class myClass ( object ): \n pass The metaclass was used to create the class myClass (which is considered a type ). So, like the object being an instance of a class, a class is an instance of a metaclass .", + "location": "/advanced/Python_Metaclasses/#metaclasses", + "text": "Maybe you have come across the type keyword in Python? You most likely used it to check the type of some object, as shown in the following examples: print type ( abder ) print type ( 100 ) print type ( 100.0 ) print type ( int ) In which case you would get the following output: type str type int type float type type Looking at the output, everything seems pretty clear until you come to the type type. To see what this might mean, let's go back to our class we defined at the beginning of this article: class myClass ( object ): \n pass Now, do the following: print type ( myClass ) What would be the output of this statement? It will surprisingly be: type type So, we can conclude that the type of classes in Python is type ! What is the relation between a type and a metaclass ? Well, a type is a metaclass , provided that the default metaclass is type . I know this might be confusing, especially that type can be used to return the class of some object as shown above, but this is due to the backward compatibility in Python. So, if you write: print type ( type ) You will get: type type Meaning that a type is a type ! The term metaclass simply means something used to create classes. In other words, it is the class of a class, meaning that the instance of a class in this case is a class. Thus, type is considered a metaclass since the instance of a type is a class. For instance, when we mentioned the following statement above: class_object = myClass () This simply builds an object/instance of the class myClass . In other words, we used a class to create an object. In the same way, when we did the following: class myClass ( object ): \n pass The metaclass was used to create the class myClass (which is considered a type ). So, like the object being an instance of a class, a class is an instance of a metaclass .", "title": "Metaclasses" - }, + }, { - "location": "/advanced/Python_Metaclasses/#using-metaclass-to-create-a-class", - "text": "In this section, we are going to see how we can use a metaclass to create a class, rather than using the class statement as we saw in the classes and objects tutorial. As we saw above, the default metaclass is type . Thus, we can use the following statement to create a new class: new_class = type ( myClass ,(),{}) If you want to make things simpler, you can assign the same class name myClass to the variable name. The dictionary { } here is used to define the attributes of the class. So, having the following statement: myClass = type ( myClass ,(),{ a : True }) Is similar to: class myClass ( object ): \n a = True", + "location": "/advanced/Python_Metaclasses/#using-metaclass-to-create-a-class", + "text": "In this section, we are going to see how we can use a metaclass to create a class, rather than using the class statement as we saw in the classes and objects tutorial. As we saw above, the default metaclass is type . Thus, we can use the following statement to create a new class: new_class = type ( myClass ,(),{}) If you want to make things simpler, you can assign the same class name myClass to the variable name. The dictionary { } here is used to define the attributes of the class. So, having the following statement: myClass = type ( myClass ,(),{ a : True }) Is similar to: class myClass ( object ): \n a = True", "title": "Using Metaclass to Create a Class" - }, + }, { - "location": "/advanced/Python_Metaclasses/#the-metaclass-attribute", - "text": "Say that we created the class myClass as follows: class myClass ( object ): \n __metaclass__ = myMetaClass \n pass In this case, class creation will occur using myMetaClass instead of type, as follows: myClass = myMetaClass ( className , bases , dictionary )", + "location": "/advanced/Python_Metaclasses/#the-metaclass-attribute", + "text": "Say that we created the class myClass as follows: class myClass ( object ): \n __metaclass__ = myMetaClass \n pass In this case, class creation will occur using myMetaClass instead of type, as follows: myClass = myMetaClass ( className , bases , dictionary )", "title": "The metaclass Attribute" - }, + }, { - "location": "/advanced/Python_Metaclasses/#creation-and-initialization-of-a-metaclass", - "text": "If you want to have control on how you create and initialize a class after its creation, you can simply use the metaclass new method and init constructor, respectively. So, when myMetaClass above is called, this is what will be happening behind the scenes: myClass = myMetaClass . __new__ ( myMetaClass , name , bases , dictionary ) myMetaClass . __init__ ( myClass , name , bases , dictionary ) Source: https://code.tutsplus.com/tutorials/quick-tip-what-is-a-metaclass-in-python--cms-26016", + "location": "/advanced/Python_Metaclasses/#creation-and-initialization-of-a-metaclass", + "text": "If you want to have control on how you create and initialize a class after its creation, you can simply use the metaclass new method and init constructor, respectively. So, when myMetaClass above is called, this is what will be happening behind the scenes: myClass = myMetaClass . __new__ ( myMetaClass , name , bases , dictionary ) myMetaClass . __init__ ( myClass , name , bases , dictionary ) Source: https://code.tutsplus.com/tutorials/quick-tip-what-is-a-metaclass-in-python--cms-26016", "title": "Creation and Initialization of a Metaclass" - }, + }, { - "location": "/advanced/Python_Metaclasses/#understanding-python-metaclasses-from-ionelmcro", - "text": "", + "location": "/advanced/Python_Metaclasses/#understanding-python-metaclasses-from-ionelmcro", + "text": "", "title": "Understanding Python metaclasses from Ionelmc.ro" - }, + }, { - "location": "/advanced/Python_Metaclasses/#a-quick-overview", - "text": "A high level explanation is necessary before we get down to the details. A class is an object, and just like any other object, it's an instance of something: a metaclass. The default metaclass is type. Unfortunately, due to backwards compatibility, type is a bit confusing: it can also be used as a function that return the class [13] of an object: class Foobar : ... pass ... type ( Foobar ) class type foo = Foobar () type ( foo ) class __main__ . Foobar If you're familiar with the isinstance builtin then you'll know this: isinstance ( foo , Foobar ) True isinstance ( Foobar , type ) True To put this in picture: But lets go back to making classes ...", + "location": "/advanced/Python_Metaclasses/#a-quick-overview", + "text": "A high level explanation is necessary before we get down to the details. A class is an object, and just like any other object, it's an instance of something: a metaclass. The default metaclass is type. Unfortunately, due to backwards compatibility, type is a bit confusing: it can also be used as a function that return the class [13] of an object: class Foobar : ... pass ... type ( Foobar ) class type foo = Foobar () type ( foo ) class __main__ . Foobar If you're familiar with the isinstance builtin then you'll know this: isinstance ( foo , Foobar ) True isinstance ( Foobar , type ) True To put this in picture: But lets go back to making classes ...", "title": "A quick overview" - }, + }, { - "location": "/advanced/Python_Metaclasses/#simple-metaclass-use", - "text": "We can use type directly to make a class, without any class statement: MyClass = type ( MyClass , (), {}) MyClass class __main__ . MyClass The class statement isn't just syntactic sugar, it does some extra things, like setting an adequate qualname and doc properties or calling prepare . We can make a custom metaclass: class Meta ( type ): ... pass And then we can use it : class Complex ( metaclass = Meta ): ... pass type ( Complex ) class __main__ . Meta Now we got a rough idea of what we'll be dealing with ...", + "location": "/advanced/Python_Metaclasses/#simple-metaclass-use", + "text": "We can use type directly to make a class, without any class statement: MyClass = type ( MyClass , (), {}) MyClass class __main__ . MyClass The class statement isn't just syntactic sugar, it does some extra things, like setting an adequate qualname and doc properties or calling prepare . We can make a custom metaclass: class Meta ( type ): ... pass And then we can use it : class Complex ( metaclass = Meta ): ... pass type ( Complex ) class __main__ . Meta Now we got a rough idea of what we'll be dealing with ...", "title": "Simple metaclass use" - }, + }, { - "location": "/advanced/Python_Metaclasses/#magic-methods", - "text": "One distinctive feature of Python is magic methods: they allow the programmer to override behavior for various operators and behavior of objects. To override the call operator you'd do this: class Funky : ... def __call__ ( self ): ... print ( Look at me, I work like a function! ) f = Funky () f () Look at me , I work like a function ! Metaclasses rely on several magic methods so it's quite useful to know a bit more about them.", + "location": "/advanced/Python_Metaclasses/#magic-methods", + "text": "One distinctive feature of Python is magic methods: they allow the programmer to override behavior for various operators and behavior of objects. To override the call operator you'd do this: class Funky : ... def __call__ ( self ): ... print ( Look at me, I work like a function! ) f = Funky () f () Look at me , I work like a function ! Metaclasses rely on several magic methods so it's quite useful to know a bit more about them.", "title": "Magic methods" - }, + }, { - "location": "/advanced/Python_Metaclasses/#the-slots", - "text": "When you define a magic method in your class the function will end up as a pointer in a struct that describes the class, in addition to the entry in dict . That struct [7] has a field for each magic method. For some reason these fields are called type slots. Now there's another feature, implemented via the slots attribute. A class with slots will create instances that don't have a dict (they use a little bit less memory). A side-effect of this is that instances cannot have other fields than what was specified in slots : if you try to set an unexpected field you'll get an exception. For the scope of this article when slots are mentioned it will mean the type slots, not slots .", + "location": "/advanced/Python_Metaclasses/#the-slots", + "text": "When you define a magic method in your class the function will end up as a pointer in a struct that describes the class, in addition to the entry in dict . That struct [7] has a field for each magic method. For some reason these fields are called type slots. Now there's another feature, implemented via the slots attribute. A class with slots will create instances that don't have a dict (they use a little bit less memory). A side-effect of this is that instances cannot have other fields than what was specified in slots : if you try to set an unexpected field you'll get an exception. For the scope of this article when slots are mentioned it will mean the type slots, not slots .", "title": "The slots" - }, + }, { - "location": "/advanced/Python_Metaclasses/#object-attribute-lookup", - "text": "Now this is something that's easy to get wrong because of the many slight differences to old-style objects in Python 2. Assuming Class is the class and instance is an instance of Class, evaluating instance.foobar roughly equates to this: Call the type slot for Class. getattribute (tp_getattro). The default does this: Does Class. dict have a foobar item that is a data descriptor ? If yes, return the result of Class. dict ['foobar']. get (instance, Class). Does instance. dict have a foobar item in it? If yes, return instance. dict ['foobar']. Does Class. dict have a foobar item that is not a data descriptor ? If yes, return the result of Class. dict ['foobar']. get (instance, klass). Does Class. dict have a foobar item ? If yes, return the result of Class. dict ['foobar']. If the attribute still wasn't found, and there's a Class. getattr , call Class. getattr ('foobar'). Still not clear? Perhaps a diagram normal attribute lookup helps: To avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.", + "location": "/advanced/Python_Metaclasses/#object-attribute-lookup", + "text": "Now this is something that's easy to get wrong because of the many slight differences to old-style objects in Python 2. Assuming Class is the class and instance is an instance of Class, evaluating instance.foobar roughly equates to this: Call the type slot for Class. getattribute (tp_getattro). The default does this: Does Class. dict have a foobar item that is a data descriptor ? If yes, return the result of Class. dict ['foobar']. get (instance, Class). Does instance. dict have a foobar item in it? If yes, return instance. dict ['foobar']. Does Class. dict have a foobar item that is not a data descriptor ? If yes, return the result of Class. dict ['foobar']. get (instance, klass). Does Class. dict have a foobar item ? If yes, return the result of Class. dict ['foobar']. If the attribute still wasn't found, and there's a Class. getattr , call Class. getattr ('foobar'). Still not clear? Perhaps a diagram normal attribute lookup helps: To avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.", "title": "Object attribute lookup" - }, + }, { - "location": "/advanced/Python_Metaclasses/#class-attribute-lookup", - "text": "Because classes needs to be able support the classmethod and staticmethod properties [6] when you evaluate something like Class.foobar the lookup is slightly different than what would happen when you evaluate instance.foobar. Assuming Class is an instance of Metaclass, evaluating Class.foobar roughly equates to this: Call the type slot for Metaclass. getattribute (tp_getattro). The default does this: Does Metaclass. dict have a foobar item that is a data descriptor ? If yes, return the result of Metaclass. dict ['foobar']. get (Class, Metaclass). Does Class. dict have a foobar item that is a descriptor (of any kind)? If yes, return the result of Class. dict ['foobar']. get (None, Class). Does Class. dict have a foobar item in it? If yes, return Class. dict ['foobar']. Does Metaclass. dict have a foobar item that is not a data descriptor ? If yes, return the result of Metaclass. dict ['foobar']. get (Class, Metaclass). Does Metaclass. dict have any foobar item? If yes, return Metaclass. dict ['foobar']. If the attribute still wasn't found, and there's a Metaclass. getattr , call Metaclass. getattr ('foobar'). The whole shebang would look like this in a diagram: To avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.", + "location": "/advanced/Python_Metaclasses/#class-attribute-lookup", + "text": "Because classes needs to be able support the classmethod and staticmethod properties [6] when you evaluate something like Class.foobar the lookup is slightly different than what would happen when you evaluate instance.foobar. Assuming Class is an instance of Metaclass, evaluating Class.foobar roughly equates to this: Call the type slot for Metaclass. getattribute (tp_getattro). The default does this: Does Metaclass. dict have a foobar item that is a data descriptor ? If yes, return the result of Metaclass. dict ['foobar']. get (Class, Metaclass). Does Class. dict have a foobar item that is a descriptor (of any kind)? If yes, return the result of Class. dict ['foobar']. get (None, Class). Does Class. dict have a foobar item in it? If yes, return Class. dict ['foobar']. Does Metaclass. dict have a foobar item that is not a data descriptor ? If yes, return the result of Metaclass. dict ['foobar']. get (Class, Metaclass). Does Metaclass. dict have any foobar item? If yes, return Metaclass. dict ['foobar']. If the attribute still wasn't found, and there's a Metaclass. getattr , call Metaclass. getattr ('foobar'). The whole shebang would look like this in a diagram: To avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.", "title": "Class attribute lookup" - }, + }, { - "location": "/advanced/Python_Metaclasses/#magic-method-lookup", - "text": "For magic methods the lookup is done on the class, directly in the big struct with the slots: Does the object's class have a slot for that magic method (roughly object- ob_type- tp_ in C code)? If yes, use it. If it's NULL then the operation is not supported. In C internals parlance:\n - object- ob_type is the class of the object. \n - ob_type- tp_ is the type slot. This looks much simpler, however, the type slots are filled with wrappers around your functions, so descriptors work as expected: class Magic : ... @property ... def __repr__ ( self ): ... def inner (): ... return It works! ... return inner ... repr ( Magic ()) It works! Thats it. Does that mean there are places that don't follow those rules and lookup the slot differently? Sadly yes, read on ...", + "location": "/advanced/Python_Metaclasses/#magic-method-lookup", + "text": "For magic methods the lookup is done on the class, directly in the big struct with the slots: Does the object's class have a slot for that magic method (roughly object- ob_type- tp_ in C code)? If yes, use it. If it's NULL then the operation is not supported. In C internals parlance:\n - object- ob_type is the class of the object. \n - ob_type- tp_ is the type slot. This looks much simpler, however, the type slots are filled with wrappers around your functions, so descriptors work as expected: class Magic : ... @property ... def __repr__ ( self ): ... def inner (): ... return It works! ... return inner ... repr ( Magic ()) It works! Thats it. Does that mean there are places that don't follow those rules and lookup the slot differently? Sadly yes, read on ...", "title": "Magic method lookup" - }, + }, { - "location": "/advanced/Python_Metaclasses/#the-new-method", - "text": "One of the most common point of confusion with both classes and metaclasses is the new method. It has some very special conventions. The new method is the constructor (it returns the new instance) while init is just a initializer (the instance is already created when init is called). Suppose have a class like this: class Foobar : \n def __new__ ( cls ): \n return super () . __new__ ( cls ) Now if you recall the previous section, you'd expect that __new__ would be looked up on the metaclass, but alas, it wouldn't be so useful that way so it's looked up statically. When the Foobar class wants this magic method it will be looked up on the same object (the class), not on a upper level like all the other magic methods. This is very important to understand, because both the class and the metaclass can define this method: Foobar.__new__ is used to create instances of Foobar type.__new__ is used to create the Foobar class (an instance of type in the example)", + "location": "/advanced/Python_Metaclasses/#the-new-method", + "text": "One of the most common point of confusion with both classes and metaclasses is the new method. It has some very special conventions. The new method is the constructor (it returns the new instance) while init is just a initializer (the instance is already created when init is called). Suppose have a class like this: class Foobar : \n def __new__ ( cls ): \n return super () . __new__ ( cls ) Now if you recall the previous section, you'd expect that __new__ would be looked up on the metaclass, but alas, it wouldn't be so useful that way so it's looked up statically. When the Foobar class wants this magic method it will be looked up on the same object (the class), not on a upper level like all the other magic methods. This is very important to understand, because both the class and the metaclass can define this method: Foobar.__new__ is used to create instances of Foobar type.__new__ is used to create the Foobar class (an instance of type in the example)", "title": "The new method" - }, + }, { - "location": "/advanced/Python_Metaclasses/#the-prepare-method", - "text": "This method is called before the class body is executed and it must return a dictionary-like object that's used as the local namespace for all the code from the class body. It was added in Python 3.0, see PEP-3115 . If your __prepare__ returns an object x then this: class Class ( metaclass = Meta ): \n a = 1 \n b = 2 \n c = 3 Will make the following changes to x: x [ a ] = 1 x [ b ] = 2 x [ c ] = 3 This x object needs to look like a dictionary. Note that this x object will end up as an argument to Metaclass.__new and if it's not an instance of dict you need to convert it before calling super().__new . Interestingly enough this method doesn't have __new__'s special lookup. It appears it doesn't have it's own type slot and it's looked up via the class attribute lookup, if you read back a bit.", + "location": "/advanced/Python_Metaclasses/#the-prepare-method", + "text": "This method is called before the class body is executed and it must return a dictionary-like object that's used as the local namespace for all the code from the class body. It was added in Python 3.0, see PEP-3115 . If your __prepare__ returns an object x then this: class Class ( metaclass = Meta ): \n a = 1 \n b = 2 \n c = 3 Will make the following changes to x: x [ a ] = 1 x [ b ] = 2 x [ c ] = 3 This x object needs to look like a dictionary. Note that this x object will end up as an argument to Metaclass.__new and if it's not an instance of dict you need to convert it before calling super().__new . Interestingly enough this method doesn't have __new__'s special lookup. It appears it doesn't have it's own type slot and it's looked up via the class attribute lookup, if you read back a bit.", "title": "The prepare method" - }, + }, { - "location": "/advanced/Python_Metaclasses/#putting-it-all-together", - "text": "To start things off, a diagram of how instances are constructed: How to read this swim lane diagram: The horizontal lanes is the place where you define the functions. Solid lines mean a function call. A line from Metaclass.__call to Class.__new means Metaclass.__call will call Class.__new . Dashed lines means something is returned. Class. new returns the instance of Class. Metaclass. call returns whatever Class. new returned (and if it returned an instance of Class it will also call Class. init on it). The number in the red circle signifies the call order. Creating a class is quite similar: Few more notes:\n- Metaclass. prepare just returns the namespace object (a dictionary-like object as explained before).\n- Metaclass. new returns the Class object.\n- MetaMetaclass. call returns whatever Metaclass. new returned (and if it returned an instance of Metaclass it will also call Metaclass. init on it). So you see, metaclasses allow you to customize almost every part of an object life-cycle.", + "location": "/advanced/Python_Metaclasses/#putting-it-all-together", + "text": "To start things off, a diagram of how instances are constructed: How to read this swim lane diagram: The horizontal lanes is the place where you define the functions. Solid lines mean a function call. A line from Metaclass.__call to Class.__new means Metaclass.__call will call Class.__new . Dashed lines means something is returned. Class. new returns the instance of Class. Metaclass. call returns whatever Class. new returned (and if it returned an instance of Class it will also call Class. init on it). The number in the red circle signifies the call order. Creating a class is quite similar: Few more notes:\n- Metaclass. prepare just returns the namespace object (a dictionary-like object as explained before).\n- Metaclass. new returns the Class object.\n- MetaMetaclass. call returns whatever Metaclass. new returned (and if it returned an instance of Metaclass it will also call Metaclass. init on it). So you see, metaclasses allow you to customize almost every part of an object life-cycle.", "title": "Putting it all together" - }, + }, { - "location": "/advanced/Python_Metaclasses/#metaclasses-are-callables", - "text": "If you look again at the diagrams, you'll notice that making an instance goes through Metaclass. call . This means you can use any callable as the metaclass: class Foo ( metaclass = print ): # pointless, but illustrative ... pass ... Foo () { __module__ : __main__ , __qualname__ : Foo } print ( Foo ) None If you use a function as the metaclass then subclasses won't inherit your function metaclass, but the type of whatever that function returned.", + "location": "/advanced/Python_Metaclasses/#metaclasses-are-callables", + "text": "If you look again at the diagrams, you'll notice that making an instance goes through Metaclass. call . This means you can use any callable as the metaclass: class Foo ( metaclass = print ): # pointless, but illustrative ... pass ... Foo () { __module__ : __main__ , __qualname__ : Foo } print ( Foo ) None If you use a function as the metaclass then subclasses won't inherit your function metaclass, but the type of whatever that function returned.", "title": "Metaclasses are callables" - }, + }, { - "location": "/advanced/Python_Metaclasses/#subclasses-inherit-the-metaclass", - "text": "One advantage compared to class decorators is the fact that subclasses inherit the metaclass. This is a consequence of the fact that Metaclass(...) returns an object which usually has Metaclass as the class .", + "location": "/advanced/Python_Metaclasses/#subclasses-inherit-the-metaclass", + "text": "One advantage compared to class decorators is the fact that subclasses inherit the metaclass. This is a consequence of the fact that Metaclass(...) returns an object which usually has Metaclass as the class .", "title": "Subclasses inherit the metaclass" - }, + }, { - "location": "/advanced/Python_Metaclasses/#restrictions-with-multiple-metaclasses", - "text": "In the same tone of classes allowing you to have multiple baseclasses, each one of those baseclasses may have a different metaclass. But with a twist: everything has to be linear - the inheritance tree must have a single leaf. For example, this is not accepted because there would be two leafs (Meta1 and Meta2): class Meta1 ( type ): ... pass ... class Meta2 ( type ): ... pass ... class Base1 ( metaclass = Meta1 ): ... pass ... class Base2 ( metaclass = Meta2 ): ... pass ... class Foobar ( Base1 , Base2 ): ... pass ... Traceback ( most recent call last ): \n File stdin , line 1 , in module TypeError : metaclass conflict : the metaclass of a derived class must be a ( non - strict ) subclass of the metaclasses of all its bases This will work (and will use the leaf as the metaclass): class Meta ( type ): ... pass ... class SubMeta ( Meta ): ... pass ... class Base1 ( metaclass = Meta ): ... pass ... class Base2 ( metaclass = SubMeta ): ... pass ... class Foobar ( Base1 , Base2 ): ... pass ... type ( Foobar ) class __main__ . SubMeta", + "location": "/advanced/Python_Metaclasses/#restrictions-with-multiple-metaclasses", + "text": "In the same tone of classes allowing you to have multiple baseclasses, each one of those baseclasses may have a different metaclass. But with a twist: everything has to be linear - the inheritance tree must have a single leaf. For example, this is not accepted because there would be two leafs (Meta1 and Meta2): class Meta1 ( type ): ... pass ... class Meta2 ( type ): ... pass ... class Base1 ( metaclass = Meta1 ): ... pass ... class Base2 ( metaclass = Meta2 ): ... pass ... class Foobar ( Base1 , Base2 ): ... pass ... Traceback ( most recent call last ): \n File stdin , line 1 , in module TypeError : metaclass conflict : the metaclass of a derived class must be a ( non - strict ) subclass of the metaclasses of all its bases This will work (and will use the leaf as the metaclass): class Meta ( type ): ... pass ... class SubMeta ( Meta ): ... pass ... class Base1 ( metaclass = Meta ): ... pass ... class Base2 ( metaclass = SubMeta ): ... pass ... class Foobar ( Base1 , Base2 ): ... pass ... type ( Foobar ) class __main__ . SubMeta", "title": "Restrictions with multiple metaclasses" - }, + }, { - "location": "/advanced/Python_Metaclasses/#the-method-signatures", - "text": "There are still few important details missing, like the method signatures. Lets look at class and metaclass with all the important stuff implemented. Note the extra **kwargs - those are the extra keywords arguments you can pass in the class statement. class Meta ( type ): ... @classmethod ... def __prepare__ ( mcs , name , bases , ** kwargs ): ... print ( Meta.__prepare__(mcs= %s , name= %r , bases= %s , ** %s ) % ( ... mcs , name , bases , kwargs ... )) ... return {} As mentioned before, __prepare can return objects that are not dict instances, so you need to make sure your __new handles that. ... def __new__ ( mcs , name , bases , attrs , ** kwargs ): ... print ( Meta.__new__(mcs= %s , name= %r , bases= %s , attrs=[ %s ], ** %s ) % ( ... mcs , name , bases , , . join ( attrs ), kwargs ... )) ... return super () . __new__ ( mcs , name , bases , attrs ) It's uncommon to see init being implemented in a metaclass because it's not that powerful - the class is already constructed when init is called. It roughly equates to having a class decorator with the difference that init would get run when making subclasses, while class decorators are not called for subclasses. ... def __init__ ( cls , name , bases , attrs , ** kwargs ): ... print ( Meta.__init__(cls= %s , name= %r , bases= %s , attrs=[ %s ], ** %s ) % ( ... cls , name , bases , , . join ( attrs ), kwargs ... )) ... return super () . __init__ ( name , bases , attrs ) The __call__ method will be called when you make instances of Class. ... def __call__ ( cls , * args , ** kwargs ): ... print ( Meta.__call__(cls= %s , args= %s , kwargs= %s ) % ( ... cls , args , kwargs ... )) ... return super () . __call__ ( * args , ** kwargs ) ... Using Meta, note the extra=1: class Class ( metaclass = Meta , extra = 1 ): ... def __new__ ( cls , myarg ): ... print ( Class.__new__(cls= %s , myarg= %s ) % ( ... cls , myarg ... )) ... return super () . __new__ ( cls ) ... ... def __init__ ( self , myarg ): ... print ( Class.__init__(self= %s , myarg= %s ) % ( ... self , myarg ... )) ... self . myarg = myarg ... return super () . __init__ () ... ... def __str__ ( self ): ... return instance of Class; myargs= %s % ( ... getattr ( self , myarg , MISSING ), ... ) \n Meta . __prepare__ ( mcs = class __main__ . Meta , name= Class , bases=(), \n ** { extra : 1 }) \n Meta . __new__ ( mcs = class __main__ . Meta , name= Class , bases=(), \n attrs = [ __qualname__ , __new__ , __init__ , __str__ , __module__ ], \n ** { extra : 1 }) \n Meta . __init__ ( cls = class __main__ . Class , name= Class , bases=(), \n attrs = [ __qualname__ , __new__ , __init__ , __str__ , __module__ ], \n ** { extra : 1 }) Note that Meta.__call__ is called when we make instance of Class: Class ( 1 ) \n Meta . __call__ ( cls = class __main__ . Class , args=(1,), kwargs={}) \n Class . __new__ ( cls = class __main__ . Class , myarg=1) \n Class . __init__ ( self = instance of Class ; myargs = MISSING , myarg = 1 ) instance of Class ; myargs = 1 Source: https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/", + "location": "/advanced/Python_Metaclasses/#the-method-signatures", + "text": "There are still few important details missing, like the method signatures. Lets look at class and metaclass with all the important stuff implemented. Note the extra **kwargs - those are the extra keywords arguments you can pass in the class statement. class Meta ( type ): ... @classmethod ... def __prepare__ ( mcs , name , bases , ** kwargs ): ... print ( Meta.__prepare__(mcs= %s , name= %r , bases= %s , ** %s ) % ( ... mcs , name , bases , kwargs ... )) ... return {} As mentioned before, __prepare can return objects that are not dict instances, so you need to make sure your __new handles that. ... def __new__ ( mcs , name , bases , attrs , ** kwargs ): ... print ( Meta.__new__(mcs= %s , name= %r , bases= %s , attrs=[ %s ], ** %s ) % ( ... mcs , name , bases , , . join ( attrs ), kwargs ... )) ... return super () . __new__ ( mcs , name , bases , attrs ) It's uncommon to see init being implemented in a metaclass because it's not that powerful - the class is already constructed when init is called. It roughly equates to having a class decorator with the difference that init would get run when making subclasses, while class decorators are not called for subclasses. ... def __init__ ( cls , name , bases , attrs , ** kwargs ): ... print ( Meta.__init__(cls= %s , name= %r , bases= %s , attrs=[ %s ], ** %s ) % ( ... cls , name , bases , , . join ( attrs ), kwargs ... )) ... return super () . __init__ ( name , bases , attrs ) The __call__ method will be called when you make instances of Class. ... def __call__ ( cls , * args , ** kwargs ): ... print ( Meta.__call__(cls= %s , args= %s , kwargs= %s ) % ( ... cls , args , kwargs ... )) ... return super () . __call__ ( * args , ** kwargs ) ... Using Meta, note the extra=1: class Class ( metaclass = Meta , extra = 1 ): ... def __new__ ( cls , myarg ): ... print ( Class.__new__(cls= %s , myarg= %s ) % ( ... cls , myarg ... )) ... return super () . __new__ ( cls ) ... ... def __init__ ( self , myarg ): ... print ( Class.__init__(self= %s , myarg= %s ) % ( ... self , myarg ... )) ... self . myarg = myarg ... return super () . __init__ () ... ... def __str__ ( self ): ... return instance of Class; myargs= %s % ( ... getattr ( self , myarg , MISSING ), ... ) \n Meta . __prepare__ ( mcs = class __main__ . Meta , name= Class , bases=(), \n ** { extra : 1 }) \n Meta . __new__ ( mcs = class __main__ . Meta , name= Class , bases=(), \n attrs = [ __qualname__ , __new__ , __init__ , __str__ , __module__ ], \n ** { extra : 1 }) \n Meta . __init__ ( cls = class __main__ . Class , name= Class , bases=(), \n attrs = [ __qualname__ , __new__ , __init__ , __str__ , __module__ ], \n ** { extra : 1 }) Note that Meta.__call__ is called when we make instance of Class: Class ( 1 ) \n Meta . __call__ ( cls = class __main__ . Class , args=(1,), kwargs={}) \n Class . __new__ ( cls = class __main__ . Class , myarg=1) \n Class . __init__ ( self = instance of Class ; myargs = MISSING , myarg = 1 ) instance of Class ; myargs = 1 Source: https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/", "title": "The method signatures" - }, + }, { - "location": "/About/", - "text": "I'll write later", + "location": "/About/", + "text": "I'll write later", "title": "About" - }, + }, { - "location": "/About/#ill-write-later", - "text": "", + "location": "/About/#ill-write-later", + "text": "", "title": "I'll write later" } ] diff --git a/site/sitemap.xml b/site/sitemap.xml index 4a234c9..a5b30f5 100644 --- a/site/sitemap.xml +++ b/site/sitemap.xml @@ -4,7 +4,7 @@ / - 2017-08-26 + 2017-09-07 daily @@ -13,31 +13,37 @@ /beginner/Python_Programming_Lanuage/ - 2017-08-26 + 2017-09-07 daily /beginner/Python_Installation/ - 2017-08-26 + 2017-09-07 daily /beginner/Start_Coding_With_Python/ - 2017-08-26 + 2017-09-07 daily /beginner/Data_Types_In_Python_3/ - 2017-08-26 + 2017-09-07 daily /beginner/Variables_And_Assignment/ - 2017-08-26 + 2017-09-07 + daily + + + + /beginner/Functions/ + 2017-09-07 daily @@ -47,7 +53,7 @@ /advanced/Python_Metaclasses/ - 2017-08-26 + 2017-09-07 daily @@ -56,7 +62,7 @@ /About/ - 2017-08-26 + 2017-09-07 daily From a394503b855db1c88c1970ed9e47d1fad951790e Mon Sep 17 00:00:00 2001 From: Goga Patarkatsishvili Date: Thu, 7 Sep 2017 16:16:42 +0400 Subject: [PATCH 30/39] .. --- docs/beginner/Functions.md | 2 +- site/beginner/Functions/index.html | 45 ++++++++++++++++++++++-------- site/mkdocs/search_index.json | 4 +-- 3 files changed, 37 insertions(+), 14 deletions(-) diff --git a/docs/beginner/Functions.md b/docs/beginner/Functions.md index f4385fe..fa31b5c 100644 --- a/docs/beginner/Functions.md +++ b/docs/beginner/Functions.md @@ -392,7 +392,7 @@ that lets us split complex systems into manageable parts. Table 16-1 summarizes primary function-related tools we’ll study in this part of the book. - Statement | Examples | +Statement | Examples | ------|------| **Calls** | **myfunc('spam', 'eggs', meat=ham)**| **def, return**| def adder(a, b=1, *c): return a + b + c[0]| diff --git a/site/beginner/Functions/index.html b/site/beginner/Functions/index.html index 79120b0..7bcc53a 100644 --- a/site/beginner/Functions/index.html +++ b/site/beginner/Functions/index.html @@ -1219,17 +1219,40 @@

          Function Basics

          reuse and minimizing code redundancy. As we’ll see, functions are also a design tool that lets us split complex systems into manageable parts. Table 16-1 summarizes the primary function-related tools we’ll study in this part of the book.

          -
          Statement  | Examples |
          -
          - - -

          ------|------| -Calls | myfunc('spam', 'eggs', meat=ham)| -def, return| def adder(a, b=1, c): return a + b + c[0]| -global| def changer():global x; x = 'new' | -nonlocal| def changer():nonlocal x; x = 'new'| -yield| def squares(x):for i in range(x): yield i 2 | -lambda| funcs = [lambda x: x2, lambda x: x3]

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          StatementExamples
          Callsmyfunc('spam', 'eggs', meat=ham)
          def, returndef adder(a, b=1, *c): return a + b + c[0]
          globaldef changer():global x; x = 'new'
          nonlocaldef changer():nonlocal x; x = 'new'
          yielddef squares(x):for i in range(x): yield i ** 2
          lambdafuncs = [lambda x: x*2, lambda x: x3]

          Why Use Functions?

          Before we get into the details, let’s establish a clear picture of what functions are all about. Functions are a nearly universal program-structuring device. You may have diff --git a/site/mkdocs/search_index.json b/site/mkdocs/search_index.json index 53cc131..d688f91 100644 --- a/site/mkdocs/search_index.json +++ b/site/mkdocs/search_index.json @@ -342,7 +342,7 @@ }, { "location": "/beginner/Functions/", - "text": "Function Calls\n\n\nIn the context of programming, a function is a named sequence of statements that\nperforms a computation. When you define a function, you specify the name and the\nsequence of statements. Later, you can \u201ccall\u201d the function by name. We have already seen\none example of a function call:\n\n\n \ntype\n(\n32\n)\n\n\ntype\n \nint\n\n\n\n\n\n\nThe name of the function is type. The expression in parentheses is called the argument\nof the function. The result, for this function, is the type of the argument.\n\nIt is common to say that a function \u201ctakes\u201d an argument and \u201creturns\u201d a result. The result\nis called the return value.\n\n\nType Conversion Functions\n\n\nPython provides built-in functions that convert values from one type to another. The\nint function takes any value and converts it to an integer, if it can, or complains\notherwise:\n\n\n \nint\n(\n32\n)\n\n\n32\n\n\n \nint\n(\nHello\n)\n\n\nValueError\n:\n \ninvalid\n \nliteral\n \nfor\n \nint\n():\n \nHello\n\n\n\n\n\n\nint can convert floating-point values to integers, but it doesn\u2019t round off; it chops off\nthe fraction part:\n\n\n \nint\n(\n3.99999\n)\n\n\n3\n\n\n \nint\n(\n-\n2.3\n)\n\n\n-\n2\n\n\n\n\n\n\nfloat converts integers and strings to floating-point numbers:\n\n\n \nfloat\n(\n32\n)\n\n\n32.0\n\n\n \nfloat\n(\n3.14159\n)\n\n\n3.14159\n\n\n\n\n\n\nFinally, str converts its argument to a string:\n\n\n \nstr\n(\n32\n)\n\n\n32\n\n\n \nstr\n(\n3.14159\n)\n\n\n3.14159\n\n\n\n\n\n\nAdding New Functions\n\n\nSo far, we have only been using the functions that come with Python, but it is also possible\nto add new functions. A function definition specifies the name of a new function and\nthe sequence of statements that execute when the function is called.\n\nHere is an example:\n\n\ndef\n \nprint_lyrics\n():\n\n \nprint\n \nI\nm a lumberjack, and I\nm okay.\n\n \nprint\n \nI sleep all night and I work all day.\n\n\n\n\n\n\ndef\n is a keyword that indicates that this is a function definition. The name of the function\nis print_lyrics. The rules for function names are the same as for variable names: letters,\nnumbers and some punctuation marks are legal, but the first character can\u2019t be a number.\nYou can\u2019t use a keyword as the name of a function, and you should avoid having a variable\nand a function with the same name.\n\nThe empty parentheses after the name indicate that this function doesn\u2019t take any\narguments.\n\nThe first line of the function definition is called the header; the rest is called the body.\nThe header has to end with a colon and the body has to be indented. By convention, the\nindentation is always four spaces; see \u201cDebugging\u201d (page 33). The body can contain any\nnumber of statements.\n\nThe strings in the print statements are enclosed in double quotes. Single quotes and\ndouble quotes do the same thing; most people use single quotes except in cases like this\nwhere a single quote (which is also an apostrophe) appears in the string.\nIf you type a function definition in interactive mode, the interpreter prints ellipses (...)\nto let you know that the definition isn\u2019t complete:\n\n\ndef\n \nprint_lyrics\n():\n\n \nprint\n \nI\nm a lumberjack, and I\nm okay.\n\n \nprint\n \nI sleep all night and I work all day.\n\n\n\n\n\n\nTo end the function, you have to enter an empty line (this is not necessary in a script).\nDefining a function creates a variable with the same name.\n\n\n \nprint\n \nprint_lyrics\n\n\nfunction\n \nprint_lyrics\n \nat\n \n0xb7e99e9c\n\n\n \ntype\n(\nprint_lyrics\n)\n\n\ntype\n \nfunction\n\n\n\n\n\n\nThe value of print_lyrics is a function object, which has type 'function'.\nThe syntax for calling the new function is the same as for built-in functions:\n\n\n \nprint_lyrics\n()\n\n\nI\nm a lumberjack, and I\nm\n \nokay\n.\n\n\nI\n \nsleep\n \nall\n \nnight\n \nand\n \nI\n \nwork\n \nall\n \nday\n.\n\n\n\n\n\n\nOnce you have defined a function, you can use it inside another function. For example,\nto repeat the previous refrain, we could write a function called repeat_lyrics: \n\n\ndef\n \nrepeat_lyrics\n():\n\n \nprint_lyrics\n()\n\n \nprint_lyrics\n()\n\n\n\n\n\n\nAnd then call repeat_lyrics: \n\n\n \nrepeat_lyrics\n()\n\n\nI\nm a lumberjack, and I\nm\n \nokay\n.\n\n\nI\n \nsleep\n \nall\n \nnight\n \nand\n \nI\n \nwork\n \nall\n \nday\n.\n\n\nI\nm a lumberjack, and I\nm\n \nokay\n.\n\n\nI\n \nsleep\n \nall\n \nnight\n \nand\n \nI\n \nwork\n \nall\n \nday\n.\n\n\n\n\n\n\nBut that\u2019s not really how the song goes.\n\n\nDefinitions and Uses\n\n\nPulling together the code fragments from the previous section, the whole program looks\nlike this:\n\n\ndef\n \nprint_lyrics\n():\n\n \nprint\n \nI\nm a lumberjack, and I\nm okay.\n\n \nprint\n \nI sleep all night and I work all day.\n\n\ndef\n \nrepeat_lyrics\n():\n\n \nprint_lyrics\n()\n\n \nprint_lyrics\n()\n \n\n\nrepeat_lyrics\n()\n\n\n\n\n\n\nThis program contains two function definitions: print_lyrics and repeat_lyrics.\nFunction definitions get executed just like other statements, but the result creates func\ntion objects. The statements inside the function do not get executed until the function\nis called, and the function definition generates no output.\n\nAs you might expect, you have to create a function before you can execute it. In other\nwords, the function definition has to be executed before the function is called the first\ntime. \n\n\nFlow of Execution\n\n\nIn order to ensure that a function is defined before its first use, you have to know the\norder in which statements are executed, which is called the flow of execution.\n\nExecution always begins at the first statement of the program. Statements are executed\none at a time, in order, from top to bottom.\n\n\nFunction definitions do not alter the flow of execution of the program, but remember\nthat statements inside the function are not executed until the function is called.\nA function call is like a detour in the flow of execution. Instead of going to the next\nstatement, the flow jumps to the body of the function, executes all the statements there,\nand then comes back to pick up where it left off.\n\nThat sounds simple enough, until you remember that one function can call another.\nWhile in the middle of one function, the program might have to execute the statements\nin another function. But while executing that new function, the program might have to\nexecute yet another function!\n\nFortunately, Python is good at keeping track of where it is, so each time a function\ncompletes, the program picks up where it left off in the function that called it. When it\ngets to the end of the program, it terminates.\n\nWhat\u2019s the moral of this sordid tale? When you read a program, you don\u2019t always want\nto read from top to bottom. Sometimes it makes more sense if you follow the flow of\nexecution. \n\n\nParameters and Arguments\n\n\nSome of the built-in functions we have seen require arguments. For example, when you\ncall math.sin you pass a number as an argument. Some functions take more than one\nargument: \nmath.pow\n takes two, the base and the exponent.\nInside the function, the arguments are assigned to variables called parameters. Here is\nan example of a user-defined function that takes an argument:\n\n\n \ndef\n \nprint_twice\n(\nbruce\n):\n\n \nprint\n \nbruce\n\n \nprint\n \nbruce\n\n\n\n\n\n\nThis function assigns the argument to a parameter named bruce. When the function is\ncalled, it prints the value of the parameter (whatever it is) twice.\n\nThis function works with any value that can be printed.\n\n\n \nprint_twice\n(\nSpam\n)\n\n\nSpam\n\n\nSpam\n\n\n \nprint_twice\n(\n17\n)\n\n\n17\n\n\n17\n\n\n \nprint_twice\n(\nmath\n.\npi\n)\n\n\n3.14159265359\n\n\n3.14159265359\n \n\n\n\n\n\nThe same rules of composition that apply to built-in functions also apply to user-defined\nfunctions, so we can use any kind of expression as an argument for \nprint_twice\n:\n\n\n \nprint_twice\n(\nSpam \n*\n4\n)\n\n\nSpam\n \nSpam\n \nSpam\n \nSpam\n\n\nSpam\n \nSpam\n \nSpam\n \nSpam\n\n\n \nprint_twice\n(\nmath\n.\ncos\n(\nmath\n.\npi\n))\n\n\n-\n1.0\n\n\n-\n1.0\n\n\n\n\n\n\nThe argument is evaluated before the function is called, so in the examples the expres\nsions 'Spam '*4 and math.cos(math.pi) are only evaluated once.\n\nYou can also use a variable as an argument:\n\n\n \nmichael\n \n=\n \nEric, the half a bee.\n\n\n \nprint_twice\n(\nmichael\n)\n\n\nEric\n,\n \nthe\n \nhalf\n \na\n \nbee\n.\n\n\nEric\n,\n \nthe\n \nhalf\n \na\n \nbee\n.\n\n\n\n\n\n\nThe name of the variable we pass as an argument (michael) has nothing to do with the\nname of the parameter (bruce). It doesn\u2019t matter what the value was called back home\n(in the caller); here in print_twice, we call everybody bruce.\n\n\nVariables and Parameters Are Local\n\n\nWhen you create a variable inside a function, it is local, which means that it only exists\ninside the function. For example:\n\n\ndef\n \ncat_twice\n(\npart1\n,\n \npart2\n):\n\n \ncat\n \n=\n \npart1\n \n+\n \npart2\n\n \nprint_twice\n(\ncat\n)\n\n\n\n\n\n\nThis function takes two arguments, concatenates them, and prints the result twice. Here\nis an example that uses it:\n\n\n \nline1\n \n=\n \nBing tiddle \n\n\n \nline2\n \n=\n \ntiddle bang.\n\n\n \ncat_twice\n(\nline1\n,\n \nline2\n)\n\n\nBing\n \ntiddle\n \ntiddle\n \nbang\n.\n\n\nBing\n \ntiddle\n \ntiddle\n \nbang\n.\n\n\n\n\n\n\nWhen cat_twice terminates, the variable cat is destroyed. If we try to print it, we get\nan exception:\n\n\n \nprint\n \ncat\n\n\nNameError\n:\n \nname\n \ncat\n \nis\n \nnot\n \ndefined\n\n\n\n\n\n\nParameters are also local. For example, outside print_twice, there is no such thing as\nbruce.\n\n\nStack Diagrams\n\n\nTo keep track of which variables can be used where, it is sometimes useful to draw a\nstack diagram. Like state diagrams, stack diagrams show the value of each variable, but\nthey also show the function each variable belongs to.\n\nEach function is represented by a frame. A frame is a box with the name of a function\nbeside it and the parameters and variables of the function inside it. The stack diagram\nfor the previous example is shown in Figure 3-1.\n\n\n\n\nThe frames are arranged in a stack that indicates which function called which, and so\non. In this example, print_twice was called by cat_twice, and cat_twice was called\nby \n\\__main\\__\n, which is a special name for the topmost frame. When you create a variable\noutside of any function, it belongs to \n\\__main\\__\n.\n\n\nEach parameter refers to the same value as its corresponding argument. So, part1 has\nthe same value as line1, part2 has the same value as line2, and bruce has the same\nvalue as cat.\nIf an error occurs during a function call, Python prints the name of the function, and\nthe name of the function that called it, and the name of the function that called that, all\nthe way back to \n\\__main__\\\n.\n\n\nFor example, if you try to access cat from within print_twice, you get a NameError:\n\n\nTraceback\n \n(\ninnermost\n \nlast\n):\n\n \nFile\n \ntest.py\n,\n \nline\n \n13\n,\n \nin\n \n__main__\n\n \ncat_twice\n(\nline1\n,\n \nline2\n)\n\n \nFile\n \ntest.py\n,\n \nline\n \n5\n,\n \nin\n \ncat_twice\n\n \nprint_twice\n(\ncat\n)\n\n \nFile\n \ntest.py\n,\n \nline\n \n9\n,\n \nin\n \nprint_twice\n\n \nprint\n \ncat\n\n \nNameError\n:\n \nname\n \ncat\n \nis\n \nnot\n \ndefined\n\n\n\n\n\n\nThis list of functions is called a traceback. It tells you what program file the error oc\ncurred in, and what line, and what functions were executing at the time. It also shows\nthe line of code that caused the error.\nThe order of the functions in the traceback is the same as the order of the frames in the\nstack diagram. The function that is currently running is listed at the bottom.\n\n\nFruitful Functions and Void Functions\n\n\nSome of the functions we are using, such as the math functions, yield results; for lack of\na better name, I call them fruitful functions. Other functions, like print_twice, per\nform an action but don\u2019t return a value. They are called void functions.\nWhen you call a fruitful function, you almost always want to do something with the\nresult; for example, you might assign it to a variable or use it as part of an expression:\n\n\nx\n \n=\n \nmath\n.\ncos\n(\nradians\n)\n\n\ngolden\n \n=\n \n(\nmath\n.\nsqrt\n(\n5\n)\n \n+\n \n1\n)\n \n/\n \n2\n\n\n\n\n\n\nWhen you call a function in interactive mode, Python displays the result:\n\n\n \nmath\n.\nsqrt\n(\n5\n)\n\n\n2.2360679774997898\n\n\n\n\n\n\nBut in a script, if you call a fruitful function all by itself, the return value is lost forever!\n\n\nmath\n.\nsqrt\n(\n5\n)\n\n\n\n\n\n\nThis script computes the square root of 5, but since it doesn\u2019t store or display the result,\nit is not very useful.\nVoid functions might display something on the screen or have some other effect, but\nthey don\u2019t have a return value. If you try to assign the result to a variable, you get a special\nvalue called None.\n\n\n \nresult\n \n=\n \nprint_twice\n(\nBing\n)\n\n\nBing\n\n\nBing\n\n\n \nprint\n \nresult\n\n\nNone\n\n\n\n\n\n\nThe value None is not the same as the string 'None'. It is a special value that has its own\ntype:\n\n\n \nprint\n \ntype\n(\nNone\n)\n\n\ntype\n \nNoneType\n\n\n\n\n\n\nThe functions we have written so far are all void. We will start writing fruitful functions\nin a few chapters.\n\n\nWhy Functions?\n\n\nIt may not be clear why it is worth the trouble to divide a program into functions. There\nare several reasons:\n\n- Creating a new function gives you an opportunity to name a group of statements,\nwhich makes your program easier to read and debug.\n- Functions can make a program smaller by eliminating repetitive code. Later, if you\nmake a change, you only have to make it in one place.\n- Dividing a long program into functions allows you to debug the parts one at a time\nand then assemble them into a working whole.\n- Well-designed functions are often useful for many programs. Once you write and\ndebug one, you can reuse it.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nFunctions by by Mark Lutz (Learning Python, Fourth Edition)\n\n\nFunction Basics\n\n\nIn Part III, we looked at basic procedural statements in Python. Here, we\u2019ll move on to\nexplore a set of additional statements that we can use to create functions of our own.\n\nIn simple terms, a function is a device that groups a set of statements so they can be run\nmore than once in a program. Functions also can compute a result value and let us\nspecify parameters that serve as function inputs, which may differ each time the code\nis run. Coding an operation as a function makes it a generally useful tool, which we\ncan use in a variety of contexts.\n\nMore fundamentally, functions are the alternative to programming by cutting and\npasting\u2014rather than having multiple redundant copies of an operation\u2019s code, we can\nfactor it into a single function. In so doing, we reduce our future work radically: if the\noperation must be changed later, we only have one copy to update, not many.\n\nFunctions are the most basic program structure Python provides for maximizing code\nreuse and minimizing code redundancy. As we\u2019ll see, functions are also a design tool\nthat lets us split complex systems into manageable parts. Table 16-1 summarizes the\nprimary function-related tools we\u2019ll study in this part of the book.\n\n\nStatement | Examples |\n\n\n\n\n\n------|------|\n\nCalls\n | \nmyfunc('spam', 'eggs', meat=ham)\n|\n\ndef, return\n| def adder(a, b=1, \nc): return a + b + c[0]| \n\nglobal\n| def changer():global x; x = 'new' | \n\nnonlocal\n| def changer():nonlocal x; x = 'new'|\n\nyield\n| def squares(x):for i in range(x): yield i \n 2 |\n\nlambda\n| funcs = [lambda x: x\n2, lambda x: x\n3]\n\n\nWhy Use Functions?\n\n\nBefore we get into the details, let\u2019s establish a clear picture of what functions are all\nabout. Functions are a nearly universal program-structuring device. You may have\ncome across them before in other languages, where they may have been called subroutines\nor procedures. As a brief introduction, functions serve two primary development\nroles:\n\n\nMaximizing code reuse and minimizing redundancy\n\nAs in most programming languages, Python functions are the simplest way to\npackage logic you may wish to use in more than one place and more than one time.\nUp until now, all the code we\u2019ve been writing has run immediately. Functions allow\nus to group and generalize code to be used arbitrarily many times later. Because\nthey allow us to code an operation in a single place and use it in many places,\nPython functions are the most basic factoring tool in the language: they allow us\nto reduce code redundancy in our programs, and thereby reduce maintenance\neffort. \n\n\nProcedural decomposition\n\nFunctions also provide a tool for splitting systems into pieces that have well-defined\nroles. For instance, to make a pizza from scratch, you would start by mixing the\ndough, rolling it out, adding toppings, baking it, and so on. If you were programming\na pizza-making robot, functions would help you divide the overall \u201cmake\npizza\u201d task into chunks\u2014one function for each subtask in the process. It\u2019s easier\nto implement the smaller tasks in isolation than it is to implement the entire process\nat once. In general, functions are about procedure\u2014how to do something, rather\nthan what you\u2019re doing it to. We\u2019ll see why this distinction matters in Part VI, when\nwe start making new object with classes. \n\n\n\n\nIn this part of the book, we\u2019ll explore the tools used to code functions in Python: function\nbasics, scope rules, and argument passing, along with a few related concepts such\nas generators and functional tools. Because its importance begins to become more apparent\nat this level of coding, we\u2019ll also revisit the notion of polymorphism introduced\nearlier in the book. As you\u2019ll see, functions don\u2019t imply much new syntax, but they do\nlead us to some bigger programming ideas.\n\n\nCoding Functions\n\n\nAlthough it wasn\u2019t made very formal, we\u2019ve already used some functions in earlier\nchapters. For instance, to make a file object, we called the built-in open function; similarly,\nwe used the len built-in function to ask for the number of items in a collection\nobject.\n\nIn this chapter, we will explore how to write new functions in Python. Functions we\nwrite behave the same way as the built-ins we\u2019ve already seen: they are called in expressions, are passed values, and return results. But writing new functions requires\nthe application of a few additional ideas that haven\u2019t yet been introduced. Moreover,\nfunctions behave very differently in Python than they do in compiled languages like C.\nHere is a brief introduction to the main concepts behind Python functions, all of which\nwe will study in this part of the book: \n\n\n\n\ndef is executable code.\n Python functions are written with a new statement, the\ndef. Unlike functions in compiled languages such as C, def is an executable statement\u2014\nyour function does not exist until Python reaches and runs the def. In fact,\nit\u2019s legal (and even occasionally useful) to nest def statements inside if statements,\nwhile loops, and even other defs. In typical operation, def statements are coded in\nmodule files and are naturally run to generate functions when a module file is first\nimported.\n\n\n\n\ndef creates an object and assigns it to a name.\n When Python reaches and runs\na def statement, it generates a new function object and assigns it to the function\u2019s\nname. As with all assignments, the function name becomes a reference to the function\nobject. There\u2019s nothing magic about the name of a function\u2014as you\u2019ll see,\nthe function object can be assigned to other names, stored in a list, and so on.\nFunction objects may also have arbitrary user-defined attributes attached to them\nto record data.\n\n\n\n\n\n\nlambda creates an object but returns it as a result.\n Functions may also be created\nwith the lambda expression, a feature that allows us to in-line function definitions\nin places where a def statement won\u2019t work syntactically\n\n\n\n\n\n\nreturn sends a result object back to the caller.\n When a function is called, the\ncaller stops until the function finishes its work and returns control to the caller.\nFunctions that compute a value send it back to the caller with a return statement;\nthe returned value becomes the result of the function call.\n\n\n\n\n\n\nyield sends a result object back to the caller, but remembers where it left\noff.\n Functions known as generators may also use the yield statement to send back\na value and suspend their state such that they may be resumed later, to produce a\nseries of results over time. This is another advanced topic covered later in this part\nof the book.\n\n\n\n\n\n\nglobal declares module-level variables that are to be assigned.\n By default, all\nnames assigned in a function are local to that function and exist only while the\nfunction runs. To assign a name in the enclosing module, functions need to list it\nin a global statement. More generally, names are always looked up in scopes\u2014\nplaces where variables are stored\u2014and assignments bind names to scopes.\n\n\n\n\n\n\nnonlocal declares enclosing function variables that are to be assigned.\n Similarly,\nthe nonlocal statement added in Python 3.0 allows a function to assign a\nname that exists in the scope of a syntactically enclosing def statement. This allows\nenclosing functions to serve as a place to retain state\u2014information remembered\nwhen a function is called\u2014without using shared global names.\n\n\n\n\n\n\nArguments are passed by assignment (object reference).\n In Python, arguments\nare passed to functions by assignment (which, as we\u2019ve learned, means by object\nreference). As you\u2019ll see, in Python\u2019s model the caller and function share objects\nby references, but there is no name aliasing. Changing an argument name within\na function does not also change the corresponding name in the caller, but changing\npassed-in mutable objects can change objects shared by the caller.\n\n\n\n\n\n\nArguments, return values, and variables are not declared.\n As with everything\nin Python, there are no type constraints on functions. In fact, nothing about a\nfunction needs to be declared ahead of time: you can pass in arguments of any type,\nreturn any kind of object, and so on. As one consequence, a single function can\noften be applied to a variety of object types\u2014any objects that sport a compatible\ninterface (methods and expressions) will do, regardless of their specific types.\n\n\n\n\n\n\nIf some of the preceding words didn\u2019t sink in, don\u2019t worry\u2014we\u2019ll explore all of these\nconcepts with real code in this part of the book. Let\u2019s get started by expanding on some\nof these ideas and looking at a few examples.\n\n\ndef Statements\n\n\nThe def statement creates a function object and assigns it to a name. Its general format\nis as follows:\n\n\ndef\n \nname\n(\narg1\n,\n \narg2\n,\n...\n \nargN\n):\n\n \nstatements\n\n\n\n\n\n\nAs with all compound Python statements, def consists of a header line followed by a\nblock of statements, usually indented (or a simple statement after the colon). The\nstatement block becomes the function\u2019s body\u2014that is, the code Python executes each\ntime the function is called.\n\nThe def header line specifies a function name that is assigned the function object, along\nwith a list of zero or more arguments (sometimes called parameters) in parentheses.\nThe argument names in the header are assigned to the objects passed in parentheses at\nthe point of call.\n\n\nFunction bodies often contain a return statement:\n\n\ndef\n \nname\n(\narg1\n,\n \narg2\n,\n...\n \nargN\n):\n\n \n...\n\n \nreturn\n \nvalue\n\n\n\n\n\n\nThe Python return statement can show up anywhere in a function body; it ends the\nfunction call and sends a result back to the caller. The return statement consists of an\nobject expression that gives the function\u2019s result. The return statement is optional; if\nit\u2019s not present, the function exits when the control flow falls off the end of the function\nbody. Technically, a function without a return statement returns the None object automatically,\nbut this return value is usually ignored.\n\n\ndef Executes at Runtime\n\n\nThe Python def is a true executable statement: when it runs, it creates a new function\nobject and assigns it to a name. (Remember, all we have in Python is runtime; there is\nno such thing as a separate compile time.) Because it\u2019s a statement, a def can appear\nanywhere a statement can\u2014even nested in other statements. For instance, although\ndefs normally are run when the module enclosing them is imported, it\u2019s also completely\nlegal to nest a function def inside an if statement to select between alternative\ndefinitions:\n\n\nif\n \ntest\n:\n\n \ndef\n \nfunc\n():\n \n# Define func this way\n\n\n...\n\n\nelse\n:\n\n \ndef\n \nfunc\n():\n \n# Or else this way\n\n \n...\n\n \n...\n\n\nfunc\n()\n \n# Call the version selected and built\n\n\n\n\n\n\nOne way to understand this code is to realize that the def is much like an = statement:\nit simply assigns a name at runtime. Unlike in compiled languages such as C, Python\nfunctions do not need to be fully defined before the program runs. More generally,\ndefs are not evaluated until they are reached and run, and the code inside defs is not\nevaluated until the functions are later called.\nBecause function definition happens at runtime, there\u2019s nothing special about the\nfunction name. What\u2019s important is the object to which it refers: \n\n\nothername\n \n=\n \nfunc\n \n# Assign function object\n\n\nothername\n()\n \n# Call func again\n\n\n\n\n\n\nHere, the function was assigned to a different name and called through the new name.\nLike everything else in Python, functions are just objects; they are recorded explicitly\nin memory at program execution time. In fact, besides calls, functions allow arbitrary\nattributes to be attached to record information for later use:\n\n\ndef\n \nfunc\n():\n \n...\n \n# Create function object\n\n\nfunc\n()\n \n# Call object\n\n\nfunc\n.\nattr\n \n=\n \nvalue\n \n# Attach attributes\n\n\n\n\n\n\nA First Example: Definitions and Calls\n\n\nApart from such runtime concepts (which tend to seem most unique to programmers\nwith backgrounds in traditional compiled languages), Python functions are straightforward\nto use. Let\u2019s code a first real example to demonstrate the basics. As you\u2019ll see,\nthere are two sides to the function picture: a definition (the def that creates a function)\nand a call (an expression that tells Python to run the function\u2019s body).\n\n\nDefinition\n\n\nHere\u2019s a definition typed interactively that defines a function called times, which returns\nthe product of its two arguments:\n\n\n \ndef\n \ntimes\n(\nx\n,\n \ny\n):\n \n# Create and assign function\n\n\n...\n \nreturn\n \nx\n \n*\n \ny\n \n# Body executed when called\n\n\n...\n\n\n\n\n\n\nWhen Python reaches and runs this def, it creates a new function object that packages\nthe function\u2019s code and assigns the object to the name times. Typically, such a statement\nis coded in a module file and runs when the enclosing file is imported; for something\nthis small, though, the interactive prompt suffices.\n\n\nCalls\n\n\nAfter the def has run, you can call (run) the function in your program by adding\nparentheses after the function\u2019s name. The parentheses may optionally contain one or\nmore object arguments, to be passed (assigned) to the names in the function\u2019s header:\n\n\n \ntimes\n(\n2\n,\n \n4\n)\n \n# Arguments in parentheses\n\n\n8\n\n\n\n\n\n\nThis expression passes two arguments to times. As mentioned previously, arguments\nare passed by assignment, so in this case the name x in the function header is assigned\nthe value 2, y is assigned the value 4, and the function\u2019s body is run. For this function,\nthe body is just a return statement that sends back the result as the value of the call\nexpression. The returned object was printed here interactively (as in most languages,\n2 * 4 is 8 in Python), but if we needed to use it later we could instead assign it to a\nvariable. For example:\n\n\n \nx\n \n=\n \ntimes\n(\n3.14\n,\n \n4\n)\n \n# Save the result object\n\n\n \nx\n\n\n12.56\n\n\n\n\n\n\nNow, watch what happens when the function is called a third time, with very different\nkinds of objects passed in:\n\n\n \ntimes\n(\nNi\n,\n \n4\n)\n \n# Functions are \ntypeless\n\n\nNiNiNiNi\n\n\n\n\n\n\nThis time, our function means something completely different (Monty Python reference\nagain intended). In this third call, a string and an integer are passed to x and y, instead\nof two numbers. Recall that * works on both numbers and sequences; because we never\ndeclare the types of variables, arguments, or return values in Python, we can use\ntimes to either multiply numbers or repeat sequences.\n\nIn other words, what our times function means and does depends on what we pass into\nit. This is a core idea in Python (and perhaps the key to using the language well), which\nwe\u2019ll explore in the next section.\n\n\n\n\nSource:\n \n\n\n \nLearning Python, Fourth Edition\n by Mark Lutz - 2009\n\n\n\n\nHow To Define Functions in Python 3\n\n\nA function is a block of instructions that performs an action and, once defined, can be reused. Functions make code more modular, allowing you to use the same code over and over again.\n\n\nPython has a number of built-in functions that you may be familiar with, including: \n\n\n\n\nprint() which will print an object to the terminal\n\n\nint() which will convert a string or number data type to an integer data type\n\n\nlen() which returns the length of an object\n\n\n\n\nFunction names include parentheses and may include parameters. \n\n\nIn this tutorial, we\u2019ll go over how to define your own functions to use in your coding projects.\n\n\nDefining a Function\n\n\nLet\u2019s start with turning the classic \u201cHello, World!\u201d program into a function.\n\n\nWe\u2019ll create a new text file in our text editor of choice, and call the program hello.py. Then, we\u2019ll define the function.\n\n\nA function is defined by using the def keyword, followed by a name of your choosing, followed by a set of parentheses which hold any parameters the function will take (they can be empty), and ending with a colon.\n\n\nIn this case, we\u2019ll define a function named hello():\n\n\ndef\n \nhello\n():\n\n\n\n\n\n\nThis sets up the initial statement for creating a function.\n\n\nFrom here, we\u2019ll add a second line with a 4-space indent to provide the instructions for what the function does. In this case, we\u2019ll be printing Hello, World! to the console:\n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\n\n\n\nOur function is now fully defined, but if we run the program at this point, nothing will happen since we didn\u2019t call the function.\n\n\nSo, outside of our defined function block, let\u2019s call the function with hello(): \n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\nhello\n()\n\n\n\n\n\n\nNow, let\u2019s run the program:\n\n\npython\n \nhello\n.\npy\n\n\n\n\n\n\nYou should receive the following output:\n\n\nHello\n,\n \nWorld\n!\n\n\n\n\n\n\nFunctions can be more complicated than the \nhello()\n function we defined above. For example, we can use for loops, conditional statements, and more within our function block.\n\n\nFor example, the function defined below utilizes a conditional statement to check if the input for the name variable contains a vowel, then uses a \nfor\n loop to iterate over the letters in the \nname\n string.\n\n\n# Define function names()\n\n\ndef\n \nnames\n():\n\n \n# Set up name variable with input\n\n \nname\n \n=\n \nstr\n(\ninput\n(\nEnter your name: \n))\n\n \n# Check whether name has a vowel\n\n \nif\n \nset\n(\naeiou\n)\n.\nintersection\n(\nname\n.\nlower\n()):\n\n \nprint\n(\nYour name contains a vowel.\n)\n\n \nelse\n:\n\n \nprint\n(\nYour name does not contain a vowel.\n)\n\n\n \n# Iterate over name\n\n \nfor\n \nletter\n \nin\n \nname\n:\n\n \nprint\n(\nletter\n)\n\n\n\n# Call the function\n\n\nnames\n()\n\n\n\n\n\n\nThe \nnames()\n function we defined above sets up a conditional statement and a for loop, showing how code can be organized within a function definition. However, depending on what we intend with our program and how we want to set up our code, we may want to define the conditional statement and the for loop as two separate functions.\n\n\nDefining functions within a program makes our code modular and reusable so that we can call the same functions without rewriting them.\n\n\nWorking with Parameters\n\n\nSo far we have looked at functions with empty parentheses that do not take arguments, but we can define parameters in function definitions within their parentheses.\n\n\nA parameter is a named entity in a function definition, specifying an argument that the function can accept.\n\n\nLet\u2019s create a small program that takes in parameters x, y, and z. We\u2019ll create a function that adds the parameters together in different configurations. The sums of these will be printed by the function. Then we\u2019ll call the function and pass numbers into the function.\n\n\ndef\n \nadd_numbers\n(\nx\n,\n \ny\n,\n \nz\n):\n\n \na\n \n=\n \nx\n \n+\n \ny\n\n \nb\n \n=\n \nx\n \n+\n \nz\n\n \nc\n \n=\n \ny\n \n+\n \nz\n\n \nprint\n(\na\n,\n \nb\n,\n \nc\n)\n\n\n\nadd_numbers\n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n\n\n\n\nWe passed the number 1 in for the x parameter, 2 in for the y parameter, and 3 in for the z parameter. These values correspond with each parameter in the order they are given.\n\n\nThe program is essentially doing the following math based on the values we passed to the parameters:\n\n\na\n \n=\n \n1\n \n+\n \n2\n\n\nb\n \n=\n \n1\n \n+\n \n3\n\n\nc\n \n=\n \n2\n \n+\n \n3\n\n\n\n\n\n\nThe function also prints a, b, and c, and based on the math above we would expect a to be equal to 3, b to be 4, and c to be 5. Let\u2019s run the program:\n\n\npython\n \nadd_numbers\n.\npy\n\n\nOutput\n \n:\n \n3\n \n4\n \n5\n\n\n\n\n\n\nWhen we pass 1, 2, and 3 as parameters to the add_numbers() function, we receive the expected output.\n\n\nParameters are arguments that are typically defined as variables within function definitions. They can be assigned values when you run the method, passing the arguments into the function.\n\n\nKeyword Arguments\n\n\nIn addition to calling parameters in order, you can use \nkeyword arguments\n in a function call, in which the caller identifies the arguments by the parameter name.\n\n\nWhen you use keyword arguments, you can use parameters out of order because the Python interpreter will use the keywords provided to match the values to the parameters.\n\n\nLet\u2019s create a function that will show us profile information for a user. We\u2019ll pass parameters to it in the form of \nusername\n (intended as a string), and \nfollowers\n (intended as an integer).\n\n\n# Define function with parameters\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n \n\n\n\n\n\nWithin the function definition statement, \nusername\n and \nfollowers\n are contained in the parentheses of the profile_info() function. The block of the function prints out information about the user as strings, making use of the two parameters.\n\n\nNow, we can call the function and assign parameters to it:\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n\n\n\n# Call function with parameters assigned as above\n\n\nprofile_info\n(\nsammyshark\n,\n \n945\n)\n\n\n\n# Call function with keyword arguments\n\n\nprofile_info\n(\nusername\n=\nAlexAnglerfish\n,\n \nfollowers\n=\n342\n)\n\n\n\n\n\n\nIn the first function call, we have filled in the information with a username of sammyshark and followers being 945, in the second function call we used keyword arguments, assigning values to the argument variables.\n\n\nLet\u2019s run the program:\n\n\npython\n \nprofile\n.\npy\n\n\nOutput\n \n:\n \n\nUsername\n:\n \nsammyshark\n\n\nFollowers\n:\n \n945\n\n\nUsername\n:\n \nAlexAnglerfish\n\n\nFollowers\n:\n \n342\n\n\n\n\n\n\nThe output shows us the usernames and numbers of followers for both users.\n\n\nThis also permits us to modify the order of the parameters, as in this example of the same program with a different call:\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n\n\n\n# Change order of parameters\n\n\nprofile_info\n(\nfollowers\n=\n820\n,\n \nusername\n=\ncameron-catfish\n)\n\n\n\n\n\n\nWhen we run the program again with the python profile.py command, we\u2019ll receive the following output:\n\n\nOutput\n:\n\n\nUsername\n:\n \ncameron\n-\ncatfish\n\n\nFollowers\n:\n \n820\n\n\n\n\n\n\nBecause the function definition maintains the same order of print() statements, if we use keyword arguments, it does not matter which order we pass them into the function call.\n\n\nDefault Argument Values\n\n\nWe can also provide default values for one or both of the parameters. Let\u2019s create a default value for the \nfollowers\n parameter with a value of 1:\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n=\n1\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n\n\n\n\n\n\nNow, we can run the function with only the username function assigned, and the number of followers will automatically default to 1. We can also still change the number of followers if we would like.\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n=\n1\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n\n\n\nprofile_info\n(\nusername\n=\nJOctopus\n)\n\n\nprofile_info\n(\nusername\n=\nsammyshark\n,\n \nfollowers\n=\n945\n)\n\n\n\n\n\n\nWhen we run the program with the python profile.py command, we\u2019ll receive the following output:\n\n\nOutput\n:\n\n\nUsername\n:\n \nJOctopus\n\n\nFollowers\n:\n \n1\n\n\nUsername\n:\n \nsammyshark\n\n\nFollowers\n:\n \n945\n\n\n\n\n\n\nProviding default parameters with values can let us skip defining values for each argument that already has a default.\n\n\nReturning a Value\n\n\nYou can pass a parameter value into a function, and a function can also produce a value.\n\n\nA function can produce a value with the return statement, which will exit a function and optionally pass an expression back to the caller. If you use a return statement with no arguments, the function will return None.\n\n\nSo far, we have used the print() statement instead of the return statement in our functions. Let\u2019s create a program that instead of printing will return a variable.\n\n\nIn a new text file called square.py, we\u2019ll create a program that squares the parameter x and returns the variable y. We issue a call to print the result variable, which is formed by running the square() function with 3 passed into it.\n\n\ndef\n \nsquare\n(\nx\n):\n\n \ny\n \n=\n \nx\n \n**\n \n2\n\n \nreturn\n \ny\n\n\n\nresult\n \n=\n \nsquare\n(\n3\n)\n\n\nprint\n(\nresult\n)\n\n\n\n\n\n\nWe can run the program and see the output:\n\n\npython\n \nsquare\n.\npy\n\n\nOutput\n:\n\n\n9\n\n\n\n\n\n\nThe integer 9 is returned as output, which is what we would expect by asking Python to find the square of 3.\n\n\nTo further understand how the \nreturn\n statement works, we can comment out the \nreturn\n statement in the program:\n\n\ndef\n \nsquare\n(\nx\n):\n\n \ny\n \n=\n \nx\n \n**\n \n2\n\n \n# return y\n\n\n\nresult\n \n=\n \nsquare\n(\n3\n)\n\n\nprint\n(\nresult\n)\n\n\n\n\n\n\nNow, let\u2019s run the program again:\n\n\npython\n \nsquare\n.\npy\n\n\nOutput\n:\n\n\nNone\n\n\n\n\n\n\nWithout using the \nreturn\n statement here, the program cannot return a value so the value defaults to None.\n\n\nAs another example, in the \nadd_numbers.py\n program above, we could swap out the \nprint()\n statement for a return statement.\n\n\ndef\n \nadd_numbers\n(\nx\n,\n \ny\n,\n \nz\n):\n\n \na\n \n=\n \nx\n \n+\n \ny\n\n \nb\n \n=\n \nx\n \n+\n \nz\n\n \nc\n \n=\n \ny\n \n+\n \nz\n\n \nreturn\n \na\n,\n \nb\n,\n \nc\n\n\n\nsums\n \n=\n \nadd_numbers\n(\n1\n,\n \n2\n,\n \n3\n)\n\n\nprint\n(\nsums\n)\n\n\n\n\n\n\nOutside of the function, we set the variable sums equal to the result of the function taking in 1, 2, and 3 as we did above. Then we called a print of the sums variable.\n\n\nLet\u2019s run the program again now that it has the return statement:\n\n\nOutput\n:\n\n\n(\n3\n,\n \n4\n,\n \n5\n)\n\n\n\n\n\n\nWe receive the same numbers 3, 4, and 5 as output that we received previously by using the print() statement in the function. This time it is delivered as a tuple because the return statement\u2019s expression list has at least one comma.\n\n\nFunctions exit immediately when they hit a return statement, whether or not they\u2019re returning a value.\n\n\ndef\n \nloop_five\n():\n\n \nfor\n \nx\n \nin\n \nrange\n(\n0\n,\n \n25\n):\n\n \nprint\n(\nx\n)\n\n \nif\n \nx\n \n==\n \n5\n:\n\n \n# Stop function at x == 5\n\n \nreturn\n\n \nprint\n(\nThis line will not execute.\n)\n\n\n\nloop_five\n()\n\n\n\n\n\n\nUsing the \nreturn\n statement within the \nfor\n loop ends the function, so the line that is outside of the loop will not run. If, instead, we had used a \nbreak\n statement, only the loop would have exited at that time, and the last print() line would run.\n\n\nThe \nreturn\n statement exits a function, and may return a value when issued with a parameter.\n\n\nUsing \nmain()\n as a Function\n\n\nAlthough in Python you can call the function at the bottom of your program and it will run (as we have done in the examples above), many programming languages (like C++ and Java) require a main function in order to execute. Including a main() function, though not required, can structure our Python programs in a logical way that puts the most important components of the program into one function. It can also make our programs easier for non-Python programmers to read.\n\n\nWe\u2019ll start with adding a main() function to the hello.py program above. We\u2019ll keep our hello() function, and then define a main() function:\n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\ndef\n \nmain\n():\n\n\n\n\n\n\nWithin the main() function, let\u2019s include a print() statement to let us know that we\u2019re in the main() function. Additionally, let\u2019s call the hello() function within the main() function:\n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\n\ndef\n \nmain\n():\n\n \nprint\n(\nThis is the main function\n)\n\n \nhello\n()\n\n\n\n\n\n\nFinally, at the bottom of the program we\u2019ll call the main() function:\n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\ndef\n \nmain\n():\n\n \nprint\n(\nThis is the main function.\n)\n\n \nhello\n()\n\n\n\nmain\n()\n\n\n\n\n\n\nAt this point, we can run our program:\n\n\npython\n \nhello\n.\npy\n\n\nOutput\n:\n\n\nThis\n \nis\n \nthe\n \nmain\n \nfunction\n.\n\n\nHello\n,\n \nWorld\n!\n\n\n\n\n\n\nBecause we called the \nhello()\n function within main() and then only called \nmain()\n to run, the \nHello, World!\n text printed only once, after the string that told us we were in the main function.\n\n\nNext we\u2019re going to be working with multiple functions, so it is worth reviewing the variable scope of global and local variables. If you define a variable within a function block, you\u2019ll only be able to use that variable within that function. If you would like to use variables across functions it may be better to declare a global variable.\n\n\nIn Python, '_\nmain_\n' is the name of the scope where top-level code will execute. When a program is run from standard input, a script, or from an interactive prompt, its _\nname_\n is set equal to '_\nmain_\n'.\n\n\nBecause of this, there is a convention to use the following construction:\n\n\nif\n \n__name__\n \n==\n \n__main__\n:\n\n \n# Code to run when this is the main program here\n\n\n\n\n\n\nThis lets program files be used either:\n- as the main program and run what follows the if statement\n- as a module and not run what follows the if statement.\n\n\nAny code that is not contained within this statement will be executed upon running. If you\u2019re using your program file as a module, the code that is not in this statement will also execute upon its import while running the secondary file.\n\n\nLet\u2019s expand on our names.py program above, and create a new file called more_names.py. In this program we\u2019ll declare a global variable and modify our original names() function so that the instructions are in two discrete functions.\n\n\nThe first function, \nhas_vowel()\n will check to see if the name string contains a vowel.\n\n\nThe second function \nprint_letters()\n will print each letter of the \nname\n string.\n\n\n# Declare global variable name for use in all functions\n\n\nname\n \n=\n \nstr\n(\ninput\n(\nEnter your name: \n))\n\n\n\n\n# Define function to check if name contains a vowel\n\n\ndef\n \nhas_vowel\n():\n\n \nif\n \nset\n(\naeiou\n)\n.\nintersection\n(\nname\n.\nlower\n()):\n\n \nprint\n(\nYour name contains a vowel.\n)\n\n \nelse\n:\n\n \nprint\n(\nYour name does not contain a vowel.\n)\n\n\n\n\n# Iterate over letters in name string\n\n\ndef\n \nprint_letters\n():\n\n \nfor\n \nletter\n \nin\n \nname\n:\n\n \nprint\n(\nletter\n)\n\n\n\n\n\n\nWith this set up, let\u2019s define the main() function which will contain a call to both the has_vowel() and the print_letters() functions.\n\n\n# Declare global variable name for use in all functions\n\n\nname\n \n=\n \nstr\n(\ninput\n(\nEnter your name: \n))\n\n\n\n\n# Define function to check if name contains a vowel\n\n\ndef\n \nhas_vowel\n():\n\n \nif\n \nset\n(\naeiou\n)\n.\nintersection\n(\nname\n.\nlower\n()):\n\n \nprint\n(\nYour name contains a vowel.\n)\n\n \nelse\n:\n\n \nprint\n(\nYour name does not contain a vowel.\n)\n\n\n\n\n# Iterate over letters in name string\n\n\ndef\n \nprint_letters\n():\n\n \nfor\n \nletter\n \nin\n \nname\n:\n\n \nprint\n(\nletter\n)\n\n\n\n\n# Define main method that calls other functions\n\n\ndef\n \nmain\n():\n\n \nhas_vowel\n()\n\n \nprint_letters\n()\n\n\n\n\n\n\nFinally, we\u2019ll add the \nif \\__name\\__ == '\\__main\\__':\n construction at the bottom of the file. For our purposes, since we have put all the functions we would like to do in the \nmain()\n function, we\u2019ll call the \nmain()\n function following this if statement.\n\n\n# Declare global variable name for use in all functions\n\n\nname\n \n=\n \nstr\n(\ninput\n(\nEnter your name: \n))\n\n\n\n\n# Define function to check if name contains a vowel\n\n\ndef\n \nhas_vowel\n():\n\n \nif\n \nset\n(\naeiou\n)\n.\nintersection\n(\nname\n.\nlower\n()):\n\n \nprint\n(\nYour name contains a vowel.\n)\n\n \nelse\n:\n\n \nprint\n(\nYour name does not contain a vowel.\n)\n\n\n\n\n# Iterate over letters in name string\n\n\ndef\n \nprint_letters\n():\n\n \nfor\n \nletter\n \nin\n \nname\n:\n\n \nprint\n(\nletter\n)\n\n\n\n\n# Define main method that calls other functions\n\n\ndef\n \nmain\n():\n\n \nhas_vowel\n()\n\n \nprint_letters\n()\n\n\n\n\n# Execute main() function\n\n\nif\n \n__name__\n \n==\n \n__main__\n:\n\n \nmain\n()\n\n\n\n\n\n\nWe can now run the program:\n\n\npython\n \nmore_names\n.\npy\n\n\n\n\n\n\nThe program will show the same output as the names.py program, but here the code is more organized and can be used in a modular way without modification.\n\n\nIf you did not want to declare a main() function, you alternatively could have ended the program like this:\n\n\nif\n \n__name__\n \n==\n \n__main__\n:\n\n \nhas_vowel\n()\n\n \nprint_letters\n()\n\n\n\n\n\n\nUsing \nmain()\n as a function and the if _\nname_\n == '_\nmain_\n': statement can organize your code in a logical way, making it more readable and modular.\n\n\nConclusion\n\n\nFunctions are code blocks of instructions that perform actions within a program, helping to make our code reusable and modular.\n\n\nTo learn more about how to make your code more modular, you can read our guide on \nHow To Write Modules in Python 3.\n\n\n\n\nSource:\n \n\n\n https://stackoverflow.com/questions/1909512/what-is-python-used-for\n\n\n\n\nPrefer Exceptions to Returning None\n\n\nWhen writing utility functions, there\u2019s a draw for Python programmers to give special\nmeaning to the return value of None. It seems to makes sense in some cases. For example,\nsay you want a helper function that divides one number by another. In the case of dividing\nby zero, returning None seems natural because the result is undefined.\n\n\ndef\n \ndivide\n(\na\n,\n \nb\n):\n\n \ntry\n:\n\n \nreturn\n \na\n \n/\n \nb\n\n \nexcept\n \nZeroDivisionError\n:\n\n \nreturn\n \nNone\n\n\n\n\n\n\nCode using this function can interpret the return value accordingly.\n\n\nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nif\n \nresult\n \nis\n \nNone\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n\n\n\n\n\n\nWhat happens when the numerator is zero? That will cause the return value to also be zero\n(if the denominator is non-zero). This can cause problems when you evaluate the result in\na condition like an if statement. You may accidentally look for any False equivalent\nvalue to indicate errors instead of only looking for None.\n\n\nx\n,\n \ny\n \n=\n \n0\n,\n \n5\n\n\nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nif\n \nnot\n \nresult\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n \n# This is wrong!\n\n\n\n\n\n\nThis is a common mistake in Python code when None has special meaning. This is why\nreturning None from a function is error prone. There are two ways to reduce the chance of\nsuch errors. \n\n\nThe first way is to split the return value into a two-tuple. The first part of the tuple\nindicates that the operation was a success or failure. The second part is the actual result\nthat was computed.\n\n\ndef\n \ndivide\n(\na\n,\n \nb\n):\n\n \ntry\n:\n\n \nreturn\n \nTrue\n,\n \na\n \n/\n \nb\n\n \nexcept\n \nZeroDivisionError\n:\n\n \nreturn\n \nFalse\n,\n \nNone\n\n\n\n\n\n\nCallers of this function have to unpack the tuple. That forces them to consider the status\npart of the tuple instead of just looking at the result of division.\n\n\nsuccess\n,\n \nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nif\n \nnot\n \nsuccess\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n\n\n\n\n\n\nThe problem is that callers can easily ignore the first part of the tuple (using the\nunderscore variable name, a Python convention for unused variables). The resulting code\ndoesn\u2019t look wrong at first glance. This is as bad as just returning None.\n\n\n_\n,\n \nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nif\n \nnot\n \nresult\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n\n\n\n\n\n\nThe second, better way to reduce these errors is to never return None at all. Instead, raise\nan exception up to the caller and make them deal with it. Here, I turn a\nZeroDivisionError into a ValueError to indicate to the caller that the input\nvalues are bad: \n\n\ndef\n \ndivide\n(\na\n,\n \nb\n):\n\n \ntry\n:\n\n \nreturn\n \na\n \n/\n \nb\n\n \nexcept\n \nZeroDivisionError\n \nas\n \ne\n:\n\n \nraise\n \nValueError\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n \nfrom\n \ne\n\n\n\n\n\n\nNow the caller should handle the exception for the invalid input case.\nThe caller no longer requires a condition on the return value of the function. If the\nfunction didn\u2019t raise an exception, then the return value must be good. The outcome of\nexception handling is clear.\n\n\nx\n,\n \ny\n \n=\n \n5\n,\n \n2\n\n\ntry\n:\n\n \nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nexcept\n \nValueError\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n\n\nelse\n:\n\n \nprint\n(\n\u2018\nResult\n \nis\n \n%.\n1\nf\n\u2019\n \n%\n \nresult\n)\n\n\n\n\nResult\n \nis\n \n2.5\n\n\n\n\n\n\nThings to Remember\n\n\n\n\nFunctions that return None to indicate special meaning are error prone because\nNone and other values (e.g., zero, the empty string) all evaluate to False in\nconditional expressions. \n\n\nRaise exceptions to indicate special situations instead of returning None. Expect the\ncalling code to handle exceptions properly when they\u2019re documented.\n\n\n\n\n\n\nSource:\n \n\n\n \nEffective Python\n by Brett Slatkin", + "text": "Function Calls\n\n\nIn the context of programming, a function is a named sequence of statements that\nperforms a computation. When you define a function, you specify the name and the\nsequence of statements. Later, you can \u201ccall\u201d the function by name. We have already seen\none example of a function call:\n\n\n \ntype\n(\n32\n)\n\n\ntype\n \nint\n\n\n\n\n\n\nThe name of the function is type. The expression in parentheses is called the argument\nof the function. The result, for this function, is the type of the argument.\n\nIt is common to say that a function \u201ctakes\u201d an argument and \u201creturns\u201d a result. The result\nis called the return value.\n\n\nType Conversion Functions\n\n\nPython provides built-in functions that convert values from one type to another. The\nint function takes any value and converts it to an integer, if it can, or complains\notherwise:\n\n\n \nint\n(\n32\n)\n\n\n32\n\n\n \nint\n(\nHello\n)\n\n\nValueError\n:\n \ninvalid\n \nliteral\n \nfor\n \nint\n():\n \nHello\n\n\n\n\n\n\nint can convert floating-point values to integers, but it doesn\u2019t round off; it chops off\nthe fraction part:\n\n\n \nint\n(\n3.99999\n)\n\n\n3\n\n\n \nint\n(\n-\n2.3\n)\n\n\n-\n2\n\n\n\n\n\n\nfloat converts integers and strings to floating-point numbers:\n\n\n \nfloat\n(\n32\n)\n\n\n32.0\n\n\n \nfloat\n(\n3.14159\n)\n\n\n3.14159\n\n\n\n\n\n\nFinally, str converts its argument to a string:\n\n\n \nstr\n(\n32\n)\n\n\n32\n\n\n \nstr\n(\n3.14159\n)\n\n\n3.14159\n\n\n\n\n\n\nAdding New Functions\n\n\nSo far, we have only been using the functions that come with Python, but it is also possible\nto add new functions. A function definition specifies the name of a new function and\nthe sequence of statements that execute when the function is called.\n\nHere is an example:\n\n\ndef\n \nprint_lyrics\n():\n\n \nprint\n \nI\nm a lumberjack, and I\nm okay.\n\n \nprint\n \nI sleep all night and I work all day.\n\n\n\n\n\n\ndef\n is a keyword that indicates that this is a function definition. The name of the function\nis print_lyrics. The rules for function names are the same as for variable names: letters,\nnumbers and some punctuation marks are legal, but the first character can\u2019t be a number.\nYou can\u2019t use a keyword as the name of a function, and you should avoid having a variable\nand a function with the same name.\n\nThe empty parentheses after the name indicate that this function doesn\u2019t take any\narguments.\n\nThe first line of the function definition is called the header; the rest is called the body.\nThe header has to end with a colon and the body has to be indented. By convention, the\nindentation is always four spaces; see \u201cDebugging\u201d (page 33). The body can contain any\nnumber of statements.\n\nThe strings in the print statements are enclosed in double quotes. Single quotes and\ndouble quotes do the same thing; most people use single quotes except in cases like this\nwhere a single quote (which is also an apostrophe) appears in the string.\nIf you type a function definition in interactive mode, the interpreter prints ellipses (...)\nto let you know that the definition isn\u2019t complete:\n\n\ndef\n \nprint_lyrics\n():\n\n \nprint\n \nI\nm a lumberjack, and I\nm okay.\n\n \nprint\n \nI sleep all night and I work all day.\n\n\n\n\n\n\nTo end the function, you have to enter an empty line (this is not necessary in a script).\nDefining a function creates a variable with the same name.\n\n\n \nprint\n \nprint_lyrics\n\n\nfunction\n \nprint_lyrics\n \nat\n \n0xb7e99e9c\n\n\n \ntype\n(\nprint_lyrics\n)\n\n\ntype\n \nfunction\n\n\n\n\n\n\nThe value of print_lyrics is a function object, which has type 'function'.\nThe syntax for calling the new function is the same as for built-in functions:\n\n\n \nprint_lyrics\n()\n\n\nI\nm a lumberjack, and I\nm\n \nokay\n.\n\n\nI\n \nsleep\n \nall\n \nnight\n \nand\n \nI\n \nwork\n \nall\n \nday\n.\n\n\n\n\n\n\nOnce you have defined a function, you can use it inside another function. For example,\nto repeat the previous refrain, we could write a function called repeat_lyrics: \n\n\ndef\n \nrepeat_lyrics\n():\n\n \nprint_lyrics\n()\n\n \nprint_lyrics\n()\n\n\n\n\n\n\nAnd then call repeat_lyrics: \n\n\n \nrepeat_lyrics\n()\n\n\nI\nm a lumberjack, and I\nm\n \nokay\n.\n\n\nI\n \nsleep\n \nall\n \nnight\n \nand\n \nI\n \nwork\n \nall\n \nday\n.\n\n\nI\nm a lumberjack, and I\nm\n \nokay\n.\n\n\nI\n \nsleep\n \nall\n \nnight\n \nand\n \nI\n \nwork\n \nall\n \nday\n.\n\n\n\n\n\n\nBut that\u2019s not really how the song goes.\n\n\nDefinitions and Uses\n\n\nPulling together the code fragments from the previous section, the whole program looks\nlike this:\n\n\ndef\n \nprint_lyrics\n():\n\n \nprint\n \nI\nm a lumberjack, and I\nm okay.\n\n \nprint\n \nI sleep all night and I work all day.\n\n\ndef\n \nrepeat_lyrics\n():\n\n \nprint_lyrics\n()\n\n \nprint_lyrics\n()\n \n\n\nrepeat_lyrics\n()\n\n\n\n\n\n\nThis program contains two function definitions: print_lyrics and repeat_lyrics.\nFunction definitions get executed just like other statements, but the result creates func\ntion objects. The statements inside the function do not get executed until the function\nis called, and the function definition generates no output.\n\nAs you might expect, you have to create a function before you can execute it. In other\nwords, the function definition has to be executed before the function is called the first\ntime. \n\n\nFlow of Execution\n\n\nIn order to ensure that a function is defined before its first use, you have to know the\norder in which statements are executed, which is called the flow of execution.\n\nExecution always begins at the first statement of the program. Statements are executed\none at a time, in order, from top to bottom.\n\n\nFunction definitions do not alter the flow of execution of the program, but remember\nthat statements inside the function are not executed until the function is called.\nA function call is like a detour in the flow of execution. Instead of going to the next\nstatement, the flow jumps to the body of the function, executes all the statements there,\nand then comes back to pick up where it left off.\n\nThat sounds simple enough, until you remember that one function can call another.\nWhile in the middle of one function, the program might have to execute the statements\nin another function. But while executing that new function, the program might have to\nexecute yet another function!\n\nFortunately, Python is good at keeping track of where it is, so each time a function\ncompletes, the program picks up where it left off in the function that called it. When it\ngets to the end of the program, it terminates.\n\nWhat\u2019s the moral of this sordid tale? When you read a program, you don\u2019t always want\nto read from top to bottom. Sometimes it makes more sense if you follow the flow of\nexecution. \n\n\nParameters and Arguments\n\n\nSome of the built-in functions we have seen require arguments. For example, when you\ncall math.sin you pass a number as an argument. Some functions take more than one\nargument: \nmath.pow\n takes two, the base and the exponent.\nInside the function, the arguments are assigned to variables called parameters. Here is\nan example of a user-defined function that takes an argument:\n\n\n \ndef\n \nprint_twice\n(\nbruce\n):\n\n \nprint\n \nbruce\n\n \nprint\n \nbruce\n\n\n\n\n\n\nThis function assigns the argument to a parameter named bruce. When the function is\ncalled, it prints the value of the parameter (whatever it is) twice.\n\nThis function works with any value that can be printed.\n\n\n \nprint_twice\n(\nSpam\n)\n\n\nSpam\n\n\nSpam\n\n\n \nprint_twice\n(\n17\n)\n\n\n17\n\n\n17\n\n\n \nprint_twice\n(\nmath\n.\npi\n)\n\n\n3.14159265359\n\n\n3.14159265359\n \n\n\n\n\n\nThe same rules of composition that apply to built-in functions also apply to user-defined\nfunctions, so we can use any kind of expression as an argument for \nprint_twice\n:\n\n\n \nprint_twice\n(\nSpam \n*\n4\n)\n\n\nSpam\n \nSpam\n \nSpam\n \nSpam\n\n\nSpam\n \nSpam\n \nSpam\n \nSpam\n\n\n \nprint_twice\n(\nmath\n.\ncos\n(\nmath\n.\npi\n))\n\n\n-\n1.0\n\n\n-\n1.0\n\n\n\n\n\n\nThe argument is evaluated before the function is called, so in the examples the expres\nsions 'Spam '*4 and math.cos(math.pi) are only evaluated once.\n\nYou can also use a variable as an argument:\n\n\n \nmichael\n \n=\n \nEric, the half a bee.\n\n\n \nprint_twice\n(\nmichael\n)\n\n\nEric\n,\n \nthe\n \nhalf\n \na\n \nbee\n.\n\n\nEric\n,\n \nthe\n \nhalf\n \na\n \nbee\n.\n\n\n\n\n\n\nThe name of the variable we pass as an argument (michael) has nothing to do with the\nname of the parameter (bruce). It doesn\u2019t matter what the value was called back home\n(in the caller); here in print_twice, we call everybody bruce.\n\n\nVariables and Parameters Are Local\n\n\nWhen you create a variable inside a function, it is local, which means that it only exists\ninside the function. For example:\n\n\ndef\n \ncat_twice\n(\npart1\n,\n \npart2\n):\n\n \ncat\n \n=\n \npart1\n \n+\n \npart2\n\n \nprint_twice\n(\ncat\n)\n\n\n\n\n\n\nThis function takes two arguments, concatenates them, and prints the result twice. Here\nis an example that uses it:\n\n\n \nline1\n \n=\n \nBing tiddle \n\n\n \nline2\n \n=\n \ntiddle bang.\n\n\n \ncat_twice\n(\nline1\n,\n \nline2\n)\n\n\nBing\n \ntiddle\n \ntiddle\n \nbang\n.\n\n\nBing\n \ntiddle\n \ntiddle\n \nbang\n.\n\n\n\n\n\n\nWhen cat_twice terminates, the variable cat is destroyed. If we try to print it, we get\nan exception:\n\n\n \nprint\n \ncat\n\n\nNameError\n:\n \nname\n \ncat\n \nis\n \nnot\n \ndefined\n\n\n\n\n\n\nParameters are also local. For example, outside print_twice, there is no such thing as\nbruce.\n\n\nStack Diagrams\n\n\nTo keep track of which variables can be used where, it is sometimes useful to draw a\nstack diagram. Like state diagrams, stack diagrams show the value of each variable, but\nthey also show the function each variable belongs to.\n\nEach function is represented by a frame. A frame is a box with the name of a function\nbeside it and the parameters and variables of the function inside it. The stack diagram\nfor the previous example is shown in Figure 3-1.\n\n\n\n\nThe frames are arranged in a stack that indicates which function called which, and so\non. In this example, print_twice was called by cat_twice, and cat_twice was called\nby \n\\__main\\__\n, which is a special name for the topmost frame. When you create a variable\noutside of any function, it belongs to \n\\__main\\__\n.\n\n\nEach parameter refers to the same value as its corresponding argument. So, part1 has\nthe same value as line1, part2 has the same value as line2, and bruce has the same\nvalue as cat.\nIf an error occurs during a function call, Python prints the name of the function, and\nthe name of the function that called it, and the name of the function that called that, all\nthe way back to \n\\__main__\\\n.\n\n\nFor example, if you try to access cat from within print_twice, you get a NameError:\n\n\nTraceback\n \n(\ninnermost\n \nlast\n):\n\n \nFile\n \ntest.py\n,\n \nline\n \n13\n,\n \nin\n \n__main__\n\n \ncat_twice\n(\nline1\n,\n \nline2\n)\n\n \nFile\n \ntest.py\n,\n \nline\n \n5\n,\n \nin\n \ncat_twice\n\n \nprint_twice\n(\ncat\n)\n\n \nFile\n \ntest.py\n,\n \nline\n \n9\n,\n \nin\n \nprint_twice\n\n \nprint\n \ncat\n\n \nNameError\n:\n \nname\n \ncat\n \nis\n \nnot\n \ndefined\n\n\n\n\n\n\nThis list of functions is called a traceback. It tells you what program file the error oc\ncurred in, and what line, and what functions were executing at the time. It also shows\nthe line of code that caused the error.\nThe order of the functions in the traceback is the same as the order of the frames in the\nstack diagram. The function that is currently running is listed at the bottom.\n\n\nFruitful Functions and Void Functions\n\n\nSome of the functions we are using, such as the math functions, yield results; for lack of\na better name, I call them fruitful functions. Other functions, like print_twice, per\nform an action but don\u2019t return a value. They are called void functions.\nWhen you call a fruitful function, you almost always want to do something with the\nresult; for example, you might assign it to a variable or use it as part of an expression:\n\n\nx\n \n=\n \nmath\n.\ncos\n(\nradians\n)\n\n\ngolden\n \n=\n \n(\nmath\n.\nsqrt\n(\n5\n)\n \n+\n \n1\n)\n \n/\n \n2\n\n\n\n\n\n\nWhen you call a function in interactive mode, Python displays the result:\n\n\n \nmath\n.\nsqrt\n(\n5\n)\n\n\n2.2360679774997898\n\n\n\n\n\n\nBut in a script, if you call a fruitful function all by itself, the return value is lost forever!\n\n\nmath\n.\nsqrt\n(\n5\n)\n\n\n\n\n\n\nThis script computes the square root of 5, but since it doesn\u2019t store or display the result,\nit is not very useful.\nVoid functions might display something on the screen or have some other effect, but\nthey don\u2019t have a return value. If you try to assign the result to a variable, you get a special\nvalue called None.\n\n\n \nresult\n \n=\n \nprint_twice\n(\nBing\n)\n\n\nBing\n\n\nBing\n\n\n \nprint\n \nresult\n\n\nNone\n\n\n\n\n\n\nThe value None is not the same as the string 'None'. It is a special value that has its own\ntype:\n\n\n \nprint\n \ntype\n(\nNone\n)\n\n\ntype\n \nNoneType\n\n\n\n\n\n\nThe functions we have written so far are all void. We will start writing fruitful functions\nin a few chapters.\n\n\nWhy Functions?\n\n\nIt may not be clear why it is worth the trouble to divide a program into functions. There\nare several reasons:\n\n- Creating a new function gives you an opportunity to name a group of statements,\nwhich makes your program easier to read and debug.\n- Functions can make a program smaller by eliminating repetitive code. Later, if you\nmake a change, you only have to make it in one place.\n- Dividing a long program into functions allows you to debug the parts one at a time\nand then assemble them into a working whole.\n- Well-designed functions are often useful for many programs. Once you write and\ndebug one, you can reuse it.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nFunctions by by Mark Lutz (Learning Python, Fourth Edition)\n\n\nFunction Basics\n\n\nIn Part III, we looked at basic procedural statements in Python. Here, we\u2019ll move on to\nexplore a set of additional statements that we can use to create functions of our own.\n\nIn simple terms, a function is a device that groups a set of statements so they can be run\nmore than once in a program. Functions also can compute a result value and let us\nspecify parameters that serve as function inputs, which may differ each time the code\nis run. Coding an operation as a function makes it a generally useful tool, which we\ncan use in a variety of contexts.\n\nMore fundamentally, functions are the alternative to programming by cutting and\npasting\u2014rather than having multiple redundant copies of an operation\u2019s code, we can\nfactor it into a single function. In so doing, we reduce our future work radically: if the\noperation must be changed later, we only have one copy to update, not many.\n\nFunctions are the most basic program structure Python provides for maximizing code\nreuse and minimizing code redundancy. As we\u2019ll see, functions are also a design tool\nthat lets us split complex systems into manageable parts. Table 16-1 summarizes the\nprimary function-related tools we\u2019ll study in this part of the book.\n\n\n\n\n\n\n\n\nStatement\n\n\nExamples\n\n\n\n\n\n\n\n\n\n\nCalls\n\n\nmyfunc('spam', 'eggs', meat=ham)\n\n\n\n\n\n\ndef, return\n\n\ndef adder(a, b=1, *c): return a + b + c[0]\n\n\n\n\n\n\nglobal\n\n\ndef changer():global x; x = 'new'\n\n\n\n\n\n\nnonlocal\n\n\ndef changer():nonlocal x; x = 'new'\n\n\n\n\n\n\nyield\n\n\ndef squares(x):for i in range(x): yield i ** 2\n\n\n\n\n\n\nlambda\n\n\nfuncs = [lambda x: x*\n2, lambda x: x\n3]\n\n\n\n\n\n\n\n\nWhy Use Functions?\n\n\nBefore we get into the details, let\u2019s establish a clear picture of what functions are all\nabout. Functions are a nearly universal program-structuring device. You may have\ncome across them before in other languages, where they may have been called subroutines\nor procedures. As a brief introduction, functions serve two primary development\nroles:\n\n\nMaximizing code reuse and minimizing redundancy\n\nAs in most programming languages, Python functions are the simplest way to\npackage logic you may wish to use in more than one place and more than one time.\nUp until now, all the code we\u2019ve been writing has run immediately. Functions allow\nus to group and generalize code to be used arbitrarily many times later. Because\nthey allow us to code an operation in a single place and use it in many places,\nPython functions are the most basic factoring tool in the language: they allow us\nto reduce code redundancy in our programs, and thereby reduce maintenance\neffort. \n\n\nProcedural decomposition\n\nFunctions also provide a tool for splitting systems into pieces that have well-defined\nroles. For instance, to make a pizza from scratch, you would start by mixing the\ndough, rolling it out, adding toppings, baking it, and so on. If you were programming\na pizza-making robot, functions would help you divide the overall \u201cmake\npizza\u201d task into chunks\u2014one function for each subtask in the process. It\u2019s easier\nto implement the smaller tasks in isolation than it is to implement the entire process\nat once. In general, functions are about procedure\u2014how to do something, rather\nthan what you\u2019re doing it to. We\u2019ll see why this distinction matters in Part VI, when\nwe start making new object with classes. \n\n\n\n\nIn this part of the book, we\u2019ll explore the tools used to code functions in Python: function\nbasics, scope rules, and argument passing, along with a few related concepts such\nas generators and functional tools. Because its importance begins to become more apparent\nat this level of coding, we\u2019ll also revisit the notion of polymorphism introduced\nearlier in the book. As you\u2019ll see, functions don\u2019t imply much new syntax, but they do\nlead us to some bigger programming ideas.\n\n\nCoding Functions\n\n\nAlthough it wasn\u2019t made very formal, we\u2019ve already used some functions in earlier\nchapters. For instance, to make a file object, we called the built-in open function; similarly,\nwe used the len built-in function to ask for the number of items in a collection\nobject.\n\nIn this chapter, we will explore how to write new functions in Python. Functions we\nwrite behave the same way as the built-ins we\u2019ve already seen: they are called in expressions, are passed values, and return results. But writing new functions requires\nthe application of a few additional ideas that haven\u2019t yet been introduced. Moreover,\nfunctions behave very differently in Python than they do in compiled languages like C.\nHere is a brief introduction to the main concepts behind Python functions, all of which\nwe will study in this part of the book: \n\n\n\n\ndef is executable code.\n Python functions are written with a new statement, the\ndef. Unlike functions in compiled languages such as C, def is an executable statement\u2014\nyour function does not exist until Python reaches and runs the def. In fact,\nit\u2019s legal (and even occasionally useful) to nest def statements inside if statements,\nwhile loops, and even other defs. In typical operation, def statements are coded in\nmodule files and are naturally run to generate functions when a module file is first\nimported.\n\n\n\n\ndef creates an object and assigns it to a name.\n When Python reaches and runs\na def statement, it generates a new function object and assigns it to the function\u2019s\nname. As with all assignments, the function name becomes a reference to the function\nobject. There\u2019s nothing magic about the name of a function\u2014as you\u2019ll see,\nthe function object can be assigned to other names, stored in a list, and so on.\nFunction objects may also have arbitrary user-defined attributes attached to them\nto record data.\n\n\n\n\n\n\nlambda creates an object but returns it as a result.\n Functions may also be created\nwith the lambda expression, a feature that allows us to in-line function definitions\nin places where a def statement won\u2019t work syntactically\n\n\n\n\n\n\nreturn sends a result object back to the caller.\n When a function is called, the\ncaller stops until the function finishes its work and returns control to the caller.\nFunctions that compute a value send it back to the caller with a return statement;\nthe returned value becomes the result of the function call.\n\n\n\n\n\n\nyield sends a result object back to the caller, but remembers where it left\noff.\n Functions known as generators may also use the yield statement to send back\na value and suspend their state such that they may be resumed later, to produce a\nseries of results over time. This is another advanced topic covered later in this part\nof the book.\n\n\n\n\n\n\nglobal declares module-level variables that are to be assigned.\n By default, all\nnames assigned in a function are local to that function and exist only while the\nfunction runs. To assign a name in the enclosing module, functions need to list it\nin a global statement. More generally, names are always looked up in scopes\u2014\nplaces where variables are stored\u2014and assignments bind names to scopes.\n\n\n\n\n\n\nnonlocal declares enclosing function variables that are to be assigned.\n Similarly,\nthe nonlocal statement added in Python 3.0 allows a function to assign a\nname that exists in the scope of a syntactically enclosing def statement. This allows\nenclosing functions to serve as a place to retain state\u2014information remembered\nwhen a function is called\u2014without using shared global names.\n\n\n\n\n\n\nArguments are passed by assignment (object reference).\n In Python, arguments\nare passed to functions by assignment (which, as we\u2019ve learned, means by object\nreference). As you\u2019ll see, in Python\u2019s model the caller and function share objects\nby references, but there is no name aliasing. Changing an argument name within\na function does not also change the corresponding name in the caller, but changing\npassed-in mutable objects can change objects shared by the caller.\n\n\n\n\n\n\nArguments, return values, and variables are not declared.\n As with everything\nin Python, there are no type constraints on functions. In fact, nothing about a\nfunction needs to be declared ahead of time: you can pass in arguments of any type,\nreturn any kind of object, and so on. As one consequence, a single function can\noften be applied to a variety of object types\u2014any objects that sport a compatible\ninterface (methods and expressions) will do, regardless of their specific types.\n\n\n\n\n\n\nIf some of the preceding words didn\u2019t sink in, don\u2019t worry\u2014we\u2019ll explore all of these\nconcepts with real code in this part of the book. Let\u2019s get started by expanding on some\nof these ideas and looking at a few examples.\n\n\ndef Statements\n\n\nThe def statement creates a function object and assigns it to a name. Its general format\nis as follows:\n\n\ndef\n \nname\n(\narg1\n,\n \narg2\n,\n...\n \nargN\n):\n\n \nstatements\n\n\n\n\n\n\nAs with all compound Python statements, def consists of a header line followed by a\nblock of statements, usually indented (or a simple statement after the colon). The\nstatement block becomes the function\u2019s body\u2014that is, the code Python executes each\ntime the function is called.\n\nThe def header line specifies a function name that is assigned the function object, along\nwith a list of zero or more arguments (sometimes called parameters) in parentheses.\nThe argument names in the header are assigned to the objects passed in parentheses at\nthe point of call.\n\n\nFunction bodies often contain a return statement:\n\n\ndef\n \nname\n(\narg1\n,\n \narg2\n,\n...\n \nargN\n):\n\n \n...\n\n \nreturn\n \nvalue\n\n\n\n\n\n\nThe Python return statement can show up anywhere in a function body; it ends the\nfunction call and sends a result back to the caller. The return statement consists of an\nobject expression that gives the function\u2019s result. The return statement is optional; if\nit\u2019s not present, the function exits when the control flow falls off the end of the function\nbody. Technically, a function without a return statement returns the None object automatically,\nbut this return value is usually ignored.\n\n\ndef Executes at Runtime\n\n\nThe Python def is a true executable statement: when it runs, it creates a new function\nobject and assigns it to a name. (Remember, all we have in Python is runtime; there is\nno such thing as a separate compile time.) Because it\u2019s a statement, a def can appear\nanywhere a statement can\u2014even nested in other statements. For instance, although\ndefs normally are run when the module enclosing them is imported, it\u2019s also completely\nlegal to nest a function def inside an if statement to select between alternative\ndefinitions:\n\n\nif\n \ntest\n:\n\n \ndef\n \nfunc\n():\n \n# Define func this way\n\n\n...\n\n\nelse\n:\n\n \ndef\n \nfunc\n():\n \n# Or else this way\n\n \n...\n\n \n...\n\n\nfunc\n()\n \n# Call the version selected and built\n\n\n\n\n\n\nOne way to understand this code is to realize that the def is much like an = statement:\nit simply assigns a name at runtime. Unlike in compiled languages such as C, Python\nfunctions do not need to be fully defined before the program runs. More generally,\ndefs are not evaluated until they are reached and run, and the code inside defs is not\nevaluated until the functions are later called.\nBecause function definition happens at runtime, there\u2019s nothing special about the\nfunction name. What\u2019s important is the object to which it refers: \n\n\nothername\n \n=\n \nfunc\n \n# Assign function object\n\n\nothername\n()\n \n# Call func again\n\n\n\n\n\n\nHere, the function was assigned to a different name and called through the new name.\nLike everything else in Python, functions are just objects; they are recorded explicitly\nin memory at program execution time. In fact, besides calls, functions allow arbitrary\nattributes to be attached to record information for later use:\n\n\ndef\n \nfunc\n():\n \n...\n \n# Create function object\n\n\nfunc\n()\n \n# Call object\n\n\nfunc\n.\nattr\n \n=\n \nvalue\n \n# Attach attributes\n\n\n\n\n\n\nA First Example: Definitions and Calls\n\n\nApart from such runtime concepts (which tend to seem most unique to programmers\nwith backgrounds in traditional compiled languages), Python functions are straightforward\nto use. Let\u2019s code a first real example to demonstrate the basics. As you\u2019ll see,\nthere are two sides to the function picture: a definition (the def that creates a function)\nand a call (an expression that tells Python to run the function\u2019s body).\n\n\nDefinition\n\n\nHere\u2019s a definition typed interactively that defines a function called times, which returns\nthe product of its two arguments:\n\n\n \ndef\n \ntimes\n(\nx\n,\n \ny\n):\n \n# Create and assign function\n\n\n...\n \nreturn\n \nx\n \n*\n \ny\n \n# Body executed when called\n\n\n...\n\n\n\n\n\n\nWhen Python reaches and runs this def, it creates a new function object that packages\nthe function\u2019s code and assigns the object to the name times. Typically, such a statement\nis coded in a module file and runs when the enclosing file is imported; for something\nthis small, though, the interactive prompt suffices.\n\n\nCalls\n\n\nAfter the def has run, you can call (run) the function in your program by adding\nparentheses after the function\u2019s name. The parentheses may optionally contain one or\nmore object arguments, to be passed (assigned) to the names in the function\u2019s header:\n\n\n \ntimes\n(\n2\n,\n \n4\n)\n \n# Arguments in parentheses\n\n\n8\n\n\n\n\n\n\nThis expression passes two arguments to times. As mentioned previously, arguments\nare passed by assignment, so in this case the name x in the function header is assigned\nthe value 2, y is assigned the value 4, and the function\u2019s body is run. For this function,\nthe body is just a return statement that sends back the result as the value of the call\nexpression. The returned object was printed here interactively (as in most languages,\n2 * 4 is 8 in Python), but if we needed to use it later we could instead assign it to a\nvariable. For example:\n\n\n \nx\n \n=\n \ntimes\n(\n3.14\n,\n \n4\n)\n \n# Save the result object\n\n\n \nx\n\n\n12.56\n\n\n\n\n\n\nNow, watch what happens when the function is called a third time, with very different\nkinds of objects passed in:\n\n\n \ntimes\n(\nNi\n,\n \n4\n)\n \n# Functions are \ntypeless\n\n\nNiNiNiNi\n\n\n\n\n\n\nThis time, our function means something completely different (Monty Python reference\nagain intended). In this third call, a string and an integer are passed to x and y, instead\nof two numbers. Recall that * works on both numbers and sequences; because we never\ndeclare the types of variables, arguments, or return values in Python, we can use\ntimes to either multiply numbers or repeat sequences.\n\nIn other words, what our times function means and does depends on what we pass into\nit. This is a core idea in Python (and perhaps the key to using the language well), which\nwe\u2019ll explore in the next section.\n\n\n\n\nSource:\n \n\n\n \nLearning Python, Fourth Edition\n by Mark Lutz - 2009\n\n\n\n\nHow To Define Functions in Python 3\n\n\nA function is a block of instructions that performs an action and, once defined, can be reused. Functions make code more modular, allowing you to use the same code over and over again.\n\n\nPython has a number of built-in functions that you may be familiar with, including: \n\n\n\n\nprint() which will print an object to the terminal\n\n\nint() which will convert a string or number data type to an integer data type\n\n\nlen() which returns the length of an object\n\n\n\n\nFunction names include parentheses and may include parameters. \n\n\nIn this tutorial, we\u2019ll go over how to define your own functions to use in your coding projects.\n\n\nDefining a Function\n\n\nLet\u2019s start with turning the classic \u201cHello, World!\u201d program into a function.\n\n\nWe\u2019ll create a new text file in our text editor of choice, and call the program hello.py. Then, we\u2019ll define the function.\n\n\nA function is defined by using the def keyword, followed by a name of your choosing, followed by a set of parentheses which hold any parameters the function will take (they can be empty), and ending with a colon.\n\n\nIn this case, we\u2019ll define a function named hello():\n\n\ndef\n \nhello\n():\n\n\n\n\n\n\nThis sets up the initial statement for creating a function.\n\n\nFrom here, we\u2019ll add a second line with a 4-space indent to provide the instructions for what the function does. In this case, we\u2019ll be printing Hello, World! to the console:\n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\n\n\n\nOur function is now fully defined, but if we run the program at this point, nothing will happen since we didn\u2019t call the function.\n\n\nSo, outside of our defined function block, let\u2019s call the function with hello(): \n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\nhello\n()\n\n\n\n\n\n\nNow, let\u2019s run the program:\n\n\npython\n \nhello\n.\npy\n\n\n\n\n\n\nYou should receive the following output:\n\n\nHello\n,\n \nWorld\n!\n\n\n\n\n\n\nFunctions can be more complicated than the \nhello()\n function we defined above. For example, we can use for loops, conditional statements, and more within our function block.\n\n\nFor example, the function defined below utilizes a conditional statement to check if the input for the name variable contains a vowel, then uses a \nfor\n loop to iterate over the letters in the \nname\n string.\n\n\n# Define function names()\n\n\ndef\n \nnames\n():\n\n \n# Set up name variable with input\n\n \nname\n \n=\n \nstr\n(\ninput\n(\nEnter your name: \n))\n\n \n# Check whether name has a vowel\n\n \nif\n \nset\n(\naeiou\n)\n.\nintersection\n(\nname\n.\nlower\n()):\n\n \nprint\n(\nYour name contains a vowel.\n)\n\n \nelse\n:\n\n \nprint\n(\nYour name does not contain a vowel.\n)\n\n\n \n# Iterate over name\n\n \nfor\n \nletter\n \nin\n \nname\n:\n\n \nprint\n(\nletter\n)\n\n\n\n# Call the function\n\n\nnames\n()\n\n\n\n\n\n\nThe \nnames()\n function we defined above sets up a conditional statement and a for loop, showing how code can be organized within a function definition. However, depending on what we intend with our program and how we want to set up our code, we may want to define the conditional statement and the for loop as two separate functions.\n\n\nDefining functions within a program makes our code modular and reusable so that we can call the same functions without rewriting them.\n\n\nWorking with Parameters\n\n\nSo far we have looked at functions with empty parentheses that do not take arguments, but we can define parameters in function definitions within their parentheses.\n\n\nA parameter is a named entity in a function definition, specifying an argument that the function can accept.\n\n\nLet\u2019s create a small program that takes in parameters x, y, and z. We\u2019ll create a function that adds the parameters together in different configurations. The sums of these will be printed by the function. Then we\u2019ll call the function and pass numbers into the function.\n\n\ndef\n \nadd_numbers\n(\nx\n,\n \ny\n,\n \nz\n):\n\n \na\n \n=\n \nx\n \n+\n \ny\n\n \nb\n \n=\n \nx\n \n+\n \nz\n\n \nc\n \n=\n \ny\n \n+\n \nz\n\n \nprint\n(\na\n,\n \nb\n,\n \nc\n)\n\n\n\nadd_numbers\n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n\n\n\n\nWe passed the number 1 in for the x parameter, 2 in for the y parameter, and 3 in for the z parameter. These values correspond with each parameter in the order they are given.\n\n\nThe program is essentially doing the following math based on the values we passed to the parameters:\n\n\na\n \n=\n \n1\n \n+\n \n2\n\n\nb\n \n=\n \n1\n \n+\n \n3\n\n\nc\n \n=\n \n2\n \n+\n \n3\n\n\n\n\n\n\nThe function also prints a, b, and c, and based on the math above we would expect a to be equal to 3, b to be 4, and c to be 5. Let\u2019s run the program:\n\n\npython\n \nadd_numbers\n.\npy\n\n\nOutput\n \n:\n \n3\n \n4\n \n5\n\n\n\n\n\n\nWhen we pass 1, 2, and 3 as parameters to the add_numbers() function, we receive the expected output.\n\n\nParameters are arguments that are typically defined as variables within function definitions. They can be assigned values when you run the method, passing the arguments into the function.\n\n\nKeyword Arguments\n\n\nIn addition to calling parameters in order, you can use \nkeyword arguments\n in a function call, in which the caller identifies the arguments by the parameter name.\n\n\nWhen you use keyword arguments, you can use parameters out of order because the Python interpreter will use the keywords provided to match the values to the parameters.\n\n\nLet\u2019s create a function that will show us profile information for a user. We\u2019ll pass parameters to it in the form of \nusername\n (intended as a string), and \nfollowers\n (intended as an integer).\n\n\n# Define function with parameters\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n \n\n\n\n\n\nWithin the function definition statement, \nusername\n and \nfollowers\n are contained in the parentheses of the profile_info() function. The block of the function prints out information about the user as strings, making use of the two parameters.\n\n\nNow, we can call the function and assign parameters to it:\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n\n\n\n# Call function with parameters assigned as above\n\n\nprofile_info\n(\nsammyshark\n,\n \n945\n)\n\n\n\n# Call function with keyword arguments\n\n\nprofile_info\n(\nusername\n=\nAlexAnglerfish\n,\n \nfollowers\n=\n342\n)\n\n\n\n\n\n\nIn the first function call, we have filled in the information with a username of sammyshark and followers being 945, in the second function call we used keyword arguments, assigning values to the argument variables.\n\n\nLet\u2019s run the program:\n\n\npython\n \nprofile\n.\npy\n\n\nOutput\n \n:\n \n\nUsername\n:\n \nsammyshark\n\n\nFollowers\n:\n \n945\n\n\nUsername\n:\n \nAlexAnglerfish\n\n\nFollowers\n:\n \n342\n\n\n\n\n\n\nThe output shows us the usernames and numbers of followers for both users.\n\n\nThis also permits us to modify the order of the parameters, as in this example of the same program with a different call:\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n\n\n\n# Change order of parameters\n\n\nprofile_info\n(\nfollowers\n=\n820\n,\n \nusername\n=\ncameron-catfish\n)\n\n\n\n\n\n\nWhen we run the program again with the python profile.py command, we\u2019ll receive the following output:\n\n\nOutput\n:\n\n\nUsername\n:\n \ncameron\n-\ncatfish\n\n\nFollowers\n:\n \n820\n\n\n\n\n\n\nBecause the function definition maintains the same order of print() statements, if we use keyword arguments, it does not matter which order we pass them into the function call.\n\n\nDefault Argument Values\n\n\nWe can also provide default values for one or both of the parameters. Let\u2019s create a default value for the \nfollowers\n parameter with a value of 1:\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n=\n1\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n\n\n\n\n\n\nNow, we can run the function with only the username function assigned, and the number of followers will automatically default to 1. We can also still change the number of followers if we would like.\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n=\n1\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n\n\n\nprofile_info\n(\nusername\n=\nJOctopus\n)\n\n\nprofile_info\n(\nusername\n=\nsammyshark\n,\n \nfollowers\n=\n945\n)\n\n\n\n\n\n\nWhen we run the program with the python profile.py command, we\u2019ll receive the following output:\n\n\nOutput\n:\n\n\nUsername\n:\n \nJOctopus\n\n\nFollowers\n:\n \n1\n\n\nUsername\n:\n \nsammyshark\n\n\nFollowers\n:\n \n945\n\n\n\n\n\n\nProviding default parameters with values can let us skip defining values for each argument that already has a default.\n\n\nReturning a Value\n\n\nYou can pass a parameter value into a function, and a function can also produce a value.\n\n\nA function can produce a value with the return statement, which will exit a function and optionally pass an expression back to the caller. If you use a return statement with no arguments, the function will return None.\n\n\nSo far, we have used the print() statement instead of the return statement in our functions. Let\u2019s create a program that instead of printing will return a variable.\n\n\nIn a new text file called square.py, we\u2019ll create a program that squares the parameter x and returns the variable y. We issue a call to print the result variable, which is formed by running the square() function with 3 passed into it.\n\n\ndef\n \nsquare\n(\nx\n):\n\n \ny\n \n=\n \nx\n \n**\n \n2\n\n \nreturn\n \ny\n\n\n\nresult\n \n=\n \nsquare\n(\n3\n)\n\n\nprint\n(\nresult\n)\n\n\n\n\n\n\nWe can run the program and see the output:\n\n\npython\n \nsquare\n.\npy\n\n\nOutput\n:\n\n\n9\n\n\n\n\n\n\nThe integer 9 is returned as output, which is what we would expect by asking Python to find the square of 3.\n\n\nTo further understand how the \nreturn\n statement works, we can comment out the \nreturn\n statement in the program:\n\n\ndef\n \nsquare\n(\nx\n):\n\n \ny\n \n=\n \nx\n \n**\n \n2\n\n \n# return y\n\n\n\nresult\n \n=\n \nsquare\n(\n3\n)\n\n\nprint\n(\nresult\n)\n\n\n\n\n\n\nNow, let\u2019s run the program again:\n\n\npython\n \nsquare\n.\npy\n\n\nOutput\n:\n\n\nNone\n\n\n\n\n\n\nWithout using the \nreturn\n statement here, the program cannot return a value so the value defaults to None.\n\n\nAs another example, in the \nadd_numbers.py\n program above, we could swap out the \nprint()\n statement for a return statement.\n\n\ndef\n \nadd_numbers\n(\nx\n,\n \ny\n,\n \nz\n):\n\n \na\n \n=\n \nx\n \n+\n \ny\n\n \nb\n \n=\n \nx\n \n+\n \nz\n\n \nc\n \n=\n \ny\n \n+\n \nz\n\n \nreturn\n \na\n,\n \nb\n,\n \nc\n\n\n\nsums\n \n=\n \nadd_numbers\n(\n1\n,\n \n2\n,\n \n3\n)\n\n\nprint\n(\nsums\n)\n\n\n\n\n\n\nOutside of the function, we set the variable sums equal to the result of the function taking in 1, 2, and 3 as we did above. Then we called a print of the sums variable.\n\n\nLet\u2019s run the program again now that it has the return statement:\n\n\nOutput\n:\n\n\n(\n3\n,\n \n4\n,\n \n5\n)\n\n\n\n\n\n\nWe receive the same numbers 3, 4, and 5 as output that we received previously by using the print() statement in the function. This time it is delivered as a tuple because the return statement\u2019s expression list has at least one comma.\n\n\nFunctions exit immediately when they hit a return statement, whether or not they\u2019re returning a value.\n\n\ndef\n \nloop_five\n():\n\n \nfor\n \nx\n \nin\n \nrange\n(\n0\n,\n \n25\n):\n\n \nprint\n(\nx\n)\n\n \nif\n \nx\n \n==\n \n5\n:\n\n \n# Stop function at x == 5\n\n \nreturn\n\n \nprint\n(\nThis line will not execute.\n)\n\n\n\nloop_five\n()\n\n\n\n\n\n\nUsing the \nreturn\n statement within the \nfor\n loop ends the function, so the line that is outside of the loop will not run. If, instead, we had used a \nbreak\n statement, only the loop would have exited at that time, and the last print() line would run.\n\n\nThe \nreturn\n statement exits a function, and may return a value when issued with a parameter.\n\n\nUsing \nmain()\n as a Function\n\n\nAlthough in Python you can call the function at the bottom of your program and it will run (as we have done in the examples above), many programming languages (like C++ and Java) require a main function in order to execute. Including a main() function, though not required, can structure our Python programs in a logical way that puts the most important components of the program into one function. It can also make our programs easier for non-Python programmers to read.\n\n\nWe\u2019ll start with adding a main() function to the hello.py program above. We\u2019ll keep our hello() function, and then define a main() function:\n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\ndef\n \nmain\n():\n\n\n\n\n\n\nWithin the main() function, let\u2019s include a print() statement to let us know that we\u2019re in the main() function. Additionally, let\u2019s call the hello() function within the main() function:\n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\n\ndef\n \nmain\n():\n\n \nprint\n(\nThis is the main function\n)\n\n \nhello\n()\n\n\n\n\n\n\nFinally, at the bottom of the program we\u2019ll call the main() function:\n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\ndef\n \nmain\n():\n\n \nprint\n(\nThis is the main function.\n)\n\n \nhello\n()\n\n\n\nmain\n()\n\n\n\n\n\n\nAt this point, we can run our program:\n\n\npython\n \nhello\n.\npy\n\n\nOutput\n:\n\n\nThis\n \nis\n \nthe\n \nmain\n \nfunction\n.\n\n\nHello\n,\n \nWorld\n!\n\n\n\n\n\n\nBecause we called the \nhello()\n function within main() and then only called \nmain()\n to run, the \nHello, World!\n text printed only once, after the string that told us we were in the main function.\n\n\nNext we\u2019re going to be working with multiple functions, so it is worth reviewing the variable scope of global and local variables. If you define a variable within a function block, you\u2019ll only be able to use that variable within that function. If you would like to use variables across functions it may be better to declare a global variable.\n\n\nIn Python, '_\nmain_\n' is the name of the scope where top-level code will execute. When a program is run from standard input, a script, or from an interactive prompt, its _\nname_\n is set equal to '_\nmain_\n'.\n\n\nBecause of this, there is a convention to use the following construction:\n\n\nif\n \n__name__\n \n==\n \n__main__\n:\n\n \n# Code to run when this is the main program here\n\n\n\n\n\n\nThis lets program files be used either:\n- as the main program and run what follows the if statement\n- as a module and not run what follows the if statement.\n\n\nAny code that is not contained within this statement will be executed upon running. If you\u2019re using your program file as a module, the code that is not in this statement will also execute upon its import while running the secondary file.\n\n\nLet\u2019s expand on our names.py program above, and create a new file called more_names.py. In this program we\u2019ll declare a global variable and modify our original names() function so that the instructions are in two discrete functions.\n\n\nThe first function, \nhas_vowel()\n will check to see if the name string contains a vowel.\n\n\nThe second function \nprint_letters()\n will print each letter of the \nname\n string.\n\n\n# Declare global variable name for use in all functions\n\n\nname\n \n=\n \nstr\n(\ninput\n(\nEnter your name: \n))\n\n\n\n\n# Define function to check if name contains a vowel\n\n\ndef\n \nhas_vowel\n():\n\n \nif\n \nset\n(\naeiou\n)\n.\nintersection\n(\nname\n.\nlower\n()):\n\n \nprint\n(\nYour name contains a vowel.\n)\n\n \nelse\n:\n\n \nprint\n(\nYour name does not contain a vowel.\n)\n\n\n\n\n# Iterate over letters in name string\n\n\ndef\n \nprint_letters\n():\n\n \nfor\n \nletter\n \nin\n \nname\n:\n\n \nprint\n(\nletter\n)\n\n\n\n\n\n\nWith this set up, let\u2019s define the main() function which will contain a call to both the has_vowel() and the print_letters() functions.\n\n\n# Declare global variable name for use in all functions\n\n\nname\n \n=\n \nstr\n(\ninput\n(\nEnter your name: \n))\n\n\n\n\n# Define function to check if name contains a vowel\n\n\ndef\n \nhas_vowel\n():\n\n \nif\n \nset\n(\naeiou\n)\n.\nintersection\n(\nname\n.\nlower\n()):\n\n \nprint\n(\nYour name contains a vowel.\n)\n\n \nelse\n:\n\n \nprint\n(\nYour name does not contain a vowel.\n)\n\n\n\n\n# Iterate over letters in name string\n\n\ndef\n \nprint_letters\n():\n\n \nfor\n \nletter\n \nin\n \nname\n:\n\n \nprint\n(\nletter\n)\n\n\n\n\n# Define main method that calls other functions\n\n\ndef\n \nmain\n():\n\n \nhas_vowel\n()\n\n \nprint_letters\n()\n\n\n\n\n\n\nFinally, we\u2019ll add the \nif \\__name\\__ == '\\__main\\__':\n construction at the bottom of the file. For our purposes, since we have put all the functions we would like to do in the \nmain()\n function, we\u2019ll call the \nmain()\n function following this if statement.\n\n\n# Declare global variable name for use in all functions\n\n\nname\n \n=\n \nstr\n(\ninput\n(\nEnter your name: \n))\n\n\n\n\n# Define function to check if name contains a vowel\n\n\ndef\n \nhas_vowel\n():\n\n \nif\n \nset\n(\naeiou\n)\n.\nintersection\n(\nname\n.\nlower\n()):\n\n \nprint\n(\nYour name contains a vowel.\n)\n\n \nelse\n:\n\n \nprint\n(\nYour name does not contain a vowel.\n)\n\n\n\n\n# Iterate over letters in name string\n\n\ndef\n \nprint_letters\n():\n\n \nfor\n \nletter\n \nin\n \nname\n:\n\n \nprint\n(\nletter\n)\n\n\n\n\n# Define main method that calls other functions\n\n\ndef\n \nmain\n():\n\n \nhas_vowel\n()\n\n \nprint_letters\n()\n\n\n\n\n# Execute main() function\n\n\nif\n \n__name__\n \n==\n \n__main__\n:\n\n \nmain\n()\n\n\n\n\n\n\nWe can now run the program:\n\n\npython\n \nmore_names\n.\npy\n\n\n\n\n\n\nThe program will show the same output as the names.py program, but here the code is more organized and can be used in a modular way without modification.\n\n\nIf you did not want to declare a main() function, you alternatively could have ended the program like this:\n\n\nif\n \n__name__\n \n==\n \n__main__\n:\n\n \nhas_vowel\n()\n\n \nprint_letters\n()\n\n\n\n\n\n\nUsing \nmain()\n as a function and the if _\nname_\n == '_\nmain_\n': statement can organize your code in a logical way, making it more readable and modular.\n\n\nConclusion\n\n\nFunctions are code blocks of instructions that perform actions within a program, helping to make our code reusable and modular.\n\n\nTo learn more about how to make your code more modular, you can read our guide on \nHow To Write Modules in Python 3.\n\n\n\n\nSource:\n \n\n\n https://stackoverflow.com/questions/1909512/what-is-python-used-for\n\n\n\n\nPrefer Exceptions to Returning None\n\n\nWhen writing utility functions, there\u2019s a draw for Python programmers to give special\nmeaning to the return value of None. It seems to makes sense in some cases. For example,\nsay you want a helper function that divides one number by another. In the case of dividing\nby zero, returning None seems natural because the result is undefined.\n\n\ndef\n \ndivide\n(\na\n,\n \nb\n):\n\n \ntry\n:\n\n \nreturn\n \na\n \n/\n \nb\n\n \nexcept\n \nZeroDivisionError\n:\n\n \nreturn\n \nNone\n\n\n\n\n\n\nCode using this function can interpret the return value accordingly.\n\n\nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nif\n \nresult\n \nis\n \nNone\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n\n\n\n\n\n\nWhat happens when the numerator is zero? That will cause the return value to also be zero\n(if the denominator is non-zero). This can cause problems when you evaluate the result in\na condition like an if statement. You may accidentally look for any False equivalent\nvalue to indicate errors instead of only looking for None.\n\n\nx\n,\n \ny\n \n=\n \n0\n,\n \n5\n\n\nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nif\n \nnot\n \nresult\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n \n# This is wrong!\n\n\n\n\n\n\nThis is a common mistake in Python code when None has special meaning. This is why\nreturning None from a function is error prone. There are two ways to reduce the chance of\nsuch errors. \n\n\nThe first way is to split the return value into a two-tuple. The first part of the tuple\nindicates that the operation was a success or failure. The second part is the actual result\nthat was computed.\n\n\ndef\n \ndivide\n(\na\n,\n \nb\n):\n\n \ntry\n:\n\n \nreturn\n \nTrue\n,\n \na\n \n/\n \nb\n\n \nexcept\n \nZeroDivisionError\n:\n\n \nreturn\n \nFalse\n,\n \nNone\n\n\n\n\n\n\nCallers of this function have to unpack the tuple. That forces them to consider the status\npart of the tuple instead of just looking at the result of division.\n\n\nsuccess\n,\n \nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nif\n \nnot\n \nsuccess\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n\n\n\n\n\n\nThe problem is that callers can easily ignore the first part of the tuple (using the\nunderscore variable name, a Python convention for unused variables). The resulting code\ndoesn\u2019t look wrong at first glance. This is as bad as just returning None.\n\n\n_\n,\n \nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nif\n \nnot\n \nresult\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n\n\n\n\n\n\nThe second, better way to reduce these errors is to never return None at all. Instead, raise\nan exception up to the caller and make them deal with it. Here, I turn a\nZeroDivisionError into a ValueError to indicate to the caller that the input\nvalues are bad: \n\n\ndef\n \ndivide\n(\na\n,\n \nb\n):\n\n \ntry\n:\n\n \nreturn\n \na\n \n/\n \nb\n\n \nexcept\n \nZeroDivisionError\n \nas\n \ne\n:\n\n \nraise\n \nValueError\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n \nfrom\n \ne\n\n\n\n\n\n\nNow the caller should handle the exception for the invalid input case.\nThe caller no longer requires a condition on the return value of the function. If the\nfunction didn\u2019t raise an exception, then the return value must be good. The outcome of\nexception handling is clear.\n\n\nx\n,\n \ny\n \n=\n \n5\n,\n \n2\n\n\ntry\n:\n\n \nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nexcept\n \nValueError\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n\n\nelse\n:\n\n \nprint\n(\n\u2018\nResult\n \nis\n \n%.\n1\nf\n\u2019\n \n%\n \nresult\n)\n\n\n\n\nResult\n \nis\n \n2.5\n\n\n\n\n\n\nThings to Remember\n\n\n\n\nFunctions that return None to indicate special meaning are error prone because\nNone and other values (e.g., zero, the empty string) all evaluate to False in\nconditional expressions. \n\n\nRaise exceptions to indicate special situations instead of returning None. Expect the\ncalling code to handle exceptions properly when they\u2019re documented.\n\n\n\n\n\n\nSource:\n \n\n\n \nEffective Python\n by Brett Slatkin", "title": "Functions" }, { @@ -402,7 +402,7 @@ }, { "location": "/beginner/Functions/#function-basics", - "text": "In Part III, we looked at basic procedural statements in Python. Here, we\u2019ll move on to\nexplore a set of additional statements that we can use to create functions of our own. \nIn simple terms, a function is a device that groups a set of statements so they can be run\nmore than once in a program. Functions also can compute a result value and let us\nspecify parameters that serve as function inputs, which may differ each time the code\nis run. Coding an operation as a function makes it a generally useful tool, which we\ncan use in a variety of contexts. \nMore fundamentally, functions are the alternative to programming by cutting and\npasting\u2014rather than having multiple redundant copies of an operation\u2019s code, we can\nfactor it into a single function. In so doing, we reduce our future work radically: if the\noperation must be changed later, we only have one copy to update, not many. \nFunctions are the most basic program structure Python provides for maximizing code\nreuse and minimizing code redundancy. As we\u2019ll see, functions are also a design tool\nthat lets us split complex systems into manageable parts. Table 16-1 summarizes the\nprimary function-related tools we\u2019ll study in this part of the book. Statement | Examples | ------|------| Calls | myfunc('spam', 'eggs', meat=ham) | def, return | def adder(a, b=1, c): return a + b + c[0]| global | def changer():global x; x = 'new' | nonlocal | def changer():nonlocal x; x = 'new'| yield | def squares(x):for i in range(x): yield i 2 | lambda | funcs = [lambda x: x 2, lambda x: x 3]", + "text": "In Part III, we looked at basic procedural statements in Python. Here, we\u2019ll move on to\nexplore a set of additional statements that we can use to create functions of our own. \nIn simple terms, a function is a device that groups a set of statements so they can be run\nmore than once in a program. Functions also can compute a result value and let us\nspecify parameters that serve as function inputs, which may differ each time the code\nis run. Coding an operation as a function makes it a generally useful tool, which we\ncan use in a variety of contexts. \nMore fundamentally, functions are the alternative to programming by cutting and\npasting\u2014rather than having multiple redundant copies of an operation\u2019s code, we can\nfactor it into a single function. In so doing, we reduce our future work radically: if the\noperation must be changed later, we only have one copy to update, not many. \nFunctions are the most basic program structure Python provides for maximizing code\nreuse and minimizing code redundancy. As we\u2019ll see, functions are also a design tool\nthat lets us split complex systems into manageable parts. Table 16-1 summarizes the\nprimary function-related tools we\u2019ll study in this part of the book. Statement Examples Calls myfunc('spam', 'eggs', meat=ham) def, return def adder(a, b=1, *c): return a + b + c[0] global def changer():global x; x = 'new' nonlocal def changer():nonlocal x; x = 'new' yield def squares(x):for i in range(x): yield i ** 2 lambda funcs = [lambda x: x* 2, lambda x: x 3]", "title": "Function Basics" }, { From 6556ac68e77c37a212070cb7f06942a4c8daa39f Mon Sep 17 00:00:00 2001 From: Goga Patarkatsishvili Date: Fri, 8 Sep 2017 16:23:29 +0400 Subject: [PATCH 31/39] .. --- docs/beginner/Scopes.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/beginner/Scopes.md b/docs/beginner/Scopes.md index afb4119..46c714d 100644 --- a/docs/beginner/Scopes.md +++ b/docs/beginner/Scopes.md @@ -112,6 +112,7 @@ names and objects clear: changing an object is not an assignment to a name. - > **Source:** -> :fa-book: **Learning Python, Fourth Edition** by Mark Lutz - 2009 \ No newline at end of file +> :fa-book: **Learning Python, Fourth Edition** by Mark Lutz - 2009 + +good resource : http://sebastianraschka.com/Articles/2014_python_scope_and_namespaces.html \ No newline at end of file From 18724deb026a5875ffadce6b3b827415fb967088 Mon Sep 17 00:00:00 2001 From: Goga Patarkatsishvili Date: Tue, 19 Sep 2017 16:36:01 +0400 Subject: [PATCH 32/39] added article and video about python context manager --- README.md | 4 +- docs/advanced/Context_Managers.md | 114 ++++++++++++++++++++++++++++++ docs/index.md | 1 + site/index.html | 1 + site/mkdocs/search_index.json | 4 +- site/sitemap.xml | 18 ++--- 6 files changed, 130 insertions(+), 12 deletions(-) create mode 100644 docs/advanced/Context_Managers.md diff --git a/README.md b/README.md index 66275d7..874fd14 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ So, You can start study from here: - ... - Advanced - ... + - [Contect Managers](https://ent1c3d.github.io/Python-Synopsis/site/advanced/Context_Managers) - [Python Metaclasses](https://ent1c3d.github.io/Python-Synopsis/site/advanced/Python_Metaclasses) - ... @@ -54,4 +55,5 @@ So, You can start study from here: - **Assignment statements in Python are more interesting than you might think** by Dibya Chakravorty - **Understanding Python variables and Memory Management** by Sreejith Kesavan - **Quick Tip: What Is a Metaclass in Python?** by Abder-Rahman Ali - - **Understanding Python metaclasses** by Ionel Cristian Mărieș \ No newline at end of file + - **Understanding Python metaclasses** by Ionel Cristian Mărieș + - **How Exactly Do Context Managers Work?**by Evan Dempsey \ No newline at end of file diff --git a/docs/advanced/Context_Managers.md b/docs/advanced/Context_Managers.md new file mode 100644 index 0000000..aa02552 --- /dev/null +++ b/docs/advanced/Context_Managers.md @@ -0,0 +1,114 @@ +## How Exactly Do Context Managers Work? + +Context managers (PEP 343) are pretty important in Python. You probably use one every time you open a file: +```python +with open('cake.txt') as c: + gobble_gobble(c) +``` +But how well do you understand what’s going on behind the scenes? + +### CONTEXT MANAGER CLASSES +It’s actually quite simple. A context manager is a class that implements an `__enter__` and an `__exit__` method. + +Let’s imagine you want to you print a line of text to the console surrounded with asterisks. Here’s a context manager to do it: + +```python +class asterisks(): + def __enter__(self): + print('*' * 32) + + def __exit__(self, exc_type, exc_val, exc_tb): + print('*' * 32) +``` +The `__exit__` method takes three arguments apart from `self`. Those arguments contain information about any errors that occurred inside the `with` block. + +You can use `asterisks` in the same way as any of the built-in context managers: +```python +>>> with asterisks(): +>>> print("Context Managers Rock!") +******************************** +Context Managers Rock! +******************************** +``` + +### ACCESSING THE CONTEXT INSIDE THE WITH BLOCK +If you need to get something back and use it inside the with block – such as a file descriptor – you simply return it from `__enter__`: +```python +class myopen(): + def __init__(self, filename, filemode): + self.filename = filename + self.filemode = filemode + + def __enter__(self): + self.file = open(self.filename, self.filemode) + return self.file + + def __exit__(self, exc_type, exc_val, exc_tb): + self.file.close() +``` +`myopen` works identically to the built-in `open`: +```python +with myopen("beer.txt") as b: + guzzle_guzzle(b) +``` + +### THE CONTEXTMANAGER DECORATOR + +Thankfully, you don’t have to implement a class every time. The `contextlib` package has a `contextmanager` decorator that you can apply to generators to automatically transform them into context managers: +```python +from contextlib import contextmanager + +@contextmanager +def spoiler(): + print('') + yield + print('') +``` +The code before `yield` corresponds to `__enter__` and the code after `yield` corresponds to `__exit__`. A context manager generator should have exactly one `yield` in it. + +It works the same as the class version: +```python +>>> with spoiler(): +>>> print("Jon Snow is Luke's father.") + +Jon Snow is Luke's father. + +``` + +### ROLL YOUR OWN CONTEXTMANAGER DECORATOR +The implementation in `contextlib` is complicated, but it’s not hard to write something that works similarly with the exception of a few edge cases: +```python +def contextmanager(gen): + class CMWrapper(object): + def __init__(self, wrapped): + self.generator = wrapped + + def __enter__(self): + return next(self.generator) + + def __exit__(self, ex_type, value, traceback): + try: + next(self.generator) + except StopIteration: + pass + + def inner(*args, **kwargs): + return CMWrapper(gen(*args, **kwargs)) + + return inner +``` +It’s not as robust as the real implementation, but it should be understandable. Here are the key points: +- The inner function instantiates a copy of the nested CMWrapper class with a handle on the generator passed into the decorator. +- `__enter__` calls next() on the generator and returns the yielded value so it can be used in the with block. +- `__exit__` calls next() again and catches the StopIteration exception that the generator throws when it finishes. + +That’s it for now. If you want to learn more about context managers, I recommend you take a look at the code for `contextlib`. + +> **Source:** +> :fa-link: https://www.smallsurething.com/how-exactly-do-context-managers-work/ + + +## Python Context Managers and the "with" Statement (__enter__ & __exit__) **VIDEO** +[![IMAGE ALT TEXT HERE](https://img.youtube.com/vi/iba-I4CrmyA/0.jpg)](https://youtu.be/iba-I4CrmyA) + + diff --git a/docs/index.md b/docs/index.md index 458e209..404e4e2 100644 --- a/docs/index.md +++ b/docs/index.md @@ -24,5 +24,6 @@ Of course, it needs plenty of time to organize best resources based on the topic - ... - Advanced - ... + - [Contect Managers](https://ent1c3d.github.io/Python-Synopsis/site/advanced/Context_Managers) - [Python Metaclasses](https://ent1c3d.github.io/Python-Synopsis/site/advanced/Python_Metaclasses) - ... \ No newline at end of file diff --git a/site/index.html b/site/index.html index 7c1d2a2..edf461a 100644 --- a/site/index.html +++ b/site/index.html @@ -440,6 +440,7 @@

          Python Study Guide

        • Advanced diff --git a/site/mkdocs/search_index.json b/site/mkdocs/search_index.json index d688f91..5db16d7 100644 --- a/site/mkdocs/search_index.json +++ b/site/mkdocs/search_index.json @@ -2,7 +2,7 @@ "docs": [ { "location": "/", - "text": "Welcome to Python Synopsis!\n\n\nPython Study Guide\n\n\nIn this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate \nbooks, articles, answers from Stackoverflow, online courses, videos from py conferences\n and etc. \n\n\nSo, after all I decided to share \ntop resources\n for everyone about each topic, that you need to know about python, if you want to be senior python \nSoftware Engineer\n. \n\n\nOf course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than \n30-40\n chapters.\n\n\n\n\nBeginner\n\n\nThe Python Programming Language, Implementation and Adventages\n\n\nPython Installation\n\n\nStart Coding With Python\n\n\nData Types In Python 3\n\n\nVariables and Assignment\n\n\n...\n\n\nFunctions\n\n\n...\n\n\n\n\n\n\nIntermediate\n\n\n... \n\n\n\n\n\n\nAdvanced\n\n\n...\n\n\nPython Metaclasses\n\n\n...", + "text": "Welcome to Python Synopsis!\n\n\nPython Study Guide\n\n\nIn this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate \nbooks, articles, answers from Stackoverflow, online courses, videos from py conferences\n and etc. \n\n\nSo, after all I decided to share \ntop resources\n for everyone about each topic, that you need to know about python, if you want to be senior python \nSoftware Engineer\n. \n\n\nOf course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than \n30-40\n chapters.\n\n\n\n\nBeginner\n\n\nThe Python Programming Language, Implementation and Adventages\n\n\nPython Installation\n\n\nStart Coding With Python\n\n\nData Types In Python 3\n\n\nVariables and Assignment\n\n\n...\n\n\nFunctions\n\n\n...\n\n\n\n\n\n\nIntermediate\n\n\n... \n\n\n\n\n\n\nAdvanced\n\n\n...\n\n\nContect Managers\n\n\nPython Metaclasses\n\n\n...", "title": "Home" }, { @@ -12,7 +12,7 @@ }, { "location": "/#python-study-guide", - "text": "In this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate books, articles, answers from Stackoverflow, online courses, videos from py conferences and etc. So, after all I decided to share top resources for everyone about each topic, that you need to know about python, if you want to be senior python Software Engineer . Of course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than 30-40 chapters. Beginner The Python Programming Language, Implementation and Adventages Python Installation Start Coding With Python Data Types In Python 3 Variables and Assignment ... Functions ... Intermediate ... Advanced ... Python Metaclasses ...", + "text": "In this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate books, articles, answers from Stackoverflow, online courses, videos from py conferences and etc. So, after all I decided to share top resources for everyone about each topic, that you need to know about python, if you want to be senior python Software Engineer . Of course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than 30-40 chapters. Beginner The Python Programming Language, Implementation and Adventages Python Installation Start Coding With Python Data Types In Python 3 Variables and Assignment ... Functions ... Intermediate ... Advanced ... Contect Managers Python Metaclasses ...", "title": "Python Study Guide" }, { diff --git a/site/sitemap.xml b/site/sitemap.xml index a5b30f5..9845671 100644 --- a/site/sitemap.xml +++ b/site/sitemap.xml @@ -4,7 +4,7 @@ / - 2017-09-07 + 2017-09-19 daily @@ -13,37 +13,37 @@ /beginner/Python_Programming_Lanuage/ - 2017-09-07 + 2017-09-19 daily /beginner/Python_Installation/ - 2017-09-07 + 2017-09-19 daily /beginner/Start_Coding_With_Python/ - 2017-09-07 + 2017-09-19 daily /beginner/Data_Types_In_Python_3/ - 2017-09-07 + 2017-09-19 daily /beginner/Variables_And_Assignment/ - 2017-09-07 + 2017-09-19 daily /beginner/Functions/ - 2017-09-07 + 2017-09-19 daily @@ -53,7 +53,7 @@ /advanced/Python_Metaclasses/ - 2017-09-07 + 2017-09-19 daily @@ -62,7 +62,7 @@ /About/ - 2017-09-07 + 2017-09-19 daily From 234e72c5d73c61dd869c7541663bfbb6233f3772 Mon Sep 17 00:00:00 2001 From: Goga Patarkatsishvili Date: Tue, 19 Sep 2017 17:04:10 +0400 Subject: [PATCH 33/39] context manager bugfix --- README.md | 2 +- docs/index.md | 2 +- mkdocs.yml | 1 + site/404.html | 12 + site/About/index.html | 12 + site/advanced/Context_Managers/index.html | 716 ++++++++++++++++++ site/advanced/Python_Metaclasses/index.html | 16 +- .../Data_Types_In_Python_3/index.html | 12 + site/beginner/Functions/index.html | 16 +- site/beginner/Python_Installation/index.html | 12 + .../Python_Programming_Lanuage/index.html | 12 + .../Start_Coding_With_Python/index.html | 12 + .../Variables_And_Assignment/index.html | 12 + site/index.html | 14 +- site/mkdocs/search_index.json | 39 +- site/sitemap.xml | 6 + 16 files changed, 887 insertions(+), 9 deletions(-) create mode 100644 site/advanced/Context_Managers/index.html diff --git a/README.md b/README.md index 874fd14..9793d9f 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ So, You can start study from here: - ... - Advanced - ... - - [Contect Managers](https://ent1c3d.github.io/Python-Synopsis/site/advanced/Context_Managers) + - [Context Managers](https://ent1c3d.github.io/Python-Synopsis/site/advanced/Context_Managers) - [Python Metaclasses](https://ent1c3d.github.io/Python-Synopsis/site/advanced/Python_Metaclasses) - ... diff --git a/docs/index.md b/docs/index.md index 404e4e2..d3ab200 100644 --- a/docs/index.md +++ b/docs/index.md @@ -24,6 +24,6 @@ Of course, it needs plenty of time to organize best resources based on the topic - ... - Advanced - ... - - [Contect Managers](https://ent1c3d.github.io/Python-Synopsis/site/advanced/Context_Managers) + - [Context Managers](https://ent1c3d.github.io/Python-Synopsis/site/advanced/Context_Managers) - [Python Metaclasses](https://ent1c3d.github.io/Python-Synopsis/site/advanced/Python_Metaclasses) - ... \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index a060a68..8ff4031 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -20,6 +20,7 @@ pages: - Variables and Assignment : beginner/Variables_And_Assignment.md - Functions : beginner/Functions.md - Advanced: + - Context Managers : advanced/Context_Managers.md - Python Metaclasses : advanced/Python_Metaclasses.md - About: About.md diff --git a/site/404.html b/site/404.html index 117e89b..37be223 100644 --- a/site/404.html +++ b/site/404.html @@ -312,6 +312,18 @@ +
        • + + Context Managers + +
        • + + + + + + +
        • Python Metaclasses diff --git a/site/About/index.html b/site/About/index.html index 952e33c..7fc5e83 100644 --- a/site/About/index.html +++ b/site/About/index.html @@ -314,6 +314,18 @@ +
        • + + Context Managers + +
        • + + + + + + +
        • Python Metaclasses diff --git a/site/advanced/Context_Managers/index.html b/site/advanced/Context_Managers/index.html new file mode 100644 index 0000000..7d1a03b --- /dev/null +++ b/site/advanced/Context_Managers/index.html @@ -0,0 +1,716 @@ + + + + + + + + + + + + + + + + + + + + + + + Context Managers - Python Synopsis + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          + +
          + +
          + + +
          +
          + + +
          +
          +
          + +
          +
          +
          + + + + + +
          +
          + + + +

          Context Managers

          + +

          How Exactly Do Context Managers Work?

          +

          Context managers (PEP 343) are pretty important in Python. You probably use one every time you open a file:

          +
          with open('cake.txt') as c:
          +    gobble_gobble(c)
          +
          + + +

          But how well do you understand what’s going on behind the scenes?

          +

          CONTEXT MANAGER CLASSES

          +

          It’s actually quite simple. A context manager is a class that implements an __enter__ and an __exit__ method.

          +

          Let’s imagine you want to you print a line of text to the console surrounded with asterisks. Here’s a context manager to do it:

          +
          class asterisks():
          +    def __enter__(self):
          +        print('*' * 32)
          +
          +    def __exit__(self, exc_type, exc_val, exc_tb):
          +        print('*' * 32)
          +
          + + +

          The __exit__ method takes three arguments apart from self. Those arguments contain information about any errors that occurred inside the with block.

          +

          You can use asterisks in the same way as any of the built-in context managers:

          +
          >>> with asterisks():
          +>>>     print("Context Managers Rock!")
          +********************************
          +Context Managers Rock!
          +********************************
          +
          + + +

          ACCESSING THE CONTEXT INSIDE THE WITH BLOCK

          +

          If you need to get something back and use it inside the with block – such as a file descriptor – you simply return it from __enter__:

          +
          class myopen():
          +    def __init__(self, filename, filemode):
          +        self.filename = filename
          +        self.filemode = filemode
          +
          +    def __enter__(self):
          +        self.file = open(self.filename, self.filemode)
          +        return self.file
          +
          +    def __exit__(self, exc_type, exc_val, exc_tb):
          +        self.file.close()
          +
          + + +

          myopen works identically to the built-in open:

          +
          with myopen("beer.txt") as b:
          +    guzzle_guzzle(b)
          +
          + + +

          THE CONTEXTMANAGER DECORATOR

          +

          Thankfully, you don’t have to implement a class every time. The contextlib package has a contextmanager decorator that you can apply to generators to automatically transform them into context managers:

          +
          from contextlib import contextmanager
          +
          +@contextmanager
          +def spoiler():
          +    print('<spoiler>')
          +    yield
          +    print('</spoiler>')
          +
          + + +

          The code before yield corresponds to __enter__ and the code after yield corresponds to __exit__. A context manager generator should have exactly one yield in it.

          +

          It works the same as the class version:

          +
          >>> with spoiler():
          +>>>     print("Jon Snow is Luke's father.")
          +<spoiler>
          +Jon Snow is Luke's father.
          +</spoiler>
          +
          + + +

          ROLL YOUR OWN CONTEXTMANAGER DECORATOR

          +

          The implementation in contextlib is complicated, but it’s not hard to write something that works similarly with the exception of a few edge cases:

          +
          def contextmanager(gen):
          +    class CMWrapper(object):
          +        def __init__(self, wrapped):
          +            self.generator = wrapped
          +
          +        def __enter__(self):
          +            return next(self.generator)
          +
          +        def __exit__(self, ex_type, value, traceback):
          +            try:
          +                next(self.generator)
          +            except StopIteration:
          +                pass
          +
          +    def inner(*args, **kwargs):
          +        return CMWrapper(gen(*args, **kwargs))
          +
          +    return inner
          +
          + + +

          It’s not as robust as the real implementation, but it should be understandable. Here are the key points: +- The inner function instantiates a copy of the nested CMWrapper class with a handle on the generator passed into the decorator.
          +- __enter__ calls next() on the generator and returns the yielded value so it can be used in the with block.
          +- __exit__ calls next() again and catches the StopIteration exception that the generator throws when it finishes.

          +

          That’s it for now. If you want to learn more about context managers, I recommend you take a look at the code for contextlib.

          +
          +

          Source:
          + https://www.smallsurething.com/how-exactly-do-context-managers-work/

          +
          +

          Python Context Managers and the "with" Statement (enter & exit) VIDEO

          +

          IMAGE ALT TEXT HERE

          + + + + + + + +
          +
          +
          +
          + + + + +
          + + + + + + + + + + + + \ No newline at end of file diff --git a/site/advanced/Python_Metaclasses/index.html b/site/advanced/Python_Metaclasses/index.html index 68d061d..d325e26 100644 --- a/site/advanced/Python_Metaclasses/index.html +++ b/site/advanced/Python_Metaclasses/index.html @@ -319,6 +319,18 @@ + +
        • + + Context Managers + +
        • + + + + + + @@ -1226,7 +1238,7 @@

          The method signatures

          diff --git a/site/beginner/Data_Types_In_Python_3/index.html b/site/beginner/Data_Types_In_Python_3/index.html index 595f542..839a72d 100644 --- a/site/beginner/Data_Types_In_Python_3/index.html +++ b/site/beginner/Data_Types_In_Python_3/index.html @@ -500,6 +500,18 @@ +
        • + + Context Managers + +
        • + + + + + + +
        • Python Metaclasses diff --git a/site/beginner/Functions/index.html b/site/beginner/Functions/index.html index 7bcc53a..498234b 100644 --- a/site/beginner/Functions/index.html +++ b/site/beginner/Functions/index.html @@ -578,6 +578,18 @@ +
        • + + Context Managers + +
        • + + + + + + +
        • Python Metaclasses @@ -2040,13 +2052,13 @@

          Things to Remember

          -
        • + Context Managers + +
        • + + + + + + +
        • Python Metaclasses diff --git a/site/beginner/Python_Programming_Lanuage/index.html b/site/beginner/Python_Programming_Lanuage/index.html index 588add3..6f31180 100644 --- a/site/beginner/Python_Programming_Lanuage/index.html +++ b/site/beginner/Python_Programming_Lanuage/index.html @@ -444,6 +444,18 @@ +
        • + + Context Managers + +
        • + + + + + + +
        • Python Metaclasses diff --git a/site/beginner/Start_Coding_With_Python/index.html b/site/beginner/Start_Coding_With_Python/index.html index 715980d..bc01152 100644 --- a/site/beginner/Start_Coding_With_Python/index.html +++ b/site/beginner/Start_Coding_With_Python/index.html @@ -474,6 +474,18 @@ +
        • + + Context Managers + +
        • + + + + + + +
        • Python Metaclasses diff --git a/site/beginner/Variables_And_Assignment/index.html b/site/beginner/Variables_And_Assignment/index.html index c229563..0db6d65 100644 --- a/site/beginner/Variables_And_Assignment/index.html +++ b/site/beginner/Variables_And_Assignment/index.html @@ -417,6 +417,18 @@ +
        • + + Context Managers + +
        • + + + + + + +
        • Python Metaclasses diff --git a/site/index.html b/site/index.html index edf461a..2dda4a8 100644 --- a/site/index.html +++ b/site/index.html @@ -350,6 +350,18 @@ +
        • + + Context Managers + +
        • + + + + + + +
        • Python Metaclasses @@ -440,7 +452,7 @@

          Python Study Guide

        • Advanced diff --git a/site/mkdocs/search_index.json b/site/mkdocs/search_index.json index 5db16d7..4a46b44 100644 --- a/site/mkdocs/search_index.json +++ b/site/mkdocs/search_index.json @@ -2,7 +2,7 @@ "docs": [ { "location": "/", - "text": "Welcome to Python Synopsis!\n\n\nPython Study Guide\n\n\nIn this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate \nbooks, articles, answers from Stackoverflow, online courses, videos from py conferences\n and etc. \n\n\nSo, after all I decided to share \ntop resources\n for everyone about each topic, that you need to know about python, if you want to be senior python \nSoftware Engineer\n. \n\n\nOf course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than \n30-40\n chapters.\n\n\n\n\nBeginner\n\n\nThe Python Programming Language, Implementation and Adventages\n\n\nPython Installation\n\n\nStart Coding With Python\n\n\nData Types In Python 3\n\n\nVariables and Assignment\n\n\n...\n\n\nFunctions\n\n\n...\n\n\n\n\n\n\nIntermediate\n\n\n... \n\n\n\n\n\n\nAdvanced\n\n\n...\n\n\nContect Managers\n\n\nPython Metaclasses\n\n\n...", + "text": "Welcome to Python Synopsis!\n\n\nPython Study Guide\n\n\nIn this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate \nbooks, articles, answers from Stackoverflow, online courses, videos from py conferences\n and etc. \n\n\nSo, after all I decided to share \ntop resources\n for everyone about each topic, that you need to know about python, if you want to be senior python \nSoftware Engineer\n. \n\n\nOf course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than \n30-40\n chapters.\n\n\n\n\nBeginner\n\n\nThe Python Programming Language, Implementation and Adventages\n\n\nPython Installation\n\n\nStart Coding With Python\n\n\nData Types In Python 3\n\n\nVariables and Assignment\n\n\n...\n\n\nFunctions\n\n\n...\n\n\n\n\n\n\nIntermediate\n\n\n... \n\n\n\n\n\n\nAdvanced\n\n\n...\n\n\nContext Managers\n\n\nPython Metaclasses\n\n\n...", "title": "Home" }, { @@ -12,7 +12,7 @@ }, { "location": "/#python-study-guide", - "text": "In this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate books, articles, answers from Stackoverflow, online courses, videos from py conferences and etc. So, after all I decided to share top resources for everyone about each topic, that you need to know about python, if you want to be senior python Software Engineer . Of course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than 30-40 chapters. Beginner The Python Programming Language, Implementation and Adventages Python Installation Start Coding With Python Data Types In Python 3 Variables and Assignment ... Functions ... Intermediate ... Advanced ... Contect Managers Python Metaclasses ...", + "text": "In this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate books, articles, answers from Stackoverflow, online courses, videos from py conferences and etc. So, after all I decided to share top resources for everyone about each topic, that you need to know about python, if you want to be senior python Software Engineer . Of course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than 30-40 chapters. Beginner The Python Programming Language, Implementation and Adventages Python Installation Start Coding With Python Data Types In Python 3 Variables and Assignment ... Functions ... Intermediate ... Advanced ... Context Managers Python Metaclasses ...", "title": "Python Study Guide" }, { @@ -490,6 +490,41 @@ "text": "Functions that return None to indicate special meaning are error prone because\nNone and other values (e.g., zero, the empty string) all evaluate to False in\nconditional expressions. Raise exceptions to indicate special situations instead of returning None. Expect the\ncalling code to handle exceptions properly when they\u2019re documented. Source: Effective Python by Brett Slatkin", "title": "Things to Remember" }, + { + "location": "/advanced/Context_Managers/", + "text": "How Exactly Do Context Managers Work?\n\n\nContext managers (PEP 343) are pretty important in Python. You probably use one every time you open a file:\n\n\nwith\n \nopen\n(\ncake.txt\n)\n \nas\n \nc\n:\n\n \ngobble_gobble\n(\nc\n)\n\n\n\n\n\n\nBut how well do you understand what\u2019s going on behind the scenes?\n\n\nCONTEXT MANAGER CLASSES\n\n\nIt\u2019s actually quite simple. A context manager is a class that implements an \n__enter__\n and an \n__exit__\n method.\n\n\nLet\u2019s imagine you want to you print a line of text to the console surrounded with asterisks. Here\u2019s a context manager to do it:\n\n\nclass\n \nasterisks\n():\n\n \ndef\n \n__enter__\n(\nself\n):\n\n \nprint\n(\n*\n \n*\n \n32\n)\n\n\n \ndef\n \n__exit__\n(\nself\n,\n \nexc_type\n,\n \nexc_val\n,\n \nexc_tb\n):\n\n \nprint\n(\n*\n \n*\n \n32\n)\n\n\n\n\n\n\nThe \n__exit__\n method takes three arguments apart from \nself\n. Those arguments contain information about any errors that occurred inside the \nwith\n block.\n\n\nYou can use \nasterisks\n in the same way as any of the built-in context managers:\n\n\n \nwith\n \nasterisks\n():\n\n\n \nprint\n(\nContext Managers Rock!\n)\n\n\n********************************\n\n\nContext\n \nManagers\n \nRock\n!\n\n\n********************************\n\n\n\n\n\n\nACCESSING THE CONTEXT INSIDE THE WITH BLOCK\n\n\nIf you need to get something back and use it inside the with block \u2013 such as a file descriptor \u2013 you simply return it from \n__enter__\n:\n\n\nclass\n \nmyopen\n():\n\n \ndef\n \n__init__\n(\nself\n,\n \nfilename\n,\n \nfilemode\n):\n\n \nself\n.\nfilename\n \n=\n \nfilename\n\n \nself\n.\nfilemode\n \n=\n \nfilemode\n\n\n \ndef\n \n__enter__\n(\nself\n):\n\n \nself\n.\nfile\n \n=\n \nopen\n(\nself\n.\nfilename\n,\n \nself\n.\nfilemode\n)\n\n \nreturn\n \nself\n.\nfile\n\n\n \ndef\n \n__exit__\n(\nself\n,\n \nexc_type\n,\n \nexc_val\n,\n \nexc_tb\n):\n\n \nself\n.\nfile\n.\nclose\n()\n\n\n\n\n\n\nmyopen\n works identically to the built-in \nopen\n:\n\n\nwith\n \nmyopen\n(\nbeer.txt\n)\n \nas\n \nb\n:\n\n \nguzzle_guzzle\n(\nb\n)\n\n\n\n\n\n\nTHE CONTEXTMANAGER DECORATOR\n\n\nThankfully, you don\u2019t have to implement a class every time. The \ncontextlib\n package has a \ncontextmanager\n decorator that you can apply to generators to automatically transform them into context managers:\n\n\nfrom\n \ncontextlib\n \nimport\n \ncontextmanager\n\n\n\n@contextmanager\n\n\ndef\n \nspoiler\n():\n\n \nprint\n(\nspoiler\n)\n\n \nyield\n\n \nprint\n(\n/spoiler\n)\n\n\n\n\n\n\nThe code before \nyield\n corresponds to \n__enter__\n and the code after \nyield\n corresponds to \n__exit__\n. A context manager generator should have exactly one \nyield\n in it.\n\n\nIt works the same as the class version:\n\n\n \nwith\n \nspoiler\n():\n\n\n \nprint\n(\nJon Snow is Luke\ns father.\n)\n\n\nspoiler\n\n\nJon\n \nSnow\n \nis\n \nLuke\ns father.\n\n\n/\nspoiler\n\n\n\n\n\n\nROLL YOUR OWN CONTEXTMANAGER DECORATOR\n\n\nThe implementation in \ncontextlib\n is complicated, but it\u2019s not hard to write something that works similarly with the exception of a few edge cases:\n\n\ndef\n \ncontextmanager\n(\ngen\n):\n\n \nclass\n \nCMWrapper\n(\nobject\n):\n\n \ndef\n \n__init__\n(\nself\n,\n \nwrapped\n):\n\n \nself\n.\ngenerator\n \n=\n \nwrapped\n\n\n \ndef\n \n__enter__\n(\nself\n):\n\n \nreturn\n \nnext\n(\nself\n.\ngenerator\n)\n\n\n \ndef\n \n__exit__\n(\nself\n,\n \nex_type\n,\n \nvalue\n,\n \ntraceback\n):\n\n \ntry\n:\n\n \nnext\n(\nself\n.\ngenerator\n)\n\n \nexcept\n \nStopIteration\n:\n\n \npass\n\n\n \ndef\n \ninner\n(\n*\nargs\n,\n \n**\nkwargs\n):\n\n \nreturn\n \nCMWrapper\n(\ngen\n(\n*\nargs\n,\n \n**\nkwargs\n))\n\n\n \nreturn\n \ninner\n\n\n\n\n\n\nIt\u2019s not as robust as the real implementation, but it should be understandable. Here are the key points:\n- The inner function instantiates a copy of the nested CMWrapper class with a handle on the generator passed into the decorator.\n\n- \n__enter__\n calls next() on the generator and returns the yielded value so it can be used in the with block.\n\n- \n__exit__\n calls next() again and catches the StopIteration exception that the generator throws when it finishes. \n\n\nThat\u2019s it for now. If you want to learn more about context managers, I recommend you take a look at the code for \ncontextlib\n.\n\n\n\n\nSource:\n \n\n\n https://www.smallsurething.com/how-exactly-do-context-managers-work/\n\n\n\n\nPython Context Managers and the \"with\" Statement (\nenter\n \n \nexit\n) \nVIDEO", + "title": "Context Managers" + }, + { + "location": "/advanced/Context_Managers/#how-exactly-do-context-managers-work", + "text": "Context managers (PEP 343) are pretty important in Python. You probably use one every time you open a file: with open ( cake.txt ) as c : \n gobble_gobble ( c ) But how well do you understand what\u2019s going on behind the scenes?", + "title": "How Exactly Do Context Managers Work?" + }, + { + "location": "/advanced/Context_Managers/#context-manager-classes", + "text": "It\u2019s actually quite simple. A context manager is a class that implements an __enter__ and an __exit__ method. Let\u2019s imagine you want to you print a line of text to the console surrounded with asterisks. Here\u2019s a context manager to do it: class asterisks (): \n def __enter__ ( self ): \n print ( * * 32 ) \n\n def __exit__ ( self , exc_type , exc_val , exc_tb ): \n print ( * * 32 ) The __exit__ method takes three arguments apart from self . Those arguments contain information about any errors that occurred inside the with block. You can use asterisks in the same way as any of the built-in context managers: with asterisks (): print ( Context Managers Rock! ) ******************************** Context Managers Rock ! ********************************", + "title": "CONTEXT MANAGER CLASSES" + }, + { + "location": "/advanced/Context_Managers/#accessing-the-context-inside-the-with-block", + "text": "If you need to get something back and use it inside the with block \u2013 such as a file descriptor \u2013 you simply return it from __enter__ : class myopen (): \n def __init__ ( self , filename , filemode ): \n self . filename = filename \n self . filemode = filemode \n\n def __enter__ ( self ): \n self . file = open ( self . filename , self . filemode ) \n return self . file \n\n def __exit__ ( self , exc_type , exc_val , exc_tb ): \n self . file . close () myopen works identically to the built-in open : with myopen ( beer.txt ) as b : \n guzzle_guzzle ( b )", + "title": "ACCESSING THE CONTEXT INSIDE THE WITH BLOCK" + }, + { + "location": "/advanced/Context_Managers/#the-contextmanager-decorator", + "text": "Thankfully, you don\u2019t have to implement a class every time. The contextlib package has a contextmanager decorator that you can apply to generators to automatically transform them into context managers: from contextlib import contextmanager @contextmanager def spoiler (): \n print ( spoiler ) \n yield \n print ( /spoiler ) The code before yield corresponds to __enter__ and the code after yield corresponds to __exit__ . A context manager generator should have exactly one yield in it. It works the same as the class version: with spoiler (): print ( Jon Snow is Luke s father. ) spoiler Jon Snow is Luke s father. / spoiler", + "title": "THE CONTEXTMANAGER DECORATOR" + }, + { + "location": "/advanced/Context_Managers/#roll-your-own-contextmanager-decorator", + "text": "The implementation in contextlib is complicated, but it\u2019s not hard to write something that works similarly with the exception of a few edge cases: def contextmanager ( gen ): \n class CMWrapper ( object ): \n def __init__ ( self , wrapped ): \n self . generator = wrapped \n\n def __enter__ ( self ): \n return next ( self . generator ) \n\n def __exit__ ( self , ex_type , value , traceback ): \n try : \n next ( self . generator ) \n except StopIteration : \n pass \n\n def inner ( * args , ** kwargs ): \n return CMWrapper ( gen ( * args , ** kwargs )) \n\n return inner It\u2019s not as robust as the real implementation, but it should be understandable. Here are the key points:\n- The inner function instantiates a copy of the nested CMWrapper class with a handle on the generator passed into the decorator. \n- __enter__ calls next() on the generator and returns the yielded value so it can be used in the with block. \n- __exit__ calls next() again and catches the StopIteration exception that the generator throws when it finishes. That\u2019s it for now. If you want to learn more about context managers, I recommend you take a look at the code for contextlib . Source: https://www.smallsurething.com/how-exactly-do-context-managers-work/", + "title": "ROLL YOUR OWN CONTEXTMANAGER DECORATOR" + }, + { + "location": "/advanced/Context_Managers/#python-context-managers-and-the-with-statement-enter-exit-video", + "text": "", + "title": "Python Context Managers and the \"with\" Statement (enter & exit) VIDEO" + }, { "location": "/advanced/Python_Metaclasses/", "text": "Quick Tip: What Is a Metaclass in Python\n\n\nThis quick tip gives a brief overview of what we mean by a metaclass in Python and shows some examples of the concept.\n\n\nBefore delving into this article, I should point out an important point \nabout classes in Python\n which makes it easier for us to grasp the concept of metaclasses.\n\n\nIs a Class an Object in Python?!\n\n\nIf you've used a programming language other than Python, the concept you understood about classes is most likely that it is a way used to create new objects. This is also true in Python, but Python even takes it one more step further\u2014classes are also considered objects!\n\n\nSo, if you created the following class in Python:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \npass\n\n\n\n\n\n\nThis simply means that an object with the name myClass has been created in memory. Since this object is able to create new objects, it is considered a class. This means we can apply object operations on classes in Python, as classes are objects themselves.\n\n\nWe can thus do operations on classes like assigning the class to a variable, as follows:\n\n\nclass_object\n \n=\n \nmyClass\n()\n\n\nprint\n \nclass_object\n\n\n\n\n\n\nWhich returns:\n\n\n__main__\n.\nmyClass\n \nobject\n \nat\n \n0x102623610\n\n\n\n\n\n\nYou can even pass the class \nmyClass\n as a parameter to a method, as follows:\n\n\ndef\n \nclass_object\n(\nobject\n):\n\n \nprint\n \nobject\n\n\n\nclass_object\n(\nmyClass\n)\n\n\n\n\n\n\nWhich returns the following output:\n\n\nclass\n \n__main__\n.\nmyClass\n\n\n\n\n\n\nIn addition to other operations you can normally apply on objects.\n\n\nMetaclasses\n\n\nMaybe you have come across the \ntype\n keyword in Python? You most likely used it to check the type of some object, as shown in the following examples:\n\n\nprint\n \ntype\n(\nabder\n)\n\n\nprint\n \ntype\n(\n100\n)\n\n\nprint\n \ntype\n(\n100.0\n)\n\n\nprint\n \ntype\n(\nint\n)\n\n\n\n\n\n\nIn which case you would get the following output:\n\n\ntype\n \nstr\n\n\ntype\n \nint\n\n\ntype\n \nfloat\n\n\ntype\n \ntype\n\n\n\n\n\n\nLooking at the output, everything seems pretty clear until you come to the type type. To see what this might mean, let's go back to our class we defined at the beginning of this article:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \npass\n\n\n\n\n\n\nNow, do the following:\n\n\nprint\n \ntype\n(\nmyClass\n)\n\n\n\n\n\n\nWhat would be the output of this statement? It will surprisingly be:\n\n\ntype\n \ntype\n\n\n\n\n\n\nSo, we can conclude that the type of classes in Python is \ntype\n!\n\n\nWhat is the relation between a \ntype\n and a \nmetaclass\n? Well, a \ntype\n is a \nmetaclass\n, provided that the default \nmetaclass\n is \ntype\n. I know this might be confusing, especially that type can be used to return the class of some object as shown above, but this is due to the backward compatibility in Python. So, if you write:\n\n\nprint\n \ntype\n(\ntype\n)\n\n\n\n\n\n\nYou will get:\n\n\ntype\n \ntype\n\n\n\n\n\n\nMeaning that a \ntype\n is a \ntype\n!\n\n\nThe term \nmetaclass\n simply means something used to create classes. In other words, it is the class of a class, meaning that the instance of a class in this case is a class. Thus, \ntype\n is considered a \nmetaclass\n since the instance of a \ntype\n is a class.\n\n\nFor instance, when we mentioned the following statement above:\n\n\nclass_object\n \n=\n \nmyClass\n()\n\n\n\n\n\n\nThis simply builds an object/instance of the class \nmyClass\n. In other words, we used a class to create an object. \n\n\nIn the same way, when we did the following:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \npass\n\n\n\n\n\n\nThe \nmetaclass\n was used to create the class \nmyClass\n (which is considered a \ntype\n). So, like the object being an instance of a class, a class is an instance of a \nmetaclass\n.\n\n\nUsing Metaclass to Create a Class\n\n\nIn this section, we are going to see how we can use a \nmetaclass\n to create a class, rather than using the \nclass\n statement as we saw in the classes and objects tutorial. As we saw above, the default \nmetaclass\n is \ntype\n. Thus, we can use the following statement to create a new class:\n\n\nnew_class\n \n=\n \ntype\n(\nmyClass\n,(),{})\n\n\n\n\n\n\nIf you want to make things simpler, you can assign the same class name myClass to the variable name.\n\n\nThe dictionary \n{ }\n here is used to define the attributes of the class. So, having the following statement:\n\n\nmyClass\n \n=\n \ntype\n(\nmyClass\n,(),{\na\n:\nTrue\n})\n\n\n\n\n\n\nIs similar to:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \na\n \n=\n \nTrue\n\n\n\n\n\n\nThe \nmetaclass\n Attribute\n\n\nSay that we created the class \nmyClass\n as follows:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \n__metaclass__\n \n=\n \nmyMetaClass\n\n \npass\n\n\n\n\n\n\nIn this case, class creation will occur using myMetaClass instead of type, as follows:\n\n\nmyClass\n \n=\n \nmyMetaClass\n(\nclassName\n,\n \nbases\n,\n \ndictionary\n)\n\n\n\n\n\n\nCreation and Initialization of a Metaclass\n\n\nIf you want to have control on how you create and initialize a class after its creation, you can simply use the metaclass \nnew\n method and \ninit\n constructor, respectively. So, when myMetaClass above is called, this is what will be happening behind the scenes:\n\n\nmyClass\n \n=\n \nmyMetaClass\n.\n__new__\n(\nmyMetaClass\n,\n \nname\n,\n \nbases\n,\n \ndictionary\n)\n\n\nmyMetaClass\n.\n__init__\n(\nmyClass\n,\n \nname\n,\n \nbases\n,\n \ndictionary\n)\n\n\n\n\n\n\n\n\nSource:\n \n\n\n https://code.tutsplus.com/tutorials/quick-tip-what-is-a-metaclass-in-python--cms-26016\n\n\n\n\n\n\nUnderstanding Python metaclasses from Ionelmc.ro\n\n\nA quick overview\n\n\nA high level explanation is necessary before we get down to the details.\n\n\nA class is an object, and just like any other object, it's an instance of something: a metaclass. The default metaclass is type. Unfortunately, due to backwards compatibility, type is a bit confusing: it can also be used as a function that return the class [13] of an object:\n\n\n \nclass\n \nFoobar\n:\n\n\n...\n \npass\n\n\n...\n\n\n \ntype\n(\nFoobar\n)\n\n\nclass\n \ntype\n\n\n \nfoo\n \n=\n \nFoobar\n()\n\n\n \ntype\n(\nfoo\n)\n\n\nclass\n \n__main__\n.\nFoobar\n\n\n\n\n\n\nIf you're familiar with the isinstance builtin then you'll know this:\n\n\n \nisinstance\n(\nfoo\n,\n \nFoobar\n)\n\n\nTrue\n\n\n \nisinstance\n(\nFoobar\n,\n \ntype\n)\n\n\nTrue\n\n\n\n\n\n\nTo put this in picture:\n\n\n \n\n\nBut lets go back to making classes ...\n\n\nSimple metaclass use\n\n\nWe can use type directly to make a class, without any class statement:\n\n\n \nMyClass\n \n=\n \ntype\n(\nMyClass\n,\n \n(),\n \n{})\n\n\n \nMyClass\n\n\nclass\n \n__main__\n.\nMyClass\n\n\n\n\n\n\nThe class statement isn't just syntactic sugar, it does some extra things, like setting an adequate \nqualname\n and \ndoc\n properties or calling \nprepare\n.\n\n\nWe can make a custom metaclass:\n\n\n \nclass\n \nMeta\n(\ntype\n):\n\n\n...\n \npass\n\n\n\n\n\n\nAnd then we can use it :\n\n\n \nclass\n \nComplex\n(\nmetaclass\n=\nMeta\n):\n\n\n...\n \npass\n\n\n \ntype\n(\nComplex\n)\n\n\nclass\n \n__main__\n.\nMeta\n\n\n\n\n\n\nNow we got a rough idea of what we'll be dealing with ...\n\n\nMagic methods\n\n\nOne distinctive feature of Python is magic methods: they allow the programmer to override behavior for various operators and behavior of objects. To override the call operator you'd do this:\n\n\n \nclass\n \nFunky\n:\n\n\n...\n \ndef\n \n__call__\n(\nself\n):\n\n\n...\n \nprint\n(\nLook at me, I work like a function!\n)\n\n\n \nf\n \n=\n \nFunky\n()\n\n\n \nf\n()\n\n\nLook\n \nat\n \nme\n,\n \nI\n \nwork\n \nlike\n \na\n \nfunction\n!\n\n\n\n\n\n\nMetaclasses rely on several magic methods so it's quite useful to know a bit more about them.\n\n\nThe slots\n\n\nWhen you define a magic method in your class the function will end up as a pointer in a struct that describes the class, in addition to the entry in \ndict\n. That struct [7] has a field for each magic method. For some reason these fields are called type slots.\n\n\nNow there's another feature, implemented via the \nslots\n attribute. A class with \nslots\n will create instances that don't have a \ndict\n (they use a little bit less memory). A side-effect of this is that instances cannot have other fields than what was specified in \nslots\n: if you try to set an unexpected field you'll get an exception.\n\n\nFor the scope of this article when slots are mentioned it will mean the type slots, not \nslots\n.\n\n\nObject attribute lookup\n\n\nNow this is something that's easy to get wrong because of the many slight differences to old-style objects in Python 2. \n\n\nAssuming Class is the class and instance is an instance of Class, evaluating instance.foobar roughly equates to this:\n\n\n\n\nCall the type slot for Class.\ngetattribute\n (tp_getattro). The default does this: \n\n\nDoes Class.\ndict\n have a foobar item that is a data descriptor ? \n\n\nIf yes, return the result of Class.\ndict\n['foobar'].\nget\n(instance, Class). \n\n\n\n\n\n\nDoes instance.\ndict\n have a foobar item in it? \n\n\nIf yes, return instance.\ndict\n['foobar']. \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item that is not a data descriptor ? \n\n\nIf yes, return the result of Class.\ndict\n['foobar'].\nget\n(instance, klass). \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item ? \n\n\nIf yes, return the result of Class.\ndict\n['foobar']. \n\n\n\n\n\n\n\n\n\n\nIf the attribute still wasn't found, and there's a Class.\ngetattr\n, call Class.\ngetattr\n('foobar').\n\n\n\n\nStill not clear? Perhaps a diagram normal attribute lookup helps:\n\n\n\n\n\nTo avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.\n\n\n\n\nClass attribute lookup\n\n\nBecause classes needs to be able support the classmethod and staticmethod properties [6] when you evaluate something like Class.foobar the lookup is slightly different than what would happen when you evaluate instance.foobar.\n\n\nAssuming Class is an instance of Metaclass, evaluating Class.foobar roughly equates to this:\n\n\n\n\nCall the type slot for Metaclass.\ngetattribute\n (tp_getattro). The default does this: \n\n\nDoes Metaclass.\ndict\n have a foobar item that is a data descriptor ?\n\n\nIf yes, return the result of Metaclass.\ndict\n['foobar'].\nget\n(Class, Metaclass). \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item that is a descriptor (of any kind)?\n\n\nIf yes, return the result of Class.\ndict\n['foobar'].\nget\n(None, Class). \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item in it?\n\n\nIf yes, return Class.\ndict\n['foobar'].\n\n\n\n\n\n\nDoes Metaclass.\ndict\n have a foobar item that is not a data descriptor ?\n\n\nIf yes, return the result of Metaclass.\ndict\n['foobar'].\nget\n(Class, Metaclass).\n\n\n\n\n\n\nDoes Metaclass.\ndict\n have any foobar item?\n\n\nIf yes, return Metaclass.\ndict\n['foobar'].\n\n\n\n\n\n\n\n\n\n\nIf the attribute still wasn't found, and there's a Metaclass.\ngetattr\n, call Metaclass.\ngetattr\n('foobar').\n\n\n\n\nThe whole shebang would look like this in a diagram:\n\n\n\n\n\nTo avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.\n\n\n\n\nMagic method lookup\n\n\nFor magic methods the lookup is done on the class, directly in the big struct with the slots:\n\n\n\n\nDoes the object's class have a slot for that magic method (roughly object-\nob_type-\ntp_\n in C code)? If yes, use it. If it's NULL then the operation is not supported.\n\n\n\n\n\n\nIn C internals parlance:\n - object-\nob_type is the class of the object. \n\n - ob_type-\ntp_\n is the type slot.\n\n\n\n\nThis looks much simpler, however, the type slots are filled with wrappers around your functions, so descriptors work as expected:\n\n\n \nclass\n \nMagic\n:\n\n\n...\n \n@property\n\n\n...\n \ndef\n \n__repr__\n(\nself\n):\n\n\n...\n \ndef\n \ninner\n():\n\n\n...\n \nreturn\n \nIt works!\n\n\n...\n \nreturn\n \ninner\n\n\n...\n\n\n \nrepr\n(\nMagic\n())\n\n\nIt works!\n\n\n\n\n\n\nThats it. Does that mean there are places that don't follow those rules and lookup the slot differently? Sadly yes, read on ...\n\n\nThe \nnew\n method\n\n\nOne of the most common point of confusion with both classes and metaclasses is the \nnew\n method. It has some very special conventions.\n\n\nThe \nnew\n method is the constructor (it returns the new instance) while \ninit\n is just a initializer (the instance is already created when \ninit\n is called).\n\n\nSuppose have a class like this:\n\n\nclass\n \nFoobar\n:\n\n \ndef\n \n__new__\n(\ncls\n):\n\n \nreturn\n \nsuper\n()\n.\n__new__\n(\ncls\n)\n\n\n\n\n\n\nNow if you recall the previous section, you'd expect that __new__ would be looked up on the metaclass, but alas, it wouldn't be so useful that way so it's looked up statically.\n\n\nWhen the Foobar class wants this magic method it will be looked up on the same object (the class), not on a upper level like all the other magic methods. This is very important to understand, because both the class and the metaclass can define this method:\n\n\n\n\nFoobar.__new__ is used to create instances of Foobar\n\n\ntype.__new__ is used to create the Foobar class (an instance of type in the example)\n\n\n\n\nThe \nprepare\n method\n\n\nThis method is called before the class body is executed and it must return a dictionary-like object that's used as the local namespace for all the code from the class body. It was added in Python 3.0, see \nPEP-3115\n.\n\n\nIf your __prepare__ returns an object x then this:\n\n\nclass\n \nClass\n(\nmetaclass\n=\nMeta\n):\n\n \na\n \n=\n \n1\n\n \nb\n \n=\n \n2\n\n \nc\n \n=\n \n3\n\n\n\n\n\n\nWill make the following changes to x:\n\n\nx\n[\na\n]\n \n=\n \n1\n\n\nx\n[\nb\n]\n \n=\n \n2\n\n\nx\n[\nc\n]\n \n=\n \n3\n\n\n\n\n\n\nThis x object needs to look like a dictionary. Note that this x object will end up as an argument to Metaclass.__new\n and if it's not an instance of dict you need to convert it before calling super().__new\n.\n\n\nInterestingly enough this method doesn't have __new__'s special lookup. It appears it doesn't have it's own type slot and it's looked up via the class attribute lookup, if you read back a bit. \n\n\nPutting it all together\n\n\nTo start things off, a diagram of how instances are constructed:\n\n\n\nHow to read this swim lane diagram: \n\n\n\n\nThe horizontal lanes is the place where you define the functions.\n\n\nSolid lines mean a function call.\n\n\nA line from Metaclass.__call\n to Class.__new\n means Metaclass.__call\n will call Class.__new\n.\n\n\n\n\n\n\nDashed lines means something is returned.\n\n\nClass.\nnew\n returns the instance of Class.\n\n\nMetaclass.\ncall\n returns whatever Class.\nnew\n returned (and if it returned an instance of Class it will also call Class.\ninit\n on it). \n\n\n\n\n\n\nThe number in the red circle signifies the call order.\n\n\n\n\nCreating a class is quite similar:\n\n\n\nFew more notes:\n- Metaclass.\nprepare\n just returns the namespace object (a dictionary-like object as explained before).\n- Metaclass.\nnew\n returns the Class object.\n- MetaMetaclass.\ncall\n returns whatever Metaclass.\nnew\n returned (and if it returned an instance of Metaclass it will also call Metaclass.\ninit\n on it). \n\n\nSo you see, metaclasses allow you to customize almost every part of an object life-cycle.\n\n\nMetaclasses are callables\n\n\nIf you look again at the diagrams, you'll notice that making an instance goes through Metaclass.\ncall\n. This means you can use any callable as the metaclass:\n\n\n \nclass\n \nFoo\n(\nmetaclass\n=\nprint\n):\n \n# pointless, but illustrative\n\n\n...\n \npass\n\n\n...\n\n\nFoo\n \n()\n \n{\n__module__\n:\n \n__main__\n,\n \n__qualname__\n:\n \nFoo\n}\n\n\n \nprint\n(\nFoo\n)\n\n\nNone\n\n\n\n\n\n\nIf you use a function as the metaclass then subclasses won't inherit your function metaclass, but the type of whatever that function returned.\n\n\nSubclasses inherit the metaclass\n\n\nOne advantage compared to class decorators is the fact that subclasses inherit the metaclass.\n\n\nThis is a consequence of the fact that Metaclass(...) returns an object which usually has Metaclass as the \nclass\n.\n\n\nRestrictions with multiple metaclasses\n\n\nIn the same tone of classes allowing you to have multiple baseclasses, each one of those baseclasses may have a different metaclass. But with a twist: everything has to be linear - the inheritance tree must have a single leaf.\n\n\nFor example, this is not accepted because there would be two leafs (Meta1 and Meta2):\n\n\n \nclass\n \nMeta1\n(\ntype\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nMeta2\n(\ntype\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase1\n(\nmetaclass\n=\nMeta1\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase2\n(\nmetaclass\n=\nMeta2\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nFoobar\n(\nBase1\n,\n \nBase2\n):\n\n\n...\n \npass\n\n\n...\n\n\nTraceback\n \n(\nmost\n \nrecent\n \ncall\n \nlast\n):\n\n \nFile\n \nstdin\n,\n \nline\n \n1\n,\n \nin\n \nmodule\n\n\nTypeError\n:\n \nmetaclass\n \nconflict\n:\n \nthe\n \nmetaclass\n \nof\n \na\n \nderived\n \nclass\n \nmust\n \nbe\n \na\n \n(\nnon\n-\nstrict\n)\n \nsubclass\n \nof\n \nthe\n \nmetaclasses\n \nof\n \nall\n \nits\n \nbases\n\n\n\n\n\n\nThis will work (and will use the leaf as the metaclass):\n\n\n \nclass\n \nMeta\n(\ntype\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nSubMeta\n(\nMeta\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase1\n(\nmetaclass\n=\nMeta\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase2\n(\nmetaclass\n=\nSubMeta\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nFoobar\n(\nBase1\n,\n \nBase2\n):\n\n\n...\n \npass\n\n\n...\n\n\n \ntype\n(\nFoobar\n)\n\n\nclass\n \n__main__\n.\nSubMeta\n\n\n\n\n\n\nThe method signatures\n\n\nThere are still few important details missing, like the method signatures. Lets look at class and metaclass with all the important stuff implemented.\n\n\nNote the extra **kwargs - those are the extra keywords arguments you can pass in the class statement. \n\n\n \nclass\n \nMeta\n(\ntype\n):\n\n\n...\n \n@classmethod\n\n\n...\n \ndef\n \n__prepare__\n(\nmcs\n,\n \nname\n,\n \nbases\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__prepare__(mcs=\n%s\n, name=\n%r\n, bases=\n%s\n, **\n%s\n)\n \n%\n \n(\n\n\n...\n \nmcs\n,\n \nname\n,\n \nbases\n,\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \n{}\n\n\n\n\n\n\nAs mentioned before, __prepare\n can return objects that are not dict instances, so you need to make sure your __new\n handles that.\n\n\n...\n \ndef\n \n__new__\n(\nmcs\n,\n \nname\n,\n \nbases\n,\n \nattrs\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__new__(mcs=\n%s\n, name=\n%r\n, bases=\n%s\n, attrs=[\n%s\n], **\n%s\n)\n \n%\n \n(\n\n\n...\n \nmcs\n,\n \nname\n,\n \nbases\n,\n \n, \n.\njoin\n(\nattrs\n),\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__new__\n(\nmcs\n,\n \nname\n,\n \nbases\n,\n \nattrs\n)\n\n\n\n\n\n\nIt's uncommon to see \ninit\n being implemented in a metaclass because it's not that powerful - the class is already constructed when \ninit\n is called. It roughly equates to having a class decorator with the difference that \ninit\n would get run when making subclasses, while class decorators are not called for subclasses.\n\n\n...\n \ndef\n \n__init__\n(\ncls\n,\n \nname\n,\n \nbases\n,\n \nattrs\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__init__(cls=\n%s\n, name=\n%r\n, bases=\n%s\n, attrs=[\n%s\n], **\n%s\n)\n \n%\n \n(\n\n\n...\n \ncls\n,\n \nname\n,\n \nbases\n,\n \n, \n.\njoin\n(\nattrs\n),\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__init__\n(\nname\n,\n \nbases\n,\n \nattrs\n)\n\n\n\n\n\n\nThe __call__ method will be called when you make instances of Class.\n\n\n...\n \ndef\n \n__call__\n(\ncls\n,\n \n*\nargs\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__call__(cls=\n%s\n, args=\n%s\n, kwargs=\n%s\n)\n \n%\n \n(\n\n\n...\n \ncls\n,\n \nargs\n,\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__call__\n(\n*\nargs\n,\n \n**\nkwargs\n)\n\n\n...\n\n\n\n\n\n\nUsing Meta, note the extra=1: \n\n\n \nclass\n \nClass\n(\nmetaclass\n=\nMeta\n,\n \nextra\n=\n1\n):\n\n\n...\n \ndef\n \n__new__\n(\ncls\n,\n \nmyarg\n):\n\n\n...\n \nprint\n(\n Class.__new__(cls=\n%s\n, myarg=\n%s\n)\n \n%\n \n(\n\n\n...\n \ncls\n,\n \nmyarg\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__new__\n(\ncls\n)\n\n\n...\n\n\n...\n \ndef\n \n__init__\n(\nself\n,\n \nmyarg\n):\n\n\n...\n \nprint\n(\n Class.__init__(self=\n%s\n, myarg=\n%s\n)\n \n%\n \n(\n\n\n...\n \nself\n,\n \nmyarg\n\n\n...\n \n))\n\n\n...\n \nself\n.\nmyarg\n \n=\n \nmyarg\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__init__\n()\n\n\n...\n\n\n...\n \ndef\n \n__str__\n(\nself\n):\n\n\n...\n \nreturn\n \ninstance of Class; myargs=\n%s\n \n%\n \n(\n\n\n...\n \ngetattr\n(\nself\n,\n \nmyarg\n,\n \nMISSING\n),\n\n\n...\n \n)\n\n \nMeta\n.\n__prepare__\n(\nmcs\n=\nclass\n \n__main__\n.\nMeta\n, name=\nClass\n, bases=(),\n\n \n**\n{\nextra\n:\n \n1\n})\n\n \nMeta\n.\n__new__\n(\nmcs\n=\nclass\n \n__main__\n.\nMeta\n, name=\nClass\n, bases=(),\n\n \nattrs\n=\n[\n__qualname__\n,\n \n__new__\n,\n \n__init__\n,\n \n__str__\n,\n \n__module__\n],\n\n \n**\n{\nextra\n:\n \n1\n})\n\n \nMeta\n.\n__init__\n(\ncls\n=\nclass\n \n__main__\n.\nClass\n, name=\nClass\n, bases=(),\n\n \nattrs\n=\n[\n__qualname__\n,\n \n__new__\n,\n \n__init__\n,\n \n__str__\n,\n \n__module__\n],\n\n \n**\n{\nextra\n:\n \n1\n})\n\n\n\n\n\n\nNote that Meta.__call__ is called when we make instance of Class:\n\n\n \nClass\n(\n1\n)\n\n \nMeta\n.\n__call__\n(\ncls\n=\nclass\n \n__main__\n.\nClass\n, args=(1,), kwargs={})\n\n \nClass\n.\n__new__\n(\ncls\n=\nclass\n \n__main__\n.\nClass\n, myarg=1)\n\n \nClass\n.\n__init__\n(\nself\n=\ninstance\n \nof\n \nClass\n;\n \nmyargs\n=\nMISSING\n,\n \nmyarg\n=\n1\n)\n\n\ninstance\n \nof\n \nClass\n;\n \nmyargs\n=\n1\n\n\n\n\n\n\n\n\nSource:\n \n\n\n https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/", diff --git a/site/sitemap.xml b/site/sitemap.xml index 9845671..788725a 100644 --- a/site/sitemap.xml +++ b/site/sitemap.xml @@ -51,6 +51,12 @@ + + /advanced/Context_Managers/ + 2017-09-19 + daily + + /advanced/Python_Metaclasses/ 2017-09-19 From 42b905b517956fa98abb4b9601d1c66c81ad5f0e Mon Sep 17 00:00:00 2001 From: ent1c3d Date: Fri, 20 Oct 2017 01:17:05 +0400 Subject: [PATCH 34/39] no message --- README.md | 2 + docs/beginner/Conditions.md | 537 +++++++ docs/beginner/For_Loop.md | 323 +++++ docs/index.md | 2 + mkdocs.yml | 2 + site/404.html | 24 + site/About/index.html | 24 + site/advanced/Context_Managers/index.html | 24 + site/advanced/Python_Metaclasses/index.html | 24 + site/beginner/Conditions/index.html | 1244 +++++++++++++++++ .../Data_Types_In_Python_3/index.html | 24 + site/beginner/For_Loop/index.html | 914 ++++++++++++ site/beginner/Functions/index.html | 35 +- site/beginner/Python_Installation/index.html | 24 + .../Python_Programming_Lanuage/index.html | 24 + .../Start_Coding_With_Python/index.html | 24 + .../Variables_And_Assignment/index.html | 28 +- site/index.html | 26 + site/mkdocs/search_index.json | 877 +++++++----- site/sitemap.xml | 32 +- 20 files changed, 3814 insertions(+), 400 deletions(-) create mode 100644 docs/beginner/Conditions.md create mode 100644 docs/beginner/For_Loop.md create mode 100644 site/beginner/Conditions/index.html create mode 100644 site/beginner/For_Loop/index.html diff --git a/README.md b/README.md index 9793d9f..e0cdf1c 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,8 @@ So, You can start study from here: - [Start Coding With Python](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Start_Coding_With_Python) - [Data Types In Python 3](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Data_Types_In_Python_3) - [Variables and Assignment](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Variables_And_Assignment) + - [Conditions](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Conditions) + - [For Loop](https://ent1c3d.github.io/Python-Synopsis/site/beginner/For_Loop) - ... - [Functions](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Functions) - ... diff --git a/docs/beginner/Conditions.md b/docs/beginner/Conditions.md new file mode 100644 index 0000000..55561d5 --- /dev/null +++ b/docs/beginner/Conditions.md @@ -0,0 +1,537 @@ +## Conditional Execution +In order to write useful programs, we almost always need the ability to check conditions +and change the behavior of the program accordingly. Conditional statements give us this +ability. The simplest form is the if statement: + +```python +if x > 0: + print 'x is positive' +``` + +The boolean expression after if is called the condition. If it is true, then the indented +statement gets executed. If not, nothing happens. +if statements have the same structure as function definitions: a header followed by an +indented body. Statements like this are called compound statements. +There is no limit on the number of statements that can appear in the body, but there has +to be at least one. Occasionally, it is useful to have a body with no statements (usually +as a place keeper for code you haven’t written yet). In that case, you can use the pass +statement, which does nothing. + +```python +if x < 0: + pass # need to handle negative values! +``` +### Alternative Execution +A second form of the if statement is alternative execution, in which there are two +possibilities and the condition determines which one gets executed. The syntax looks +like this: + +```python +if x%2 == 0: + print 'x is even' +else: + print 'x is odd' +``` + +If the remainder when x is divided by 2 is 0, then we know that x is even, and the program +displays a message to that effect. If the condition is false, the second set of statements is +executed. Since the condition must be true or false, exactly one of the alternatives will +be executed. The alternatives are called branches, because they are branches in the flow +of execution. + +### Chained Conditionals +Sometimes there are more than two possibilities and we need more than two branches. +One way to express a computation like that is a chained conditional: + +```python +if x < y: + print 'x is less than y' +elif x > y: + print 'x is greater than y' +else: + print 'x and y are equal' +``` +elif is an abbreviation of “else if.” Again, exactly one branch will be executed. There is +no limit on the number of elif statements. If there is an else clause, it has to be at the +end, but there doesn’t have to be one. + +```python +if choice == 'a': + draw_a() +elif choice == 'b': + draw_b() +elif choice == 'c': + draw_c() +``` +Each condition is checked in order. If the first is false, the next is checked, and so on. If +one of them is true, the corresponding branch executes, and the statement ends. Even +if more than one condition is true, only the first true branch executes. + +### Nested Conditionals +One conditional can also be nested within another. We could have written the tri +chotomy example like this: + +```python +if x == y: + print 'x and y are equal' +else: + if x < y: + print 'x is less than y' + else: + print 'x is greater than y' +``` + +The outer conditional contains two branches. The first branch contains a simple state +ment. The second branch contains another if statement, which has two branches of its +own. Those two branches are both simple statements, although they could have been +conditional statements as well. +Although the indentation of the statements makes the structure apparent, nested +conditionals become difficult to read very quickly. In general, it is a good idea to avoid +them when you can. +Logical operators often provide a way to simplify nested conditional statements. For +example, we can rewrite the following code using a single conditional: + +```python +if 0 < x: + if x < 10: + print 'x is a positive single-digit number.' +``` +The print statement is executed only if we make it past both conditionals, so we can +get the same effect with the and operator: + +```python +if 0 < x and x < 10: + print 'x is a positive single-digit number.' +``` + +> **Source:** +> :fa-book: **Think Python** by Allen B. Downey - 2012 + + +## If-Else statements in Python By Udemy +The if-else statement is a staple of most programming languages. It is used to test different conditions and execute code accordingly. You can think of it as a ‘map’ used to make decisions in the program. + +The basic syntax is as follows: + +```python +if condition1 = True: + execute code1 +else: + execute code2 +``` +In plain English, this can be described as follows: +`If condition1 is true, then execute the code included in code1. If it is not true, then run code2` + +A few things to note about the syntax: +- Each if/else statement must close with a colon (:) +- Code to be executed as part of any if/else statement must be indented by four spaces, equivalent to one press of the Tab key. +- Although not explicitly required, every if statement must also include an else statement – it just makes for a better program. + +You use if-else statements a lot in your every day. Virtually every decision you make involves some form of if-else statements. “If the bacon is cheap, I’ll buy a pound. If not, I’ll grab some mac and cheese”, “if I wake up before 6, I’ll head out for a jog. Otherwise, I’ll head straight to work”, and “if the traffic is light, we’ll make the movie theater in time. Else, we’ll just have to grab dinner and go back home” – these are some simple if-else decisions we’ve all made in our everyday life. Thus, by using if-else statements in Python, you give the program the ability to make decisions depending on the user input. + +But enough talk; let’s try to understand if-else statements with an example: + +```python +x = 5 +if x > 5: + print "X is larger than five!" +else: + print "X is smaller than or equal to five!" +``` +this program basically instructs Python to: +- Check the value of x. +- If the value of x is more than 5, print that “X is larger than five”. +- If the value of x is less than or equal to 5, print “X is smaller than or equal to five”. + +As we’ll learn below, the decision making capabilities of if-else conditions will come very handy when you want to create complicated programs. + +### Testing Multiple Conditions with Elif +The above if-else syntax is great if you want to test just one condition, but what happens when you want to check multiple conditions? + +This is where the Elif statement comes in handy. +Elif is a shortened form of Else-If. The syntax can be seen as follows: + +```python +if condition1 = True: + execute code1 +elif condition2 = True: + execute code2 +else: + execute code3 +``` +In plain English, you can read this as follows: +`If condition1 is true, execute code1. Else, if condition2 is true, execute code2. If neither condition1 or condition2 are true, execute code3.` + +There is no limit to the number of elif statements you can include in a Python program. You can test dozens of conditions using multiple elif statements as long as you close with an else statement. +Let’s try to understand this with an example: + +```python +x = 5 +if x == 5: + print "Wow, X is EXACTLY five!" +elif x > 5: + print "X is now MORE than five!" +else: + print "X is now LESS than five!" +``` + +So what exactly is happening here? Let’s break it down into individual steps: + +- Python first checks if the value of x is exactly equal to 5, as given in the first if statement. +- If x is equal to five, Python executes the code included within the first if statement and exits the program. +- If, however, x is not equal to 5, Python goes to the second elif statement. It now checks if x is greater than 5. +- In case x is more than 5, Python executes the second block of code under the elif statement and exits the program. +- However, if both conditions are not met, that is, x is neither equal to, nor greater than five, Python displays the output under the third else statement. + +As mentioned above, an if-else conditional block can include as many elif statements as you want. + +### Nested If-Else Statements +So far, we’ve used just a single level of if-else statements. But what if you want to make decisions within decisions? That’s like saying: “if the oranges are fresh, buy a dozen if they are more than $5/lb, and two dozen if they are less than $5/lb” + +In programmer-speak (i.e. algorithmically) this can be written as follows: + +```python +orange_quality = “fresh” +orange_price = 4.0 +if orange_quality == “fresh”: + if orange_price < 5: + buy 24.0 + else: + buy 12.0 +else: + don’t_buy_oranges +``` +This is an example of a nested if-else statement – an if-else statement inside another if-else statement. These can help you make more complex decisions and give you even finer control over the program flow. In terms of syntax, they can be written as follows: + +```python +if condition1 = True: + if condition2 = True: + execute code1 + elif condition3 = True: + execute code2 + else: + execute code3 +else: + execute code4 +``` +Thus, the syntax rules are the same as a standard if-statement – i.e. nested statements must be tabbed in. Theoretically, you can nest as many if-else statements as you want, but it is poor practice to go more than two levels deep. + +> **Source:** +> :fa-link: https://blog.udemy.com/python-if-else/ + + +## How To Write Conditional Statements in Python 3 +Conditional statements are part of every programming language. With conditional statements, we can have code that sometimes runs and at other times does not run, depending on the conditions of the program at that time. + +When we fully execute each statement of a program, moving from the top to the bottom with each line executed in order, we are not asking the program to evaluate specific conditions. By using conditional statements, programs can determine whether certain conditions are being met and then be told what to do next. + +Let’s look at some examples where we would use conditional statements: + +- If the student receives over 65% on her test, report that her grade passes; if not, report that her grade fails +- If he has money in his account, calculate interest; if he doesn’t, charge a penalty fee +- If they buy 10 oranges or more, calculate a discount of 5%; if they buy fewer, then don’t + +Through evaluating conditions and assigning code to run based on whether or not those conditions are met, we are writing conditional code. + + +This tutorial will take you through writing conditional statements in the Python programming language. + +### If statement +We will start with the if statement, which will evaluate whether a statement is true or false, and run code only in the case that the statement is true. + +In a plain text editor, open a file and write the following code: + +```python +grade = 70 + +if grade >= 65: + print("Passing grade") +``` + +With this code, we have the variable grade and are giving it the integer value of 70. We are then using the if statement to evaluate whether or not the variable grade is greater than or equal ( >= ) to 65. If it does meet this condition, we are telling the program to print out the string Passing grade. + +In this case, the grade of 70 does meet the condition of being greater than or equal to 65, so you will receive the following output once you run the program: + +```python +Output +Passing grade +``` +Let’s now change the result of this program by changing the value of the grade variable to 60: + +```python +grade = 60 + +if grade >= 65: + print("Passing grade") +``` + +When we save and run this code, we will receive no output because the condition was not met and we did not tell the program to execute another statement. + +To give one more example, let us calculate whether a bank account balance is below 0. Let’s create a file called `account.py` and write the following program: + +```python +balance = -5 + +if balance < 0: + print("Balance is below 0, add funds now or you will be charged a penalty.") +``` + +When we run the program with python account.py, we’ll receive the following output: + +```python +Output +Balance is below 0, add funds now or you will be charged a penalty. +``` +In the program we initialized the variable `balance` with the value of -5, which is less than 0. Since the balance met the condition of the if statement (balance < 0), once we save and run the code, we will receive the string output. Again, if we change the balance to 0 or a positive number, we will receive no output. + +### Else Statement +It is likely that we will want the program to do something even when an `if` statement evaluates to false. In our grade example, we will want output whether the grade is passing or failing. + +To do this, we will add an else statement to the grade condition above that is constructed like this: + +```python +grade = 60 + +if grade >= 65: + print("Passing grade") + +else: + print("Failing grade") +``` + +Since the grade variable above has the value of 60, the if statement evaluates as false, so the program will not print out Passing grade. The else statement that follows tells the program to do something anyway. + +When we save and run the program, we’ll receive the following output: + +```python +Output +Failing grade +``` +If we then rewrite the program to give the grade a value of `65` or higher, we will instead receive the output `Passing grade`. + +To add an else statement to the bank account example, we rewrite the code like this: + +```python +balance = 522 + +if balance < 0: + print("Balance is below 0, add funds now or you will be charged a penalty.") + +else: + print("Your balance is 0 or above.") +``` + +Here, we changed the balance variable value to a positive number so that the else statement will print. To get the first if statement to print, we can rewrite the value to a negative number. + +By combining an if statement with an else statement, you are constructing a two-part conditional statement that will tell the computer to execute certain code whether or not the if condition is met. + +### Else if statement +So far, we have presented a Boolean option for conditional statements, with each if statement evaluating to either true or false. In many cases, we will want a program that evaluates more than two possible outcomes. For this, we will use an else if statement, which is written in Python as elif. The elif or else if statement looks like the if statement and will evaluate another condition. + +In the bank account program, we may want to have three discrete outputs for three different situations: + +- The balance is below 0 +- The balance is equal to 0 +- The balance is above 0 + +The `elif` statement will be placed between the if statement and the else statement as follows: + +```python +. . . +if balance < 0: + print("Balance is below 0, add funds now or you will be charged a penalty.") + +elif balance == 0: + print("Balance is equal to 0, add funds soon.") + +else: + print("Your balance is 0 or above.") +``` + +Now, there are three possible outputs that can occur once we run the program: +- If the variable balance is equal to 0 we will receive the output from the elif statement (Balance is equal to 0, add funds soon.) +- If the variable balance is set to a positive number, we will receive the output from the else statement (Your balance is 0 or above.). +- If the variable balance is set to a negative number, the output will be the string from the if statement (Balance is below 0, add funds now or you will be charged a penalty). + +What if we want to have more than three possibilities, though? We can do this by writing more than one elif statement into our code. + +In the `grade.py` program, let’s rewrite the code so that there are a few letter grades corresponding to ranges of numerical grades: + +- 90 or above is equivalent to an A grade +- 80-89 is equivalent to a B grade +- 70-79 is equivalent to a C grade +- 65-69 is equivalent to a D grade +- 64 or below is equivalent to an F grade + +To run this code, we will need one `if` statement, three `elif` statements, and an `else` statement that will handle all failing cases. + +Let’s rewrite the code from the example above to have strings that print out each of the letter grades. We can keep our else statement the same. + +```python +. . . +if grade >= 90: + print("A grade") + +elif grade >=80: + print("B grade") + +elif grade >=70: + print("C grade") + +elif grade >= 65: + print("D grade") + +else: + print("Failing grade") +``` + +Since elif statements will evaluate in order, we can keep our statements pretty basic. This program is completing the following steps: + +- If the grade is greater than 90, the program will print A grade, if the grade is less than 90, the program will continue to the next statement... +- If the grade is greater than or equal to 80, the program will print B grade, if the grade is 79 or less, the program will continue to the next statement... +- If the grade is greater than or equal to 70, the program will print C grade, if the grade is 69 or less, the program will continue to the next statement... +- If the grade is greater than or equal to 65, the program will print D grade, if the grade is 64 or less, the program will continue to the next statement... +- The program will print Failing grade because all of the above conditions were not met. + +### Nested If Statements + +Once you are feeling comfortable with the if, elif, and else statements, you can move on to nested conditional statements. We can use nested if statements for situations where we want to check for a secondary condition if the first condition executes as true. For this, we can have an if-else statement inside of another if-else statement. Let’s look at the syntax of a nested if statement: + +```python +if statement1: #outer if statement + print("true") + + if nested_statement: #nested if statement + print("yes") + + else: #nested else statement + print("no") + +else: #outer else statement + print("false") +``` + +A few possible outputs can result from this code: +- If `statement1` evaluates to true, the program will then evaluate whether the nested_statement also evaluates to true. If both cases are true, the output will be: + +```python +Output +true +yes +``` +- If, however, statement1 evaluates to true, but nested_statement evaluates to false, then the output will be: + +```python +Output +true +no +``` +- And if statement1 evaluates to false, the nested if-else statement will not run, so the else statement will run alone, and the output will be: + +```python +Output +false +``` + +We can also have multiple if statements nested throughout our code: + +```python +if statement1: #outer if + print("hello world") + + if nested_statement1: #first nested if + print("yes") + + elif nested_statement2: #first nested elif + print("maybe") + + else: #first nested else + print("no") + +elif statement2: #outer elif + print("hello galaxy") + + if nested_statement3: #second nested if + print("yes") + + elif nested_statement4: #second nested elif + print("maybe") + + else: #second nested else + print("no") + +else: #outer else + statement("hello universe") +``` + +In the above code, there is a nested if statement inside each if statement in addition to the elif statement. This will allow for more options within each condition. + +Let’s look at an example of nested if statements with our grade.py program. We can check for whether a grade is passing first (greater than or equal to 65%), then evaluate which letter grade the numerical grade should be equivalent to. If the grade is not passing, though, we do not need to run through the letter grades, and instead can have the program report that the grade is failing. Our modified code with the nested if statement will look like this: + +```python +. . . +if grade >= 65: + print("Passing grade of:") + + if grade >= 90: + print("A") + + elif grade >=80: + print("B") + + elif grade >=70: + print("C") + + elif grade >= 65: + print("D") + +else: + print("Failing grade") +``` + +If we run the code with the variable grade set to the integer value 92, the first condition is met, and the program will print out Passing grade of:. Next, it will check to see if the grade is greater than or equal to 90, and since this condition is also met, it will print out A. + +If we run the code with the grade variable set to 60, then the first condition is not met, so the program will skip the nested if statements and move down to the else statement, with the program printing out `Failing grade`. + +We can of course add even more options to this, and use a second layer of nested if statements. Perhaps we will want to evaluate for grades of A+, A and A- separately. We can do so by first checking if the grade is passing, then checkingto see if the grade is 90 or above, then checkingto see if the grade is over 96 for an A+ for instance: + +```python +. . . +if grade >= 65: + print("Passing grade of:") + + if grade >= 90: + if grade > 96: + print("A+") + + elif grade > 93 and grade <= 96: + print("A") + + elif grade >= 90: + print("A-") +. . . +``` + +In the code above, for a grade variable set to 96, the program will run the following: + +- Check if the grade is greater than or equal to 65 (true) +- Print out Passing grade of: +- Check if the grade is greater than or equal to 90 (true) +- Check if the grade is greater than 96 (false) +- Check if the grade is greater than 93 and also less than or equal to 96 (true) +- Print A +- Leave these nested conditional statements and continue with remaining code + +The output of the program for a grade of 96 therefore looks like this: +```python +Output +Passing grade of: +A +``` +Nested if statements can provide the opportunity to add several specific levels of conditions to your code. + +### Conclusion +By using conditional statements like the if statement, you will have greater control over what your program executes. Conditional statements tell the program to evaluate whether a certain condition is being met. If the condition is met it will execute specific code, but if it is not met the program will continue to move down to other code. + +> **Source:** +> :fa-link: https://www.digitalocean.com/community/tutorials/how-to-write-conditional-statements-in-python-3-2 \ No newline at end of file diff --git a/docs/beginner/For_Loop.md b/docs/beginner/For_Loop.md new file mode 100644 index 0000000..50359dd --- /dev/null +++ b/docs/beginner/For_Loop.md @@ -0,0 +1,323 @@ +## How To Construct For Loops in Python 3 + +Using loops in computer programming allows us to automate and repeat similar tasks multiple times. In this tutorial, we’ll be covering Python’s for loop. + +A for loop implements the repeated execution of code based on a loop counter or loop variable. This means that for loops are used most often when the number of iterations is known before entering the loop, unlike while loops which are conditionally based. + +## For Loops +In Python, for loops are constructed like so: + +```python +for [iterating variable] in [sequence]: + [do something] +``` + +The something that is being done will be executed until the sequence is over. + +Let’s look at a for loop that iterates through a range of values: + +```python +for i in range(0,5): + print(i) +``` +When we run this program, the output looks like this: +```python +Output +0 +1 +2 +3 +4 +``` +This for loop sets up i as its iterating variable, and the sequence exists in the range of 0 to 5. + +Then within the loop we print out one integer per loop iteration. Keep in mind that in programming we tend to begin at index 0, so that is why although 5 numbers are printed out, they range from 0-4. + +You’ll commonly see and use for loops when a program needs to repeat a block of code a number of times. + +### For Loops using range() +One of Python’s built-in immutable sequence types is range(). In loops, range() is used to control how many times the loop will be repeated. +When working with range(), you can pass between 1 and 3 integer arguments to it: + +- start states the integer value at which the sequence begins, if this is not included then start begins at 0 +- stop is always required and is the integer that is counted up to but not included +- step sets how much to increase (or decrease in the case of negative numbers) the next iteration, if this is omitted then step defaults to 1 + +We’ll look at some examples of passing different arguments to `range()`. + +First, let’s only pass the stop argument, so that our sequence set up is `range(stop)`: + +```python +for i in range(6): + print(i) +``` +In the program above, the stop argument is 6, so the code will iterate from 0-6 (exclusive of 6): + +```python +Output +0 +1 +2 +3 +4 +5 +``` +Next, we’ll look at range(start, stop), with values passed for when the iteration should start and for when it should stop: +```python +for i in range(20,25): + print(i) +``` + +Here, the range goes from 20 (inclusive) to 25 (exclusive), so the output looks like this: + +```python +Output +20 +21 +22 +23 +24 +``` +The step argument of range() is similar to specifying stride while slicing strings in that it can be used to skip values within the sequence. + +With all three arguments, step comes in the final position: range(start, stop, step). First, let’s use a step with a positive value: + +```python +for i in range(0,15,3): + print(i) +``` +In this case, the for loop is set up so that the numbers from 0 to 15 print out, but at a step of 3, so that only every third number is printed, like so: + + +```python +Output +0 +3 +6 +9 +12 +``` +We can also use a negative value for our step argument to iterate backwards, but we’ll have to adjust our start and stop arguments accordingly: + +```python +for i in range(100,0,-10): + print(i) +``` + +Here, 100 is the start value, 0 is the stop value, and -10 is the range, so the loop begins at 100 and ends at 0, decreasing by 10 with each iteration. We can see this occur in the output: + +```python +Output +100 +90 +80 +70 +60 +50 +40 +30 +20 +10 +``` +When programming in Python, `for` loops often make use of the range() sequence type as its parameters for iteration. + +### For Loops using Sequential Data Types +Lists and other data sequence types can also be leveraged as iteration parameters in for loops. Rather than iterating through a range(), you can define a list and iterate through that list. + +We’ll assign a list to a variable, and then iterate through the list: + +```python +sharks = ['hammerhead', 'great white', 'dogfish', 'frilled', 'bullhead', 'requiem'] + +for shark in sharks: + print(shark) +``` + +In this case, we are printing out each item in the list. Though we used the variable shark, we could have called the variable any other valid variable name and we would get the same output: + +```python +Output +hammerhead +great white +dogfish +frilled +bullhead +requiem +``` +The output above shows that the for loop iterated through the list, and printed each item from the list per line. + +Lists and other sequence-based data types like strings and tuples are common to use with loops because they are iterable. You can combine these data types with range() to add items to a list, for example: + + +```python +sharks = ['hammerhead', 'great white', 'dogfish', 'frilled', 'bullhead', 'requiem'] + +for item in range(len(sharks)): + sharks.append('shark') + +print(sharks) +``` + +```python +Output +['hammerhead', 'great white', 'dogfish', 'frilled', 'bullhead', 'requiem', 'shark', 'shark', 'shark', 'shark', 'shark', 'shark'] +``` + +Here, we have added a placeholder string of 'shark' for each item of the length of the sharks list. + +You can also use a for loop to construct a list from scratch: + +```python +integers = [] + +for i in range(10): + integers.append(i) + +print(integers) +``` + +In this example, the list integers is initialized empty, but the for loop populates the list like so: + +```python +Output +[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] +``` + +Similarly, we can iterate through strings: + +```python +sammy = 'Sammy' + +for letter in sammy: + print(letter) +``` + +```python +Output +S +a +m +m +y +``` + +Iterating through tuples is done in the same format as iterating through lists or strings above. + +When iterating through a dictionary, it’s important to keep the key : value structure in mind to ensure that you are calling the correct element of the dictionary. Here is an example that calls both the key and the value: + +```python +sammy_shark = {'name': 'Sammy', 'animal': 'shark', 'color': 'blue', 'location': 'ocean'} + +for key in sammy_shark: + print(key + ': ' + sammy_shark[key]) +``` + + +```python +Output +name: Sammy +animal: shark +location: ocean +color: blue +``` + + +When using dictionaries with for loops, the iterating variable corresponds to the keys of the dictionary, and dictionary_variable[iterating_variable] corresponds to the values. In the case above, the iterating variable key was used to stand for key, and sammy_shark[key] was used to stand for the values. + +Loops are often used to iterate and manipulate sequential data types. + +### Nested For Loops +Loops can be nested in Python, as they can with other programming languages. + +A nested loop is a loop that occurs within another loop, structurally similar to nested if statements. These are constructed like so: + + +```python +for [first iterating variable] in [outer loop]: # Outer loop + [do something] # Optional + for [second iterating variable] in [nested loop]: # Nested loop + [do something] +``` + + +The program first encounters the outer loop, executing its first iteration. This first iteration triggers the inner, nested loop, which then runs to completion. Then the program returns back to the top of the outer loop, completing the second iteration and again triggering the nested loop. Again, the nested loop runs to completion, and the program returns back to the top of the outer loop until the sequence is complete or a break or other statement disrupts the process. + +Let’s implement a nested for loop so we can take a closer look. In this example, the outer loop will iterate through a list of integers called num_list, and the inner loop will iterate through a list of strings called alpha_list. + +```python +num_list = [1, 2, 3] +alpha_list = ['a', 'b', 'c'] + +for number in num_list: + print(number) + for letter in alpha_list: + print(letter) +``` + +When we run this program, we’ll receive the following output: + +```python +Output +1 +a +b +c +2 +a +b +c +3 +a +b +c +``` +The output illustrates that the program completes the first iteration of the outer loop by printing 1, which then triggers completion of the inner loop, printing a, b, c consecutively. Once the inner loop has completed, the program returns to the top of the outer loop, prints 2, then again prints the inner loop in its entirety (a, b, c), etc. + +Nested for loops can be useful for iterating through items within lists composed of lists. In a list composed of lists, if we employ just one for loop, the program will output each internal list as an item: + +```python +list_of_lists = [['hammerhead', 'great white', 'dogfish'],[0, 1, 2],[9.9, 8.8, 7.7]] + +for list in list_of_lists: + print(list) +``` + +```python +Output +['hammerhead', 'great white', 'dogfish'] +[0, 1, 2] +[9.9, 8.8, 7.7] +``` +In order to access each individual item of the internal lists, we’ll implement a nested for loop: + +```python +list_of_lists = [['hammerhead', 'great white', 'dogfish'],[0, 1, 2],[9.9, 8.8, 7.7]] + +for list in list_of_lists: + for item in list: + print(item) +``` + +```python +Output +hammerhead +great white +dogfish +0 +1 +2 +9.9 +8.8 +7.7 +``` + + +When we utilize a nested for loop we are able to iterate over the individual items contained in the lists. + + + +### Conclusion + +This tutorial went over how for loops work in Python and how to construct them. For loops continue to loop through a block of code provided a certain number of times. + +From here, you can continue to learn about looping by reading tutorials on [while](https://www.digitalocean.com/community/tutorials/how-to-construct-while-loops-in-python-3) loops and [break, continue, and pass statements.](https://www.digitalocean.com/community/tutorials/how-to-use-break-continue-and-pass-statements-when-working-with-loops-in-python-3) diff --git a/docs/index.md b/docs/index.md index d3ab200..57a65ef 100644 --- a/docs/index.md +++ b/docs/index.md @@ -17,6 +17,8 @@ Of course, it needs plenty of time to organize best resources based on the topic - [Start Coding With Python](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Start_Coding_With_Python) - [Data Types In Python 3](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Data_Types_In_Python_3) - [Variables and Assignment](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Variables_And_Assignment) + - [Conditions](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Conditions) + - [For Loop](https://ent1c3d.github.io/Python-Synopsis/site/beginner/For_Loop) - ... - [Functions](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Functions) - ... diff --git a/mkdocs.yml b/mkdocs.yml index 8ff4031..d0d41ea 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -18,6 +18,8 @@ pages: - Start Coding With Python : beginner/Start_Coding_With_Python.md - Data Types in Python 3 : beginner/Data_Types_In_Python_3.md - Variables and Assignment : beginner/Variables_And_Assignment.md + - Conditions : beginner/Conditions.md + - For Loop : beginner/For_Loop.md - Functions : beginner/Functions.md - Advanced: - Context Managers : advanced/Context_Managers.md diff --git a/site/404.html b/site/404.html index 37be223..a50ea1c 100644 --- a/site/404.html +++ b/site/404.html @@ -276,6 +276,30 @@ +
        • + + Conditions + +
        • + + + + + + + +
        • + + For Loop + +
        • + + + + + + +
        • Functions diff --git a/site/About/index.html b/site/About/index.html index 7fc5e83..e74698e 100644 --- a/site/About/index.html +++ b/site/About/index.html @@ -278,6 +278,30 @@ +
        • + + Conditions + +
        • + + + + + + + +
        • + + For Loop + +
        • + + + + + + +
        • Functions diff --git a/site/advanced/Context_Managers/index.html b/site/advanced/Context_Managers/index.html index 7d1a03b..15b9e1a 100644 --- a/site/advanced/Context_Managers/index.html +++ b/site/advanced/Context_Managers/index.html @@ -282,6 +282,30 @@ +
        • + + Conditions + +
        • + + + + + + + +
        • + + For Loop + +
        • + + + + + + +
        • Functions diff --git a/site/advanced/Python_Metaclasses/index.html b/site/advanced/Python_Metaclasses/index.html index d325e26..fc09fbd 100644 --- a/site/advanced/Python_Metaclasses/index.html +++ b/site/advanced/Python_Metaclasses/index.html @@ -282,6 +282,30 @@ +
        • + + Conditions + +
        • + + + + + + + +
        • + + For Loop + +
        • + + + + + + +
        • Functions diff --git a/site/beginner/Conditions/index.html b/site/beginner/Conditions/index.html new file mode 100644 index 0000000..e4eec97 --- /dev/null +++ b/site/beginner/Conditions/index.html @@ -0,0 +1,1244 @@ + + + + + + + + + + + + + + + + + + + + + + + Conditions - Python Synopsis + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          + +
          + +
          + + +
          +
          + + +
          +
          +
          + +
          +
          +
          + + + + + +
          +
          + + + +

          Conditions

          + +

          Conditional Execution

          +

          In order to write useful programs, we almost always need the ability to check conditions +and change the behavior of the program accordingly. Conditional statements give us this +ability. The simplest form is the if statement:

          +
          if x > 0:
          +    print 'x is positive'
          +
          + + +

          The boolean expression after if is called the condition. If it is true, then the indented +statement gets executed. If not, nothing happens. +if statements have the same structure as function definitions: a header followed by an +indented body. Statements like this are called compound statements. +There is no limit on the number of statements that can appear in the body, but there has +to be at least one. Occasionally, it is useful to have a body with no statements (usually +as a place keeper for code you haven’t written yet). In that case, you can use the pass +statement, which does nothing.

          +
          if x < 0:
          +    pass # need to handle negative values!
          +
          + + +

          Alternative Execution

          +

          A second form of the if statement is alternative execution, in which there are two +possibilities and the condition determines which one gets executed. The syntax looks +like this:

          +
          if x%2 == 0:
          +    print 'x is even'
          +else:
          +    print 'x is odd'
          +
          + + +

          If the remainder when x is divided by 2 is 0, then we know that x is even, and the program +displays a message to that effect. If the condition is false, the second set of statements is +executed. Since the condition must be true or false, exactly one of the alternatives will +be executed. The alternatives are called branches, because they are branches in the flow +of execution.

          +

          Chained Conditionals

          +

          Sometimes there are more than two possibilities and we need more than two branches. +One way to express a computation like that is a chained conditional:

          +
          if x < y:
          +    print 'x is less than y'
          +elif x > y:
          +    print 'x is greater than y'
          +else:
          +    print 'x and y are equal'
          +
          + + +

          elif is an abbreviation of “else if.” Again, exactly one branch will be executed. There is +no limit on the number of elif statements. If there is an else clause, it has to be at the +end, but there doesn’t have to be one.

          +
          if choice == 'a':
          +    draw_a()
          +elif choice == 'b':
          +    draw_b()
          +elif choice == 'c':
          +    draw_c()
          +
          + + +

          Each condition is checked in order. If the first is false, the next is checked, and so on. If +one of them is true, the corresponding branch executes, and the statement ends. Even +if more than one condition is true, only the first true branch executes.

          +

          Nested Conditionals

          +

          One conditional can also be nested within another. We could have written the tri +chotomy example like this:

          +
          if x == y:
          +    print 'x and y are equal'
          +else:
          +    if x < y:
          +        print 'x is less than y'
          +    else:
          +        print 'x is greater than y'
          +
          + + +

          The outer conditional contains two branches. The first branch contains a simple state +ment. The second branch contains another if statement, which has two branches of its +own. Those two branches are both simple statements, although they could have been +conditional statements as well.
          +Although the indentation of the statements makes the structure apparent, nested +conditionals become difficult to read very quickly. In general, it is a good idea to avoid +them when you can.
          +Logical operators often provide a way to simplify nested conditional statements. For +example, we can rewrite the following code using a single conditional:

          +
          if 0 < x:
          +    if x < 10:
          +        print 'x is a positive single-digit number.'
          +
          + + +

          The print statement is executed only if we make it past both conditionals, so we can +get the same effect with the and operator:

          +
          if 0 < x and x < 10:
          +    print 'x is a positive single-digit number.'
          +
          + + +
          +

          Source:
          + Think Python by Allen B. Downey - 2012

          +
          +

          If-Else statements in Python By Udemy

          +

          The if-else statement is a staple of most programming languages. It is used to test different conditions and execute code accordingly. You can think of it as a ‘map’ used to make decisions in the program.

          +

          The basic syntax is as follows:

          +
          if condition1 = True:
          +      execute code1
          +else:               
          +      execute code2
          +
          + + +

          In plain English, this can be described as follows: +If condition1 is true, then execute the code included in code1. If it is not true, then run code2

          +

          A few things to note about the syntax: +- Each if/else statement must close with a colon (:) +- Code to be executed as part of any if/else statement must be indented by four spaces, equivalent to one press of the Tab key. +- Although not explicitly required, every if statement must also include an else statement – it just makes for a better program.

          +

          You use if-else statements a lot in your every day. Virtually every decision you make involves some form of if-else statements. “If the bacon is cheap, I’ll buy a pound. If not, I’ll grab some mac and cheese”, “if I wake up before 6, I’ll head out for a jog. Otherwise, I’ll head straight to work”, and “if the traffic is light, we’ll make the movie theater in time. Else, we’ll just have to grab dinner and go back home” – these are some simple if-else decisions we’ve all made in our everyday life. Thus, by using if-else statements in Python, you give the program the ability to make decisions depending on the user input.

          +

          But enough talk; let’s try to understand if-else statements with an example:

          +
          x = 5
          +if x > 5:
          +          print "X is larger than five!"
          +else:
          +          print "X is smaller than or equal to five!"
          +
          + + +

          this program basically instructs Python to: +- Check the value of x. +- If the value of x is more than 5, print that “X is larger than five”. +- If the value of x is less than or equal to 5, print “X is smaller than or equal to five”.

          +

          As we’ll learn below, the decision making capabilities of if-else conditions will come very handy when you want to create complicated programs.

          +

          Testing Multiple Conditions with Elif

          +

          The above if-else syntax is great if you want to test just one condition, but what happens when you want to check multiple conditions?

          +

          This is where the Elif statement comes in handy.
          +Elif is a shortened form of Else-If. The syntax can be seen as follows:

          +
          if condition1 = True:
          +         execute code1
          +elif condition2 = True:
          +         execute code2
          +else:  
          +         execute code3
          +
          + + +

          In plain English, you can read this as follows: +If condition1 is true, execute code1. Else, if condition2 is true, execute code2. If neither condition1 or condition2 are true, execute code3.

          +

          There is no limit to the number of elif statements you can include in a Python program. You can test dozens of conditions using multiple elif statements as long as you close with an else statement.
          +Let’s try to understand this with an example:

          +
          x = 5
          +if x == 5:
          +          print "Wow, X is EXACTLY five!"
          +elif x > 5:
          +          print "X is now MORE than five!"
          +else:
          +          print "X is now LESS than five!"
          +
          + + +

          So what exactly is happening here? Let’s break it down into individual steps:

          +
            +
          • Python first checks if the value of x is exactly equal to 5, as given in the first if statement.
          • +
          • If x is equal to five, Python executes the code included within the first if statement and exits the program.
          • +
          • If, however, x is not equal to 5, Python goes to the second elif statement. It now checks if x is greater than 5.
          • +
          • In case x is more than 5, Python executes the second block of code under the elif statement and exits the program.
          • +
          • However, if both conditions are not met, that is, x is neither equal to, nor greater than five, Python displays the output under the third else statement.
          • +
          +

          As mentioned above, an if-else conditional block can include as many elif statements as you want.

          +

          Nested If-Else Statements

          +

          So far, we’ve used just a single level of if-else statements. But what if you want to make decisions within decisions? That’s like saying: “if the oranges are fresh, buy a dozen if they are more than $5/lb, and two dozen if they are less than $5/lb”

          +

          In programmer-speak (i.e. algorithmically) this can be written as follows:

          +
          orange_quality = fresh
          +orange_price = 4.0
          +if orange_quality == fresh:
          +          if orange_price < 5:
          +                    buy 24.0
          +          else: 
          +                    buy 12.0
          +else:
          +          dont_buy_oranges
          +
          + + +

          This is an example of a nested if-else statement – an if-else statement inside another if-else statement. These can help you make more complex decisions and give you even finer control over the program flow. In terms of syntax, they can be written as follows:

          +
          if condition1 =  True:
          +          if condition2 = True:
          +                  execute code1
          +          elif condition3 = True:
          +                  execute code2
          +          else:
          +                  execute code3
          +else:
          +          execute code4
          +
          + + +

          Thus, the syntax rules are the same as a standard if-statement – i.e. nested statements must be tabbed in. Theoretically, you can nest as many if-else statements as you want, but it is poor practice to go more than two levels deep.

          +
          +

          Source:
          + https://blog.udemy.com/python-if-else/

          +
          +

          How To Write Conditional Statements in Python 3

          +

          Conditional statements are part of every programming language. With conditional statements, we can have code that sometimes runs and at other times does not run, depending on the conditions of the program at that time.

          +

          When we fully execute each statement of a program, moving from the top to the bottom with each line executed in order, we are not asking the program to evaluate specific conditions. By using conditional statements, programs can determine whether certain conditions are being met and then be told what to do next.

          +

          Let’s look at some examples where we would use conditional statements:

          +
            +
          • If the student receives over 65% on her test, report that her grade passes; if not, report that her grade fails
          • +
          • If he has money in his account, calculate interest; if he doesn’t, charge a penalty fee
          • +
          • If they buy 10 oranges or more, calculate a discount of 5%; if they buy fewer, then don’t
          • +
          +

          Through evaluating conditions and assigning code to run based on whether or not those conditions are met, we are writing conditional code.

          +

          This tutorial will take you through writing conditional statements in the Python programming language.

          +

          If statement

          +

          We will start with the if statement, which will evaluate whether a statement is true or false, and run code only in the case that the statement is true.

          +

          In a plain text editor, open a file and write the following code:

          +
          grade = 70
          +
          +if grade >= 65:
          +    print("Passing grade")
          +
          + + +

          With this code, we have the variable grade and are giving it the integer value of 70. We are then using the if statement to evaluate whether or not the variable grade is greater than or equal ( >= ) to 65. If it does meet this condition, we are telling the program to print out the string Passing grade.

          +

          In this case, the grade of 70 does meet the condition of being greater than or equal to 65, so you will receive the following output once you run the program:

          +
          Output
          +Passing grade
          +
          + + +

          Let’s now change the result of this program by changing the value of the grade variable to 60:

          +
          grade = 60
          +
          +if grade >= 65:
          +    print("Passing grade")
          +
          + + +

          When we save and run this code, we will receive no output because the condition was not met and we did not tell the program to execute another statement.

          +

          To give one more example, let us calculate whether a bank account balance is below 0. Let’s create a file called account.py and write the following program:

          +
          balance = -5
          +
          +if balance < 0:
          +    print("Balance is below 0, add funds now or you will be charged a penalty.")
          +
          + + +

          When we run the program with python account.py, we’ll receive the following output:

          +
          Output
          +Balance is below 0, add funds now or you will be charged a penalty.
          +
          + + +

          In the program we initialized the variable balance with the value of -5, which is less than 0. Since the balance met the condition of the if statement (balance < 0), once we save and run the code, we will receive the string output. Again, if we change the balance to 0 or a positive number, we will receive no output.

          +

          Else Statement

          +

          It is likely that we will want the program to do something even when an if statement evaluates to false. In our grade example, we will want output whether the grade is passing or failing.

          +

          To do this, we will add an else statement to the grade condition above that is constructed like this:

          +
          grade = 60
          +
          +if grade >= 65:
          +    print("Passing grade")
          +
          +else:
          +    print("Failing grade")
          +
          + + +

          Since the grade variable above has the value of 60, the if statement evaluates as false, so the program will not print out Passing grade. The else statement that follows tells the program to do something anyway.

          +

          When we save and run the program, we’ll receive the following output:

          +
          Output
          +Failing grade
          +
          + + +

          If we then rewrite the program to give the grade a value of 65 or higher, we will instead receive the output Passing grade.

          +

          To add an else statement to the bank account example, we rewrite the code like this:

          +
          balance = 522
          +
          +if balance < 0:
          +    print("Balance is below 0, add funds now or you will be charged a penalty.")
          +
          +else:
          +    print("Your balance is 0 or above.")
          +
          + + +

          Here, we changed the balance variable value to a positive number so that the else statement will print. To get the first if statement to print, we can rewrite the value to a negative number.

          +

          By combining an if statement with an else statement, you are constructing a two-part conditional statement that will tell the computer to execute certain code whether or not the if condition is met.

          +

          Else if statement

          +

          So far, we have presented a Boolean option for conditional statements, with each if statement evaluating to either true or false. In many cases, we will want a program that evaluates more than two possible outcomes. For this, we will use an else if statement, which is written in Python as elif. The elif or else if statement looks like the if statement and will evaluate another condition.

          +

          In the bank account program, we may want to have three discrete outputs for three different situations:

          +
            +
          • The balance is below 0
          • +
          • The balance is equal to 0
          • +
          • The balance is above 0
          • +
          +

          The elif statement will be placed between the if statement and the else statement as follows:

          +
          . . .
          +if balance < 0:
          +    print("Balance is below 0, add funds now or you will be charged a penalty.")
          +
          +elif balance == 0:
          +    print("Balance is equal to 0, add funds soon.")
          +
          +else:
          +    print("Your balance is 0 or above.")
          +
          + + +

          Now, there are three possible outputs that can occur once we run the program: +- If the variable balance is equal to 0 we will receive the output from the elif statement (Balance is equal to 0, add funds soon.) +- If the variable balance is set to a positive number, we will receive the output from the else statement (Your balance is 0 or above.). +- If the variable balance is set to a negative number, the output will be the string from the if statement (Balance is below 0, add funds now or you will be charged a penalty).

          +

          What if we want to have more than three possibilities, though? We can do this by writing more than one elif statement into our code.

          +

          In the grade.py program, let’s rewrite the code so that there are a few letter grades corresponding to ranges of numerical grades:

          +
            +
          • 90 or above is equivalent to an A grade
          • +
          • 80-89 is equivalent to a B grade
          • +
          • 70-79 is equivalent to a C grade
          • +
          • 65-69 is equivalent to a D grade
          • +
          • 64 or below is equivalent to an F grade
          • +
          +

          To run this code, we will need one if statement, three elif statements, and an else statement that will handle all failing cases.

          +

          Let’s rewrite the code from the example above to have strings that print out each of the letter grades. We can keep our else statement the same.

          +
          . . .
          +if grade >= 90:
          +    print("A grade")
          +
          +elif grade >=80:
          +    print("B grade")
          +
          +elif grade >=70:
          +    print("C grade")
          +
          +elif grade >= 65:
          +    print("D grade")
          +
          +else:
          +    print("Failing grade")
          +
          + + +

          Since elif statements will evaluate in order, we can keep our statements pretty basic. This program is completing the following steps:

          +
            +
          • If the grade is greater than 90, the program will print A grade, if the grade is less than 90, the program will continue to the next statement...
          • +
          • If the grade is greater than or equal to 80, the program will print B grade, if the grade is 79 or less, the program will continue to the next statement...
          • +
          • If the grade is greater than or equal to 70, the program will print C grade, if the grade is 69 or less, the program will continue to the next statement...
          • +
          • If the grade is greater than or equal to 65, the program will print D grade, if the grade is 64 or less, the program will continue to the next statement...
          • +
          • The program will print Failing grade because all of the above conditions were not met.
          • +
          +

          Nested If Statements

          +

          Once you are feeling comfortable with the if, elif, and else statements, you can move on to nested conditional statements. We can use nested if statements for situations where we want to check for a secondary condition if the first condition executes as true. For this, we can have an if-else statement inside of another if-else statement. Let’s look at the syntax of a nested if statement:

          +
          if statement1:              #outer if statement
          +    print("true")
          +
          +    if nested_statement:    #nested if statement
          +        print("yes")
          +
          +    else:                   #nested else statement
          +        print("no")
          +
          +else:                       #outer else statement
          +    print("false")
          +
          + + +

          A few possible outputs can result from this code:
          +- If statement1 evaluates to true, the program will then evaluate whether the nested_statement also evaluates to true. If both cases are true, the output will be:

          +
          Output
          +true
          +yes
          +
          + + +
            +
          • If, however, statement1 evaluates to true, but nested_statement evaluates to false, then the output will be:
          • +
          +
          Output
          +true
          +no
          +
          + + +
            +
          • And if statement1 evaluates to false, the nested if-else statement will not run, so the else statement will run alone, and the output will be:
          • +
          +
          Output
          +false
          +
          + + +

          We can also have multiple if statements nested throughout our code:

          +
          if statement1:                  #outer if 
          +    print("hello world")
          +
          +    if nested_statement1:       #first nested if 
          +        print("yes")
          +
          +    elif nested_statement2:     #first nested elif
          +        print("maybe")
          +
          +    else:                       #first nested else
          +        print("no")
          +
          +elif statement2:                #outer elif
          +    print("hello galaxy")
          +
          +    if nested_statement3:       #second nested if
          +        print("yes")
          +
          +    elif nested_statement4:     #second nested elif
          +        print("maybe")
          +
          +    else:                       #second nested else
          +        print("no")
          +
          +else:                           #outer else
          +    statement("hello universe")
          +
          + + +

          In the above code, there is a nested if statement inside each if statement in addition to the elif statement. This will allow for more options within each condition.

          +

          Let’s look at an example of nested if statements with our grade.py program. We can check for whether a grade is passing first (greater than or equal to 65%), then evaluate which letter grade the numerical grade should be equivalent to. If the grade is not passing, though, we do not need to run through the letter grades, and instead can have the program report that the grade is failing. Our modified code with the nested if statement will look like this:

          +
          . . .
          +if grade >= 65:
          +    print("Passing grade of:")
          +
          +    if grade >= 90:
          +        print("A")
          +
          +    elif grade >=80:
          +        print("B")
          +
          +    elif grade >=70:
          +        print("C")
          +
          +    elif grade >= 65:
          +        print("D")
          +
          +else:
          +    print("Failing grade")
          +
          + + +

          If we run the code with the variable grade set to the integer value 92, the first condition is met, and the program will print out Passing grade of:. Next, it will check to see if the grade is greater than or equal to 90, and since this condition is also met, it will print out A.

          +

          If we run the code with the grade variable set to 60, then the first condition is not met, so the program will skip the nested if statements and move down to the else statement, with the program printing out Failing grade.

          +

          We can of course add even more options to this, and use a second layer of nested if statements. Perhaps we will want to evaluate for grades of A+, A and A- separately. We can do so by first checking if the grade is passing, then checkingto see if the grade is 90 or above, then checkingto see if the grade is over 96 for an A+ for instance:

          +
          . . .
          +if grade >= 65:
          +    print("Passing grade of:")
          +
          +    if grade >= 90:
          +        if grade > 96:
          +            print("A+")
          +
          +        elif grade > 93 and grade <= 96:
          +            print("A")
          +
          +        elif grade >= 90:
          +            print("A-")
          +. . .
          +
          + + +

          In the code above, for a grade variable set to 96, the program will run the following:

          +
            +
          • Check if the grade is greater than or equal to 65 (true)
          • +
          • Print out Passing grade of:
          • +
          • Check if the grade is greater than or equal to 90 (true)
          • +
          • Check if the grade is greater than 96 (false)
          • +
          • Check if the grade is greater than 93 and also less than or equal to 96 (true)
          • +
          • Print A
          • +
          • Leave these nested conditional statements and continue with remaining code
          • +
          +

          The output of the program for a grade of 96 therefore looks like this:

          +
          Output
          +Passing grade of:
          +A
          +
          + + +

          Nested if statements can provide the opportunity to add several specific levels of conditions to your code.

          +

          Conclusion

          +

          By using conditional statements like the if statement, you will have greater control over what your program executes. Conditional statements tell the program to evaluate whether a certain condition is being met. If the condition is met it will execute specific code, but if it is not met the program will continue to move down to other code.

          +
          +

          Source:
          + https://www.digitalocean.com/community/tutorials/how-to-write-conditional-statements-in-python-3-2

          +
          + + + + + + + +
          +
          +
          +
          + + + + +
          + + + + + + + + + + + + \ No newline at end of file diff --git a/site/beginner/Data_Types_In_Python_3/index.html b/site/beginner/Data_Types_In_Python_3/index.html index 839a72d..f34ab1b 100644 --- a/site/beginner/Data_Types_In_Python_3/index.html +++ b/site/beginner/Data_Types_In_Python_3/index.html @@ -464,6 +464,30 @@ +
        • + + Conditions + +
        • + + + + + + + +
        • + + For Loop + +
        • + + + + + + +
        • Functions diff --git a/site/beginner/For_Loop/index.html b/site/beginner/For_Loop/index.html new file mode 100644 index 0000000..a8917b2 --- /dev/null +++ b/site/beginner/For_Loop/index.html @@ -0,0 +1,914 @@ + + + + + + + + + + + + + + + + + + + + + + + For Loop - Python Synopsis + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          + +
          + +
          + + +
          +
          + + +
          +
          +
          + +
          +
          +
          + + +
          +
          +
          + + +
          +
          +
          + + +
          +
          + + + +

          For Loop

          + +

          How To Construct For Loops in Python 3

          +

          Using loops in computer programming allows us to automate and repeat similar tasks multiple times. In this tutorial, we’ll be covering Python’s for loop.

          +

          A for loop implements the repeated execution of code based on a loop counter or loop variable. This means that for loops are used most often when the number of iterations is known before entering the loop, unlike while loops which are conditionally based.

          +

          For Loops

          +

          In Python, for loops are constructed like so:

          +
          for [iterating variable] in [sequence]:
          +    [do something]
          +
          + + +

          The something that is being done will be executed until the sequence is over.

          +

          Let’s look at a for loop that iterates through a range of values:

          +
          for i in range(0,5):
          +   print(i)
          +
          + + +

          When we run this program, the output looks like this:

          +
          Output
          +0
          +1
          +2
          +3
          +4
          +
          + + +

          This for loop sets up i as its iterating variable, and the sequence exists in the range of 0 to 5.

          +

          Then within the loop we print out one integer per loop iteration. Keep in mind that in programming we tend to begin at index 0, so that is why although 5 numbers are printed out, they range from 0-4.

          +

          You’ll commonly see and use for loops when a program needs to repeat a block of code a number of times.

          +

          For Loops using range()

          +

          One of Python’s built-in immutable sequence types is range(). In loops, range() is used to control how many times the loop will be repeated.
          +When working with range(), you can pass between 1 and 3 integer arguments to it:

          +
            +
          • start states the integer value at which the sequence begins, if this is not included then start begins at 0
          • +
          • stop is always required and is the integer that is counted up to but not included
          • +
          • step sets how much to increase (or decrease in the case of negative numbers) the next iteration, if this is omitted then step defaults to 1
          • +
          +

          We’ll look at some examples of passing different arguments to range().

          +

          First, let’s only pass the stop argument, so that our sequence set up is range(stop):

          +
          for i in range(6):
          +   print(i)
          +
          + + +

          In the program above, the stop argument is 6, so the code will iterate from 0-6 (exclusive of 6):

          +
          Output
          +0
          +1
          +2
          +3
          +4
          +5
          +
          + + +

          Next, we’ll look at range(start, stop), with values passed for when the iteration should start and for when it should stop:

          +
          for i in range(20,25):
          +   print(i)
          +
          + + +

          Here, the range goes from 20 (inclusive) to 25 (exclusive), so the output looks like this:

          +
          Output
          +20
          +21
          +22
          +23
          +24
          +
          + + +

          The step argument of range() is similar to specifying stride while slicing strings in that it can be used to skip values within the sequence.

          +

          With all three arguments, step comes in the final position: range(start, stop, step). First, let’s use a step with a positive value:

          +
          for i in range(0,15,3):
          +   print(i)
          +
          + + +

          In this case, the for loop is set up so that the numbers from 0 to 15 print out, but at a step of 3, so that only every third number is printed, like so:

          +
          Output
          +0
          +3
          +6
          +9
          +12
          +
          + + +

          We can also use a negative value for our step argument to iterate backwards, but we’ll have to adjust our start and stop arguments accordingly:

          +
          for i in range(100,0,-10):
          +   print(i)
          +
          + + +

          Here, 100 is the start value, 0 is the stop value, and -10 is the range, so the loop begins at 100 and ends at 0, decreasing by 10 with each iteration. We can see this occur in the output:

          +
          Output
          +100
          +90
          +80
          +70
          +60
          +50
          +40
          +30
          +20
          +10
          +
          + + +

          When programming in Python, for loops often make use of the range() sequence type as its parameters for iteration.

          +

          For Loops using Sequential Data Types

          +

          Lists and other data sequence types can also be leveraged as iteration parameters in for loops. Rather than iterating through a range(), you can define a list and iterate through that list.

          +

          We’ll assign a list to a variable, and then iterate through the list:

          +
          sharks = ['hammerhead', 'great white', 'dogfish', 'frilled', 'bullhead', 'requiem']
          +
          +for shark in sharks:
          +   print(shark)
          +
          + + +

          In this case, we are printing out each item in the list. Though we used the variable shark, we could have called the variable any other valid variable name and we would get the same output:

          +
          Output
          +hammerhead
          +great white
          +dogfish
          +frilled
          +bullhead
          +requiem
          +
          + + +

          The output above shows that the for loop iterated through the list, and printed each item from the list per line.

          +

          Lists and other sequence-based data types like strings and tuples are common to use with loops because they are iterable. You can combine these data types with range() to add items to a list, for example:

          +
          sharks = ['hammerhead', 'great white', 'dogfish', 'frilled', 'bullhead', 'requiem']
          +
          +for item in range(len(sharks)):
          +   sharks.append('shark')
          +
          +print(sharks)
          +
          + + +
          Output
          +['hammerhead', 'great white', 'dogfish', 'frilled', 'bullhead', 'requiem', 'shark', 'shark', 'shark', 'shark', 'shark', 'shark']
          +
          + + +

          Here, we have added a placeholder string of 'shark' for each item of the length of the sharks list.

          +

          You can also use a for loop to construct a list from scratch:

          +
          integers = []
          +
          +for i in range(10):
          +   integers.append(i)
          +
          +print(integers)
          +
          + + +

          In this example, the list integers is initialized empty, but the for loop populates the list like so:

          +
          Output
          +[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
          +
          + + +

          Similarly, we can iterate through strings:

          +
          sammy = 'Sammy'
          +
          +for letter in sammy:
          +   print(letter)
          +
          + + +
          Output
          +S
          +a
          +m
          +m
          +y
          +
          + + +

          Iterating through tuples is done in the same format as iterating through lists or strings above.

          +

          When iterating through a dictionary, it’s important to keep the key : value structure in mind to ensure that you are calling the correct element of the dictionary. Here is an example that calls both the key and the value:

          +
          sammy_shark = {'name': 'Sammy', 'animal': 'shark', 'color': 'blue', 'location': 'ocean'}
          +
          +for key in sammy_shark:
          +   print(key + ': ' + sammy_shark[key])
          +
          + + +
          Output
          +name: Sammy
          +animal: shark
          +location: ocean
          +color: blue
          +
          + + +

          When using dictionaries with for loops, the iterating variable corresponds to the keys of the dictionary, and dictionary_variable[iterating_variable] corresponds to the values. In the case above, the iterating variable key was used to stand for key, and sammy_shark[key] was used to stand for the values.

          +

          Loops are often used to iterate and manipulate sequential data types.

          +

          Nested For Loops

          +

          Loops can be nested in Python, as they can with other programming languages.

          +

          A nested loop is a loop that occurs within another loop, structurally similar to nested if statements. These are constructed like so:

          +
          for [first iterating variable] in [outer loop]: # Outer loop
          +    [do something]  # Optional
          +    for [second iterating variable] in [nested loop]:   # Nested loop
          +        [do something]  
          +
          + + +

          The program first encounters the outer loop, executing its first iteration. This first iteration triggers the inner, nested loop, which then runs to completion. Then the program returns back to the top of the outer loop, completing the second iteration and again triggering the nested loop. Again, the nested loop runs to completion, and the program returns back to the top of the outer loop until the sequence is complete or a break or other statement disrupts the process.

          +

          Let’s implement a nested for loop so we can take a closer look. In this example, the outer loop will iterate through a list of integers called num_list, and the inner loop will iterate through a list of strings called alpha_list.

          +
          num_list = [1, 2, 3]
          +alpha_list = ['a', 'b', 'c']
          +
          +for number in num_list:
          +    print(number)
          +    for letter in alpha_list:
          +        print(letter)
          +
          + + +

          When we run this program, we’ll receive the following output:

          +
          Output
          +1
          +a
          +b
          +c
          +2
          +a
          +b
          +c
          +3
          +a
          +b
          +c
          +
          + + +

          The output illustrates that the program completes the first iteration of the outer loop by printing 1, which then triggers completion of the inner loop, printing a, b, c consecutively. Once the inner loop has completed, the program returns to the top of the outer loop, prints 2, then again prints the inner loop in its entirety (a, b, c), etc.

          +

          Nested for loops can be useful for iterating through items within lists composed of lists. In a list composed of lists, if we employ just one for loop, the program will output each internal list as an item:

          +
          list_of_lists = [['hammerhead', 'great white', 'dogfish'],[0, 1, 2],[9.9, 8.8, 7.7]]
          +
          +for list in list_of_lists:
          +    print(list)
          +
          + + +
          Output
          +['hammerhead', 'great white', 'dogfish']
          +[0, 1, 2]
          +[9.9, 8.8, 7.7]
          +
          + + +

          In order to access each individual item of the internal lists, we’ll implement a nested for loop:

          +
          list_of_lists = [['hammerhead', 'great white', 'dogfish'],[0, 1, 2],[9.9, 8.8, 7.7]]
          +
          +for list in list_of_lists:
          +    for item in list:
          +        print(item)
          +
          + + +
          Output
          +hammerhead
          +great white
          +dogfish
          +0
          +1
          +2
          +9.9
          +8.8
          +7.7
          +
          + + +

          When we utilize a nested for loop we are able to iterate over the individual items contained in the lists.

          +

          Conclusion

          +

          This tutorial went over how for loops work in Python and how to construct them. For loops continue to loop through a block of code provided a certain number of times.

          +

          From here, you can continue to learn about looping by reading tutorials on while loops and break, continue, and pass statements.

          + + + + + + + +
          +
          +
          +
          + + + + +
          + + + + + + + + + + + + \ No newline at end of file diff --git a/site/beginner/Functions/index.html b/site/beginner/Functions/index.html index 498234b..8eaf941 100644 --- a/site/beginner/Functions/index.html +++ b/site/beginner/Functions/index.html @@ -283,6 +283,30 @@ + +
        • + + Conditions + +
        • + + + + + + + +
        • + + For Loop + +
        • + + + + + + @@ -1236,32 +1260,39 @@

          Function Basics

          Statement Examples + Calls myfunc('spam', 'eggs', meat=ham) + def, return def adder(a, b=1, *c): return a + b + c[0] + global def changer():global x; x = 'new' + nonlocal def changer():nonlocal x; x = 'new' + yield def squares(x):for i in range(x): yield i ** 2 + lambda funcs = [lambda x: x*2, lambda x: x3] + @@ -2037,7 +2068,7 @@

          Things to Remember

          diff --git a/site/beginner/Python_Installation/index.html b/site/beginner/Python_Installation/index.html index 115e4e3..58bd3d1 100644 --- a/site/beginner/Python_Installation/index.html +++ b/site/beginner/Python_Installation/index.html @@ -343,6 +343,30 @@ +
        • + + Conditions + +
        • + + + + + + + +
        • + + For Loop + +
        • + + + + + + +
        • Functions diff --git a/site/beginner/Python_Programming_Lanuage/index.html b/site/beginner/Python_Programming_Lanuage/index.html index 6f31180..30d419c 100644 --- a/site/beginner/Python_Programming_Lanuage/index.html +++ b/site/beginner/Python_Programming_Lanuage/index.html @@ -408,6 +408,30 @@ +
        • + + Conditions + +
        • + + + + + + + +
        • + + For Loop + +
        • + + + + + + +
        • Functions diff --git a/site/beginner/Start_Coding_With_Python/index.html b/site/beginner/Start_Coding_With_Python/index.html index bc01152..507074b 100644 --- a/site/beginner/Start_Coding_With_Python/index.html +++ b/site/beginner/Start_Coding_With_Python/index.html @@ -438,6 +438,30 @@ +
        • + + Conditions + +
        • + + + + + + + +
        • + + For Loop + +
        • + + + + + + +
        • Functions diff --git a/site/beginner/Variables_And_Assignment/index.html b/site/beginner/Variables_And_Assignment/index.html index 0db6d65..b98edbc 100644 --- a/site/beginner/Variables_And_Assignment/index.html +++ b/site/beginner/Variables_And_Assignment/index.html @@ -381,6 +381,30 @@ +
        • + + Conditions + +
        • + + + + + + + +
        • + + For Loop + +
        • + + + + + + +
        • Functions @@ -1070,13 +1094,13 @@

          Conclusion

          -
        • + Conditions + +
        • + + + + + + + +
        • + + For Loop + +
        • + + + + + + +
        • Functions @@ -441,6 +465,8 @@

          Python Study Guide

        • Start Coding With Python
        • Data Types In Python 3
        • Variables and Assignment
        • +
        • Conditions
        • +
        • For Loop
        • ...
        • Functions
        • ...
        • diff --git a/site/mkdocs/search_index.json b/site/mkdocs/search_index.json index 4a46b44..ddba050 100644 --- a/site/mkdocs/search_index.json +++ b/site/mkdocs/search_index.json @@ -1,648 +1,753 @@ { "docs": [ { - "location": "/", - "text": "Welcome to Python Synopsis!\n\n\nPython Study Guide\n\n\nIn this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate \nbooks, articles, answers from Stackoverflow, online courses, videos from py conferences\n and etc. \n\n\nSo, after all I decided to share \ntop resources\n for everyone about each topic, that you need to know about python, if you want to be senior python \nSoftware Engineer\n. \n\n\nOf course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than \n30-40\n chapters.\n\n\n\n\nBeginner\n\n\nThe Python Programming Language, Implementation and Adventages\n\n\nPython Installation\n\n\nStart Coding With Python\n\n\nData Types In Python 3\n\n\nVariables and Assignment\n\n\n...\n\n\nFunctions\n\n\n...\n\n\n\n\n\n\nIntermediate\n\n\n... \n\n\n\n\n\n\nAdvanced\n\n\n...\n\n\nContext Managers\n\n\nPython Metaclasses\n\n\n...", + "location": "/", + "text": "Welcome to Python Synopsis!\n\n\nPython Study Guide\n\n\nIn this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate \nbooks, articles, answers from Stackoverflow, online courses, videos from py conferences\n and etc. \n\n\nSo, after all I decided to share \ntop resources\n for everyone about each topic, that you need to know about python, if you want to be senior python \nSoftware Engineer\n. \n\n\nOf course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than \n30-40\n chapters.\n\n\n\n\nBeginner\n\n\nThe Python Programming Language, Implementation and Adventages\n\n\nPython Installation\n\n\nStart Coding With Python\n\n\nData Types In Python 3\n\n\nVariables and Assignment\n\n\nConditions\n\n\nFor Loop\n\n\n...\n\n\nFunctions\n\n\n...\n\n\n\n\n\n\nIntermediate\n\n\n... \n\n\n\n\n\n\nAdvanced\n\n\n...\n\n\nContext Managers\n\n\nPython Metaclasses\n\n\n...", "title": "Home" - }, + }, { - "location": "/#welcome-to-python-synopsis", - "text": "", + "location": "/#welcome-to-python-synopsis", + "text": "", "title": "Welcome to Python Synopsis!" - }, + }, { - "location": "/#python-study-guide", - "text": "In this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate books, articles, answers from Stackoverflow, online courses, videos from py conferences and etc. So, after all I decided to share top resources for everyone about each topic, that you need to know about python, if you want to be senior python Software Engineer . Of course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than 30-40 chapters. Beginner The Python Programming Language, Implementation and Adventages Python Installation Start Coding With Python Data Types In Python 3 Variables and Assignment ... Functions ... Intermediate ... Advanced ... Context Managers Python Metaclasses ...", + "location": "/#python-study-guide", + "text": "In this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate books, articles, answers from Stackoverflow, online courses, videos from py conferences and etc. So, after all I decided to share top resources for everyone about each topic, that you need to know about python, if you want to be senior python Software Engineer . Of course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than 30-40 chapters. Beginner The Python Programming Language, Implementation and Adventages Python Installation Start Coding With Python Data Types In Python 3 Variables and Assignment Conditions For Loop ... Functions ... Intermediate ... Advanced ... Context Managers Python Metaclasses ...", "title": "Python Study Guide" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/", - "text": "The Python Programming Language\n\n\n\n\nThe programming language you will learn is Python. Python is an example of a highlevel\nlanguage; other high-level languages you might have heard of are \nC, C++, Perl,\n\nand \nJava\n.\nThere are also low-level languages, sometimes referred to as \n\u201cmachine languages\u201d\n or\n\n\u201cassembly languages.\u201d\n Loosely speaking, computers can only run programs written in\nlow-level languages. So programs written in a high-level language have to be processed\nbefore they can run. This extra processing takes some time, which is a small disadvantage\nof high-level languages.\n\n\nThe advantages are enormous. First, it is much easier to program in a high-level lan\nguage. Programs written in a high-level language take less time to write, they are shorter\nand easier to read, and they are more likely to be correct. Second, high-level languages\nare portable, meaning that they can run on different kinds of computers with few or no\nmodifications. Low-level programs can run on only one kind of computer and have to\nbe rewritten to run on another.\n\n\nDue to these advantages, almost all programs are written in high-level languages. Lowlevel\nlanguages are used only for a few specialized applications.\n\n\nTwo kinds of programs process high-level languages into low-level languages:\ninterpreters and compilers. An interpreter reads a high-level program and executes it,\nmeaning that it does what the program says. It processes the program a little at a time,\nalternately reading lines and performing computations. Figure 1-1 shows the structure\nof an interpreter.\n\n\n \n\n\nA compiler reads the program and translates it completely before the program starts\nrunning. In this context, the high-level program is called the source code, and the\ntranslated program is called the object code or the executable. Once a program is com\npiled, you can execute it repeatedly without further translation. Figure 1-2 shows the\nstructure of a compiler.\n\n\n\n\nPython is considered an interpreted language because Python programs are executed\nby an interpreter. There are two ways to use the interpreter: \ninteractive\n mode and \nscript mode\n. In interactive mode, you type Python programs and the interpreter displays the\nresult:\n>\n 1 + 1\n2\nThe chevron, \n, is the prompt the interpreter uses to indicate that it is ready. If you\ntype 1 + 1, the interpreter replies 2.\n\n\nAlternatively, you can store code in a file and use the interpreter to execute the contents\nof the file, which is called a script. By convention, Python scripts have names that end\nwith .py.\nTo execute the script, you have to tell the interpreter the name of the file. If you have a\nscript named dinsdale.py and you are working in a UNIX command window, you type\npython dinsdale.py. In other development environments, the details of executing\nscripts are different. You can find instructions for your environment at the Python web\nsite http://python.org.\nWorking in interactive mode is convenient for testing small pieces of code because you\ncan type and execute them immediately. But for anything more than a few lines, you\nshould save your code as a script so you can modify and execute it in the future.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nPython\u2019s View\n\n\nThe brief description in the prior section is fairly standard for scripting languages, and\nit\u2019s usually all that most Python programmers need to know. You type code into text\nfiles, and you run those files through the interpreter. Under the hood, though, a bit\nmore happens when you tell Python to \u201cgo.\u201d Although knowledge of Python internals\nis not strictly required for Python programming, a basic understanding of the runtime\nstructure of Python can help you grasp the bigger picture of program execution.\nWhen you instruct Python to run your script, there are a few steps that Python carries\nout before your code actually starts crunching away. Specifically, it\u2019s first compiled to\nsomething called \u201cbyte code\u201d and then routed to something called a \u201cvirtual machine.\u201d\n\n\nByte code compilation\n\n\nInternally, and almost completely hidden from you, when you execute a program\nPython first compiles your source code (the statements in your file) into a format known\nas byte code. Compilation is simply a translation step, and byte code is a lower-level,\nplatform-independent representation of your source code. Roughly, Python translates\neach of your source statements into a group of byte code instructions by decomposing\nthem into individual steps. This byte code translation is performed to speed\nexecution\u2014byte code can be run much more quickly than the original source code\nstatements in your text file.\nYou\u2019ll notice that the prior paragraph said that this is almost completely hidden from\nyou. If the Python process has write access on your machine, it will store the byte code\nof your programs in files that end with a .pyc extension (\u201c.pyc\u201d means compiled \u201c.py\u201d\nsource). You will see these files show up on your computer after you\u2019ve run a few\nprograms alongside the corresponding source code files (that is, in the same\ndirectories).\nPython saves byte code like this as a startup speed optimization. The next time you run\nyour program, Python will load the .pyc files and skip the compilation step, as long as\nyou haven\u2019t changed your source code since the byte code was last saved. Python automatically\nchecks the timestamps of source and byte code files to know when it must\nrecompile\u2014if you resave your source code, byte code is automatically re-created the\nnext time your program is run.\nIf Python cannot write the byte code files to your machine, your program still works\u2014\nthe byte code is generated in memory and simply discarded on program exit.* However,\nbecause .pyc files speed startup time, you\u2019ll want to make sure they are written for larger\nprograms. Byte code files are also one way to ship Python programs\u2014Python is happy\nto run a program if all it can find are .pyc files, even if the original .py source files are\nabsent.\n\n\nThe Python Virtual Machine (PVM)\n\n\nOnce your program has been compiled to byte code (or the byte code has been loaded\nfrom existing .pyc files), it is shipped off for execution to something generally known\nas the Python Virtual Machine (PVM, for the more acronym-inclined among you). The\nPVM sounds more impressive than it is; really, it\u2019s not a separate program, and it need\nnot be installed by itself. In fact, the PVM is just a big loop that iterates through your\nbyte code instructions, one by one, to carry out their operations. The PVM is the runtime\nengine of Python; it\u2019s always present as part of the Python system, and it\u2019s the\ncomponent that truly runs your scripts. Technically, it\u2019s just the last step of what is\ncalled the \u201cPython interpreter.\u201d\n\n\n\n\nFigure illustrates the runtime structure described here. Keep in mind that all of this\ncomplexity is deliberately hidden from Python programmers. Byte code compilation is\nautomatic, and the PVM is just part of the Python system that you have installed on\nyour machine. Again, programmers simply code and run files of statements.\n\n\nPerformance implications\n\n\nReaders with a background in fully compiled languages such as C and C++ might notice\na few differences in the Python model. For one thing, there is usually no build or \u201cmake\u201d\nstep in Python work: code runs immediately after it is written. For another, Python byte\ncode is not binary machine code (e.g., instructions for an Intel chip). Byte code is a\nPython-specific representation.\n\n\nThis is why some Python code may not run as fast as C or C++ code, as described in\nChapter 1\u2014the PVM loop, not the CPU chip, still must interpret the byte code, and\nbyte code instructions require more work than CPU instructions. On the other hand,\nunlike in classic interpreters, there is still an internal compile step\u2014Python does not\nneed to reanalyze and reparse each source statement repeatedly. The net effect is that\npure Python code runs at speeds somewhere between those of a traditional compiled\nlanguage and a traditional interpreted language. See Chapter 1 for more on Python\nperformance tradeoffs.\n\n\n\n\nSource:\n \n\n\n \nLearning Python, Fourth Edition\n by Mark Lutz - 2009\n\n\n\n\nPython Implementation Alternatives\n\n\nReally, as this book is being written, there are three primary implementations of the\nPython language\u2014CPython, Jython, and IronPython\u2014along with a handful of secondary\nimplementations such as Stackless Python. In brief, CPython is the standard implementation;\nall the others have very specific purposes and roles. All implement the\nsame Python language but execute programs in different ways.\n\n\nCPython\n\n\nThe original, and standard, implementation of Python is usually called CPython, when\nyou want to contrast it with the other two. Its name comes from the fact that it is coded\nin portable ANSI C language code. This is the Python that you fetch from http://www\n.python.org, get with the ActivePython distribution, and have automatically on most\nLinux and Mac OS X machines. If you\u2019ve found a preinstalled version of Python on\nyour machine, it\u2019s probably CPython, unless your company is using Python in very\nspecialized ways.\nUnless you want to script Java or .NET applications with Python, you probably want\nto use the standard CPython system. Because it is the reference implementation of the\nlanguage, it tends to run the fastest, be the most complete, and be more robust than\nthe alternative systems. Figure 1-3 reflects CPython\u2019s runtime architecture.\n\n\nJython\n\n\nThe Jython system (originally known as JPython) is an alternative implementation of\nthe Python language, targeted for integration with the Java programming language.\nJython consists of Java classes that compile Python source code to Java byte code and\nthen route the resulting byte code to the Java Virtual Machine (JVM). Programmers\nstill code Python statements in .py text files as usual; the Jython system essentially just\nreplaces the rightmost two bubbles in Figure 1-3 with Java-based equivalents.\nJython\u2019s goal is to allow Python code to script Java applications, much as CPython\nallows Python to script C and C++ components. Its integration with Java is remarkably\nseamless. Because Python code is translated to Java byte code, it looks and feels like a\ntrue Java program at runtime. Jython scripts can serve as web applets and servlets, build\nJava-based GUIs, and so on. Moreover, Jython includes integration support that allows\nPython code to import and use Java classes as though they were coded in Python.\nBecause Jython is slower and less robust than CPython, though, it is usually seen as a\ntool of interest primarily to Java developers looking for a scripting language to be a\nfrontend to Java code.\n\n\nIronPython\n\n\nA third implementation of Python, and newer than both CPython and Jython,\nIronPython is designed to allow Python programs to integrate with applications coded\nto work with Microsoft\u2019s .NET Framework for Windows, as well as the Mono open\nsource equivalent for Linux. .NET and its C# programming language runtime system\nare designed to be a language-neutral object communication layer, in the spirit of Microsoft\u2019s\nearlier COM model. IronPython allows Python programs to act as both client\nand server components, accessible from other .NET languages.\nBy implementation, IronPython is very much like Jython (and, in fact, was developed\nby the same creator)\u2014it replaces the last two bubbles in Figure 1-3 with equivalents\nfor execution in the .NET environment. Also, like Jython, IronPython has a special\nfocus\u2014it is primarily of interest to developers integrating Python with .NET components.\nBecause it is being developed by Microsoft, though, IronPython might also be\nable to leverage some important optimization tools for better performance.\nIronPython\u2019s scope is still evolving as I write this; for more details, consult the Python\nonline resources or search the Web.\n\n\n\n\nSource:\n \n\n\n \nLearning Python, Fourth Edition\n by Mark Lutz - 2009\n\n\n\n\nPython Programming Language Advantages\n\n\nPython is a dynamic, strongly typed, object oriented, multipurpose programming language, designed to be quick (to learn, to use, and to understand), and to enforce a clean and uniform syntax.\n\n\n\n\nPython is dynamically typed: it means that you don't declare a type (e.g. 'integer') for a variable name, and then assign something of that type (and only that type). Instead, you have variable names, and you bind them to entities whose type stays with the entity itself. a = 5 makes the variable name a to refer to the integer 5. Later, a = \"hello\" makes the variable name a to refer to a string containing \"hello\". Static typed languages would have you declare int a and then a = 5, but assigning a = \"hello\" would have been a compile time error. On one hand, this makes everything more unpredictable (you don't know what a refers to). On the other hand, it makes very easy to achieve some results a static typed languages makes very difficult.\n\n\nPython is strongly typed. It means that if a = \"5\" (the string whose value is '5') will remain a string, and never coerced to a number if the context requires so. Every type conversion in python must be done explicitly. This is different from, for example, Perl or Javascript, where you have weak typing, and can write things like \"hello\" + 5 to get \"hello5\".\n\n\nPython is object oriented, with class-based inheritance. Everything is an object (including classes, functions, modules, etc), in the sense that they can be passed around as arguments, have methods and attributes, and so on. \n\n\nPython is multipurpose: it is not specialised to a specific target of users (like R for statistics, or PHP for web programming). It is extended through modules and libraries, that hook very easily into the C programming language.\n\n\nPython enforces correct indentation of the code by making the indentation part of the syntax. There are no control braces in Python. Blocks of code are identified by the level of indentation. Although a big turn off for many programmers not used to this, it is precious as it gives a very uniform style and results in code that is visually pleasant to read.\n\n\nThe code is compiled into byte code and then executed in a virtual machine. This means that precompiled code is portable between platforms.\n\n\n\n\nPython can be used for any programming task, from GUI programming to web programming with everything else in between. It's quite efficient, as much of its activity is done at the C level. Python is just a layer on top of C. There are libraries for everything you can think of: game programming and openGL, GUI interfaces, web frameworks, semantic web, scientific computing...\n\n\n\n\nSource:\n \n\n\n https://stackoverflow.com/questions/1909512/what-is-python-used-for\n\n\n\n\nAdventages again\n\n\n\n\nEasy Syntax\n\nPython's syntax is easy to learn, so both non-programmers and programmers can start programming right away.\n\n\nReadability\n\nPython's syntax is very clear, so it is easy to understand program code. (Python is often referred to as \"executable pseudo-code\" because its syntax mostly follows the conventions used by programmers to outline their ideas without the formal verbosity of code in most programming languages; in other words syntax of Python is almost identical to the simplified \"pseudo-code\" used by many programmers to prototype and describe their solution to other programmers. Thus Python can be used to prototype and test code which is later to be implemented in other programming languages).[citation needed]\n\n\nHigh-Level Language\n\nPython looks more like a readable, human language than like a low-level language. This gives you the ability to program at a faster rate than a low-level language will allow you.\n\n\nObject oriented programming\n\nObject-oriented programming allows you to create data structures that can be re-used, which reduces the amount of repetitive work that you'll need to do. Programming languages usually define objects with namespaces, like class or def, and objects can edit themselves by using keyword, like this or self. Most modern programming languages are object-oriented (such as Java, C++, and C#) or have support for OOP features (such as Perl version 5 and later). Additionally object-oriented techniques can be used in the design of almost any non-trivial software and implemented in almost any programming or scripting language. (For example a number of Linux kernel features are \"objects\" which implement their own encapsulation of behavior and data structive via pointers, specifically pointers to functions, in the C programming language).[citation needed] Python's support for object-oriented programming is one of its greatest benefits to new programmers because they will be encountering the same concepts and terminology in their work environment. If you ever decide to switch languages, or use any other for that fact, you'll have a significant chance that you'll be working with object-oriented programming.[1]\n\n\nIt's Free\n\nPython is both free and open-source. The Python Software Foundation distributes pre-made binaries that are freely available for use on all major operating systems called CPython. You can get CPython's source-code, too. Plus, you can modify the source code and distribute as allowed by CPython's license. [2] (Luckily, CPython has a permissive free software license attitude.)\n\n\nCross-platform\n\nPython runs on all major operating systems like Microsoft Windows, Linux, and Mac OS X.\n\n\nWidely Supported\n\nPython has an active support community with many web sites, mailing lists, and USENET \"netnews\" groups that attract a large number of knowledgeable and helpful contributes.\n\n\nIt's Safe\n\nPython doesn't have pointers like other C-based languages, making it much more reliable. Along with that, errors never pass silently unless they're explicitly silenced. This allows you to see and read why the program crashed and where to correct your error.\n\n\nBatteries Included\n\nPython is famous for being the \"batteries are included\" language.[3] There are over 300 standard library modules which contain modules and classes for a wide variety of programming tasks.[citation needed] For example the standard library contains modules for safely creating temporary files (named or anonymous), mapping files into memory (including use of shared and anonymous memory mappings), spawning and controlling sub-processes, compressing and decompressing files (compatible with gzip or PK-zip) and archives files (such as Unix/Linux \"tar\"), accessing indexed \"DBM\" (database) files, interfacing to various graphical user interfaces (such as the TK toolkit and the popular WxWindows multi-platform windowing system), parsing and maintaining CSV (comma-separated values) and \".cfg\" or \".ini\" configuration files (similar in syntax to the venerable WIN.INI files from MS-DOS and MS-Windows), for sending e-mail, fetching and parsing web pages, etc. It's possible, for example, to create a custom web server in Python using less than a dozen lines of code, and one of the standard libraries, of course.\n\n\nExtensible\n\nIn addition to the standard libraries there are extensive collections of freely available add-on modules, libraries, frameworks, and tool-kits. These generally conform to similar standards and conventions; for example almost all of the database adapters (to talk to almost any client-server RDBMS engine such as MySQL, Postgres, Oracle, etc) conform to the Python DBAPI and thus can mostly be accessed using the same code. So it's usually easy to modify a Python program to support any database engine.\n\n\n\n\n\n\nSource:\n \n\n\n https://en.wikiversity.org/wiki/Python_Concepts/Why_learn_Python\n\n\n\n\nWho Uses Python Today ?\n\n\nHere are links to just a few of the organizations that use python:\n\n- \n https://wiki.python.org/moin/OrganizationsUsingPython\n\n\nPython Success Stories :\n\n- \n https://www.python.org/about/success", + "location": "/beginner/Python_Programming_Lanuage/", + "text": "The Python Programming Language\n\n\n\n\nThe programming language you will learn is Python. Python is an example of a highlevel\nlanguage; other high-level languages you might have heard of are \nC, C++, Perl,\n\nand \nJava\n.\nThere are also low-level languages, sometimes referred to as \n\u201cmachine languages\u201d\n or\n\n\u201cassembly languages.\u201d\n Loosely speaking, computers can only run programs written in\nlow-level languages. So programs written in a high-level language have to be processed\nbefore they can run. This extra processing takes some time, which is a small disadvantage\nof high-level languages.\n\n\nThe advantages are enormous. First, it is much easier to program in a high-level lan\nguage. Programs written in a high-level language take less time to write, they are shorter\nand easier to read, and they are more likely to be correct. Second, high-level languages\nare portable, meaning that they can run on different kinds of computers with few or no\nmodifications. Low-level programs can run on only one kind of computer and have to\nbe rewritten to run on another.\n\n\nDue to these advantages, almost all programs are written in high-level languages. Lowlevel\nlanguages are used only for a few specialized applications.\n\n\nTwo kinds of programs process high-level languages into low-level languages:\ninterpreters and compilers. An interpreter reads a high-level program and executes it,\nmeaning that it does what the program says. It processes the program a little at a time,\nalternately reading lines and performing computations. Figure 1-1 shows the structure\nof an interpreter.\n\n\n \n\n\nA compiler reads the program and translates it completely before the program starts\nrunning. In this context, the high-level program is called the source code, and the\ntranslated program is called the object code or the executable. Once a program is com\npiled, you can execute it repeatedly without further translation. Figure 1-2 shows the\nstructure of a compiler.\n\n\n\n\nPython is considered an interpreted language because Python programs are executed\nby an interpreter. There are two ways to use the interpreter: \ninteractive\n mode and \nscript mode\n. In interactive mode, you type Python programs and the interpreter displays the\nresult:\n>\n 1 + 1\n2\nThe chevron, \n, is the prompt the interpreter uses to indicate that it is ready. If you\ntype 1 + 1, the interpreter replies 2.\n\n\nAlternatively, you can store code in a file and use the interpreter to execute the contents\nof the file, which is called a script. By convention, Python scripts have names that end\nwith .py.\nTo execute the script, you have to tell the interpreter the name of the file. If you have a\nscript named dinsdale.py and you are working in a UNIX command window, you type\npython dinsdale.py. In other development environments, the details of executing\nscripts are different. You can find instructions for your environment at the Python web\nsite http://python.org.\nWorking in interactive mode is convenient for testing small pieces of code because you\ncan type and execute them immediately. But for anything more than a few lines, you\nshould save your code as a script so you can modify and execute it in the future.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nPython\u2019s View\n\n\nThe brief description in the prior section is fairly standard for scripting languages, and\nit\u2019s usually all that most Python programmers need to know. You type code into text\nfiles, and you run those files through the interpreter. Under the hood, though, a bit\nmore happens when you tell Python to \u201cgo.\u201d Although knowledge of Python internals\nis not strictly required for Python programming, a basic understanding of the runtime\nstructure of Python can help you grasp the bigger picture of program execution.\nWhen you instruct Python to run your script, there are a few steps that Python carries\nout before your code actually starts crunching away. Specifically, it\u2019s first compiled to\nsomething called \u201cbyte code\u201d and then routed to something called a \u201cvirtual machine.\u201d\n\n\nByte code compilation\n\n\nInternally, and almost completely hidden from you, when you execute a program\nPython first compiles your source code (the statements in your file) into a format known\nas byte code. Compilation is simply a translation step, and byte code is a lower-level,\nplatform-independent representation of your source code. Roughly, Python translates\neach of your source statements into a group of byte code instructions by decomposing\nthem into individual steps. This byte code translation is performed to speed\nexecution\u2014byte code can be run much more quickly than the original source code\nstatements in your text file.\nYou\u2019ll notice that the prior paragraph said that this is almost completely hidden from\nyou. If the Python process has write access on your machine, it will store the byte code\nof your programs in files that end with a .pyc extension (\u201c.pyc\u201d means compiled \u201c.py\u201d\nsource). You will see these files show up on your computer after you\u2019ve run a few\nprograms alongside the corresponding source code files (that is, in the same\ndirectories).\nPython saves byte code like this as a startup speed optimization. The next time you run\nyour program, Python will load the .pyc files and skip the compilation step, as long as\nyou haven\u2019t changed your source code since the byte code was last saved. Python automatically\nchecks the timestamps of source and byte code files to know when it must\nrecompile\u2014if you resave your source code, byte code is automatically re-created the\nnext time your program is run.\nIf Python cannot write the byte code files to your machine, your program still works\u2014\nthe byte code is generated in memory and simply discarded on program exit.* However,\nbecause .pyc files speed startup time, you\u2019ll want to make sure they are written for larger\nprograms. Byte code files are also one way to ship Python programs\u2014Python is happy\nto run a program if all it can find are .pyc files, even if the original .py source files are\nabsent.\n\n\nThe Python Virtual Machine (PVM)\n\n\nOnce your program has been compiled to byte code (or the byte code has been loaded\nfrom existing .pyc files), it is shipped off for execution to something generally known\nas the Python Virtual Machine (PVM, for the more acronym-inclined among you). The\nPVM sounds more impressive than it is; really, it\u2019s not a separate program, and it need\nnot be installed by itself. In fact, the PVM is just a big loop that iterates through your\nbyte code instructions, one by one, to carry out their operations. The PVM is the runtime\nengine of Python; it\u2019s always present as part of the Python system, and it\u2019s the\ncomponent that truly runs your scripts. Technically, it\u2019s just the last step of what is\ncalled the \u201cPython interpreter.\u201d\n\n\n\n\nFigure illustrates the runtime structure described here. Keep in mind that all of this\ncomplexity is deliberately hidden from Python programmers. Byte code compilation is\nautomatic, and the PVM is just part of the Python system that you have installed on\nyour machine. Again, programmers simply code and run files of statements.\n\n\nPerformance implications\n\n\nReaders with a background in fully compiled languages such as C and C++ might notice\na few differences in the Python model. For one thing, there is usually no build or \u201cmake\u201d\nstep in Python work: code runs immediately after it is written. For another, Python byte\ncode is not binary machine code (e.g., instructions for an Intel chip). Byte code is a\nPython-specific representation.\n\n\nThis is why some Python code may not run as fast as C or C++ code, as described in\nChapter 1\u2014the PVM loop, not the CPU chip, still must interpret the byte code, and\nbyte code instructions require more work than CPU instructions. On the other hand,\nunlike in classic interpreters, there is still an internal compile step\u2014Python does not\nneed to reanalyze and reparse each source statement repeatedly. The net effect is that\npure Python code runs at speeds somewhere between those of a traditional compiled\nlanguage and a traditional interpreted language. See Chapter 1 for more on Python\nperformance tradeoffs.\n\n\n\n\nSource:\n \n\n\n \nLearning Python, Fourth Edition\n by Mark Lutz - 2009\n\n\n\n\nPython Implementation Alternatives\n\n\nReally, as this book is being written, there are three primary implementations of the\nPython language\u2014CPython, Jython, and IronPython\u2014along with a handful of secondary\nimplementations such as Stackless Python. In brief, CPython is the standard implementation;\nall the others have very specific purposes and roles. All implement the\nsame Python language but execute programs in different ways.\n\n\nCPython\n\n\nThe original, and standard, implementation of Python is usually called CPython, when\nyou want to contrast it with the other two. Its name comes from the fact that it is coded\nin portable ANSI C language code. This is the Python that you fetch from http://www\n.python.org, get with the ActivePython distribution, and have automatically on most\nLinux and Mac OS X machines. If you\u2019ve found a preinstalled version of Python on\nyour machine, it\u2019s probably CPython, unless your company is using Python in very\nspecialized ways.\nUnless you want to script Java or .NET applications with Python, you probably want\nto use the standard CPython system. Because it is the reference implementation of the\nlanguage, it tends to run the fastest, be the most complete, and be more robust than\nthe alternative systems. Figure 1-3 reflects CPython\u2019s runtime architecture.\n\n\nJython\n\n\nThe Jython system (originally known as JPython) is an alternative implementation of\nthe Python language, targeted for integration with the Java programming language.\nJython consists of Java classes that compile Python source code to Java byte code and\nthen route the resulting byte code to the Java Virtual Machine (JVM). Programmers\nstill code Python statements in .py text files as usual; the Jython system essentially just\nreplaces the rightmost two bubbles in Figure 1-3 with Java-based equivalents.\nJython\u2019s goal is to allow Python code to script Java applications, much as CPython\nallows Python to script C and C++ components. Its integration with Java is remarkably\nseamless. Because Python code is translated to Java byte code, it looks and feels like a\ntrue Java program at runtime. Jython scripts can serve as web applets and servlets, build\nJava-based GUIs, and so on. Moreover, Jython includes integration support that allows\nPython code to import and use Java classes as though they were coded in Python.\nBecause Jython is slower and less robust than CPython, though, it is usually seen as a\ntool of interest primarily to Java developers looking for a scripting language to be a\nfrontend to Java code.\n\n\nIronPython\n\n\nA third implementation of Python, and newer than both CPython and Jython,\nIronPython is designed to allow Python programs to integrate with applications coded\nto work with Microsoft\u2019s .NET Framework for Windows, as well as the Mono open\nsource equivalent for Linux. .NET and its C# programming language runtime system\nare designed to be a language-neutral object communication layer, in the spirit of Microsoft\u2019s\nearlier COM model. IronPython allows Python programs to act as both client\nand server components, accessible from other .NET languages.\nBy implementation, IronPython is very much like Jython (and, in fact, was developed\nby the same creator)\u2014it replaces the last two bubbles in Figure 1-3 with equivalents\nfor execution in the .NET environment. Also, like Jython, IronPython has a special\nfocus\u2014it is primarily of interest to developers integrating Python with .NET components.\nBecause it is being developed by Microsoft, though, IronPython might also be\nable to leverage some important optimization tools for better performance.\nIronPython\u2019s scope is still evolving as I write this; for more details, consult the Python\nonline resources or search the Web.\n\n\n\n\nSource:\n \n\n\n \nLearning Python, Fourth Edition\n by Mark Lutz - 2009\n\n\n\n\nPython Programming Language Advantages\n\n\nPython is a dynamic, strongly typed, object oriented, multipurpose programming language, designed to be quick (to learn, to use, and to understand), and to enforce a clean and uniform syntax.\n\n\n\n\nPython is dynamically typed: it means that you don't declare a type (e.g. 'integer') for a variable name, and then assign something of that type (and only that type). Instead, you have variable names, and you bind them to entities whose type stays with the entity itself. a = 5 makes the variable name a to refer to the integer 5. Later, a = \"hello\" makes the variable name a to refer to a string containing \"hello\". Static typed languages would have you declare int a and then a = 5, but assigning a = \"hello\" would have been a compile time error. On one hand, this makes everything more unpredictable (you don't know what a refers to). On the other hand, it makes very easy to achieve some results a static typed languages makes very difficult.\n\n\nPython is strongly typed. It means that if a = \"5\" (the string whose value is '5') will remain a string, and never coerced to a number if the context requires so. Every type conversion in python must be done explicitly. This is different from, for example, Perl or Javascript, where you have weak typing, and can write things like \"hello\" + 5 to get \"hello5\".\n\n\nPython is object oriented, with class-based inheritance. Everything is an object (including classes, functions, modules, etc), in the sense that they can be passed around as arguments, have methods and attributes, and so on. \n\n\nPython is multipurpose: it is not specialised to a specific target of users (like R for statistics, or PHP for web programming). It is extended through modules and libraries, that hook very easily into the C programming language.\n\n\nPython enforces correct indentation of the code by making the indentation part of the syntax. There are no control braces in Python. Blocks of code are identified by the level of indentation. Although a big turn off for many programmers not used to this, it is precious as it gives a very uniform style and results in code that is visually pleasant to read.\n\n\nThe code is compiled into byte code and then executed in a virtual machine. This means that precompiled code is portable between platforms.\n\n\n\n\nPython can be used for any programming task, from GUI programming to web programming with everything else in between. It's quite efficient, as much of its activity is done at the C level. Python is just a layer on top of C. There are libraries for everything you can think of: game programming and openGL, GUI interfaces, web frameworks, semantic web, scientific computing...\n\n\n\n\nSource:\n \n\n\n https://stackoverflow.com/questions/1909512/what-is-python-used-for\n\n\n\n\nAdventages again\n\n\n\n\nEasy Syntax\n\nPython's syntax is easy to learn, so both non-programmers and programmers can start programming right away.\n\n\nReadability\n\nPython's syntax is very clear, so it is easy to understand program code. (Python is often referred to as \"executable pseudo-code\" because its syntax mostly follows the conventions used by programmers to outline their ideas without the formal verbosity of code in most programming languages; in other words syntax of Python is almost identical to the simplified \"pseudo-code\" used by many programmers to prototype and describe their solution to other programmers. Thus Python can be used to prototype and test code which is later to be implemented in other programming languages).[citation needed]\n\n\nHigh-Level Language\n\nPython looks more like a readable, human language than like a low-level language. This gives you the ability to program at a faster rate than a low-level language will allow you.\n\n\nObject oriented programming\n\nObject-oriented programming allows you to create data structures that can be re-used, which reduces the amount of repetitive work that you'll need to do. Programming languages usually define objects with namespaces, like class or def, and objects can edit themselves by using keyword, like this or self. Most modern programming languages are object-oriented (such as Java, C++, and C#) or have support for OOP features (such as Perl version 5 and later). Additionally object-oriented techniques can be used in the design of almost any non-trivial software and implemented in almost any programming or scripting language. (For example a number of Linux kernel features are \"objects\" which implement their own encapsulation of behavior and data structive via pointers, specifically pointers to functions, in the C programming language).[citation needed] Python's support for object-oriented programming is one of its greatest benefits to new programmers because they will be encountering the same concepts and terminology in their work environment. If you ever decide to switch languages, or use any other for that fact, you'll have a significant chance that you'll be working with object-oriented programming.[1]\n\n\nIt's Free\n\nPython is both free and open-source. The Python Software Foundation distributes pre-made binaries that are freely available for use on all major operating systems called CPython. You can get CPython's source-code, too. Plus, you can modify the source code and distribute as allowed by CPython's license. [2] (Luckily, CPython has a permissive free software license attitude.)\n\n\nCross-platform\n\nPython runs on all major operating systems like Microsoft Windows, Linux, and Mac OS X.\n\n\nWidely Supported\n\nPython has an active support community with many web sites, mailing lists, and USENET \"netnews\" groups that attract a large number of knowledgeable and helpful contributes.\n\n\nIt's Safe\n\nPython doesn't have pointers like other C-based languages, making it much more reliable. Along with that, errors never pass silently unless they're explicitly silenced. This allows you to see and read why the program crashed and where to correct your error.\n\n\nBatteries Included\n\nPython is famous for being the \"batteries are included\" language.[3] There are over 300 standard library modules which contain modules and classes for a wide variety of programming tasks.[citation needed] For example the standard library contains modules for safely creating temporary files (named or anonymous), mapping files into memory (including use of shared and anonymous memory mappings), spawning and controlling sub-processes, compressing and decompressing files (compatible with gzip or PK-zip) and archives files (such as Unix/Linux \"tar\"), accessing indexed \"DBM\" (database) files, interfacing to various graphical user interfaces (such as the TK toolkit and the popular WxWindows multi-platform windowing system), parsing and maintaining CSV (comma-separated values) and \".cfg\" or \".ini\" configuration files (similar in syntax to the venerable WIN.INI files from MS-DOS and MS-Windows), for sending e-mail, fetching and parsing web pages, etc. It's possible, for example, to create a custom web server in Python using less than a dozen lines of code, and one of the standard libraries, of course.\n\n\nExtensible\n\nIn addition to the standard libraries there are extensive collections of freely available add-on modules, libraries, frameworks, and tool-kits. These generally conform to similar standards and conventions; for example almost all of the database adapters (to talk to almost any client-server RDBMS engine such as MySQL, Postgres, Oracle, etc) conform to the Python DBAPI and thus can mostly be accessed using the same code. So it's usually easy to modify a Python program to support any database engine.\n\n\n\n\n\n\nSource:\n \n\n\n https://en.wikiversity.org/wiki/Python_Concepts/Why_learn_Python\n\n\n\n\nWho Uses Python Today ?\n\n\nHere are links to just a few of the organizations that use python:\n\n- \n https://wiki.python.org/moin/OrganizationsUsingPython\n\n\nPython Success Stories :\n\n- \n https://www.python.org/about/success", "title": "The Python Programming Language, Implementation and Adventages" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#the-python-programming-language", - "text": "The programming language you will learn is Python. Python is an example of a highlevel\nlanguage; other high-level languages you might have heard of are C, C++, Perl, \nand Java .\nThere are also low-level languages, sometimes referred to as \u201cmachine languages\u201d or \u201cassembly languages.\u201d Loosely speaking, computers can only run programs written in\nlow-level languages. So programs written in a high-level language have to be processed\nbefore they can run. This extra processing takes some time, which is a small disadvantage\nof high-level languages. The advantages are enormous. First, it is much easier to program in a high-level lan\nguage. Programs written in a high-level language take less time to write, they are shorter\nand easier to read, and they are more likely to be correct. Second, high-level languages\nare portable, meaning that they can run on different kinds of computers with few or no\nmodifications. Low-level programs can run on only one kind of computer and have to\nbe rewritten to run on another. Due to these advantages, almost all programs are written in high-level languages. Lowlevel\nlanguages are used only for a few specialized applications. Two kinds of programs process high-level languages into low-level languages:\ninterpreters and compilers. An interpreter reads a high-level program and executes it,\nmeaning that it does what the program says. It processes the program a little at a time,\nalternately reading lines and performing computations. Figure 1-1 shows the structure\nof an interpreter. A compiler reads the program and translates it completely before the program starts\nrunning. In this context, the high-level program is called the source code, and the\ntranslated program is called the object code or the executable. Once a program is com\npiled, you can execute it repeatedly without further translation. Figure 1-2 shows the\nstructure of a compiler. Python is considered an interpreted language because Python programs are executed\nby an interpreter. There are two ways to use the interpreter: interactive mode and script mode . In interactive mode, you type Python programs and the interpreter displays the\nresult:\n> 1 + 1\n2\nThe chevron, , is the prompt the interpreter uses to indicate that it is ready. If you\ntype 1 + 1, the interpreter replies 2. Alternatively, you can store code in a file and use the interpreter to execute the contents\nof the file, which is called a script. By convention, Python scripts have names that end\nwith .py.\nTo execute the script, you have to tell the interpreter the name of the file. If you have a\nscript named dinsdale.py and you are working in a UNIX command window, you type\npython dinsdale.py. In other development environments, the details of executing\nscripts are different. You can find instructions for your environment at the Python web\nsite http://python.org.\nWorking in interactive mode is convenient for testing small pieces of code because you\ncan type and execute them immediately. But for anything more than a few lines, you\nshould save your code as a script so you can modify and execute it in the future. Source: Think Python by Allen B. Downey - 2012", + "location": "/beginner/Python_Programming_Lanuage/#the-python-programming-language", + "text": "The programming language you will learn is Python. Python is an example of a highlevel\nlanguage; other high-level languages you might have heard of are C, C++, Perl, \nand Java .\nThere are also low-level languages, sometimes referred to as \u201cmachine languages\u201d or \u201cassembly languages.\u201d Loosely speaking, computers can only run programs written in\nlow-level languages. So programs written in a high-level language have to be processed\nbefore they can run. This extra processing takes some time, which is a small disadvantage\nof high-level languages. The advantages are enormous. First, it is much easier to program in a high-level lan\nguage. Programs written in a high-level language take less time to write, they are shorter\nand easier to read, and they are more likely to be correct. Second, high-level languages\nare portable, meaning that they can run on different kinds of computers with few or no\nmodifications. Low-level programs can run on only one kind of computer and have to\nbe rewritten to run on another. Due to these advantages, almost all programs are written in high-level languages. Lowlevel\nlanguages are used only for a few specialized applications. Two kinds of programs process high-level languages into low-level languages:\ninterpreters and compilers. An interpreter reads a high-level program and executes it,\nmeaning that it does what the program says. It processes the program a little at a time,\nalternately reading lines and performing computations. Figure 1-1 shows the structure\nof an interpreter. A compiler reads the program and translates it completely before the program starts\nrunning. In this context, the high-level program is called the source code, and the\ntranslated program is called the object code or the executable. Once a program is com\npiled, you can execute it repeatedly without further translation. Figure 1-2 shows the\nstructure of a compiler. Python is considered an interpreted language because Python programs are executed\nby an interpreter. There are two ways to use the interpreter: interactive mode and script mode . In interactive mode, you type Python programs and the interpreter displays the\nresult:\n> 1 + 1\n2\nThe chevron, , is the prompt the interpreter uses to indicate that it is ready. If you\ntype 1 + 1, the interpreter replies 2. Alternatively, you can store code in a file and use the interpreter to execute the contents\nof the file, which is called a script. By convention, Python scripts have names that end\nwith .py.\nTo execute the script, you have to tell the interpreter the name of the file. If you have a\nscript named dinsdale.py and you are working in a UNIX command window, you type\npython dinsdale.py. In other development environments, the details of executing\nscripts are different. You can find instructions for your environment at the Python web\nsite http://python.org.\nWorking in interactive mode is convenient for testing small pieces of code because you\ncan type and execute them immediately. But for anything more than a few lines, you\nshould save your code as a script so you can modify and execute it in the future. Source: Think Python by Allen B. Downey - 2012", "title": "The Python Programming Language" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#pythons-view", - "text": "The brief description in the prior section is fairly standard for scripting languages, and\nit\u2019s usually all that most Python programmers need to know. You type code into text\nfiles, and you run those files through the interpreter. Under the hood, though, a bit\nmore happens when you tell Python to \u201cgo.\u201d Although knowledge of Python internals\nis not strictly required for Python programming, a basic understanding of the runtime\nstructure of Python can help you grasp the bigger picture of program execution.\nWhen you instruct Python to run your script, there are a few steps that Python carries\nout before your code actually starts crunching away. Specifically, it\u2019s first compiled to\nsomething called \u201cbyte code\u201d and then routed to something called a \u201cvirtual machine.\u201d", + "location": "/beginner/Python_Programming_Lanuage/#pythons-view", + "text": "The brief description in the prior section is fairly standard for scripting languages, and\nit\u2019s usually all that most Python programmers need to know. You type code into text\nfiles, and you run those files through the interpreter. Under the hood, though, a bit\nmore happens when you tell Python to \u201cgo.\u201d Although knowledge of Python internals\nis not strictly required for Python programming, a basic understanding of the runtime\nstructure of Python can help you grasp the bigger picture of program execution.\nWhen you instruct Python to run your script, there are a few steps that Python carries\nout before your code actually starts crunching away. Specifically, it\u2019s first compiled to\nsomething called \u201cbyte code\u201d and then routed to something called a \u201cvirtual machine.\u201d", "title": "Python\u2019s View" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#byte-code-compilation", - "text": "Internally, and almost completely hidden from you, when you execute a program\nPython first compiles your source code (the statements in your file) into a format known\nas byte code. Compilation is simply a translation step, and byte code is a lower-level,\nplatform-independent representation of your source code. Roughly, Python translates\neach of your source statements into a group of byte code instructions by decomposing\nthem into individual steps. This byte code translation is performed to speed\nexecution\u2014byte code can be run much more quickly than the original source code\nstatements in your text file.\nYou\u2019ll notice that the prior paragraph said that this is almost completely hidden from\nyou. If the Python process has write access on your machine, it will store the byte code\nof your programs in files that end with a .pyc extension (\u201c.pyc\u201d means compiled \u201c.py\u201d\nsource). You will see these files show up on your computer after you\u2019ve run a few\nprograms alongside the corresponding source code files (that is, in the same\ndirectories).\nPython saves byte code like this as a startup speed optimization. The next time you run\nyour program, Python will load the .pyc files and skip the compilation step, as long as\nyou haven\u2019t changed your source code since the byte code was last saved. Python automatically\nchecks the timestamps of source and byte code files to know when it must\nrecompile\u2014if you resave your source code, byte code is automatically re-created the\nnext time your program is run.\nIf Python cannot write the byte code files to your machine, your program still works\u2014\nthe byte code is generated in memory and simply discarded on program exit.* However,\nbecause .pyc files speed startup time, you\u2019ll want to make sure they are written for larger\nprograms. Byte code files are also one way to ship Python programs\u2014Python is happy\nto run a program if all it can find are .pyc files, even if the original .py source files are\nabsent.", + "location": "/beginner/Python_Programming_Lanuage/#byte-code-compilation", + "text": "Internally, and almost completely hidden from you, when you execute a program\nPython first compiles your source code (the statements in your file) into a format known\nas byte code. Compilation is simply a translation step, and byte code is a lower-level,\nplatform-independent representation of your source code. Roughly, Python translates\neach of your source statements into a group of byte code instructions by decomposing\nthem into individual steps. This byte code translation is performed to speed\nexecution\u2014byte code can be run much more quickly than the original source code\nstatements in your text file.\nYou\u2019ll notice that the prior paragraph said that this is almost completely hidden from\nyou. If the Python process has write access on your machine, it will store the byte code\nof your programs in files that end with a .pyc extension (\u201c.pyc\u201d means compiled \u201c.py\u201d\nsource). You will see these files show up on your computer after you\u2019ve run a few\nprograms alongside the corresponding source code files (that is, in the same\ndirectories).\nPython saves byte code like this as a startup speed optimization. The next time you run\nyour program, Python will load the .pyc files and skip the compilation step, as long as\nyou haven\u2019t changed your source code since the byte code was last saved. Python automatically\nchecks the timestamps of source and byte code files to know when it must\nrecompile\u2014if you resave your source code, byte code is automatically re-created the\nnext time your program is run.\nIf Python cannot write the byte code files to your machine, your program still works\u2014\nthe byte code is generated in memory and simply discarded on program exit.* However,\nbecause .pyc files speed startup time, you\u2019ll want to make sure they are written for larger\nprograms. Byte code files are also one way to ship Python programs\u2014Python is happy\nto run a program if all it can find are .pyc files, even if the original .py source files are\nabsent.", "title": "Byte code compilation" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#the-python-virtual-machine-pvm", - "text": "Once your program has been compiled to byte code (or the byte code has been loaded\nfrom existing .pyc files), it is shipped off for execution to something generally known\nas the Python Virtual Machine (PVM, for the more acronym-inclined among you). The\nPVM sounds more impressive than it is; really, it\u2019s not a separate program, and it need\nnot be installed by itself. In fact, the PVM is just a big loop that iterates through your\nbyte code instructions, one by one, to carry out their operations. The PVM is the runtime\nengine of Python; it\u2019s always present as part of the Python system, and it\u2019s the\ncomponent that truly runs your scripts. Technically, it\u2019s just the last step of what is\ncalled the \u201cPython interpreter.\u201d Figure illustrates the runtime structure described here. Keep in mind that all of this\ncomplexity is deliberately hidden from Python programmers. Byte code compilation is\nautomatic, and the PVM is just part of the Python system that you have installed on\nyour machine. Again, programmers simply code and run files of statements.", + "location": "/beginner/Python_Programming_Lanuage/#the-python-virtual-machine-pvm", + "text": "Once your program has been compiled to byte code (or the byte code has been loaded\nfrom existing .pyc files), it is shipped off for execution to something generally known\nas the Python Virtual Machine (PVM, for the more acronym-inclined among you). The\nPVM sounds more impressive than it is; really, it\u2019s not a separate program, and it need\nnot be installed by itself. In fact, the PVM is just a big loop that iterates through your\nbyte code instructions, one by one, to carry out their operations. The PVM is the runtime\nengine of Python; it\u2019s always present as part of the Python system, and it\u2019s the\ncomponent that truly runs your scripts. Technically, it\u2019s just the last step of what is\ncalled the \u201cPython interpreter.\u201d Figure illustrates the runtime structure described here. Keep in mind that all of this\ncomplexity is deliberately hidden from Python programmers. Byte code compilation is\nautomatic, and the PVM is just part of the Python system that you have installed on\nyour machine. Again, programmers simply code and run files of statements.", "title": "The Python Virtual Machine (PVM)" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#performance-implications", - "text": "Readers with a background in fully compiled languages such as C and C++ might notice\na few differences in the Python model. For one thing, there is usually no build or \u201cmake\u201d\nstep in Python work: code runs immediately after it is written. For another, Python byte\ncode is not binary machine code (e.g., instructions for an Intel chip). Byte code is a\nPython-specific representation. This is why some Python code may not run as fast as C or C++ code, as described in\nChapter 1\u2014the PVM loop, not the CPU chip, still must interpret the byte code, and\nbyte code instructions require more work than CPU instructions. On the other hand,\nunlike in classic interpreters, there is still an internal compile step\u2014Python does not\nneed to reanalyze and reparse each source statement repeatedly. The net effect is that\npure Python code runs at speeds somewhere between those of a traditional compiled\nlanguage and a traditional interpreted language. See Chapter 1 for more on Python\nperformance tradeoffs. Source: Learning Python, Fourth Edition by Mark Lutz - 2009", + "location": "/beginner/Python_Programming_Lanuage/#performance-implications", + "text": "Readers with a background in fully compiled languages such as C and C++ might notice\na few differences in the Python model. For one thing, there is usually no build or \u201cmake\u201d\nstep in Python work: code runs immediately after it is written. For another, Python byte\ncode is not binary machine code (e.g., instructions for an Intel chip). Byte code is a\nPython-specific representation. This is why some Python code may not run as fast as C or C++ code, as described in\nChapter 1\u2014the PVM loop, not the CPU chip, still must interpret the byte code, and\nbyte code instructions require more work than CPU instructions. On the other hand,\nunlike in classic interpreters, there is still an internal compile step\u2014Python does not\nneed to reanalyze and reparse each source statement repeatedly. The net effect is that\npure Python code runs at speeds somewhere between those of a traditional compiled\nlanguage and a traditional interpreted language. See Chapter 1 for more on Python\nperformance tradeoffs. Source: Learning Python, Fourth Edition by Mark Lutz - 2009", "title": "Performance implications" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#python-implementation-alternatives", - "text": "Really, as this book is being written, there are three primary implementations of the\nPython language\u2014CPython, Jython, and IronPython\u2014along with a handful of secondary\nimplementations such as Stackless Python. In brief, CPython is the standard implementation;\nall the others have very specific purposes and roles. All implement the\nsame Python language but execute programs in different ways.", + "location": "/beginner/Python_Programming_Lanuage/#python-implementation-alternatives", + "text": "Really, as this book is being written, there are three primary implementations of the\nPython language\u2014CPython, Jython, and IronPython\u2014along with a handful of secondary\nimplementations such as Stackless Python. In brief, CPython is the standard implementation;\nall the others have very specific purposes and roles. All implement the\nsame Python language but execute programs in different ways.", "title": "Python Implementation Alternatives" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#cpython", - "text": "The original, and standard, implementation of Python is usually called CPython, when\nyou want to contrast it with the other two. Its name comes from the fact that it is coded\nin portable ANSI C language code. This is the Python that you fetch from http://www\n.python.org, get with the ActivePython distribution, and have automatically on most\nLinux and Mac OS X machines. If you\u2019ve found a preinstalled version of Python on\nyour machine, it\u2019s probably CPython, unless your company is using Python in very\nspecialized ways.\nUnless you want to script Java or .NET applications with Python, you probably want\nto use the standard CPython system. Because it is the reference implementation of the\nlanguage, it tends to run the fastest, be the most complete, and be more robust than\nthe alternative systems. Figure 1-3 reflects CPython\u2019s runtime architecture.", + "location": "/beginner/Python_Programming_Lanuage/#cpython", + "text": "The original, and standard, implementation of Python is usually called CPython, when\nyou want to contrast it with the other two. Its name comes from the fact that it is coded\nin portable ANSI C language code. This is the Python that you fetch from http://www\n.python.org, get with the ActivePython distribution, and have automatically on most\nLinux and Mac OS X machines. If you\u2019ve found a preinstalled version of Python on\nyour machine, it\u2019s probably CPython, unless your company is using Python in very\nspecialized ways.\nUnless you want to script Java or .NET applications with Python, you probably want\nto use the standard CPython system. Because it is the reference implementation of the\nlanguage, it tends to run the fastest, be the most complete, and be more robust than\nthe alternative systems. Figure 1-3 reflects CPython\u2019s runtime architecture.", "title": "CPython" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#jython", - "text": "The Jython system (originally known as JPython) is an alternative implementation of\nthe Python language, targeted for integration with the Java programming language.\nJython consists of Java classes that compile Python source code to Java byte code and\nthen route the resulting byte code to the Java Virtual Machine (JVM). Programmers\nstill code Python statements in .py text files as usual; the Jython system essentially just\nreplaces the rightmost two bubbles in Figure 1-3 with Java-based equivalents.\nJython\u2019s goal is to allow Python code to script Java applications, much as CPython\nallows Python to script C and C++ components. Its integration with Java is remarkably\nseamless. Because Python code is translated to Java byte code, it looks and feels like a\ntrue Java program at runtime. Jython scripts can serve as web applets and servlets, build\nJava-based GUIs, and so on. Moreover, Jython includes integration support that allows\nPython code to import and use Java classes as though they were coded in Python.\nBecause Jython is slower and less robust than CPython, though, it is usually seen as a\ntool of interest primarily to Java developers looking for a scripting language to be a\nfrontend to Java code.", + "location": "/beginner/Python_Programming_Lanuage/#jython", + "text": "The Jython system (originally known as JPython) is an alternative implementation of\nthe Python language, targeted for integration with the Java programming language.\nJython consists of Java classes that compile Python source code to Java byte code and\nthen route the resulting byte code to the Java Virtual Machine (JVM). Programmers\nstill code Python statements in .py text files as usual; the Jython system essentially just\nreplaces the rightmost two bubbles in Figure 1-3 with Java-based equivalents.\nJython\u2019s goal is to allow Python code to script Java applications, much as CPython\nallows Python to script C and C++ components. Its integration with Java is remarkably\nseamless. Because Python code is translated to Java byte code, it looks and feels like a\ntrue Java program at runtime. Jython scripts can serve as web applets and servlets, build\nJava-based GUIs, and so on. Moreover, Jython includes integration support that allows\nPython code to import and use Java classes as though they were coded in Python.\nBecause Jython is slower and less robust than CPython, though, it is usually seen as a\ntool of interest primarily to Java developers looking for a scripting language to be a\nfrontend to Java code.", "title": "Jython" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#ironpython", - "text": "A third implementation of Python, and newer than both CPython and Jython,\nIronPython is designed to allow Python programs to integrate with applications coded\nto work with Microsoft\u2019s .NET Framework for Windows, as well as the Mono open\nsource equivalent for Linux. .NET and its C# programming language runtime system\nare designed to be a language-neutral object communication layer, in the spirit of Microsoft\u2019s\nearlier COM model. IronPython allows Python programs to act as both client\nand server components, accessible from other .NET languages.\nBy implementation, IronPython is very much like Jython (and, in fact, was developed\nby the same creator)\u2014it replaces the last two bubbles in Figure 1-3 with equivalents\nfor execution in the .NET environment. Also, like Jython, IronPython has a special\nfocus\u2014it is primarily of interest to developers integrating Python with .NET components.\nBecause it is being developed by Microsoft, though, IronPython might also be\nable to leverage some important optimization tools for better performance.\nIronPython\u2019s scope is still evolving as I write this; for more details, consult the Python\nonline resources or search the Web. Source: Learning Python, Fourth Edition by Mark Lutz - 2009", + "location": "/beginner/Python_Programming_Lanuage/#ironpython", + "text": "A third implementation of Python, and newer than both CPython and Jython,\nIronPython is designed to allow Python programs to integrate with applications coded\nto work with Microsoft\u2019s .NET Framework for Windows, as well as the Mono open\nsource equivalent for Linux. .NET and its C# programming language runtime system\nare designed to be a language-neutral object communication layer, in the spirit of Microsoft\u2019s\nearlier COM model. IronPython allows Python programs to act as both client\nand server components, accessible from other .NET languages.\nBy implementation, IronPython is very much like Jython (and, in fact, was developed\nby the same creator)\u2014it replaces the last two bubbles in Figure 1-3 with equivalents\nfor execution in the .NET environment. Also, like Jython, IronPython has a special\nfocus\u2014it is primarily of interest to developers integrating Python with .NET components.\nBecause it is being developed by Microsoft, though, IronPython might also be\nable to leverage some important optimization tools for better performance.\nIronPython\u2019s scope is still evolving as I write this; for more details, consult the Python\nonline resources or search the Web. Source: Learning Python, Fourth Edition by Mark Lutz - 2009", "title": "IronPython" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#python-programming-language-advantages", - "text": "Python is a dynamic, strongly typed, object oriented, multipurpose programming language, designed to be quick (to learn, to use, and to understand), and to enforce a clean and uniform syntax. Python is dynamically typed: it means that you don't declare a type (e.g. 'integer') for a variable name, and then assign something of that type (and only that type). Instead, you have variable names, and you bind them to entities whose type stays with the entity itself. a = 5 makes the variable name a to refer to the integer 5. Later, a = \"hello\" makes the variable name a to refer to a string containing \"hello\". Static typed languages would have you declare int a and then a = 5, but assigning a = \"hello\" would have been a compile time error. On one hand, this makes everything more unpredictable (you don't know what a refers to). On the other hand, it makes very easy to achieve some results a static typed languages makes very difficult. Python is strongly typed. It means that if a = \"5\" (the string whose value is '5') will remain a string, and never coerced to a number if the context requires so. Every type conversion in python must be done explicitly. This is different from, for example, Perl or Javascript, where you have weak typing, and can write things like \"hello\" + 5 to get \"hello5\". Python is object oriented, with class-based inheritance. Everything is an object (including classes, functions, modules, etc), in the sense that they can be passed around as arguments, have methods and attributes, and so on. Python is multipurpose: it is not specialised to a specific target of users (like R for statistics, or PHP for web programming). It is extended through modules and libraries, that hook very easily into the C programming language. Python enforces correct indentation of the code by making the indentation part of the syntax. There are no control braces in Python. Blocks of code are identified by the level of indentation. Although a big turn off for many programmers not used to this, it is precious as it gives a very uniform style and results in code that is visually pleasant to read. The code is compiled into byte code and then executed in a virtual machine. This means that precompiled code is portable between platforms. Python can be used for any programming task, from GUI programming to web programming with everything else in between. It's quite efficient, as much of its activity is done at the C level. Python is just a layer on top of C. There are libraries for everything you can think of: game programming and openGL, GUI interfaces, web frameworks, semantic web, scientific computing... Source: https://stackoverflow.com/questions/1909512/what-is-python-used-for", + "location": "/beginner/Python_Programming_Lanuage/#python-programming-language-advantages", + "text": "Python is a dynamic, strongly typed, object oriented, multipurpose programming language, designed to be quick (to learn, to use, and to understand), and to enforce a clean and uniform syntax. Python is dynamically typed: it means that you don't declare a type (e.g. 'integer') for a variable name, and then assign something of that type (and only that type). Instead, you have variable names, and you bind them to entities whose type stays with the entity itself. a = 5 makes the variable name a to refer to the integer 5. Later, a = \"hello\" makes the variable name a to refer to a string containing \"hello\". Static typed languages would have you declare int a and then a = 5, but assigning a = \"hello\" would have been a compile time error. On one hand, this makes everything more unpredictable (you don't know what a refers to). On the other hand, it makes very easy to achieve some results a static typed languages makes very difficult. Python is strongly typed. It means that if a = \"5\" (the string whose value is '5') will remain a string, and never coerced to a number if the context requires so. Every type conversion in python must be done explicitly. This is different from, for example, Perl or Javascript, where you have weak typing, and can write things like \"hello\" + 5 to get \"hello5\". Python is object oriented, with class-based inheritance. Everything is an object (including classes, functions, modules, etc), in the sense that they can be passed around as arguments, have methods and attributes, and so on. Python is multipurpose: it is not specialised to a specific target of users (like R for statistics, or PHP for web programming). It is extended through modules and libraries, that hook very easily into the C programming language. Python enforces correct indentation of the code by making the indentation part of the syntax. There are no control braces in Python. Blocks of code are identified by the level of indentation. Although a big turn off for many programmers not used to this, it is precious as it gives a very uniform style and results in code that is visually pleasant to read. The code is compiled into byte code and then executed in a virtual machine. This means that precompiled code is portable between platforms. Python can be used for any programming task, from GUI programming to web programming with everything else in between. It's quite efficient, as much of its activity is done at the C level. Python is just a layer on top of C. There are libraries for everything you can think of: game programming and openGL, GUI interfaces, web frameworks, semantic web, scientific computing... Source: https://stackoverflow.com/questions/1909512/what-is-python-used-for", "title": "Python Programming Language Advantages" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#adventages-again", - "text": "Easy Syntax \nPython's syntax is easy to learn, so both non-programmers and programmers can start programming right away. Readability \nPython's syntax is very clear, so it is easy to understand program code. (Python is often referred to as \"executable pseudo-code\" because its syntax mostly follows the conventions used by programmers to outline their ideas without the formal verbosity of code in most programming languages; in other words syntax of Python is almost identical to the simplified \"pseudo-code\" used by many programmers to prototype and describe their solution to other programmers. Thus Python can be used to prototype and test code which is later to be implemented in other programming languages).[citation needed] High-Level Language \nPython looks more like a readable, human language than like a low-level language. This gives you the ability to program at a faster rate than a low-level language will allow you. Object oriented programming \nObject-oriented programming allows you to create data structures that can be re-used, which reduces the amount of repetitive work that you'll need to do. Programming languages usually define objects with namespaces, like class or def, and objects can edit themselves by using keyword, like this or self. Most modern programming languages are object-oriented (such as Java, C++, and C#) or have support for OOP features (such as Perl version 5 and later). Additionally object-oriented techniques can be used in the design of almost any non-trivial software and implemented in almost any programming or scripting language. (For example a number of Linux kernel features are \"objects\" which implement their own encapsulation of behavior and data structive via pointers, specifically pointers to functions, in the C programming language).[citation needed] Python's support for object-oriented programming is one of its greatest benefits to new programmers because they will be encountering the same concepts and terminology in their work environment. If you ever decide to switch languages, or use any other for that fact, you'll have a significant chance that you'll be working with object-oriented programming.[1] It's Free \nPython is both free and open-source. The Python Software Foundation distributes pre-made binaries that are freely available for use on all major operating systems called CPython. You can get CPython's source-code, too. Plus, you can modify the source code and distribute as allowed by CPython's license. [2] (Luckily, CPython has a permissive free software license attitude.) Cross-platform \nPython runs on all major operating systems like Microsoft Windows, Linux, and Mac OS X. Widely Supported \nPython has an active support community with many web sites, mailing lists, and USENET \"netnews\" groups that attract a large number of knowledgeable and helpful contributes. It's Safe \nPython doesn't have pointers like other C-based languages, making it much more reliable. Along with that, errors never pass silently unless they're explicitly silenced. This allows you to see and read why the program crashed and where to correct your error. Batteries Included \nPython is famous for being the \"batteries are included\" language.[3] There are over 300 standard library modules which contain modules and classes for a wide variety of programming tasks.[citation needed] For example the standard library contains modules for safely creating temporary files (named or anonymous), mapping files into memory (including use of shared and anonymous memory mappings), spawning and controlling sub-processes, compressing and decompressing files (compatible with gzip or PK-zip) and archives files (such as Unix/Linux \"tar\"), accessing indexed \"DBM\" (database) files, interfacing to various graphical user interfaces (such as the TK toolkit and the popular WxWindows multi-platform windowing system), parsing and maintaining CSV (comma-separated values) and \".cfg\" or \".ini\" configuration files (similar in syntax to the venerable WIN.INI files from MS-DOS and MS-Windows), for sending e-mail, fetching and parsing web pages, etc. It's possible, for example, to create a custom web server in Python using less than a dozen lines of code, and one of the standard libraries, of course. Extensible \nIn addition to the standard libraries there are extensive collections of freely available add-on modules, libraries, frameworks, and tool-kits. These generally conform to similar standards and conventions; for example almost all of the database adapters (to talk to almost any client-server RDBMS engine such as MySQL, Postgres, Oracle, etc) conform to the Python DBAPI and thus can mostly be accessed using the same code. So it's usually easy to modify a Python program to support any database engine. Source: https://en.wikiversity.org/wiki/Python_Concepts/Why_learn_Python", + "location": "/beginner/Python_Programming_Lanuage/#adventages-again", + "text": "Easy Syntax \nPython's syntax is easy to learn, so both non-programmers and programmers can start programming right away. Readability \nPython's syntax is very clear, so it is easy to understand program code. (Python is often referred to as \"executable pseudo-code\" because its syntax mostly follows the conventions used by programmers to outline their ideas without the formal verbosity of code in most programming languages; in other words syntax of Python is almost identical to the simplified \"pseudo-code\" used by many programmers to prototype and describe their solution to other programmers. Thus Python can be used to prototype and test code which is later to be implemented in other programming languages).[citation needed] High-Level Language \nPython looks more like a readable, human language than like a low-level language. This gives you the ability to program at a faster rate than a low-level language will allow you. Object oriented programming \nObject-oriented programming allows you to create data structures that can be re-used, which reduces the amount of repetitive work that you'll need to do. Programming languages usually define objects with namespaces, like class or def, and objects can edit themselves by using keyword, like this or self. Most modern programming languages are object-oriented (such as Java, C++, and C#) or have support for OOP features (such as Perl version 5 and later). Additionally object-oriented techniques can be used in the design of almost any non-trivial software and implemented in almost any programming or scripting language. (For example a number of Linux kernel features are \"objects\" which implement their own encapsulation of behavior and data structive via pointers, specifically pointers to functions, in the C programming language).[citation needed] Python's support for object-oriented programming is one of its greatest benefits to new programmers because they will be encountering the same concepts and terminology in their work environment. If you ever decide to switch languages, or use any other for that fact, you'll have a significant chance that you'll be working with object-oriented programming.[1] It's Free \nPython is both free and open-source. The Python Software Foundation distributes pre-made binaries that are freely available for use on all major operating systems called CPython. You can get CPython's source-code, too. Plus, you can modify the source code and distribute as allowed by CPython's license. [2] (Luckily, CPython has a permissive free software license attitude.) Cross-platform \nPython runs on all major operating systems like Microsoft Windows, Linux, and Mac OS X. Widely Supported \nPython has an active support community with many web sites, mailing lists, and USENET \"netnews\" groups that attract a large number of knowledgeable and helpful contributes. It's Safe \nPython doesn't have pointers like other C-based languages, making it much more reliable. Along with that, errors never pass silently unless they're explicitly silenced. This allows you to see and read why the program crashed and where to correct your error. Batteries Included \nPython is famous for being the \"batteries are included\" language.[3] There are over 300 standard library modules which contain modules and classes for a wide variety of programming tasks.[citation needed] For example the standard library contains modules for safely creating temporary files (named or anonymous), mapping files into memory (including use of shared and anonymous memory mappings), spawning and controlling sub-processes, compressing and decompressing files (compatible with gzip or PK-zip) and archives files (such as Unix/Linux \"tar\"), accessing indexed \"DBM\" (database) files, interfacing to various graphical user interfaces (such as the TK toolkit and the popular WxWindows multi-platform windowing system), parsing and maintaining CSV (comma-separated values) and \".cfg\" or \".ini\" configuration files (similar in syntax to the venerable WIN.INI files from MS-DOS and MS-Windows), for sending e-mail, fetching and parsing web pages, etc. It's possible, for example, to create a custom web server in Python using less than a dozen lines of code, and one of the standard libraries, of course. Extensible \nIn addition to the standard libraries there are extensive collections of freely available add-on modules, libraries, frameworks, and tool-kits. These generally conform to similar standards and conventions; for example almost all of the database adapters (to talk to almost any client-server RDBMS engine such as MySQL, Postgres, Oracle, etc) conform to the Python DBAPI and thus can mostly be accessed using the same code. So it's usually easy to modify a Python program to support any database engine. Source: https://en.wikiversity.org/wiki/Python_Concepts/Why_learn_Python", "title": "Adventages again" - }, + }, { - "location": "/beginner/Python_Programming_Lanuage/#who-uses-python-today", - "text": "Here are links to just a few of the organizations that use python: \n- https://wiki.python.org/moin/OrganizationsUsingPython Python Success Stories : \n- https://www.python.org/about/success", + "location": "/beginner/Python_Programming_Lanuage/#who-uses-python-today", + "text": "Here are links to just a few of the organizations that use python: \n- https://wiki.python.org/moin/OrganizationsUsingPython Python Success Stories : \n- https://www.python.org/about/success", "title": "Who Uses Python Today ?" - }, + }, { - "location": "/beginner/Python_Installation/", - "text": "Python Download and Installation Instructions\n\n\nInstall Python on Windows\n\n\n\n\nInstall Python on Ubuntu\n\n\n\n\nInstall Python on Mac", + "location": "/beginner/Python_Installation/", + "text": "Python Download and Installation Instructions\n\n\nInstall Python on Windows\n\n\n\n\nInstall Python on Ubuntu\n\n\n\n\nInstall Python on Mac", "title": "Python Installation" - }, + }, { - "location": "/beginner/Python_Installation/#python-download-and-installation-instructions", - "text": "", + "location": "/beginner/Python_Installation/#python-download-and-installation-instructions", + "text": "", "title": "Python Download and Installation Instructions" - }, + }, { - "location": "/beginner/Python_Installation/#install-python-on-windows", - "text": "", + "location": "/beginner/Python_Installation/#install-python-on-windows", + "text": "", "title": "Install Python on Windows" - }, + }, { - "location": "/beginner/Python_Installation/#install-python-on-ubuntu", - "text": "", + "location": "/beginner/Python_Installation/#install-python-on-ubuntu", + "text": "", "title": "Install Python on Ubuntu" - }, + }, { - "location": "/beginner/Python_Installation/#install-python-on-mac", - "text": "", + "location": "/beginner/Python_Installation/#install-python-on-mac", + "text": "", "title": "Install Python on Mac" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/", - "text": "What Is a Program?\n\n\nA program is a sequence of instructions that specifies how to perform a computation.\nThe computation might be something mathematical, such as solving a system of equat\nions or finding the roots of a polynomial, but it can also be a symbolic computation,\nsuch as searching and replacing text in a document or (strangely enough) compiling a\nprogram.\nThe details look different in different languages, but a few basic instructions appear in\njust about every language:\n\n\ninput: \n\n\n\n\nGet data from the keyboard, a file, or some other device.\n\n\n\n\noutput:\n\n\n\n\nDisplay data on the screen or send data to a file or other device.\n\n\n\n\nmath:\n\n\n\n\nPerform basic mathematical operations like addition and\n multiplication.\n\n\n\n\nconditional execution:\n\n\n\n\nCheck for certain conditions and execute the appropriate code.\n\n\n\n\nrepetition:\n\n\n\n\nPerform some action repeatedly, usually with some variation.\n\n\n\n\nBelieve it or not, that\u2019s pretty much all there is to it. Every program you\u2019ve ever used, no\nmatter how complicated, is made up of instructions that look pretty much like these. So\nyou can think of programming as the process of breaking a large, complex task into\nsmaller and smaller subtasks until the subtasks are simple enough to be performed with\none of these basic instructions.\nThat may be a little vague, but we will come back to this topic when we talk about\nalgorithms.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nRun Python Scripts\n\n\nIf you can't execute or run a Python script, then programming is pointless. When you run a Python script, the interpreter converts a Python program into something that that the computer can understand. Executing a Python program can be done in two ways: calling the Python interpreter with a shebang line, and using the interactive Python shell.\n\n\nRun a Python Script as a File\n\n\nGenerally programmers write stand alone scripts, that are independent to live environments. Then they save it with a \".py\" extension, which indicates to the operating system and programmer that the file is actually a Python program. After the interpreter is invoked, it reads and interprets the file. The way Python scripts are run on Windows versus Unix based operating systems is very different. We'll show you the difference, and how to run a Python script on Windows and Unix platforms.\n\n\nRun a Python script under Windows with the Command Prompt\n\n\nWindows users must pass the path of the program as an argument to the Python interpreter. Such as follows:\n\n\nC:\n\\P\nython27\n\\p\nython.exe C:\n\\U\nsers\n\\U\nsername\n\\D\nesktop\n\\m\ny_python_script.py\n\n\n\n\n\nNote that you must use the full path of the Python interpreter. If you want to simply type python.exe C:\\Users\\Username\\Desktop\\my_python_script.py you must add python.exe to your PATH environmental variable.\nNote that Windows comes with two Python executables - python.exe and pythonw.exe. If you want a terminal to pop-up when you run your script, use python.exe However if you don't want any terminal pop-up, use pythonw.exe. pythonw.exe is typically used for GUI programs, where you only want to display your program, not the terminal.\n\n\nRun a Python Script Under Mac, Linux, BSD, Unix, etc\n\n\nOn platforms like Mac, BSD or Linux (Unix) you can put a \"shebang\" line as first line of the program which indicates the location of the Python interpreter on the hard drive. It's in the following format:\n\n\n#!/path/to/interpreter\n\n\n\n\n\n\nA common shebang line used for the Python interpreter is as follows:\n\n\n#!/usr/bin/env python\n\n\n\n\n\n\nYou must then make the script executable, using the following command:\n\n\nchmod +x my_python_script.py\n\n\n\n\n\nUnlike Windows, the Python interpreter is typically already in the $PATH environmental variable, so adding it is un-necessary.\n\n\nYou can then run a program by invoking the Python interpreter manually as follows:\n\n\npython firstprogram.py\n\n\n\n\n\nPython Execution with the Shell (Live Interpreter)\n\n\nAssuming that you already have Python installed and running well (if you're getting an error, see this post), open the terminal or console and type 'python' and hit the 'Enter' key. You will then be directed immediately to the Python live interpreter. Your screen will display a message something like:\n\n\nuser@hostname:~ python\nPython \n3\n.3.0 \n(\ndefault, Nov \n23\n \n2012\n, \n10\n:26:01\n)\n \n\n[\nGCC \n4\n.2.1 Compatible Apple Clang \n4\n.1 \n((\ntags/Apple/clang-421.11.66\n))]\n on darwin\nType \nhelp\n, \ncopyright\n, \ncredits\n or \nlicense\n \nfor\n more information.\n\n\n\n\n\n\n\nThe Python programmer should keep in mind one thing: that while working with the live interpreter, everything is read and interpreted in real-time. For example loops iterate immediately, unless they are part of function. So it requires some mental planning. Using the Python shell is typically used to execute code interactively. If you want to run a Python script from the interpreter, you must either import it or call the Python executable.\n\n\n\n\nSource:\n \n\n\n http://pythoncentral.io/execute-python-script-file-shell/\n\n\n\n\nA Good First Program\n\n\nType the following text into a single file named \nex1.py\n. Python works best with files ending in \n.py\n.\n\n\nprint\n \nHello World!\n\n\nprint\n \nHello Again\n\n\nprint\n \nI like typing this.\n\n\nprint\n \nThis is fun.\n\n\nprint\n \nYay! Printing.\n\n\nprint\n \nI\nd much rather you \nnot\n.\n\n\nprint\n \nI \nsaid\n do not touch this.\n\n\n\n\n\n\nYour Atom text editor should look something like this on all platforms:\n\n\n\n\nDon't worry if your editor doesn't look exactly the same, it should be close though. You may have a slightly different window header, maybe slightly different colors, and the left side of your Atom window won't say \"zedshaw\" but will instead show the directory you used for saving your files. All of those differences are fine.\n\n\nWhen you create this file, keep in mind these points:\n\n\n\n\nI did not type the line numbers on the left. Those are printed in the book so I can talk about specific lines by saying, \"See line 5...\" You do not type line numbers into Python scripts.\n\n\nI have the print at the beginning of the line and it looks exactly the same as what I have in ex1.py. Exactly means exactly, not kind of sort of the same. Every single character has to match for it to work. Color doesn't matter, only the characters you type.\n\n\n\n\nIn Terminal run the file by typing:\n\n\npython ex1.py\n\n\n\n\n\nIf you did it right then you should see the same output as I in the What You Should See section of this exercise. If not, you have done something wrong. No, the computer is not wrong.\n\n\nWhat You Should See\n\n\nOn Mac OS X in the Terminal you should see this:\n\n\nOn Windows in PowerShell you should see this:\n\n\n\nYou may see different names, before the python ex1.py command, but the important part is that you type the command and see the output is the same as mine.\n\n\n\n\n\nIf you have an error it will look like this:\n\n\n$ python ex/ex1.py\n File \nex/ex1.py\n, line \n3\n\n print \nI like typing this.\n\n\n ^\n\n\nSyntaxError: EOL while scanning string literal\n\n\n\n\n\n\nIt's important that you can read these error messages because you will be making many of these mistakes. Even I make many of these mistakes. Let's look at this line by line.\n\n\n\n\nWe ran our command in the Terminal to run the ex1.py script.\n\n\nPython tells us that the file ex1.py has an error on line 3.\n\n\nIt prints this line of code for us to see it.\n\n\nThen it puts a ^ (caret) character to point at where the problem is. Notice the missing \" (double-quote) character?\n\n\nFinally, it prints out a \"SyntaxError\" and tells us something about what might be the error. Usually these are very cryptic, but if you copy that text into a search engine, you will find someone else who's had that error and you can probably figure out how to fix it.\n\n\n\n\n\n\nSource:\n \n\n\n \nLEARN PYTHON THE HARD WAY\n by Zed A. Shaw - 2013\n\n\n\n\nDebugging and Errors\n\n\nWhat Is Debugging?\n\n\nProgramming is error-prone. For whimsical reasons, programming errors are called\n\nbugs\n and the process of tracking them down is called \ndebugging\n.\nThree kinds of errors can occur in a program: syntax errors, runtime errors, and se\nmantic errors. It is useful to distinguish between them in order to track them down more\nquickly.\n\n\nError Types :\n\n\nSyntax Errors\n\n\nPython can only execute a program if the syntax is correct; otherwise, the interpreter\ndisplays an error message. Syntax refers to the structure of a program and the rules\nabout that structure.For example, parentheses have to come in matching pairs, so\n(1 + 2) is legal, but 8) is a \nsyntax error\n.\nIn English readers can tolerate most syntax errors, which is why we can read the poetry\nof e. e. cummings without spewing error messages. Python is not so forgiving. If there\nis a single syntax error anywhere in your program, Python will display an error message\nand quit, and you will not be able to run your program. During the first few weeks of\nyour programming career, you will probably spend a lot of time tracking down syntax\nerrors. As you gain experience, you will make fewer errors and find them faster.\n\n\nRuntime Errors\n\n\nThe second type of error is a runtime error, so called because the error does not appear\nuntil after the program has started running. These errors are also called exceptions\nbecause they usually indicate that something exceptional (and bad) has happened.\nRuntime errors are rare in the simple programs you will see in the first few chapters, so\nit might be a while before you encounter one.\n\n\nSemantic Errors\n\n\nThe third type of error is the semantic error. If there is a semantic error in your program,\nit will run successfully in the sense that the computer will not generate any error mess\nages, but it will not do the right thing. It will do something else. Specifically, it will do\nwhat you told it to do.\nThe problem is that the program you wrote is not the program you wanted to write. The\nmeaning of the program (its semantics) is wrong. Identifying semantic errors can be\ntricky because it requires you to work backward by looking at the output of the program\nand trying to figure out what it is doing.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nReserved Words\n\n\nThe following list shows the Python keywords. These are reserved words and you cannot use them as constants or variables or any other identifier names. All the Python keywords contain lowercase letters only.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nand\n\n\nexec\n\n\nnot\n\n\n\n\n\n\nas\n\n\nfinally\n\n\nor\n\n\n\n\n\n\nassert\n\n\nfor\n\n\npass\n\n\n\n\n\n\nbreak\n\n\nfrom\n\n\nprint\n\n\n\n\n\n\nclass\n\n\nglobal\n\n\nraise\n\n\n\n\n\n\ncontinue\n\n\nif\n\n\nreturn\n\n\n\n\n\n\ndef\n\n\nimport\n\n\ntry\n\n\n\n\n\n\ndel\n\n\nin\n\n\nwhile\n\n\n\n\n\n\nelif\n\n\nis\n\n\nwith\n\n\n\n\n\n\nelse\n\n\nlambda\n\n\nyield\n\n\n\n\n\n\nexcept\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nSource:\n \n\n\n https://www.tutorialspoint.com", + "location": "/beginner/Start_Coding_With_Python/", + "text": "What Is a Program?\n\n\nA program is a sequence of instructions that specifies how to perform a computation.\nThe computation might be something mathematical, such as solving a system of equat\nions or finding the roots of a polynomial, but it can also be a symbolic computation,\nsuch as searching and replacing text in a document or (strangely enough) compiling a\nprogram.\nThe details look different in different languages, but a few basic instructions appear in\njust about every language:\n\n\ninput: \n\n\n\n\nGet data from the keyboard, a file, or some other device.\n\n\n\n\noutput:\n\n\n\n\nDisplay data on the screen or send data to a file or other device.\n\n\n\n\nmath:\n\n\n\n\nPerform basic mathematical operations like addition and\n multiplication.\n\n\n\n\nconditional execution:\n\n\n\n\nCheck for certain conditions and execute the appropriate code.\n\n\n\n\nrepetition:\n\n\n\n\nPerform some action repeatedly, usually with some variation.\n\n\n\n\nBelieve it or not, that\u2019s pretty much all there is to it. Every program you\u2019ve ever used, no\nmatter how complicated, is made up of instructions that look pretty much like these. So\nyou can think of programming as the process of breaking a large, complex task into\nsmaller and smaller subtasks until the subtasks are simple enough to be performed with\none of these basic instructions.\nThat may be a little vague, but we will come back to this topic when we talk about\nalgorithms.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nRun Python Scripts\n\n\nIf you can't execute or run a Python script, then programming is pointless. When you run a Python script, the interpreter converts a Python program into something that that the computer can understand. Executing a Python program can be done in two ways: calling the Python interpreter with a shebang line, and using the interactive Python shell.\n\n\nRun a Python Script as a File\n\n\nGenerally programmers write stand alone scripts, that are independent to live environments. Then they save it with a \".py\" extension, which indicates to the operating system and programmer that the file is actually a Python program. After the interpreter is invoked, it reads and interprets the file. The way Python scripts are run on Windows versus Unix based operating systems is very different. We'll show you the difference, and how to run a Python script on Windows and Unix platforms.\n\n\nRun a Python script under Windows with the Command Prompt\n\n\nWindows users must pass the path of the program as an argument to the Python interpreter. Such as follows:\n\n\nC:\n\\P\nython27\n\\p\nython.exe C:\n\\U\nsers\n\\U\nsername\n\\D\nesktop\n\\m\ny_python_script.py\n\n\n\n\n\nNote that you must use the full path of the Python interpreter. If you want to simply type python.exe C:\\Users\\Username\\Desktop\\my_python_script.py you must add python.exe to your PATH environmental variable.\nNote that Windows comes with two Python executables - python.exe and pythonw.exe. If you want a terminal to pop-up when you run your script, use python.exe However if you don't want any terminal pop-up, use pythonw.exe. pythonw.exe is typically used for GUI programs, where you only want to display your program, not the terminal.\n\n\nRun a Python Script Under Mac, Linux, BSD, Unix, etc\n\n\nOn platforms like Mac, BSD or Linux (Unix) you can put a \"shebang\" line as first line of the program which indicates the location of the Python interpreter on the hard drive. It's in the following format:\n\n\n#!/path/to/interpreter\n\n\n\n\n\n\nA common shebang line used for the Python interpreter is as follows:\n\n\n#!/usr/bin/env python\n\n\n\n\n\n\nYou must then make the script executable, using the following command:\n\n\nchmod +x my_python_script.py\n\n\n\n\n\nUnlike Windows, the Python interpreter is typically already in the $PATH environmental variable, so adding it is un-necessary.\n\n\nYou can then run a program by invoking the Python interpreter manually as follows:\n\n\npython firstprogram.py\n\n\n\n\n\nPython Execution with the Shell (Live Interpreter)\n\n\nAssuming that you already have Python installed and running well (if you're getting an error, see this post), open the terminal or console and type 'python' and hit the 'Enter' key. You will then be directed immediately to the Python live interpreter. Your screen will display a message something like:\n\n\nuser@hostname:~ python\nPython \n3\n.3.0 \n(\ndefault, Nov \n23\n \n2012\n, \n10\n:26:01\n)\n \n\n[\nGCC \n4\n.2.1 Compatible Apple Clang \n4\n.1 \n((\ntags/Apple/clang-421.11.66\n))]\n on darwin\nType \nhelp\n, \ncopyright\n, \ncredits\n or \nlicense\n \nfor\n more information.\n\n\n\n\n\n\n\nThe Python programmer should keep in mind one thing: that while working with the live interpreter, everything is read and interpreted in real-time. For example loops iterate immediately, unless they are part of function. So it requires some mental planning. Using the Python shell is typically used to execute code interactively. If you want to run a Python script from the interpreter, you must either import it or call the Python executable.\n\n\n\n\nSource:\n \n\n\n http://pythoncentral.io/execute-python-script-file-shell/\n\n\n\n\nA Good First Program\n\n\nType the following text into a single file named \nex1.py\n. Python works best with files ending in \n.py\n.\n\n\nprint\n \nHello World!\n\n\nprint\n \nHello Again\n\n\nprint\n \nI like typing this.\n\n\nprint\n \nThis is fun.\n\n\nprint\n \nYay! Printing.\n\n\nprint\n \nI\nd much rather you \nnot\n.\n\n\nprint\n \nI \nsaid\n do not touch this.\n\n\n\n\n\n\nYour Atom text editor should look something like this on all platforms:\n\n\n\n\nDon't worry if your editor doesn't look exactly the same, it should be close though. You may have a slightly different window header, maybe slightly different colors, and the left side of your Atom window won't say \"zedshaw\" but will instead show the directory you used for saving your files. All of those differences are fine.\n\n\nWhen you create this file, keep in mind these points:\n\n\n\n\nI did not type the line numbers on the left. Those are printed in the book so I can talk about specific lines by saying, \"See line 5...\" You do not type line numbers into Python scripts.\n\n\nI have the print at the beginning of the line and it looks exactly the same as what I have in ex1.py. Exactly means exactly, not kind of sort of the same. Every single character has to match for it to work. Color doesn't matter, only the characters you type.\n\n\n\n\nIn Terminal run the file by typing:\n\n\npython ex1.py\n\n\n\n\n\nIf you did it right then you should see the same output as I in the What You Should See section of this exercise. If not, you have done something wrong. No, the computer is not wrong.\n\n\nWhat You Should See\n\n\nOn Mac OS X in the Terminal you should see this:\n\n\nOn Windows in PowerShell you should see this:\n\n\n\nYou may see different names, before the python ex1.py command, but the important part is that you type the command and see the output is the same as mine.\n\n\n\n\n\nIf you have an error it will look like this:\n\n\n$ python ex/ex1.py\n File \nex/ex1.py\n, line \n3\n\n print \nI like typing this.\n\n\n ^\n\n\nSyntaxError: EOL while scanning string literal\n\n\n\n\n\n\nIt's important that you can read these error messages because you will be making many of these mistakes. Even I make many of these mistakes. Let's look at this line by line.\n\n\n\n\nWe ran our command in the Terminal to run the ex1.py script.\n\n\nPython tells us that the file ex1.py has an error on line 3.\n\n\nIt prints this line of code for us to see it.\n\n\nThen it puts a ^ (caret) character to point at where the problem is. Notice the missing \" (double-quote) character?\n\n\nFinally, it prints out a \"SyntaxError\" and tells us something about what might be the error. Usually these are very cryptic, but if you copy that text into a search engine, you will find someone else who's had that error and you can probably figure out how to fix it.\n\n\n\n\n\n\nSource:\n \n\n\n \nLEARN PYTHON THE HARD WAY\n by Zed A. Shaw - 2013\n\n\n\n\nDebugging and Errors\n\n\nWhat Is Debugging?\n\n\nProgramming is error-prone. For whimsical reasons, programming errors are called\n\nbugs\n and the process of tracking them down is called \ndebugging\n.\nThree kinds of errors can occur in a program: syntax errors, runtime errors, and se\nmantic errors. It is useful to distinguish between them in order to track them down more\nquickly.\n\n\nError Types :\n\n\nSyntax Errors\n\n\nPython can only execute a program if the syntax is correct; otherwise, the interpreter\ndisplays an error message. Syntax refers to the structure of a program and the rules\nabout that structure.For example, parentheses have to come in matching pairs, so\n(1 + 2) is legal, but 8) is a \nsyntax error\n.\nIn English readers can tolerate most syntax errors, which is why we can read the poetry\nof e. e. cummings without spewing error messages. Python is not so forgiving. If there\nis a single syntax error anywhere in your program, Python will display an error message\nand quit, and you will not be able to run your program. During the first few weeks of\nyour programming career, you will probably spend a lot of time tracking down syntax\nerrors. As you gain experience, you will make fewer errors and find them faster.\n\n\nRuntime Errors\n\n\nThe second type of error is a runtime error, so called because the error does not appear\nuntil after the program has started running. These errors are also called exceptions\nbecause they usually indicate that something exceptional (and bad) has happened.\nRuntime errors are rare in the simple programs you will see in the first few chapters, so\nit might be a while before you encounter one.\n\n\nSemantic Errors\n\n\nThe third type of error is the semantic error. If there is a semantic error in your program,\nit will run successfully in the sense that the computer will not generate any error mess\nages, but it will not do the right thing. It will do something else. Specifically, it will do\nwhat you told it to do.\nThe problem is that the program you wrote is not the program you wanted to write. The\nmeaning of the program (its semantics) is wrong. Identifying semantic errors can be\ntricky because it requires you to work backward by looking at the output of the program\nand trying to figure out what it is doing.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nReserved Words\n\n\nThe following list shows the Python keywords. These are reserved words and you cannot use them as constants or variables or any other identifier names. All the Python keywords contain lowercase letters only.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nand\n\n\nexec\n\n\nnot\n\n\n\n\n\n\nas\n\n\nfinally\n\n\nor\n\n\n\n\n\n\nassert\n\n\nfor\n\n\npass\n\n\n\n\n\n\nbreak\n\n\nfrom\n\n\nprint\n\n\n\n\n\n\nclass\n\n\nglobal\n\n\nraise\n\n\n\n\n\n\ncontinue\n\n\nif\n\n\nreturn\n\n\n\n\n\n\ndef\n\n\nimport\n\n\ntry\n\n\n\n\n\n\ndel\n\n\nin\n\n\nwhile\n\n\n\n\n\n\nelif\n\n\nis\n\n\nwith\n\n\n\n\n\n\nelse\n\n\nlambda\n\n\nyield\n\n\n\n\n\n\nexcept\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nSource:\n \n\n\n https://www.tutorialspoint.com", "title": "Start Coding With Python" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#what-is-a-program", - "text": "A program is a sequence of instructions that specifies how to perform a computation.\nThe computation might be something mathematical, such as solving a system of equat\nions or finding the roots of a polynomial, but it can also be a symbolic computation,\nsuch as searching and replacing text in a document or (strangely enough) compiling a\nprogram.\nThe details look different in different languages, but a few basic instructions appear in\njust about every language: input: Get data from the keyboard, a file, or some other device. output: Display data on the screen or send data to a file or other device. math: Perform basic mathematical operations like addition and\n multiplication. conditional execution: Check for certain conditions and execute the appropriate code. repetition: Perform some action repeatedly, usually with some variation. Believe it or not, that\u2019s pretty much all there is to it. Every program you\u2019ve ever used, no\nmatter how complicated, is made up of instructions that look pretty much like these. So\nyou can think of programming as the process of breaking a large, complex task into\nsmaller and smaller subtasks until the subtasks are simple enough to be performed with\none of these basic instructions.\nThat may be a little vague, but we will come back to this topic when we talk about\nalgorithms. Source: Think Python by Allen B. Downey - 2012", + "location": "/beginner/Start_Coding_With_Python/#what-is-a-program", + "text": "A program is a sequence of instructions that specifies how to perform a computation.\nThe computation might be something mathematical, such as solving a system of equat\nions or finding the roots of a polynomial, but it can also be a symbolic computation,\nsuch as searching and replacing text in a document or (strangely enough) compiling a\nprogram.\nThe details look different in different languages, but a few basic instructions appear in\njust about every language: input: Get data from the keyboard, a file, or some other device. output: Display data on the screen or send data to a file or other device. math: Perform basic mathematical operations like addition and\n multiplication. conditional execution: Check for certain conditions and execute the appropriate code. repetition: Perform some action repeatedly, usually with some variation. Believe it or not, that\u2019s pretty much all there is to it. Every program you\u2019ve ever used, no\nmatter how complicated, is made up of instructions that look pretty much like these. So\nyou can think of programming as the process of breaking a large, complex task into\nsmaller and smaller subtasks until the subtasks are simple enough to be performed with\none of these basic instructions.\nThat may be a little vague, but we will come back to this topic when we talk about\nalgorithms. Source: Think Python by Allen B. Downey - 2012", "title": "What Is a Program?" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#run-python-scripts", - "text": "If you can't execute or run a Python script, then programming is pointless. When you run a Python script, the interpreter converts a Python program into something that that the computer can understand. Executing a Python program can be done in two ways: calling the Python interpreter with a shebang line, and using the interactive Python shell.", + "location": "/beginner/Start_Coding_With_Python/#run-python-scripts", + "text": "If you can't execute or run a Python script, then programming is pointless. When you run a Python script, the interpreter converts a Python program into something that that the computer can understand. Executing a Python program can be done in two ways: calling the Python interpreter with a shebang line, and using the interactive Python shell.", "title": "Run Python Scripts" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#run-a-python-script-as-a-file", - "text": "Generally programmers write stand alone scripts, that are independent to live environments. Then they save it with a \".py\" extension, which indicates to the operating system and programmer that the file is actually a Python program. After the interpreter is invoked, it reads and interprets the file. The way Python scripts are run on Windows versus Unix based operating systems is very different. We'll show you the difference, and how to run a Python script on Windows and Unix platforms.", + "location": "/beginner/Start_Coding_With_Python/#run-a-python-script-as-a-file", + "text": "Generally programmers write stand alone scripts, that are independent to live environments. Then they save it with a \".py\" extension, which indicates to the operating system and programmer that the file is actually a Python program. After the interpreter is invoked, it reads and interprets the file. The way Python scripts are run on Windows versus Unix based operating systems is very different. We'll show you the difference, and how to run a Python script on Windows and Unix platforms.", "title": "Run a Python Script as a File" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#run-a-python-script-under-windows-with-the-command-prompt", - "text": "Windows users must pass the path of the program as an argument to the Python interpreter. Such as follows: C: \\P ython27 \\p ython.exe C: \\U sers \\U sername \\D esktop \\m y_python_script.py Note that you must use the full path of the Python interpreter. If you want to simply type python.exe C:\\Users\\Username\\Desktop\\my_python_script.py you must add python.exe to your PATH environmental variable.\nNote that Windows comes with two Python executables - python.exe and pythonw.exe. If you want a terminal to pop-up when you run your script, use python.exe However if you don't want any terminal pop-up, use pythonw.exe. pythonw.exe is typically used for GUI programs, where you only want to display your program, not the terminal.", + "location": "/beginner/Start_Coding_With_Python/#run-a-python-script-under-windows-with-the-command-prompt", + "text": "Windows users must pass the path of the program as an argument to the Python interpreter. Such as follows: C: \\P ython27 \\p ython.exe C: \\U sers \\U sername \\D esktop \\m y_python_script.py Note that you must use the full path of the Python interpreter. If you want to simply type python.exe C:\\Users\\Username\\Desktop\\my_python_script.py you must add python.exe to your PATH environmental variable.\nNote that Windows comes with two Python executables - python.exe and pythonw.exe. If you want a terminal to pop-up when you run your script, use python.exe However if you don't want any terminal pop-up, use pythonw.exe. pythonw.exe is typically used for GUI programs, where you only want to display your program, not the terminal.", "title": "Run a Python script under Windows with the Command Prompt" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#run-a-python-script-under-mac-linux-bsd-unix-etc", - "text": "On platforms like Mac, BSD or Linux (Unix) you can put a \"shebang\" line as first line of the program which indicates the location of the Python interpreter on the hard drive. It's in the following format: #!/path/to/interpreter A common shebang line used for the Python interpreter is as follows: #!/usr/bin/env python You must then make the script executable, using the following command: chmod +x my_python_script.py Unlike Windows, the Python interpreter is typically already in the $PATH environmental variable, so adding it is un-necessary. You can then run a program by invoking the Python interpreter manually as follows: python firstprogram.py", + "location": "/beginner/Start_Coding_With_Python/#run-a-python-script-under-mac-linux-bsd-unix-etc", + "text": "On platforms like Mac, BSD or Linux (Unix) you can put a \"shebang\" line as first line of the program which indicates the location of the Python interpreter on the hard drive. It's in the following format: #!/path/to/interpreter A common shebang line used for the Python interpreter is as follows: #!/usr/bin/env python You must then make the script executable, using the following command: chmod +x my_python_script.py Unlike Windows, the Python interpreter is typically already in the $PATH environmental variable, so adding it is un-necessary. You can then run a program by invoking the Python interpreter manually as follows: python firstprogram.py", "title": "Run a Python Script Under Mac, Linux, BSD, Unix, etc" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#python-execution-with-the-shell-live-interpreter", - "text": "Assuming that you already have Python installed and running well (if you're getting an error, see this post), open the terminal or console and type 'python' and hit the 'Enter' key. You will then be directed immediately to the Python live interpreter. Your screen will display a message something like: user@hostname:~ python\nPython 3 .3.0 ( default, Nov 23 2012 , 10 :26:01 ) [ GCC 4 .2.1 Compatible Apple Clang 4 .1 (( tags/Apple/clang-421.11.66 ))] on darwin\nType help , copyright , credits or license for more information. The Python programmer should keep in mind one thing: that while working with the live interpreter, everything is read and interpreted in real-time. For example loops iterate immediately, unless they are part of function. So it requires some mental planning. Using the Python shell is typically used to execute code interactively. If you want to run a Python script from the interpreter, you must either import it or call the Python executable. Source: http://pythoncentral.io/execute-python-script-file-shell/", + "location": "/beginner/Start_Coding_With_Python/#python-execution-with-the-shell-live-interpreter", + "text": "Assuming that you already have Python installed and running well (if you're getting an error, see this post), open the terminal or console and type 'python' and hit the 'Enter' key. You will then be directed immediately to the Python live interpreter. Your screen will display a message something like: user@hostname:~ python\nPython 3 .3.0 ( default, Nov 23 2012 , 10 :26:01 ) [ GCC 4 .2.1 Compatible Apple Clang 4 .1 (( tags/Apple/clang-421.11.66 ))] on darwin\nType help , copyright , credits or license for more information. The Python programmer should keep in mind one thing: that while working with the live interpreter, everything is read and interpreted in real-time. For example loops iterate immediately, unless they are part of function. So it requires some mental planning. Using the Python shell is typically used to execute code interactively. If you want to run a Python script from the interpreter, you must either import it or call the Python executable. Source: http://pythoncentral.io/execute-python-script-file-shell/", "title": "Python Execution with the Shell (Live Interpreter)" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#a-good-first-program", - "text": "Type the following text into a single file named ex1.py . Python works best with files ending in .py . print Hello World! print Hello Again print I like typing this. print This is fun. print Yay! Printing. print I d much rather you not . print I said do not touch this. Your Atom text editor should look something like this on all platforms: Don't worry if your editor doesn't look exactly the same, it should be close though. You may have a slightly different window header, maybe slightly different colors, and the left side of your Atom window won't say \"zedshaw\" but will instead show the directory you used for saving your files. All of those differences are fine. When you create this file, keep in mind these points: I did not type the line numbers on the left. Those are printed in the book so I can talk about specific lines by saying, \"See line 5...\" You do not type line numbers into Python scripts. I have the print at the beginning of the line and it looks exactly the same as what I have in ex1.py. Exactly means exactly, not kind of sort of the same. Every single character has to match for it to work. Color doesn't matter, only the characters you type. In Terminal run the file by typing: python ex1.py If you did it right then you should see the same output as I in the What You Should See section of this exercise. If not, you have done something wrong. No, the computer is not wrong.", + "location": "/beginner/Start_Coding_With_Python/#a-good-first-program", + "text": "Type the following text into a single file named ex1.py . Python works best with files ending in .py . print Hello World! print Hello Again print I like typing this. print This is fun. print Yay! Printing. print I d much rather you not . print I said do not touch this. Your Atom text editor should look something like this on all platforms: Don't worry if your editor doesn't look exactly the same, it should be close though. You may have a slightly different window header, maybe slightly different colors, and the left side of your Atom window won't say \"zedshaw\" but will instead show the directory you used for saving your files. All of those differences are fine. When you create this file, keep in mind these points: I did not type the line numbers on the left. Those are printed in the book so I can talk about specific lines by saying, \"See line 5...\" You do not type line numbers into Python scripts. I have the print at the beginning of the line and it looks exactly the same as what I have in ex1.py. Exactly means exactly, not kind of sort of the same. Every single character has to match for it to work. Color doesn't matter, only the characters you type. In Terminal run the file by typing: python ex1.py If you did it right then you should see the same output as I in the What You Should See section of this exercise. If not, you have done something wrong. No, the computer is not wrong.", "title": "A Good First Program" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#what-you-should-see", - "text": "On Mac OS X in the Terminal you should see this: \nOn Windows in PowerShell you should see this: You may see different names, before the python ex1.py command, but the important part is that you type the command and see the output is the same as mine. If you have an error it will look like this: $ python ex/ex1.py\n File ex/ex1.py , line 3 \n print I like typing this. ^ SyntaxError: EOL while scanning string literal It's important that you can read these error messages because you will be making many of these mistakes. Even I make many of these mistakes. Let's look at this line by line. We ran our command in the Terminal to run the ex1.py script. Python tells us that the file ex1.py has an error on line 3. It prints this line of code for us to see it. Then it puts a ^ (caret) character to point at where the problem is. Notice the missing \" (double-quote) character? Finally, it prints out a \"SyntaxError\" and tells us something about what might be the error. Usually these are very cryptic, but if you copy that text into a search engine, you will find someone else who's had that error and you can probably figure out how to fix it. Source: LEARN PYTHON THE HARD WAY by Zed A. Shaw - 2013", + "location": "/beginner/Start_Coding_With_Python/#what-you-should-see", + "text": "On Mac OS X in the Terminal you should see this: \nOn Windows in PowerShell you should see this: You may see different names, before the python ex1.py command, but the important part is that you type the command and see the output is the same as mine. If you have an error it will look like this: $ python ex/ex1.py\n File ex/ex1.py , line 3 \n print I like typing this. ^ SyntaxError: EOL while scanning string literal It's important that you can read these error messages because you will be making many of these mistakes. Even I make many of these mistakes. Let's look at this line by line. We ran our command in the Terminal to run the ex1.py script. Python tells us that the file ex1.py has an error on line 3. It prints this line of code for us to see it. Then it puts a ^ (caret) character to point at where the problem is. Notice the missing \" (double-quote) character? Finally, it prints out a \"SyntaxError\" and tells us something about what might be the error. Usually these are very cryptic, but if you copy that text into a search engine, you will find someone else who's had that error and you can probably figure out how to fix it. Source: LEARN PYTHON THE HARD WAY by Zed A. Shaw - 2013", "title": "What You Should See" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#debugging-and-errors", - "text": "", + "location": "/beginner/Start_Coding_With_Python/#debugging-and-errors", + "text": "", "title": "Debugging and Errors" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#what-is-debugging", - "text": "Programming is error-prone. For whimsical reasons, programming errors are called bugs and the process of tracking them down is called debugging .\nThree kinds of errors can occur in a program: syntax errors, runtime errors, and se\nmantic errors. It is useful to distinguish between them in order to track them down more\nquickly.", + "location": "/beginner/Start_Coding_With_Python/#what-is-debugging", + "text": "Programming is error-prone. For whimsical reasons, programming errors are called bugs and the process of tracking them down is called debugging .\nThree kinds of errors can occur in a program: syntax errors, runtime errors, and se\nmantic errors. It is useful to distinguish between them in order to track them down more\nquickly.", "title": "What Is Debugging?" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#error-types", - "text": "", + "location": "/beginner/Start_Coding_With_Python/#error-types", + "text": "", "title": "Error Types :" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#syntax-errors", - "text": "Python can only execute a program if the syntax is correct; otherwise, the interpreter\ndisplays an error message. Syntax refers to the structure of a program and the rules\nabout that structure.For example, parentheses have to come in matching pairs, so\n(1 + 2) is legal, but 8) is a syntax error .\nIn English readers can tolerate most syntax errors, which is why we can read the poetry\nof e. e. cummings without spewing error messages. Python is not so forgiving. If there\nis a single syntax error anywhere in your program, Python will display an error message\nand quit, and you will not be able to run your program. During the first few weeks of\nyour programming career, you will probably spend a lot of time tracking down syntax\nerrors. As you gain experience, you will make fewer errors and find them faster.", + "location": "/beginner/Start_Coding_With_Python/#syntax-errors", + "text": "Python can only execute a program if the syntax is correct; otherwise, the interpreter\ndisplays an error message. Syntax refers to the structure of a program and the rules\nabout that structure.For example, parentheses have to come in matching pairs, so\n(1 + 2) is legal, but 8) is a syntax error .\nIn English readers can tolerate most syntax errors, which is why we can read the poetry\nof e. e. cummings without spewing error messages. Python is not so forgiving. If there\nis a single syntax error anywhere in your program, Python will display an error message\nand quit, and you will not be able to run your program. During the first few weeks of\nyour programming career, you will probably spend a lot of time tracking down syntax\nerrors. As you gain experience, you will make fewer errors and find them faster.", "title": "Syntax Errors" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#runtime-errors", - "text": "The second type of error is a runtime error, so called because the error does not appear\nuntil after the program has started running. These errors are also called exceptions\nbecause they usually indicate that something exceptional (and bad) has happened.\nRuntime errors are rare in the simple programs you will see in the first few chapters, so\nit might be a while before you encounter one.", + "location": "/beginner/Start_Coding_With_Python/#runtime-errors", + "text": "The second type of error is a runtime error, so called because the error does not appear\nuntil after the program has started running. These errors are also called exceptions\nbecause they usually indicate that something exceptional (and bad) has happened.\nRuntime errors are rare in the simple programs you will see in the first few chapters, so\nit might be a while before you encounter one.", "title": "Runtime Errors" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#semantic-errors", - "text": "The third type of error is the semantic error. If there is a semantic error in your program,\nit will run successfully in the sense that the computer will not generate any error mess\nages, but it will not do the right thing. It will do something else. Specifically, it will do\nwhat you told it to do.\nThe problem is that the program you wrote is not the program you wanted to write. The\nmeaning of the program (its semantics) is wrong. Identifying semantic errors can be\ntricky because it requires you to work backward by looking at the output of the program\nand trying to figure out what it is doing. Source: Think Python by Allen B. Downey - 2012", + "location": "/beginner/Start_Coding_With_Python/#semantic-errors", + "text": "The third type of error is the semantic error. If there is a semantic error in your program,\nit will run successfully in the sense that the computer will not generate any error mess\nages, but it will not do the right thing. It will do something else. Specifically, it will do\nwhat you told it to do.\nThe problem is that the program you wrote is not the program you wanted to write. The\nmeaning of the program (its semantics) is wrong. Identifying semantic errors can be\ntricky because it requires you to work backward by looking at the output of the program\nand trying to figure out what it is doing. Source: Think Python by Allen B. Downey - 2012", "title": "Semantic Errors" - }, + }, { - "location": "/beginner/Start_Coding_With_Python/#reserved-words", - "text": "The following list shows the Python keywords. These are reserved words and you cannot use them as constants or variables or any other identifier names. All the Python keywords contain lowercase letters only. and exec not as finally or assert for pass break from print class global raise continue if return def import try del in while elif is with else lambda yield except Source: https://www.tutorialspoint.com", + "location": "/beginner/Start_Coding_With_Python/#reserved-words", + "text": "The following list shows the Python keywords. These are reserved words and you cannot use them as constants or variables or any other identifier names. All the Python keywords contain lowercase letters only. and exec not as finally or assert for pass break from print class global raise continue if return def import try del in while elif is with else lambda yield except Source: https://www.tutorialspoint.com", "title": "Reserved Words" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/", - "text": "Data Types in Python 3\n\n\nUnderstanding Data Types in Python 3\n\n\nIntroduction\n\n\nIn Python, like in all programming languages, data types are used to classify one particular type of data. This is important because the specific data type you use will determine what values you can assign to it and what you can do to it (including what operations you can perform on it).\n\n\nIn this tutorial, we will go over the important data types native to Python. This is not an exhaustive investigation of data types, but will help you become familiar with what options you have available to you in Python.\n\n\nBackground\n\n\nOne way to think about data types is to consider the different types of data that we use in the real world. An example of data in the real world are numbers: we may use whole numbers (0, 1, 2, \u2026), integers (\u2026, -1, 0, 1, \u2026), and irrational numbers (\u03c0), for example.\n\n\nUsually, in math, we can combine numbers from different types, and get some kind of an answer. We may want to add 5 to \u03c0, for example:\n\n\n5 + \u03c0\n\n\nWe can either keep the equation as the answer to account for the irrational number, or round \u03c0 to a number with a brief number of decimal places, and then add the numbers together:\n\n\n5 + \u03c0 = 5 + 3.14 = 8.14\n\n\nBut, if we start to try to evaluate numbers with another data type, such as words, things start to make less sense. How would we solve for the following equation?\n\n\nsky + 8\n\n\nFor computers, each data type can be thought of as being quite different, like words and numbers, so we will have to be careful about how we use them to assign values and how we manipulate them through operations.\n\n\nNumbers\n\n\nAny \nnumber\n you enter in Python will be interpreted as a number; you are not required to declare what kind of data type you are entering. Python will consider any number written without decimals as an \ninteger\n (as in \n138\n) and any number written with decimals as a \nfloat\n (as in \n138.0\n).\n\n\nIntegers\n\n\nLike in \nmath\n, \nintegers\n in computer programming are whole numbers that can be positive, negative, or 0 (\u2026, \n-1\n, \n0\n, \n1\n, \u2026). An integer can also be known as an \nint\n. As with other programming languages, you should not use commas in numbers of four digits or more, so when you write 1,000 in your program, write it as \n1000\n.\n\n\nWe can print out an integer in a simple way like this:\n\n\nprint\n(\n-\n25\n)\n\n\n\n#Output : -25\n\n\n\n\n\n\nOr, we can declare a \nvariable\n, which in this case is essentially a symbol of the number we are using or manipulating, like so:\n\n\nmy_int\n \n=\n \n-\n25\n\n\nprint\n(\nmy_int\n)\n\n\n\n#Output : -25\n\n\n\n\n\n\nWe can do math with integers in Python, too:\n\n\nint_ans\n \n=\n \n116\n \n-\n \n68\n\n\nprint\n(\nint_ans\n)\n\n\n\n#Output : 48\n\n\n\n\n\n\nIntegers can be used in many ways within Python programs, and as you continue to learn more about the language you will have a lot of opportunities to work with integers and understand more about this data type.\n\n\nFloating-Point Numbers\n\n\nA \nfloating-point number\n or a \nfloat\n is a real number, meaning that it can be either a rational or an irrational number. Because of this, floating-point numbers can be numbers that can contain a fractional part, such as \n9.0\n or \n-116.42\n. Simply speaking, for the purposes of thinking of a \nfloat\n in a Python program, it is a number that contains a decimal point.\n\n\nLike we did with the integer, we can print out a floating-point number in a simple way like this:\n\n\nprint\n(\n17.3\n)\n\n\n\n#Output : 17.3\n\n\n\n\n\n\nWe can also declare a variable that stands in for a float, like so:\n\n\nmy_flt\n \n=\n \n17.3\n\n\nprint\n(\nmy_flt\n)\n\n\n\n#Output : 17.3\n\n\n\n\n\n\nAnd, just like with integers, we can do math with floats in Python, too:\n\n\nflt_ans\n \n=\n \n564.0\n \n+\n \n365.24\n\n\nprint\n(\nflt_ans\n)\n\n\n\n#Output : 929.24\n\n\n\n\n\n\nWith integers and floating-point numbers, it is important to keep in mind that 3 \u2260 3.0, as \n3\n refers to an integer while \n3.0\n refers to a float.\n\n\nBooleans\n\n\nThe \nBoolean\n data type can be one of two values, either \nTrue\n or \nFalse\n. Booleans are used to represent the truth values that are associated with the logic branch of mathematics, which informs algorithms in computer science.\n\n\nWhenever you see the data type Boolean, it will start with a capitalized B because it is named for the mathematician George Boole. The values \nTrue\n and \nFalse\n will also always be with a capital T and F respectively, as they are special values in Python.\n\n\nMany operations in math give us answers that evaluate to either True or False:\n\n\n*\n \n**\ngreater\n \nthan\n**\n\n \n*\n \n500\n \n \n100\n \n`True`\n\n \n*\n \n1\n \n \n5\n \n`False`\n\n\n*\n \n**\nless\n \nthan\n**\n\n \n*\n \n200\n \n \n400\n \n`True`\n\n \n*\n \n4\n \n \n2\n \n`False`\n\n\n*\n \n**\nequal\n**\n\n \n*\n \n5\n \n=\n \n5\n \n`True`\n\n \n*\n \n500\n \n=\n \n400\n \n`False`\n\n\n\n\n\n\nLike with numbers, we can store a Boolean value in a variable:\n\n\nmy_bool\n \n=\n \n5\n \n \n8\n\n\n\n\n\n\nWe can then print the Boolean value with a call to the \nprint()\n function:\n\n\nprint\n(\nmy_bool\n)\n\n\n\n\n\n\nSince 5 is not greater than 8, we will receive the following #Output : :\n\n\n#Output : False\n\n\n\n\n\n\nAs you write more programs in Python, you will become more familiar with how Booleans work and how different functions and operations evaluating to either True or False can change the course of the program.\n\n\nStrings\n\n\nA \nstring\n is a sequence of one or more characters (letters, numbers, symbols) that can be either a constant or a variable. Strings exist within either single quotes \n'\n or double quotes \n\"\n in Python, so to create a string, enclose a sequence of characters in quotes:\n\n\nThis is a string in single quotes.\n\n\n\nThis is a string in double quotes.\n\n\n\n\n\n\nYou can choose to use either single quotes or double quotes, but whichever you decide on you should be consistent within a program.\n\n\nThe simple program \u201c\nHello, World!\n\u201d demonstrates how a string can be used in computer programming, as the characters that make up the phrase \nHello, World!\n are a string.\n\n\nprint\n(\nHello, World!\n)\n\n\n\n\n\n\nAs with other data types, we can store strings in variables:\n\n\nhw\n \n=\n \nHello, World!\n\n\n\n\n\n\nAnd print out the string by calling the variable:\n\n\nprint\n(\nhw\n)\n\n\n\n#Ouput : Hello, World!\n\n\n\n\n\n\nLike numbers, there are many operations that we can perform on strings within our programs in order to manipulate them to achieve the results we are seeking. Strings are important for communicating information to the user, and for the user to communicate information back to the program.\n\n\nLists\n\n\nA \nlist\n is a mutable, or changeable, ordered sequence of elements. Each element or value that is inside of a list is called an \nitem\n. Just as strings are defined as characters between quotes, lists are defined by having values between square brackets \n[ ]\n.\n\n\nA list of integers looks like this:\n\n\n[\n-\n3\n,\n \n-\n2\n,\n \n-\n1\n,\n \n0\n,\n \n1\n,\n \n2\n,\n \n3\n]\n\n\n\n\n\n\nA list of floats looks like this:\n\n\n[\n3.14\n,\n \n9.23\n,\n \n111.11\n,\n \n312.12\n,\n \n1.05\n]\n\n\n\n\n\n\nA list of strings:\n\n\n[\nshark\n,\n \ncuttlefish\n,\n \nsquid\n,\n \nmantis shrimp\n]\n\n\n\n\n\n\nIf we define our string list as \nsea_creatures\n:\n\n\nsea_creatures\n \n=\n \n[\nshark\n,\n \ncuttlefish\n,\n \nsquid\n,\n \nmantis shrimp\n]\n\n\n\n\n\n\nWe can print them out by calling the variable:\n\n\nprint\n(\nsea_creatures\n)\n\n\n\n\n\n\nAnd we see that the #Output : looks exactly like the list that we created:\n\n\n#Output : [\nshark\n, \ncuttlefish\n, \nsquid\n, \nmantis shrimp\n]\n\n\n\n\n\n\nLists are a very flexible data type because they are mutable in that they can have values added, removed, and changed. There is a data type that is similar to lists but that can\u2019t be changed, and that is called a tuple.\n\n\nTuples\n\n\nA \ntuple\n is used for grouping data. It is an immutable, or unchangeable, ordered sequence of elements.\n\n\nTuples are very similar to lists, but they use parentheses \n( )\n instead of square brackets and because they are immutable their values cannot be modified.\n\n\nA tuple looks like this:\n\n\n(\nblue coral\n,\n \nstaghorn coral\n,\n \npillar coral\n)\n\n\n\n\n\n\nWe can store a tuple in a variable and print it out:\n\n\ncoral\n \n=\n \n(\nblue coral\n,\n \nstaghorn coral\n,\n \npillar coral\n)\n\n\nprint\n(\ncoral\n)\n\n\n\nOuput\n(\nblue coral\n,\n \nstaghorn coral\n,\n \npillar coral\n)\n\n\n\n\n\n\nLike in the other data types, Python prints out the tuple just as we had typed it, with parentheses containing a sequence of values.\n\n\nDictionaries\n\n\nThe \ndictionary\n is Python\u2019s built-in \nmapping\n type. This means that dictionaries map \nkeys\n to \nvalues\n and these key-value pairs are a useful way to store data in Python. A dictionary is constructed with curly braces on either side \n{ }\n.\n\n\nTypically used to hold data that are related, such as the information contained in an ID, a dictionary looks like this:\n\n\n{\nname\n:\n \nSammy\n,\n \nanimal\n:\n \nshark\n,\n \ncolor\n:\n \nblue\n,\n \nlocation\n:\n \nocean\n}\n\n\n\n\n\n\nYou will notice that in addition to the curly braces, there are also colons throughout the dictionary. The words to the left of the colons are the keys. Keys can be made up of any immutable data type. The keys in the dictionary above are: \n'name', 'animal', 'color', 'location'\n.\n\n\nThe words to the right of the colons are the values. Values can be comprised of any data type. The values in the dictionary above are: \n'Sammy', 'shark', 'blue', 'ocean'\n.\n\n\nLike the other data types, let\u2019s store the dictionary inside a variable, and print it out:\n\n\nsammy\n \n=\n \n{\nname\n:\n \nSammy\n,\n \nanimal\n:\n \nshark\n,\n \ncolor\n:\n \nblue\n,\n \nlocation\n:\n \nocean\n}\n\n\n#Ouput : {\ncolor\n: \nblue\n, \nanimal\n: \nshark\n, \nname\n: \nSammy\n, \nlocation\n: \nocean\n}\n\n\n\n\n\n\nIf we want to isolate Sammy\u2019s color, we can do so by calling \nsammy['color']\n. Let\u2019s print that out:\n\n\nprint\n(\nsammy\n[\ncolor\n])\n\n\n\n#Output : blue\n\n\n\n\n\n\nAs dictionaries offer key-value pairs for storing data, they can be important elements in your Python program.\n\n\nConclusion\n\n\nAt this point, you should have a better understanding of some of the major data types that are available for you to use in Python. Each of these data types will become important as you develop programming projects in the Python language.\n\n\nYou can learn about each of the data types above in more detail by reading the following specific tutorials:\n\n\n\n\nNumbers\n\n\nBooleans\n\n\nStrings\n\n\nLists\n\n\nTuples\n\n\nDictionaries\n\n\n\n\nOnce you have a solid grasp of data types available to you in Python, you can learn how to \nconvert data types\n.\n\n\n\n\nSource:\n \n\n\n https://www.digitalocean.com/community/tutorials/understanding-data-types-in-python-3\n\n\n\n\n\n\nNative Datatypes By Dive Into Python 3\n\n\n\n\n\n\nSource:\n \n\n\n \nDive into Python 3\n by Mark Pilgrim \n\n\n\n\nStandard Data Types By Tutorialspoint\n\n\nThe data stored in memory can be of many types. For example, a person's age is stored as a numeric value and his or her address is stored as alphanumeric characters. Python has various standard data types that are used to define the operations possible on them and the storage method for each of them.\n\n\nPython has five standard data types : \n\n\n\n\n\n\nNumbers\n\n\n\n\n\n\nString\n\n\n\n\n\n\nList\n\n\n\n\n\n\nTuple\n\n\n\n\n\n\nDictionary\n\n\n\n\n\n\nPython Numbers\n\n\nNumber data types store numeric values. Number objects are created when you assign a value to them. For example \u2212\n\n\nvar1\n \n=\n \n1\n\n\nvar2\n \n=\n \n10\n\n\n\n\n\n\nYou can also delete the reference to a number object by using the del statement. The syntax of the del statement is \u2212\n\n\ndel\n \nvar1\n[,\nvar2\n[,\nvar3\n[\n....\n,\nvarN\n]]]]\n\n\n\n\n\n\nYou can delete a single object or multiple objects by using the del statement.\n\n\nFor example \u2212\n\n\ndel\n \nvar\n\n\ndel\n \nvar_a\n,\n \nvar_b\n\n\n\n\n\n\nPython supports three different numerical types \u2212\n- int (signed integers)\n\n\n\n\n\n\nfloat (floating point real values)\n\n\n\n\n\n\ncomplex (complex numbers)\n\n\n\n\n\n\nAll integers in Python3 are represented as long integers. Hence, there is no separate number type as long.\n\n\n\n\n\n\n\n\nint\n\n\nfloat\n\n\ncomplex\n\n\n\n\n\n\n\n\n\n\n10\n\n\n0.0\n\n\n3.14j\n\n\n\n\n\n\n100\n\n\n15.20\n\n\n45.j\n\n\n\n\n\n\n-786\n\n\n-21.9\n\n\n9.322e-36j\n\n\n\n\n\n\n\n\nA complex number consists of an ordered pair of real floating-point numbers denoted by x + yj, where x and y are real numbers and j is the imaginary unit.\n\n\nPython Strings\n\n\nStrings in Python are identified as a contiguous set of characters represented in the quotation marks. Python allows either pair of single or double quotes. Subsets of strings can be taken using the slice operator ([ ] and [:] ) with indexes starting at 0 in the beginning of the string and working their way from -1 to the end.\n\n\nThe plus (+) sign is the string concatenation operator and the asterisk (*) is the repetition operator. For example \u2212\n\n\n#!/usr/bin/python3\n\n\n\nstr\n \n=\n \nHello World!\n\n\n\nprint\n \n(\nstr\n)\n \n# Prints complete string\n\n\nprint\n \n(\nstr\n[\n0\n])\n \n# Prints first character of the string\n\n\nprint\n \n(\nstr\n[\n2\n:\n5\n])\n \n# Prints characters starting from 3rd to 5th\n\n\nprint\n \n(\nstr\n[\n2\n:])\n \n# Prints string starting from 3rd character\n\n\nprint\n \n(\nstr\n \n*\n \n2\n)\n \n# Prints string two times\n\n\nprint\n \n(\nstr\n \n+\n \nTEST\n)\n \n# Prints concatenated string\n\n\n\n\n\n\nThis will produce the following result \u2212\n\n\nHello\n \nWorld\n!\n\n\nH\n\n\nllo\n\n\nllo\n \nWorld\n!\n\n\nHello\n \nWorld\n!\nHello\n \nWorld\n!\n\n\nHello\n \nWorld\n!\nTEST\n\n\n\n\n\n\nPython Lists\n\n\nLists are the most versatile of Python's compound data types. A list contains items separated by commas and enclosed within square brackets ([]). To some extent, lists are similar to arrays in C. One of the differences between them is that all the items belonging to a list can be of different data type.\n\n\nThe values stored in a list can be accessed using the slice operator ([ ] and [:]) with indexes starting at 0 in the beginning of the list and working their way to end -1. The plus (+) sign is the list concatenation operator, and the asterisk (*) is the repetition operator. For example \u2212\n\n\n#!/usr/bin/python3\n\n\n\nlist\n \n=\n \n[\n \nabcd\n,\n \n786\n \n,\n \n2.23\n,\n \njohn\n,\n \n70.2\n \n]\n\n\ntinylist\n \n=\n \n[\n123\n,\n \njohn\n]\n\n\n\nprint\n \n(\nlist\n)\n \n# Prints complete list\n\n\nprint\n \n(\nlist\n[\n0\n])\n \n# Prints first element of the list\n\n\nprint\n \n(\nlist\n[\n1\n:\n3\n])\n \n# Prints elements starting from 2nd till 3rd \n\n\nprint\n \n(\nlist\n[\n2\n:])\n \n# Prints elements starting from 3rd element\n\n\nprint\n \n(\ntinylist\n \n*\n \n2\n)\n \n# Prints list two times\n\n\nprint\n \n(\nlist\n \n+\n \ntinylist\n)\n \n# Prints concatenated lists\n\n\n\n\n\n\nThis produces the following result \u2212\n\n\n[\nabcd\n,\n \n786\n,\n \n2.23\n,\n \njohn\n,\n \n70.200000000000003\n]\n\n\nabcd\n\n\n[\n786\n,\n \n2.23\n]\n\n\n[\n2.23\n,\n \njohn\n,\n \n70.200000000000003\n]\n\n\n[\n123\n,\n \njohn\n,\n \n123\n,\n \njohn\n]\n\n\n[\nabcd\n,\n \n786\n,\n \n2.23\n,\n \njohn\n,\n \n70.200000000000003\n,\n \n123\n,\n \njohn\n]\n\n\n\n\n\n\nPython Tuples\n\n\nA tuple is another sequence data type that is similar to the list. A tuple consists of a number of values separated by commas. Unlike lists, however, tuples are enclosed within parenthesis.\n\n\nThe main difference between lists and tuples are \u2212 Lists are enclosed in brackets ( [ ] ) and their elements and size can be changed, while tuples are enclosed in parentheses ( ( ) ) and cannot be updated. Tuples can be thought of as read-only lists. For example \u2212\n\n\n#!/usr/bin/python3\n\n\n\ntuple\n \n=\n \n(\n \nabcd\n,\n \n786\n \n,\n \n2.23\n,\n \njohn\n,\n \n70.2\n \n)\n\n\ntinytuple\n \n=\n \n(\n123\n,\n \njohn\n)\n\n\n\nprint\n \n(\ntuple\n)\n \n# Prints complete tuple\n\n\nprint\n \n(\ntuple\n[\n0\n])\n \n# Prints first element of the tuple\n\n\nprint\n \n(\ntuple\n[\n1\n:\n3\n])\n \n# Prints elements starting from 2nd till 3rd \n\n\nprint\n \n(\ntuple\n[\n2\n:])\n \n# Prints elements starting from 3rd element\n\n\nprint\n \n(\ntinytuple\n \n*\n \n2\n)\n \n# Prints tuple two times\n\n\nprint\n \n(\ntuple\n \n+\n \ntinytuple\n)\n \n# Prints concatenated tuple\n\n\n\n\n\n\nThis produces the following result \u2212\n\n\n(\nabcd\n,\n \n786\n,\n \n2.23\n,\n \njohn\n,\n \n70.200000000000003\n)\n\n\nabcd\n\n\n(\n786\n,\n \n2.23\n)\n\n\n(\n2.23\n,\n \njohn\n,\n \n70.200000000000003\n)\n\n\n(\n123\n,\n \njohn\n,\n \n123\n,\n \njohn\n)\n\n\n(\nabcd\n,\n \n786\n,\n \n2.23\n,\n \njohn\n,\n \n70.200000000000003\n,\n \n123\n,\n \njohn\n)\n\n\n\n\n\n\nThe following code is invalid with tuple, because we attempted to update a tuple, which is not allowed. Similar case is possible with lists \u2212\n\n\n#!/usr/bin/python3\n\n\n\ntuple\n \n=\n \n(\n \nabcd\n,\n \n786\n \n,\n \n2.23\n,\n \njohn\n,\n \n70.2\n \n)\n\n\nlist\n \n=\n \n[\n \nabcd\n,\n \n786\n \n,\n \n2.23\n,\n \njohn\n,\n \n70.2\n \n]\n\n\ntuple\n[\n2\n]\n \n=\n \n1000\n \n# Invalid syntax with tuple\n\n\nlist\n[\n2\n]\n \n=\n \n1000\n \n# Valid syntax with list\n\n\n\n\n\n\nPython Dictionary\n\n\nPython's dictionaries are kind of hash-table type. They work like associative arrays or hashes found in Perl and consist of key-value pairs. A dictionary key can be almost any Python type, but are usually numbers or strings. Values, on the other hand, can be any arbitrary Python object.\n\n\nDictionaries are enclosed by curly braces ({ }) and values can be assigned and accessed using square braces ([]). For example \u2212\n\n\n#!/usr/bin/python3\n\n\n\ndict\n \n=\n \n{}\n\n\ndict\n[\none\n]\n \n=\n \nThis is one\n\n\ndict\n[\n2\n]\n \n=\n \nThis is two\n\n\n\ntinydict\n \n=\n \n{\nname\n:\n \njohn\n,\ncode\n:\n6734\n,\n \ndept\n:\n \nsales\n}\n\n\n\n\nprint\n \n(\ndict\n[\none\n])\n \n# Prints value for \none\n key\n\n\nprint\n \n(\ndict\n[\n2\n])\n \n# Prints value for 2 key\n\n\nprint\n \n(\ntinydict\n)\n \n# Prints complete dictionary\n\n\nprint\n \n(\ntinydict\n.\nkeys\n())\n \n# Prints all the keys\n\n\nprint\n \n(\ntinydict\n.\nvalues\n())\n \n# Prints all the values\n\n\n\n\n\n\nThis produces the following result \u2212\n\n\nThis\n \nis\n \none\n\n\nThis\n \nis\n \ntwo\n\n\n{\nname\n:\n \njohn\n,\n \ndept\n:\n \nsales\n,\n \ncode\n:\n \n6734\n}\n\n\ndict_keys\n([\nname\n,\n \ndept\n,\n \ncode\n])\n\n\ndict_values\n([\njohn\n,\n \nsales\n,\n \n6734\n])\n\n\n\n\n\n\nDictionaries have no concept of order among the elements. It is incorrect to say that the elements are \"out of order\"; they are simply unordered.\n\n\n\n\nSource:\n \n\n\n https://www.tutorialspoint.com/python3/python_variable_types.htm", + "location": "/beginner/Data_Types_In_Python_3/", + "text": "Data Types in Python 3\n\n\nUnderstanding Data Types in Python 3\n\n\nIntroduction\n\n\nIn Python, like in all programming languages, data types are used to classify one particular type of data. This is important because the specific data type you use will determine what values you can assign to it and what you can do to it (including what operations you can perform on it).\n\n\nIn this tutorial, we will go over the important data types native to Python. This is not an exhaustive investigation of data types, but will help you become familiar with what options you have available to you in Python.\n\n\nBackground\n\n\nOne way to think about data types is to consider the different types of data that we use in the real world. An example of data in the real world are numbers: we may use whole numbers (0, 1, 2, \u2026), integers (\u2026, -1, 0, 1, \u2026), and irrational numbers (\u03c0), for example.\n\n\nUsually, in math, we can combine numbers from different types, and get some kind of an answer. We may want to add 5 to \u03c0, for example:\n\n\n5 + \u03c0\n\n\nWe can either keep the equation as the answer to account for the irrational number, or round \u03c0 to a number with a brief number of decimal places, and then add the numbers together:\n\n\n5 + \u03c0 = 5 + 3.14 = 8.14\n\n\nBut, if we start to try to evaluate numbers with another data type, such as words, things start to make less sense. How would we solve for the following equation?\n\n\nsky + 8\n\n\nFor computers, each data type can be thought of as being quite different, like words and numbers, so we will have to be careful about how we use them to assign values and how we manipulate them through operations.\n\n\nNumbers\n\n\nAny \nnumber\n you enter in Python will be interpreted as a number; you are not required to declare what kind of data type you are entering. Python will consider any number written without decimals as an \ninteger\n (as in \n138\n) and any number written with decimals as a \nfloat\n (as in \n138.0\n).\n\n\nIntegers\n\n\nLike in \nmath\n, \nintegers\n in computer programming are whole numbers that can be positive, negative, or 0 (\u2026, \n-1\n, \n0\n, \n1\n, \u2026). An integer can also be known as an \nint\n. As with other programming languages, you should not use commas in numbers of four digits or more, so when you write 1,000 in your program, write it as \n1000\n.\n\n\nWe can print out an integer in a simple way like this:\n\n\nprint\n(\n-\n25\n)\n\n\n\n#Output : -25\n\n\n\n\n\n\nOr, we can declare a \nvariable\n, which in this case is essentially a symbol of the number we are using or manipulating, like so:\n\n\nmy_int\n \n=\n \n-\n25\n\n\nprint\n(\nmy_int\n)\n\n\n\n#Output : -25\n\n\n\n\n\n\nWe can do math with integers in Python, too:\n\n\nint_ans\n \n=\n \n116\n \n-\n \n68\n\n\nprint\n(\nint_ans\n)\n\n\n\n#Output : 48\n\n\n\n\n\n\nIntegers can be used in many ways within Python programs, and as you continue to learn more about the language you will have a lot of opportunities to work with integers and understand more about this data type.\n\n\nFloating-Point Numbers\n\n\nA \nfloating-point number\n or a \nfloat\n is a real number, meaning that it can be either a rational or an irrational number. Because of this, floating-point numbers can be numbers that can contain a fractional part, such as \n9.0\n or \n-116.42\n. Simply speaking, for the purposes of thinking of a \nfloat\n in a Python program, it is a number that contains a decimal point.\n\n\nLike we did with the integer, we can print out a floating-point number in a simple way like this:\n\n\nprint\n(\n17.3\n)\n\n\n\n#Output : 17.3\n\n\n\n\n\n\nWe can also declare a variable that stands in for a float, like so:\n\n\nmy_flt\n \n=\n \n17.3\n\n\nprint\n(\nmy_flt\n)\n\n\n\n#Output : 17.3\n\n\n\n\n\n\nAnd, just like with integers, we can do math with floats in Python, too:\n\n\nflt_ans\n \n=\n \n564.0\n \n+\n \n365.24\n\n\nprint\n(\nflt_ans\n)\n\n\n\n#Output : 929.24\n\n\n\n\n\n\nWith integers and floating-point numbers, it is important to keep in mind that 3 \u2260 3.0, as \n3\n refers to an integer while \n3.0\n refers to a float.\n\n\nBooleans\n\n\nThe \nBoolean\n data type can be one of two values, either \nTrue\n or \nFalse\n. Booleans are used to represent the truth values that are associated with the logic branch of mathematics, which informs algorithms in computer science.\n\n\nWhenever you see the data type Boolean, it will start with a capitalized B because it is named for the mathematician George Boole. The values \nTrue\n and \nFalse\n will also always be with a capital T and F respectively, as they are special values in Python.\n\n\nMany operations in math give us answers that evaluate to either True or False:\n\n\n*\n \n**\ngreater\n \nthan\n**\n\n \n*\n \n500\n \n \n100\n \n`True`\n\n \n*\n \n1\n \n \n5\n \n`False`\n\n\n*\n \n**\nless\n \nthan\n**\n\n \n*\n \n200\n \n \n400\n \n`True`\n\n \n*\n \n4\n \n \n2\n \n`False`\n\n\n*\n \n**\nequal\n**\n\n \n*\n \n5\n \n=\n \n5\n \n`True`\n\n \n*\n \n500\n \n=\n \n400\n \n`False`\n\n\n\n\n\n\nLike with numbers, we can store a Boolean value in a variable:\n\n\nmy_bool\n \n=\n \n5\n \n \n8\n\n\n\n\n\n\nWe can then print the Boolean value with a call to the \nprint()\n function:\n\n\nprint\n(\nmy_bool\n)\n\n\n\n\n\n\nSince 5 is not greater than 8, we will receive the following #Output : :\n\n\n#Output : False\n\n\n\n\n\n\nAs you write more programs in Python, you will become more familiar with how Booleans work and how different functions and operations evaluating to either True or False can change the course of the program.\n\n\nStrings\n\n\nA \nstring\n is a sequence of one or more characters (letters, numbers, symbols) that can be either a constant or a variable. Strings exist within either single quotes \n'\n or double quotes \n\"\n in Python, so to create a string, enclose a sequence of characters in quotes:\n\n\nThis is a string in single quotes.\n\n\n\nThis is a string in double quotes.\n\n\n\n\n\n\nYou can choose to use either single quotes or double quotes, but whichever you decide on you should be consistent within a program.\n\n\nThe simple program \u201c\nHello, World!\n\u201d demonstrates how a string can be used in computer programming, as the characters that make up the phrase \nHello, World!\n are a string.\n\n\nprint\n(\nHello, World!\n)\n\n\n\n\n\n\nAs with other data types, we can store strings in variables:\n\n\nhw\n \n=\n \nHello, World!\n\n\n\n\n\n\nAnd print out the string by calling the variable:\n\n\nprint\n(\nhw\n)\n\n\n\n#Ouput : Hello, World!\n\n\n\n\n\n\nLike numbers, there are many operations that we can perform on strings within our programs in order to manipulate them to achieve the results we are seeking. Strings are important for communicating information to the user, and for the user to communicate information back to the program.\n\n\nLists\n\n\nA \nlist\n is a mutable, or changeable, ordered sequence of elements. Each element or value that is inside of a list is called an \nitem\n. Just as strings are defined as characters between quotes, lists are defined by having values between square brackets \n[ ]\n.\n\n\nA list of integers looks like this:\n\n\n[\n-\n3\n,\n \n-\n2\n,\n \n-\n1\n,\n \n0\n,\n \n1\n,\n \n2\n,\n \n3\n]\n\n\n\n\n\n\nA list of floats looks like this:\n\n\n[\n3.14\n,\n \n9.23\n,\n \n111.11\n,\n \n312.12\n,\n \n1.05\n]\n\n\n\n\n\n\nA list of strings:\n\n\n[\nshark\n,\n \ncuttlefish\n,\n \nsquid\n,\n \nmantis shrimp\n]\n\n\n\n\n\n\nIf we define our string list as \nsea_creatures\n:\n\n\nsea_creatures\n \n=\n \n[\nshark\n,\n \ncuttlefish\n,\n \nsquid\n,\n \nmantis shrimp\n]\n\n\n\n\n\n\nWe can print them out by calling the variable:\n\n\nprint\n(\nsea_creatures\n)\n\n\n\n\n\n\nAnd we see that the #Output : looks exactly like the list that we created:\n\n\n#Output : [\nshark\n, \ncuttlefish\n, \nsquid\n, \nmantis shrimp\n]\n\n\n\n\n\n\nLists are a very flexible data type because they are mutable in that they can have values added, removed, and changed. There is a data type that is similar to lists but that can\u2019t be changed, and that is called a tuple.\n\n\nTuples\n\n\nA \ntuple\n is used for grouping data. It is an immutable, or unchangeable, ordered sequence of elements.\n\n\nTuples are very similar to lists, but they use parentheses \n( )\n instead of square brackets and because they are immutable their values cannot be modified.\n\n\nA tuple looks like this:\n\n\n(\nblue coral\n,\n \nstaghorn coral\n,\n \npillar coral\n)\n\n\n\n\n\n\nWe can store a tuple in a variable and print it out:\n\n\ncoral\n \n=\n \n(\nblue coral\n,\n \nstaghorn coral\n,\n \npillar coral\n)\n\n\nprint\n(\ncoral\n)\n\n\n\nOuput\n(\nblue coral\n,\n \nstaghorn coral\n,\n \npillar coral\n)\n\n\n\n\n\n\nLike in the other data types, Python prints out the tuple just as we had typed it, with parentheses containing a sequence of values.\n\n\nDictionaries\n\n\nThe \ndictionary\n is Python\u2019s built-in \nmapping\n type. This means that dictionaries map \nkeys\n to \nvalues\n and these key-value pairs are a useful way to store data in Python. A dictionary is constructed with curly braces on either side \n{ }\n.\n\n\nTypically used to hold data that are related, such as the information contained in an ID, a dictionary looks like this:\n\n\n{\nname\n:\n \nSammy\n,\n \nanimal\n:\n \nshark\n,\n \ncolor\n:\n \nblue\n,\n \nlocation\n:\n \nocean\n}\n\n\n\n\n\n\nYou will notice that in addition to the curly braces, there are also colons throughout the dictionary. The words to the left of the colons are the keys. Keys can be made up of any immutable data type. The keys in the dictionary above are: \n'name', 'animal', 'color', 'location'\n.\n\n\nThe words to the right of the colons are the values. Values can be comprised of any data type. The values in the dictionary above are: \n'Sammy', 'shark', 'blue', 'ocean'\n.\n\n\nLike the other data types, let\u2019s store the dictionary inside a variable, and print it out:\n\n\nsammy\n \n=\n \n{\nname\n:\n \nSammy\n,\n \nanimal\n:\n \nshark\n,\n \ncolor\n:\n \nblue\n,\n \nlocation\n:\n \nocean\n}\n\n\n#Ouput : {\ncolor\n: \nblue\n, \nanimal\n: \nshark\n, \nname\n: \nSammy\n, \nlocation\n: \nocean\n}\n\n\n\n\n\n\nIf we want to isolate Sammy\u2019s color, we can do so by calling \nsammy['color']\n. Let\u2019s print that out:\n\n\nprint\n(\nsammy\n[\ncolor\n])\n\n\n\n#Output : blue\n\n\n\n\n\n\nAs dictionaries offer key-value pairs for storing data, they can be important elements in your Python program.\n\n\nConclusion\n\n\nAt this point, you should have a better understanding of some of the major data types that are available for you to use in Python. Each of these data types will become important as you develop programming projects in the Python language.\n\n\nYou can learn about each of the data types above in more detail by reading the following specific tutorials:\n\n\n\n\nNumbers\n\n\nBooleans\n\n\nStrings\n\n\nLists\n\n\nTuples\n\n\nDictionaries\n\n\n\n\nOnce you have a solid grasp of data types available to you in Python, you can learn how to \nconvert data types\n.\n\n\n\n\nSource:\n \n\n\n https://www.digitalocean.com/community/tutorials/understanding-data-types-in-python-3\n\n\n\n\n\n\nNative Datatypes By Dive Into Python 3\n\n\n\n\n\n\nSource:\n \n\n\n \nDive into Python 3\n by Mark Pilgrim \n\n\n\n\nStandard Data Types By Tutorialspoint\n\n\nThe data stored in memory can be of many types. For example, a person's age is stored as a numeric value and his or her address is stored as alphanumeric characters. Python has various standard data types that are used to define the operations possible on them and the storage method for each of them.\n\n\nPython has five standard data types : \n\n\n\n\n\n\nNumbers\n\n\n\n\n\n\nString\n\n\n\n\n\n\nList\n\n\n\n\n\n\nTuple\n\n\n\n\n\n\nDictionary\n\n\n\n\n\n\nPython Numbers\n\n\nNumber data types store numeric values. Number objects are created when you assign a value to them. For example \u2212\n\n\nvar1\n \n=\n \n1\n\n\nvar2\n \n=\n \n10\n\n\n\n\n\n\nYou can also delete the reference to a number object by using the del statement. The syntax of the del statement is \u2212\n\n\ndel\n \nvar1\n[,\nvar2\n[,\nvar3\n[\n....\n,\nvarN\n]]]]\n\n\n\n\n\n\nYou can delete a single object or multiple objects by using the del statement.\n\n\nFor example \u2212\n\n\ndel\n \nvar\n\n\ndel\n \nvar_a\n,\n \nvar_b\n\n\n\n\n\n\nPython supports three different numerical types \u2212\n- int (signed integers)\n\n\n\n\n\n\nfloat (floating point real values)\n\n\n\n\n\n\ncomplex (complex numbers)\n\n\n\n\n\n\nAll integers in Python3 are represented as long integers. Hence, there is no separate number type as long.\n\n\n\n\n\n\n\n\nint\n\n\nfloat\n\n\ncomplex\n\n\n\n\n\n\n\n\n\n\n10\n\n\n0.0\n\n\n3.14j\n\n\n\n\n\n\n100\n\n\n15.20\n\n\n45.j\n\n\n\n\n\n\n-786\n\n\n-21.9\n\n\n9.322e-36j\n\n\n\n\n\n\n\n\nA complex number consists of an ordered pair of real floating-point numbers denoted by x + yj, where x and y are real numbers and j is the imaginary unit.\n\n\nPython Strings\n\n\nStrings in Python are identified as a contiguous set of characters represented in the quotation marks. Python allows either pair of single or double quotes. Subsets of strings can be taken using the slice operator ([ ] and [:] ) with indexes starting at 0 in the beginning of the string and working their way from -1 to the end.\n\n\nThe plus (+) sign is the string concatenation operator and the asterisk (*) is the repetition operator. For example \u2212\n\n\n#!/usr/bin/python3\n\n\n\nstr\n \n=\n \nHello World!\n\n\n\nprint\n \n(\nstr\n)\n \n# Prints complete string\n\n\nprint\n \n(\nstr\n[\n0\n])\n \n# Prints first character of the string\n\n\nprint\n \n(\nstr\n[\n2\n:\n5\n])\n \n# Prints characters starting from 3rd to 5th\n\n\nprint\n \n(\nstr\n[\n2\n:])\n \n# Prints string starting from 3rd character\n\n\nprint\n \n(\nstr\n \n*\n \n2\n)\n \n# Prints string two times\n\n\nprint\n \n(\nstr\n \n+\n \nTEST\n)\n \n# Prints concatenated string\n\n\n\n\n\n\nThis will produce the following result \u2212\n\n\nHello\n \nWorld\n!\n\n\nH\n\n\nllo\n\n\nllo\n \nWorld\n!\n\n\nHello\n \nWorld\n!\nHello\n \nWorld\n!\n\n\nHello\n \nWorld\n!\nTEST\n\n\n\n\n\n\nPython Lists\n\n\nLists are the most versatile of Python's compound data types. A list contains items separated by commas and enclosed within square brackets ([]). To some extent, lists are similar to arrays in C. One of the differences between them is that all the items belonging to a list can be of different data type.\n\n\nThe values stored in a list can be accessed using the slice operator ([ ] and [:]) with indexes starting at 0 in the beginning of the list and working their way to end -1. The plus (+) sign is the list concatenation operator, and the asterisk (*) is the repetition operator. For example \u2212\n\n\n#!/usr/bin/python3\n\n\n\nlist\n \n=\n \n[\n \nabcd\n,\n \n786\n \n,\n \n2.23\n,\n \njohn\n,\n \n70.2\n \n]\n\n\ntinylist\n \n=\n \n[\n123\n,\n \njohn\n]\n\n\n\nprint\n \n(\nlist\n)\n \n# Prints complete list\n\n\nprint\n \n(\nlist\n[\n0\n])\n \n# Prints first element of the list\n\n\nprint\n \n(\nlist\n[\n1\n:\n3\n])\n \n# Prints elements starting from 2nd till 3rd \n\n\nprint\n \n(\nlist\n[\n2\n:])\n \n# Prints elements starting from 3rd element\n\n\nprint\n \n(\ntinylist\n \n*\n \n2\n)\n \n# Prints list two times\n\n\nprint\n \n(\nlist\n \n+\n \ntinylist\n)\n \n# Prints concatenated lists\n\n\n\n\n\n\nThis produces the following result \u2212\n\n\n[\nabcd\n,\n \n786\n,\n \n2.23\n,\n \njohn\n,\n \n70.200000000000003\n]\n\n\nabcd\n\n\n[\n786\n,\n \n2.23\n]\n\n\n[\n2.23\n,\n \njohn\n,\n \n70.200000000000003\n]\n\n\n[\n123\n,\n \njohn\n,\n \n123\n,\n \njohn\n]\n\n\n[\nabcd\n,\n \n786\n,\n \n2.23\n,\n \njohn\n,\n \n70.200000000000003\n,\n \n123\n,\n \njohn\n]\n\n\n\n\n\n\nPython Tuples\n\n\nA tuple is another sequence data type that is similar to the list. A tuple consists of a number of values separated by commas. Unlike lists, however, tuples are enclosed within parenthesis.\n\n\nThe main difference between lists and tuples are \u2212 Lists are enclosed in brackets ( [ ] ) and their elements and size can be changed, while tuples are enclosed in parentheses ( ( ) ) and cannot be updated. Tuples can be thought of as read-only lists. For example \u2212\n\n\n#!/usr/bin/python3\n\n\n\ntuple\n \n=\n \n(\n \nabcd\n,\n \n786\n \n,\n \n2.23\n,\n \njohn\n,\n \n70.2\n \n)\n\n\ntinytuple\n \n=\n \n(\n123\n,\n \njohn\n)\n\n\n\nprint\n \n(\ntuple\n)\n \n# Prints complete tuple\n\n\nprint\n \n(\ntuple\n[\n0\n])\n \n# Prints first element of the tuple\n\n\nprint\n \n(\ntuple\n[\n1\n:\n3\n])\n \n# Prints elements starting from 2nd till 3rd \n\n\nprint\n \n(\ntuple\n[\n2\n:])\n \n# Prints elements starting from 3rd element\n\n\nprint\n \n(\ntinytuple\n \n*\n \n2\n)\n \n# Prints tuple two times\n\n\nprint\n \n(\ntuple\n \n+\n \ntinytuple\n)\n \n# Prints concatenated tuple\n\n\n\n\n\n\nThis produces the following result \u2212\n\n\n(\nabcd\n,\n \n786\n,\n \n2.23\n,\n \njohn\n,\n \n70.200000000000003\n)\n\n\nabcd\n\n\n(\n786\n,\n \n2.23\n)\n\n\n(\n2.23\n,\n \njohn\n,\n \n70.200000000000003\n)\n\n\n(\n123\n,\n \njohn\n,\n \n123\n,\n \njohn\n)\n\n\n(\nabcd\n,\n \n786\n,\n \n2.23\n,\n \njohn\n,\n \n70.200000000000003\n,\n \n123\n,\n \njohn\n)\n\n\n\n\n\n\nThe following code is invalid with tuple, because we attempted to update a tuple, which is not allowed. Similar case is possible with lists \u2212\n\n\n#!/usr/bin/python3\n\n\n\ntuple\n \n=\n \n(\n \nabcd\n,\n \n786\n \n,\n \n2.23\n,\n \njohn\n,\n \n70.2\n \n)\n\n\nlist\n \n=\n \n[\n \nabcd\n,\n \n786\n \n,\n \n2.23\n,\n \njohn\n,\n \n70.2\n \n]\n\n\ntuple\n[\n2\n]\n \n=\n \n1000\n \n# Invalid syntax with tuple\n\n\nlist\n[\n2\n]\n \n=\n \n1000\n \n# Valid syntax with list\n\n\n\n\n\n\nPython Dictionary\n\n\nPython's dictionaries are kind of hash-table type. They work like associative arrays or hashes found in Perl and consist of key-value pairs. A dictionary key can be almost any Python type, but are usually numbers or strings. Values, on the other hand, can be any arbitrary Python object.\n\n\nDictionaries are enclosed by curly braces ({ }) and values can be assigned and accessed using square braces ([]). For example \u2212\n\n\n#!/usr/bin/python3\n\n\n\ndict\n \n=\n \n{}\n\n\ndict\n[\none\n]\n \n=\n \nThis is one\n\n\ndict\n[\n2\n]\n \n=\n \nThis is two\n\n\n\ntinydict\n \n=\n \n{\nname\n:\n \njohn\n,\ncode\n:\n6734\n,\n \ndept\n:\n \nsales\n}\n\n\n\n\nprint\n \n(\ndict\n[\none\n])\n \n# Prints value for \none\n key\n\n\nprint\n \n(\ndict\n[\n2\n])\n \n# Prints value for 2 key\n\n\nprint\n \n(\ntinydict\n)\n \n# Prints complete dictionary\n\n\nprint\n \n(\ntinydict\n.\nkeys\n())\n \n# Prints all the keys\n\n\nprint\n \n(\ntinydict\n.\nvalues\n())\n \n# Prints all the values\n\n\n\n\n\n\nThis produces the following result \u2212\n\n\nThis\n \nis\n \none\n\n\nThis\n \nis\n \ntwo\n\n\n{\nname\n:\n \njohn\n,\n \ndept\n:\n \nsales\n,\n \ncode\n:\n \n6734\n}\n\n\ndict_keys\n([\nname\n,\n \ndept\n,\n \ncode\n])\n\n\ndict_values\n([\njohn\n,\n \nsales\n,\n \n6734\n])\n\n\n\n\n\n\nDictionaries have no concept of order among the elements. It is incorrect to say that the elements are \"out of order\"; they are simply unordered.\n\n\n\n\nSource:\n \n\n\n https://www.tutorialspoint.com/python3/python_variable_types.htm", "title": "Data Types in Python 3" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#data-types-in-python-3", - "text": "", + "location": "/beginner/Data_Types_In_Python_3/#data-types-in-python-3", + "text": "", "title": "Data Types in Python 3" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#understanding-data-types-in-python-3", - "text": "", + "location": "/beginner/Data_Types_In_Python_3/#understanding-data-types-in-python-3", + "text": "", "title": "Understanding Data Types in Python 3" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#introduction", - "text": "In Python, like in all programming languages, data types are used to classify one particular type of data. This is important because the specific data type you use will determine what values you can assign to it and what you can do to it (including what operations you can perform on it). In this tutorial, we will go over the important data types native to Python. This is not an exhaustive investigation of data types, but will help you become familiar with what options you have available to you in Python.", + "location": "/beginner/Data_Types_In_Python_3/#introduction", + "text": "In Python, like in all programming languages, data types are used to classify one particular type of data. This is important because the specific data type you use will determine what values you can assign to it and what you can do to it (including what operations you can perform on it). In this tutorial, we will go over the important data types native to Python. This is not an exhaustive investigation of data types, but will help you become familiar with what options you have available to you in Python.", "title": "Introduction" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#background", - "text": "One way to think about data types is to consider the different types of data that we use in the real world. An example of data in the real world are numbers: we may use whole numbers (0, 1, 2, \u2026), integers (\u2026, -1, 0, 1, \u2026), and irrational numbers (\u03c0), for example. Usually, in math, we can combine numbers from different types, and get some kind of an answer. We may want to add 5 to \u03c0, for example: 5 + \u03c0 We can either keep the equation as the answer to account for the irrational number, or round \u03c0 to a number with a brief number of decimal places, and then add the numbers together: 5 + \u03c0 = 5 + 3.14 = 8.14 But, if we start to try to evaluate numbers with another data type, such as words, things start to make less sense. How would we solve for the following equation? sky + 8 For computers, each data type can be thought of as being quite different, like words and numbers, so we will have to be careful about how we use them to assign values and how we manipulate them through operations.", + "location": "/beginner/Data_Types_In_Python_3/#background", + "text": "One way to think about data types is to consider the different types of data that we use in the real world. An example of data in the real world are numbers: we may use whole numbers (0, 1, 2, \u2026), integers (\u2026, -1, 0, 1, \u2026), and irrational numbers (\u03c0), for example. Usually, in math, we can combine numbers from different types, and get some kind of an answer. We may want to add 5 to \u03c0, for example: 5 + \u03c0 We can either keep the equation as the answer to account for the irrational number, or round \u03c0 to a number with a brief number of decimal places, and then add the numbers together: 5 + \u03c0 = 5 + 3.14 = 8.14 But, if we start to try to evaluate numbers with another data type, such as words, things start to make less sense. How would we solve for the following equation? sky + 8 For computers, each data type can be thought of as being quite different, like words and numbers, so we will have to be careful about how we use them to assign values and how we manipulate them through operations.", "title": "Background" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#numbers", - "text": "Any number you enter in Python will be interpreted as a number; you are not required to declare what kind of data type you are entering. Python will consider any number written without decimals as an integer (as in 138 ) and any number written with decimals as a float (as in 138.0 ).", + "location": "/beginner/Data_Types_In_Python_3/#numbers", + "text": "Any number you enter in Python will be interpreted as a number; you are not required to declare what kind of data type you are entering. Python will consider any number written without decimals as an integer (as in 138 ) and any number written with decimals as a float (as in 138.0 ).", "title": "Numbers" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#integers", - "text": "Like in math , integers in computer programming are whole numbers that can be positive, negative, or 0 (\u2026, -1 , 0 , 1 , \u2026). An integer can also be known as an int . As with other programming languages, you should not use commas in numbers of four digits or more, so when you write 1,000 in your program, write it as 1000 . We can print out an integer in a simple way like this: print ( - 25 ) #Output : -25 Or, we can declare a variable , which in this case is essentially a symbol of the number we are using or manipulating, like so: my_int = - 25 print ( my_int ) #Output : -25 We can do math with integers in Python, too: int_ans = 116 - 68 print ( int_ans ) #Output : 48 Integers can be used in many ways within Python programs, and as you continue to learn more about the language you will have a lot of opportunities to work with integers and understand more about this data type.", + "location": "/beginner/Data_Types_In_Python_3/#integers", + "text": "Like in math , integers in computer programming are whole numbers that can be positive, negative, or 0 (\u2026, -1 , 0 , 1 , \u2026). An integer can also be known as an int . As with other programming languages, you should not use commas in numbers of four digits or more, so when you write 1,000 in your program, write it as 1000 . We can print out an integer in a simple way like this: print ( - 25 ) #Output : -25 Or, we can declare a variable , which in this case is essentially a symbol of the number we are using or manipulating, like so: my_int = - 25 print ( my_int ) #Output : -25 We can do math with integers in Python, too: int_ans = 116 - 68 print ( int_ans ) #Output : 48 Integers can be used in many ways within Python programs, and as you continue to learn more about the language you will have a lot of opportunities to work with integers and understand more about this data type.", "title": "Integers" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#floating-point-numbers", - "text": "A floating-point number or a float is a real number, meaning that it can be either a rational or an irrational number. Because of this, floating-point numbers can be numbers that can contain a fractional part, such as 9.0 or -116.42 . Simply speaking, for the purposes of thinking of a float in a Python program, it is a number that contains a decimal point. Like we did with the integer, we can print out a floating-point number in a simple way like this: print ( 17.3 ) #Output : 17.3 We can also declare a variable that stands in for a float, like so: my_flt = 17.3 print ( my_flt ) #Output : 17.3 And, just like with integers, we can do math with floats in Python, too: flt_ans = 564.0 + 365.24 print ( flt_ans ) #Output : 929.24 With integers and floating-point numbers, it is important to keep in mind that 3 \u2260 3.0, as 3 refers to an integer while 3.0 refers to a float.", + "location": "/beginner/Data_Types_In_Python_3/#floating-point-numbers", + "text": "A floating-point number or a float is a real number, meaning that it can be either a rational or an irrational number. Because of this, floating-point numbers can be numbers that can contain a fractional part, such as 9.0 or -116.42 . Simply speaking, for the purposes of thinking of a float in a Python program, it is a number that contains a decimal point. Like we did with the integer, we can print out a floating-point number in a simple way like this: print ( 17.3 ) #Output : 17.3 We can also declare a variable that stands in for a float, like so: my_flt = 17.3 print ( my_flt ) #Output : 17.3 And, just like with integers, we can do math with floats in Python, too: flt_ans = 564.0 + 365.24 print ( flt_ans ) #Output : 929.24 With integers and floating-point numbers, it is important to keep in mind that 3 \u2260 3.0, as 3 refers to an integer while 3.0 refers to a float.", "title": "Floating-Point Numbers" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#booleans", - "text": "The Boolean data type can be one of two values, either True or False . Booleans are used to represent the truth values that are associated with the logic branch of mathematics, which informs algorithms in computer science. Whenever you see the data type Boolean, it will start with a capitalized B because it is named for the mathematician George Boole. The values True and False will also always be with a capital T and F respectively, as they are special values in Python. Many operations in math give us answers that evaluate to either True or False: * ** greater than ** \n * 500 100 `True` \n * 1 5 `False` * ** less than ** \n * 200 400 `True` \n * 4 2 `False` * ** equal ** \n * 5 = 5 `True` \n * 500 = 400 `False` Like with numbers, we can store a Boolean value in a variable: my_bool = 5 8 We can then print the Boolean value with a call to the print() function: print ( my_bool ) Since 5 is not greater than 8, we will receive the following #Output : : #Output : False As you write more programs in Python, you will become more familiar with how Booleans work and how different functions and operations evaluating to either True or False can change the course of the program.", + "location": "/beginner/Data_Types_In_Python_3/#booleans", + "text": "The Boolean data type can be one of two values, either True or False . Booleans are used to represent the truth values that are associated with the logic branch of mathematics, which informs algorithms in computer science. Whenever you see the data type Boolean, it will start with a capitalized B because it is named for the mathematician George Boole. The values True and False will also always be with a capital T and F respectively, as they are special values in Python. Many operations in math give us answers that evaluate to either True or False: * ** greater than ** \n * 500 100 `True` \n * 1 5 `False` * ** less than ** \n * 200 400 `True` \n * 4 2 `False` * ** equal ** \n * 5 = 5 `True` \n * 500 = 400 `False` Like with numbers, we can store a Boolean value in a variable: my_bool = 5 8 We can then print the Boolean value with a call to the print() function: print ( my_bool ) Since 5 is not greater than 8, we will receive the following #Output : : #Output : False As you write more programs in Python, you will become more familiar with how Booleans work and how different functions and operations evaluating to either True or False can change the course of the program.", "title": "Booleans" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#strings", - "text": "A string is a sequence of one or more characters (letters, numbers, symbols) that can be either a constant or a variable. Strings exist within either single quotes ' or double quotes \" in Python, so to create a string, enclose a sequence of characters in quotes: This is a string in single quotes. This is a string in double quotes. You can choose to use either single quotes or double quotes, but whichever you decide on you should be consistent within a program. The simple program \u201c Hello, World! \u201d demonstrates how a string can be used in computer programming, as the characters that make up the phrase Hello, World! are a string. print ( Hello, World! ) As with other data types, we can store strings in variables: hw = Hello, World! And print out the string by calling the variable: print ( hw ) #Ouput : Hello, World! Like numbers, there are many operations that we can perform on strings within our programs in order to manipulate them to achieve the results we are seeking. Strings are important for communicating information to the user, and for the user to communicate information back to the program.", + "location": "/beginner/Data_Types_In_Python_3/#strings", + "text": "A string is a sequence of one or more characters (letters, numbers, symbols) that can be either a constant or a variable. Strings exist within either single quotes ' or double quotes \" in Python, so to create a string, enclose a sequence of characters in quotes: This is a string in single quotes. This is a string in double quotes. You can choose to use either single quotes or double quotes, but whichever you decide on you should be consistent within a program. The simple program \u201c Hello, World! \u201d demonstrates how a string can be used in computer programming, as the characters that make up the phrase Hello, World! are a string. print ( Hello, World! ) As with other data types, we can store strings in variables: hw = Hello, World! And print out the string by calling the variable: print ( hw ) #Ouput : Hello, World! Like numbers, there are many operations that we can perform on strings within our programs in order to manipulate them to achieve the results we are seeking. Strings are important for communicating information to the user, and for the user to communicate information back to the program.", "title": "Strings" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#lists", - "text": "A list is a mutable, or changeable, ordered sequence of elements. Each element or value that is inside of a list is called an item . Just as strings are defined as characters between quotes, lists are defined by having values between square brackets [ ] . A list of integers looks like this: [ - 3 , - 2 , - 1 , 0 , 1 , 2 , 3 ] A list of floats looks like this: [ 3.14 , 9.23 , 111.11 , 312.12 , 1.05 ] A list of strings: [ shark , cuttlefish , squid , mantis shrimp ] If we define our string list as sea_creatures : sea_creatures = [ shark , cuttlefish , squid , mantis shrimp ] We can print them out by calling the variable: print ( sea_creatures ) And we see that the #Output : looks exactly like the list that we created: #Output : [ shark , cuttlefish , squid , mantis shrimp ] Lists are a very flexible data type because they are mutable in that they can have values added, removed, and changed. There is a data type that is similar to lists but that can\u2019t be changed, and that is called a tuple.", + "location": "/beginner/Data_Types_In_Python_3/#lists", + "text": "A list is a mutable, or changeable, ordered sequence of elements. Each element or value that is inside of a list is called an item . Just as strings are defined as characters between quotes, lists are defined by having values between square brackets [ ] . A list of integers looks like this: [ - 3 , - 2 , - 1 , 0 , 1 , 2 , 3 ] A list of floats looks like this: [ 3.14 , 9.23 , 111.11 , 312.12 , 1.05 ] A list of strings: [ shark , cuttlefish , squid , mantis shrimp ] If we define our string list as sea_creatures : sea_creatures = [ shark , cuttlefish , squid , mantis shrimp ] We can print them out by calling the variable: print ( sea_creatures ) And we see that the #Output : looks exactly like the list that we created: #Output : [ shark , cuttlefish , squid , mantis shrimp ] Lists are a very flexible data type because they are mutable in that they can have values added, removed, and changed. There is a data type that is similar to lists but that can\u2019t be changed, and that is called a tuple.", "title": "Lists" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#tuples", - "text": "A tuple is used for grouping data. It is an immutable, or unchangeable, ordered sequence of elements. Tuples are very similar to lists, but they use parentheses ( ) instead of square brackets and because they are immutable their values cannot be modified. A tuple looks like this: ( blue coral , staghorn coral , pillar coral ) We can store a tuple in a variable and print it out: coral = ( blue coral , staghorn coral , pillar coral ) print ( coral ) Ouput ( blue coral , staghorn coral , pillar coral ) Like in the other data types, Python prints out the tuple just as we had typed it, with parentheses containing a sequence of values.", + "location": "/beginner/Data_Types_In_Python_3/#tuples", + "text": "A tuple is used for grouping data. It is an immutable, or unchangeable, ordered sequence of elements. Tuples are very similar to lists, but they use parentheses ( ) instead of square brackets and because they are immutable their values cannot be modified. A tuple looks like this: ( blue coral , staghorn coral , pillar coral ) We can store a tuple in a variable and print it out: coral = ( blue coral , staghorn coral , pillar coral ) print ( coral ) Ouput ( blue coral , staghorn coral , pillar coral ) Like in the other data types, Python prints out the tuple just as we had typed it, with parentheses containing a sequence of values.", "title": "Tuples" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#dictionaries", - "text": "The dictionary is Python\u2019s built-in mapping type. This means that dictionaries map keys to values and these key-value pairs are a useful way to store data in Python. A dictionary is constructed with curly braces on either side { } . Typically used to hold data that are related, such as the information contained in an ID, a dictionary looks like this: { name : Sammy , animal : shark , color : blue , location : ocean } You will notice that in addition to the curly braces, there are also colons throughout the dictionary. The words to the left of the colons are the keys. Keys can be made up of any immutable data type. The keys in the dictionary above are: 'name', 'animal', 'color', 'location' . The words to the right of the colons are the values. Values can be comprised of any data type. The values in the dictionary above are: 'Sammy', 'shark', 'blue', 'ocean' . Like the other data types, let\u2019s store the dictionary inside a variable, and print it out: sammy = { name : Sammy , animal : shark , color : blue , location : ocean } #Ouput : { color : blue , animal : shark , name : Sammy , location : ocean } If we want to isolate Sammy\u2019s color, we can do so by calling sammy['color'] . Let\u2019s print that out: print ( sammy [ color ]) #Output : blue As dictionaries offer key-value pairs for storing data, they can be important elements in your Python program.", + "location": "/beginner/Data_Types_In_Python_3/#dictionaries", + "text": "The dictionary is Python\u2019s built-in mapping type. This means that dictionaries map keys to values and these key-value pairs are a useful way to store data in Python. A dictionary is constructed with curly braces on either side { } . Typically used to hold data that are related, such as the information contained in an ID, a dictionary looks like this: { name : Sammy , animal : shark , color : blue , location : ocean } You will notice that in addition to the curly braces, there are also colons throughout the dictionary. The words to the left of the colons are the keys. Keys can be made up of any immutable data type. The keys in the dictionary above are: 'name', 'animal', 'color', 'location' . The words to the right of the colons are the values. Values can be comprised of any data type. The values in the dictionary above are: 'Sammy', 'shark', 'blue', 'ocean' . Like the other data types, let\u2019s store the dictionary inside a variable, and print it out: sammy = { name : Sammy , animal : shark , color : blue , location : ocean } #Ouput : { color : blue , animal : shark , name : Sammy , location : ocean } If we want to isolate Sammy\u2019s color, we can do so by calling sammy['color'] . Let\u2019s print that out: print ( sammy [ color ]) #Output : blue As dictionaries offer key-value pairs for storing data, they can be important elements in your Python program.", "title": "Dictionaries" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#conclusion", - "text": "At this point, you should have a better understanding of some of the major data types that are available for you to use in Python. Each of these data types will become important as you develop programming projects in the Python language. You can learn about each of the data types above in more detail by reading the following specific tutorials: Numbers Booleans Strings Lists Tuples Dictionaries Once you have a solid grasp of data types available to you in Python, you can learn how to convert data types . Source: https://www.digitalocean.com/community/tutorials/understanding-data-types-in-python-3", + "location": "/beginner/Data_Types_In_Python_3/#conclusion", + "text": "At this point, you should have a better understanding of some of the major data types that are available for you to use in Python. Each of these data types will become important as you develop programming projects in the Python language. You can learn about each of the data types above in more detail by reading the following specific tutorials: Numbers Booleans Strings Lists Tuples Dictionaries Once you have a solid grasp of data types available to you in Python, you can learn how to convert data types . Source: https://www.digitalocean.com/community/tutorials/understanding-data-types-in-python-3", "title": "Conclusion" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#native-datatypes-by-dive-into-python-3", - "text": "Source: Dive into Python 3 by Mark Pilgrim", + "location": "/beginner/Data_Types_In_Python_3/#native-datatypes-by-dive-into-python-3", + "text": "Source: Dive into Python 3 by Mark Pilgrim", "title": "Native Datatypes By Dive Into Python 3" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#standard-data-types-by-tutorialspoint", - "text": "The data stored in memory can be of many types. For example, a person's age is stored as a numeric value and his or her address is stored as alphanumeric characters. Python has various standard data types that are used to define the operations possible on them and the storage method for each of them. Python has five standard data types : Numbers String List Tuple Dictionary", + "location": "/beginner/Data_Types_In_Python_3/#standard-data-types-by-tutorialspoint", + "text": "The data stored in memory can be of many types. For example, a person's age is stored as a numeric value and his or her address is stored as alphanumeric characters. Python has various standard data types that are used to define the operations possible on them and the storage method for each of them. Python has five standard data types : Numbers String List Tuple Dictionary", "title": "Standard Data Types By Tutorialspoint" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#python-numbers", - "text": "Number data types store numeric values. Number objects are created when you assign a value to them. For example \u2212 var1 = 1 var2 = 10 You can also delete the reference to a number object by using the del statement. The syntax of the del statement is \u2212 del var1 [, var2 [, var3 [ .... , varN ]]]] You can delete a single object or multiple objects by using the del statement. For example \u2212 del var del var_a , var_b Python supports three different numerical types \u2212\n- int (signed integers) float (floating point real values) complex (complex numbers) All integers in Python3 are represented as long integers. Hence, there is no separate number type as long. int float complex 10 0.0 3.14j 100 15.20 45.j -786 -21.9 9.322e-36j A complex number consists of an ordered pair of real floating-point numbers denoted by x + yj, where x and y are real numbers and j is the imaginary unit.", + "location": "/beginner/Data_Types_In_Python_3/#python-numbers", + "text": "Number data types store numeric values. Number objects are created when you assign a value to them. For example \u2212 var1 = 1 var2 = 10 You can also delete the reference to a number object by using the del statement. The syntax of the del statement is \u2212 del var1 [, var2 [, var3 [ .... , varN ]]]] You can delete a single object or multiple objects by using the del statement. For example \u2212 del var del var_a , var_b Python supports three different numerical types \u2212\n- int (signed integers) float (floating point real values) complex (complex numbers) All integers in Python3 are represented as long integers. Hence, there is no separate number type as long. int float complex 10 0.0 3.14j 100 15.20 45.j -786 -21.9 9.322e-36j A complex number consists of an ordered pair of real floating-point numbers denoted by x + yj, where x and y are real numbers and j is the imaginary unit.", "title": "Python Numbers" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#python-strings", - "text": "Strings in Python are identified as a contiguous set of characters represented in the quotation marks. Python allows either pair of single or double quotes. Subsets of strings can be taken using the slice operator ([ ] and [:] ) with indexes starting at 0 in the beginning of the string and working their way from -1 to the end. The plus (+) sign is the string concatenation operator and the asterisk (*) is the repetition operator. For example \u2212 #!/usr/bin/python3 str = Hello World! print ( str ) # Prints complete string print ( str [ 0 ]) # Prints first character of the string print ( str [ 2 : 5 ]) # Prints characters starting from 3rd to 5th print ( str [ 2 :]) # Prints string starting from 3rd character print ( str * 2 ) # Prints string two times print ( str + TEST ) # Prints concatenated string This will produce the following result \u2212 Hello World ! H llo llo World ! Hello World ! Hello World ! Hello World ! TEST", + "location": "/beginner/Data_Types_In_Python_3/#python-strings", + "text": "Strings in Python are identified as a contiguous set of characters represented in the quotation marks. Python allows either pair of single or double quotes. Subsets of strings can be taken using the slice operator ([ ] and [:] ) with indexes starting at 0 in the beginning of the string and working their way from -1 to the end. The plus (+) sign is the string concatenation operator and the asterisk (*) is the repetition operator. For example \u2212 #!/usr/bin/python3 str = Hello World! print ( str ) # Prints complete string print ( str [ 0 ]) # Prints first character of the string print ( str [ 2 : 5 ]) # Prints characters starting from 3rd to 5th print ( str [ 2 :]) # Prints string starting from 3rd character print ( str * 2 ) # Prints string two times print ( str + TEST ) # Prints concatenated string This will produce the following result \u2212 Hello World ! H llo llo World ! Hello World ! Hello World ! Hello World ! TEST", "title": "Python Strings" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#python-lists", - "text": "Lists are the most versatile of Python's compound data types. A list contains items separated by commas and enclosed within square brackets ([]). To some extent, lists are similar to arrays in C. One of the differences between them is that all the items belonging to a list can be of different data type. The values stored in a list can be accessed using the slice operator ([ ] and [:]) with indexes starting at 0 in the beginning of the list and working their way to end -1. The plus (+) sign is the list concatenation operator, and the asterisk (*) is the repetition operator. For example \u2212 #!/usr/bin/python3 list = [ abcd , 786 , 2.23 , john , 70.2 ] tinylist = [ 123 , john ] print ( list ) # Prints complete list print ( list [ 0 ]) # Prints first element of the list print ( list [ 1 : 3 ]) # Prints elements starting from 2nd till 3rd print ( list [ 2 :]) # Prints elements starting from 3rd element print ( tinylist * 2 ) # Prints list two times print ( list + tinylist ) # Prints concatenated lists This produces the following result \u2212 [ abcd , 786 , 2.23 , john , 70.200000000000003 ] abcd [ 786 , 2.23 ] [ 2.23 , john , 70.200000000000003 ] [ 123 , john , 123 , john ] [ abcd , 786 , 2.23 , john , 70.200000000000003 , 123 , john ]", + "location": "/beginner/Data_Types_In_Python_3/#python-lists", + "text": "Lists are the most versatile of Python's compound data types. A list contains items separated by commas and enclosed within square brackets ([]). To some extent, lists are similar to arrays in C. One of the differences between them is that all the items belonging to a list can be of different data type. The values stored in a list can be accessed using the slice operator ([ ] and [:]) with indexes starting at 0 in the beginning of the list and working their way to end -1. The plus (+) sign is the list concatenation operator, and the asterisk (*) is the repetition operator. For example \u2212 #!/usr/bin/python3 list = [ abcd , 786 , 2.23 , john , 70.2 ] tinylist = [ 123 , john ] print ( list ) # Prints complete list print ( list [ 0 ]) # Prints first element of the list print ( list [ 1 : 3 ]) # Prints elements starting from 2nd till 3rd print ( list [ 2 :]) # Prints elements starting from 3rd element print ( tinylist * 2 ) # Prints list two times print ( list + tinylist ) # Prints concatenated lists This produces the following result \u2212 [ abcd , 786 , 2.23 , john , 70.200000000000003 ] abcd [ 786 , 2.23 ] [ 2.23 , john , 70.200000000000003 ] [ 123 , john , 123 , john ] [ abcd , 786 , 2.23 , john , 70.200000000000003 , 123 , john ]", "title": "Python Lists" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#python-tuples", - "text": "A tuple is another sequence data type that is similar to the list. A tuple consists of a number of values separated by commas. Unlike lists, however, tuples are enclosed within parenthesis. The main difference between lists and tuples are \u2212 Lists are enclosed in brackets ( [ ] ) and their elements and size can be changed, while tuples are enclosed in parentheses ( ( ) ) and cannot be updated. Tuples can be thought of as read-only lists. For example \u2212 #!/usr/bin/python3 tuple = ( abcd , 786 , 2.23 , john , 70.2 ) tinytuple = ( 123 , john ) print ( tuple ) # Prints complete tuple print ( tuple [ 0 ]) # Prints first element of the tuple print ( tuple [ 1 : 3 ]) # Prints elements starting from 2nd till 3rd print ( tuple [ 2 :]) # Prints elements starting from 3rd element print ( tinytuple * 2 ) # Prints tuple two times print ( tuple + tinytuple ) # Prints concatenated tuple This produces the following result \u2212 ( abcd , 786 , 2.23 , john , 70.200000000000003 ) abcd ( 786 , 2.23 ) ( 2.23 , john , 70.200000000000003 ) ( 123 , john , 123 , john ) ( abcd , 786 , 2.23 , john , 70.200000000000003 , 123 , john ) The following code is invalid with tuple, because we attempted to update a tuple, which is not allowed. Similar case is possible with lists \u2212 #!/usr/bin/python3 tuple = ( abcd , 786 , 2.23 , john , 70.2 ) list = [ abcd , 786 , 2.23 , john , 70.2 ] tuple [ 2 ] = 1000 # Invalid syntax with tuple list [ 2 ] = 1000 # Valid syntax with list", + "location": "/beginner/Data_Types_In_Python_3/#python-tuples", + "text": "A tuple is another sequence data type that is similar to the list. A tuple consists of a number of values separated by commas. Unlike lists, however, tuples are enclosed within parenthesis. The main difference between lists and tuples are \u2212 Lists are enclosed in brackets ( [ ] ) and their elements and size can be changed, while tuples are enclosed in parentheses ( ( ) ) and cannot be updated. Tuples can be thought of as read-only lists. For example \u2212 #!/usr/bin/python3 tuple = ( abcd , 786 , 2.23 , john , 70.2 ) tinytuple = ( 123 , john ) print ( tuple ) # Prints complete tuple print ( tuple [ 0 ]) # Prints first element of the tuple print ( tuple [ 1 : 3 ]) # Prints elements starting from 2nd till 3rd print ( tuple [ 2 :]) # Prints elements starting from 3rd element print ( tinytuple * 2 ) # Prints tuple two times print ( tuple + tinytuple ) # Prints concatenated tuple This produces the following result \u2212 ( abcd , 786 , 2.23 , john , 70.200000000000003 ) abcd ( 786 , 2.23 ) ( 2.23 , john , 70.200000000000003 ) ( 123 , john , 123 , john ) ( abcd , 786 , 2.23 , john , 70.200000000000003 , 123 , john ) The following code is invalid with tuple, because we attempted to update a tuple, which is not allowed. Similar case is possible with lists \u2212 #!/usr/bin/python3 tuple = ( abcd , 786 , 2.23 , john , 70.2 ) list = [ abcd , 786 , 2.23 , john , 70.2 ] tuple [ 2 ] = 1000 # Invalid syntax with tuple list [ 2 ] = 1000 # Valid syntax with list", "title": "Python Tuples" - }, + }, { - "location": "/beginner/Data_Types_In_Python_3/#python-dictionary", - "text": "Python's dictionaries are kind of hash-table type. They work like associative arrays or hashes found in Perl and consist of key-value pairs. A dictionary key can be almost any Python type, but are usually numbers or strings. Values, on the other hand, can be any arbitrary Python object. Dictionaries are enclosed by curly braces ({ }) and values can be assigned and accessed using square braces ([]). For example \u2212 #!/usr/bin/python3 dict = {} dict [ one ] = This is one dict [ 2 ] = This is two tinydict = { name : john , code : 6734 , dept : sales } print ( dict [ one ]) # Prints value for one key print ( dict [ 2 ]) # Prints value for 2 key print ( tinydict ) # Prints complete dictionary print ( tinydict . keys ()) # Prints all the keys print ( tinydict . values ()) # Prints all the values This produces the following result \u2212 This is one This is two { name : john , dept : sales , code : 6734 } dict_keys ([ name , dept , code ]) dict_values ([ john , sales , 6734 ]) Dictionaries have no concept of order among the elements. It is incorrect to say that the elements are \"out of order\"; they are simply unordered. Source: https://www.tutorialspoint.com/python3/python_variable_types.htm", + "location": "/beginner/Data_Types_In_Python_3/#python-dictionary", + "text": "Python's dictionaries are kind of hash-table type. They work like associative arrays or hashes found in Perl and consist of key-value pairs. A dictionary key can be almost any Python type, but are usually numbers or strings. Values, on the other hand, can be any arbitrary Python object. Dictionaries are enclosed by curly braces ({ }) and values can be assigned and accessed using square braces ([]). For example \u2212 #!/usr/bin/python3 dict = {} dict [ one ] = This is one dict [ 2 ] = This is two tinydict = { name : john , code : 6734 , dept : sales } print ( dict [ one ]) # Prints value for one key print ( dict [ 2 ]) # Prints value for 2 key print ( tinydict ) # Prints complete dictionary print ( tinydict . keys ()) # Prints all the keys print ( tinydict . values ()) # Prints all the values This produces the following result \u2212 This is one This is two { name : john , dept : sales , code : 6734 } dict_keys ([ name , dept , code ]) dict_values ([ john , sales , 6734 ]) Dictionaries have no concept of order among the elements. It is incorrect to say that the elements are \"out of order\"; they are simply unordered. Source: https://www.tutorialspoint.com/python3/python_variable_types.htm", "title": "Python Dictionary" - }, + }, { - "location": "/beginner/Variables_And_Assignment/", - "text": "Variables and Assignment\n\n\nVariables are named locations which are used to store references to the object stored in memory. The names we choose for variables and functions are commonly known as Identifiers. In python Identifiers must obey the following rules.\n\n\n\n\nAll identifiers must start with letter or underscore ( _ ) , you\n can\u2019t use digits. For e.g my_var is valid identifier while 1digit \n is not.\n\n\nIdentifiers can contain letters, digits and underscores ( _ ). \n\n\nThey can be of any length.\n\n\n\n\nIdentifier can\u2019t be a keyword (keywords are reserved words that\n Python uses for special purpose).Following are Keywords in python 3.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nand\n\n\nexec\n\n\nnot\n\n\n\n\n\n\nas\n\n\nfinally\n\n\nor\n\n\n\n\n\n\nassert\n\n\nfor\n\n\npass\n\n\n\n\n\n\nbreak\n\n\nfrom\n\n\nprint\n\n\n\n\n\n\nclass\n\n\nglobal\n\n\nraise\n\n\n\n\n\n\ncontinue\n\n\nif\n\n\nreturn\n\n\n\n\n\n\ndef\n\n\nimport\n\n\ntry\n\n\n\n\n\n\ndel\n\n\nin\n\n\nwhile\n\n\n\n\n\n\nelif\n\n\nis\n\n\nwith\n\n\n\n\n\n\nelse\n\n\nlambda\n\n\nyield\n\n\n\n\n\n\nexcept\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nAssigning Values to Variables\n\n\nValues are basic things that programs works with. For e.g 1 , 11 , 3.14 , \"hello\" are all values. In programming terminology they are also commonly known as literals. Literals can be of different type for e.g 1 , 11 are of type int , 3.14 is float and \"hello\" is string . Remember in python everything is object even basic data types like int, float, string, we will elaborate more on this in later chapters.\n\n\nIn python you don\u2019t need to declare types of variable ahead of time. Interpreter automatically detects the type of the variable by the data it contains. To assign value to a variable equal sign ( = ) is used. = is also known as assignment operator.\n\n\nFollowing are some examples of variable declaration:\n\n\nx\n \n=\n \n100\n \n# x is integer\n\n\npi\n \n=\n \n3.14\n \n# pi is float\n\n\nempname\n \n=\n \npython is great\n \n# empname is string\n\n\n\na\n \n=\n \nb\n \n=\n \nc\n \n=\n \n100\n \n# this statement assign 100 to c, b and a.\n\n\n\n\n\n\n\n\nNote:\n\nIn the above code x stores reference to the 100 ( which is an int object ) , x don\u2019t store 100 itself.\n\n\n\n\nIn Python comments are preceded by a pound sign ( # ). Comments are not programming statements that python interpreter executes while running the program. Comments are used by programmers to remind themselves how the program works. They are also used to write program documentation.\n\n\n#display hello world\n\n\nprint\n(\nhello world\n)\n\n\n\n\n\n\nSimultaneous Assignments\n\n\nPython allow simultaneous assignment syntax like this:\n\n\nvar1\n,\n \nvar2\n,\n \n...\n,\n \nvarn\n \n=\n \nexp1\n,\n \nexp2\n,\n \n...\n,\n \nexpn\n\n\n\n\n\n\nthis statements tells the python to evaluate all the expression on the right and assign them to the corresponding variables on the left. Simultaneous Assignments is helpful to swap values of two variables. For e.g\n\n\n \nx\n \n=\n \n1\n\n\n \ny\n \n=\n \n2\n\n\n\n \ny\n,\n \nx\n \n=\n \nx\n,\n \ny\n \n# assign y value to x and x value to y\n\n\n\n\n\n\nPython Data Types\n\n\nPython has 5 standard data types namely.\n\na) \nNumbers\n\nb) \nString\n\nc) \nList\n\nd) \nTuple\n\ne) \nDictionary\n\nf) Boolean \u2013 In Python True and False are boolean literals. But the following values are also considered as false.\n\n\n[] \u2013 empty list , () \u2013 empty tuple , {} \u2013 empty dictionary\n \n\n\nReceiving input from Console\n\n\ninput() function is used to receive input from the console.\n\n\nSyntax: input([prompt]) -\n string\n\n\ninput() function accepts an optional string argument called prompt and returns a string.\n\n\n \nname\n \n=\n \ninput\n(\nEnter your name: \n)\n\n\n \nEnter\n \nyour\n \nname\n:\n \ntim\n\n\n \nname\n\n\ntim\n\n\n\n\n\n\nNote that input() returns string even if you enter a number, to convert it to an integer you can use int() or eval() .\n\n\n \nage\n \n=\n \nint\n(\ninput\n(\nEnter your age: \n))\n\n\nEnter\n \nyour\n \nage\n:\n \n22\n\n\n \nage\n\n\n22\n\n\n \ntype\n(\nage\n)\n\n\nclass\n \nint\n\n\n\n\n\n\n\n\nSource:\n \n\n\n http://thepythonguru.com\n\n\n\n\nUnderstanding Python variables and Memory Management\n\n\nHave you ever noticed any difference between variables in Python and C? For example, when you do an assignment like the following in C, it actually creates a block of memory space so that it can hold the value for that variable\n\n\nint\n \na\n \n=\n \n1\n;\n\n\n\n\n\n\nYou can think of it as putting the value assigned in a box with the variable name as shown below.\n\n\n\nAnd for all the variables you create a new box is created with the variable name to hold the value. If you change the value of the variable the box will be updated with the new value. That means doing\n\n\na\n \n=\n \n2\n;\n\n\n\n\n\n\nwill result in\n\n\n\n\nAssigning one variable to another makes a copy of the value and put that value in the new box.\n\n\nint\n \nb\n \n=\n \na\n;\n\n\n\n\n\n\n \n\n\nBut in Python variables work more like tags unlike the boxes you have seen before. When you do an assignment in Python, it tags the value with the variable name.\n\n\na\n \n=\n \n1\n\n\n\n\n\n\n\n\nand if you change the value of the varaible, it just changes the tag to the new value in memory. You dont need to do the housekeeping job of freeing the memory here. Python's Automatic Garbage Collection does it for you. When a value is without names/tags it is automatically removed from memory.\n\n\na\n \n=\n \n2\n\n\n\n\n\n\n\n\nAssigning one variable to another makes a new tag bound to the same value as show below.\n\n\nb\n \n=\n \na\n\n\n\n\n\n\n\nOther languages have 'variables'. Python has 'names'.\n\n\nA bit about Python's memory management\n\n\nAs you have seen before, a value will have only one copy in memory and all the variables having this value will refer to this memory location. For example when you have variables a, b, c having a value 10, it doesn't mean that there will be 3 copy of 10s in memory. There will be only one 10 and all the variables a, b, c will point to this value. Once a variable is updated, say you are doing a += 1 a new value 11 will be allocated in memory and a will be pointing to this.\n\n\nLet's check this behaviour with Python Interpreter. Start the Python Shell and try the following for yourselves.\n\n\n \na\n \n=\n \n10\n\n\n \nb\n \n=\n \n10\n\n\n \nc\n \n=\n \n10\n\n\n \nid\n(\na\n),\n \nid\n(\nb\n),\n \nid\n(\nc\n)\n\n\n(\n140621897573616\n,\n \n140621897573616\n,\n \n140621897573616\n)\n\n\n \na\n \n+=\n \n1\n\n\n \nid\n(\na\n)\n\n\n140621897573592\n\n\n\n\n\n\nid() will return an objects memory address (object's identity). As you have noticed, when you assign the same integer value to the variables, we see the same ids. But this assumption does not hold true all the time. See the following for example\n\n\n \nx\n \n=\n \n500\n\n\n \ny\n \n=\n \n500\n\n\n \nid\n(\nx\n)\n\n\n4338740848\n\n\n \nid\n(\ny\n)\n\n\n4338741040\n\n\n\n\n\n\nWhat happened here? Even after assigning the same integer values to different variable names, we are getting two different ids here. These are actually the effects of CPython optimization we are observing here. CPython implementation keeps an array of integer objects for all integers between -5 and 256. So when we create an integer in that range, they simply back reference to the existing object. You may refer the following \nlinks\n for more information.\n\n\nLet's take a look at strings now.\n\n\n \ns1\n \n=\n \nhello\n\n\n \ns2\n \n=\n \nhello\n\n\n \nid\n(\ns1\n),\n \nid\n(\ns2\n)\n\n\n(\n4454725888\n,\n \n4454725888\n)\n\n\n \ns1\n \n==\n \ns2\n\n\nTrue\n\n\n \ns1\n \nis\n \ns2\n\n\nTrue\n\n\n \ns3\n \n=\n \nhello, world!\n\n\n \ns4\n \n=\n \nhello, world!\n\n\n \nid\n(\ns3\n),\n \nid\n(\ns4\n)\n\n\n(\n4454721608\n,\n \n4454721664\n)\n\n\n \ns3\n \n==\n \ns4\n\n\nTrue\n\n\n \ns3\n \nis\n \ns4\n\n\nFalse\n\n\n\n\n\n\nLooks interesting, isn't it? When the string was a simple and shorter one the variable names where referring to the same object in memory. But when they became bigger, this was not the case. This is called interning, and Python does interning (to some extent) of shorter string literals (as in s1 and s2) which are created at compile time. But in general, Python string literals creates a new string object each time (as in s3 and s4). Interning is runtime dependant and is always a trade-off between memory use and the cost of checking if you are creating the same string. There's a built-in intern() function to forcefully apply interning. Read more about interning from the following links.\n\n\nStack Overflow: Does Python intern Strings?\n\n\nStack Overflow: Python String Interning\n\n\nInternals of Python String Interning\n\n\n\n\nSource:\n \n\n\n http://foobarnbaz.com/2012/07/08/understanding-python-variables/\n\n\n\n\nAssignment statements in Python are more interesting than you might think\n\n\nIn this article, we will take a deep look at three kinds of assignment statements in Python and discuss what\u2019s going on under the hood.\n\n\n \nmy_string\n \n=\n \nHello World\n \n# right hand side is a simple expression\n\n\n \nanother_string\n \n=\n \nmy_string\n \n# right hand side is another variable\n\n\n \nanother_string\n \n=\n \nanother_string\n \n+\n \n!\n \n# right hand side is an operation\n\n\n\n\n\n\nWhat we find may surprise you.\n\n\nWhat happens when the right hand side is a simple expression?\n\n\n \nmy_string\n \n=\n \nHello World\n\n\n\n\n\n\nIn simple terms, this creates a string \u201cHello World\u201d in memory and assigns the name my_string to it. If you are using CPython[1], then we can even check the memory address explicitly by using the built in function id .\n\n\n \nmy_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n \n\n \nid\n(\nmy_string\n)\n\n\n140400709562064\n\n\n\n\n\n\nThat big number 140400709562064 denotes where the data lives in the memory. It will be very useful for us in this entire discussion.\nWhat happens if we create another string with the same value?\n\n\n \nanother_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n\n\n\n\n\n\nDoes it reuse the previous \u201cHello World\u201d stored in memory or does it create an independent copy? Let\u2019s check this by querying the id function again.\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562208\n\n\n\n\n\n\nThis outputs a different id, so this must be an independent copy. We conclude that:\n\n\n\n\nNote:\n\nAssignment statements where the right hand side is a simple expression creates independent copies every time.\n\n\n\n\nWhile for everyday programming, this is the rule we should remember, there are actually some weird exceptions to this rule. Here\u2019s an example.\n\n\n \nmy_string\n \n=\n \n\u201c\nhello\n\u201d\n\n\n \nid\n(\nmy_string\n)\n\n\n140400709562016\n\n\n \nanother_string\n \n=\n \n\u201c\nhello\n\u201d\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562016\n\n\n\n\n\n\nIn this case, two consecutive assignment statements did not create independent copies. Why?\nIt gets interesting now.\nFor optimizing memory, Python treats a special set of objects differently. The string \u201chello\u201d belongs to this privileged set and has a different behavior. The exact set depends on the implementation like CPython, PyPy, Jython or IronPython. For CPython, the special rule applies to:\n\n\n\n\nStrings without whitespaces and less than 20 characters and\n\n\nIntegers from -5 to +255.\n\n\n\n\nThese objects are always reused or interned. The rationale behind doing this is as follows:\n\n\n\n\nSince programmers use these objects frequently, interning existing\n objects saves memory.\n\n\nSince immutable objects like tuples and strings cannot be modified,\n there is no risk in interning the same object.\n\n\n\n\nHowever, Python does not do this for all immutable objects because there is a runtime cost involved for this feature. For interning an object, it must first search for the object in memory, and searching takes time. This is why the special treatment only applies for small integers and strings, because finding them is not that costly.\n\n\nWhat happens when the right hand side is an existing Python variable?\n\nLet\u2019s move on to the second type of assignment statement where the right hand side is an existing Python variable.\n\n\n \nanother_string\n \n=\n \nmy_string\n\n\n\n\n\n\nIn this case, nothing is created in memory. After the assignment, both variables refer to the already existing object. It\u2019s basically like giving the object an additional nickname or alias. Let\u2019s confirm this by using the id function.\n\n\n \nmy_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n\n\n \nid\n(\nmy_string\n)\n\n\n140400709562160\n\n\n \nanother_string\n \n=\n \nmy_string\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562160\n\n\n\n\n\n\nThe natural question at this stage is : what if, instead of just giving the existing object an alias, we wanted to create an independent copy?\nFor mutable objects, this is possible. You can either use the copy module of Python (which works on all objects) or you may use copy methods specific to the class. For a list, you have several possibilities for creating copies, all of which have different runtime.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \ncopy_of_my_list\n \n=\n \nmy_list\n.\ncopy\n()\n \n# fastest, works only on latest Python versions\n\n\n \ncopy_of_my_list\n \n=\n \nmy_list\n[:]\n \n# same runtime as List.copy()\n\n\n \ncopy_of_my_list\n \n=\n \nlist\n(\nmy_list\n)\n \n# slightly slower\n\n\n \nimport\n \ncopy\n\n\n \ncopy_of_my_list\n \n=\n \ncopy\n.\ncopy\n(\nmy_list\n)\n \n# slowest\n\n\n\n\n\n\nHow can you copy an immutable object? Well\u2026you can\u2019t! At least not in a straightforward way. If you try to use the copy module or the slicing notation, you will get back the same object and not an independent copy. Here\u2019s proof.\n\n\n# Standard ways of copying lists do not apply for tuples\n\n\n\n \nmy_tuple\n \n=\n \n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n \nid\n(\nmy_tuple\n)\n\n\n140371873244816\n\n\n \nanother_tuple\n \n=\n \nmy_tuple\n[:]\n\n\n \nid\n(\nanother_tuple\n)\n\n\n140371873244816\n\n\n\n# The copy module also doesn\u2019t help\n\n\n\n \nimport\n \ncopy\n \n\n \nanother_tuple\n \n=\n \ncopy\n.\ncopy\n(\nmy_tuple\n)\n\n\n \nid\n(\nanother_tuple\n)\n\n\n140371873244816\n\n\n\n\n\n\nMore importantly, there is no reason for explicitly copying an immutable object anyway. We will see why in a moment when we discuss the third kind of assignment statement.\n\nWhat happpens when the right hand side is an operation?\n\n\nIn this case, what happens depends on the result of the operation. We will discuss two simple cases:\n\n\n\n\nadding an element to an immutable object (like a tuple) and\n\n\nadding an element to a mutable object (like a list).\n\n\n\n\nLet\u2019s start with the case of the tuple.\n\n\n \nanother_tuple\n \n+=\n \n(\n4\n,)\n\n\n\n\n\n\nWhen you add a new element to a tuple using another_tuple += (4,), this creates a new object in memory. The immutability of tuples is key to understanding this. Since tuples are immutable, any operation that leads to a changed tuple would result in an independent copy.\nThis is the reason why you don\u2019t need to explicitly copy immutable objects : it happens automatically under the hood. Here\u2019s an example.\n\n\n \nmy_tuple\n \n=\n \n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n \nanother_tuple\n \n=\n \nmy_tuple\n \n# both variables point to the same object\n\n\n \nanother_tuple\n \n+=\n \n(\n4\n,)\n \n# this statement creates a new independent object\n\n\n \nprint\n(\nanother_tuple\n)\n \n\n(\n1\n,\n \n2\n,\n \n3\n,\n \n4\n)\n\n\n \nprint\n(\nmy_tuple\n)\n \n# the old one remains unharmed\n\n\n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n\n\n\n\nThe situation is much different for mutable objects and much more confusing. Let\u2019s try the same example, but now for lists.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n \n# both variables point to the same object\n\n\n \nanother_list\n \n+=\n \n[\n4\n,]\n \n# this statement modifies the object in place\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is modified\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n\n\n\n\nMutable objects can be modified in place. Some operations modify the list in place and some operations don\u2019t. In this case, the statement another_list += [4,] calls another_list.\niadd\n([4,]) and \niadd\n modifies the existing object in place.\nTo make things doubly confusing, we would have completely different results if we used a slightly different notation.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n \n# both variables point to the same object\n\n\n \nanother_list\n \n=\n \nanother_list\n \n+\n \n[\n4\n,]\n \n# this creates an independent copy\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is unharmed\n\n\n[\n1\n,\n \n2\n,\n \n3\n]\n \n\n\n\n\n\nWoah! What\u2019s going on? What changed?\nIt turns out that when we change the third line, Python now internally calls a different function another_list.\nadd\n([4,]) instead of \niadd\n. This function returns a new copy instead of modifying the list in place.\nTo prevent this confusion, it is always better to create a true copy of the list if you wish to prevent modification to the original.\nLet\u2019s remember the list copy methods from before. They were List.copy(), [:], list() and copy.copy(). This is what we should use.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n.\ncopy\n()\n \n# this creates an independent copy\n\n\n \nanother_list\n \n+=\n \n[\n4\n,]\n \n# this statement modifies the independent copy\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is unharmed\n\n\n[\n1\n,\n \n2\n,\n \n3\n]\n \n\n\n\n\n\nThere\u2019s one last gotcha that can happen when copying lists.\nSuppose we have a list that has a nested list inside it. We copy this list using List.copy() and then modify the nested list. Unfortunately, this will modify the original list again!\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n.\ncopy\n()\n\n\n \nanother_list\n[\n0\n]\n \n+=\n \n[\n6\n,]\n\n\n \nprint\n(\nanother_list\n)\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n\n\n \nprint\n(\nmy_list\n)\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n \n\n\n\n\n\nWhy did that happen? Didn\u2019t we just copy the original list?\nThe truth is : we actually don\u2019t have a completely independent copy in this case. The copy() function generates a shallow copy. To see what it does, let\u2019s look at the ids of all the elements in my_list and the ids of all the elements in the copied list.\n\n\n# for my_list\n\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nid\n(\nmy_list\n)\n\n\n140371873277424\n\n\n \nprint\n([\nid\n(\nx\n)\n \nfor\n \nx\n \nin\n \nmy_list\n])\n\n\n[\n140371873599288\n,\n \n13820176\n,\n \n13820152\n]\n\n\n\n# for another_list obtained by my_list.copy()\n\n\n\n \nid\n(\nanother_list\n)\n\n\n140371873317016\n\n\n \nprint\n([\nid\n(\nx\n)\n \nfor\n \nx\n \nin\n \nanother_list\n])\n\n\n[\n140371873599288\n,\n \n13820176\n,\n \n13820152\n]\n\n\n\n\n\n\nWe see the ids of my_list and another_list are indeed different, indicating another_list is a copy. But the ids of the elements contained in another_list have the same ids as the elements in my_list . So the elements have not been copied!\nThis is the property of shallow copy. It creates a new copy of the object but reuses the attributes and elements of the old copy. Thus, when you modify the elements of the new copy, you are modifying the elements of the old copy too.\nTo solve this problem, we need to copy an object along with all its attributes and elements. This can be achieved by copy.deepcopy.\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nanother_list\n \n=\n \ncopy\n.\ndeepcopy\n(\nmy_list\n)\n\n\n \nanother_list\n[\n0\n]\n \n+=\n \n[\n6\n,]\n\n\n \nanother_list\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n\n\n \nmy_list\n\n\n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n\n\n\n\nDeep copy is a quite time intensive operation and can take 1o times longer to complete compared to a shallow copy. But in some situations, it is unavoidable.\n\n\nConclusion\n\n\nThis brings me to the end of this discussion. To summarize, we have talked about the different scenarios which can arise in an assignment statement in Python. We found that:\n\n\n\n\nWhen the right hand side is a simple expression, a new copy is\n created every time. There are some exceptions to this rule, which\n depend on the implementation\n\n\nWhen the right hand side is an existing Python variable, then an\n alias is created for the existing copy.\n\n\nWhen the right hand side is an operation, then the outcome depends on\n the operation. In a simple case involving a tuple, we saw that an\n independent copy was created. In the same case with lists, we saw\n that the list was modified in place in one case (when we used\n \niadd\n) and a new copy was generated in another case (when we used \nadd\n).\n\n\nList item\n\n\nMutable objects can be copied but immutable objects cannot be copied\n in a straightforward way. There is also no need to copy immutable\n objects.\n\n\nTo copy a mutable object along with all its attributes and elements,\n we need to use deep copy.\n\n\n\n\n\n\nSource:\n \n\n\n https://medium.com/broken-window/many-names-one-memory-address-122f78734cb6", + "location": "/beginner/Variables_And_Assignment/", + "text": "Variables and Assignment\n\n\nVariables are named locations which are used to store references to the object stored in memory. The names we choose for variables and functions are commonly known as Identifiers. In python Identifiers must obey the following rules.\n\n\n\n\nAll identifiers must start with letter or underscore ( _ ) , you\n can\u2019t use digits. For e.g my_var is valid identifier while 1digit \n is not.\n\n\nIdentifiers can contain letters, digits and underscores ( _ ). \n\n\nThey can be of any length.\n\n\n\n\nIdentifier can\u2019t be a keyword (keywords are reserved words that\n Python uses for special purpose).Following are Keywords in python 3.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nand\n\n\nexec\n\n\nnot\n\n\n\n\n\n\nas\n\n\nfinally\n\n\nor\n\n\n\n\n\n\nassert\n\n\nfor\n\n\npass\n\n\n\n\n\n\nbreak\n\n\nfrom\n\n\nprint\n\n\n\n\n\n\nclass\n\n\nglobal\n\n\nraise\n\n\n\n\n\n\ncontinue\n\n\nif\n\n\nreturn\n\n\n\n\n\n\ndef\n\n\nimport\n\n\ntry\n\n\n\n\n\n\ndel\n\n\nin\n\n\nwhile\n\n\n\n\n\n\nelif\n\n\nis\n\n\nwith\n\n\n\n\n\n\nelse\n\n\nlambda\n\n\nyield\n\n\n\n\n\n\nexcept\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nAssigning Values to Variables\n\n\nValues are basic things that programs works with. For e.g 1 , 11 , 3.14 , \"hello\" are all values. In programming terminology they are also commonly known as literals. Literals can be of different type for e.g 1 , 11 are of type int , 3.14 is float and \"hello\" is string . Remember in python everything is object even basic data types like int, float, string, we will elaborate more on this in later chapters.\n\n\nIn python you don\u2019t need to declare types of variable ahead of time. Interpreter automatically detects the type of the variable by the data it contains. To assign value to a variable equal sign ( = ) is used. = is also known as assignment operator.\n\n\nFollowing are some examples of variable declaration:\n\n\nx\n \n=\n \n100\n \n# x is integer\n\n\npi\n \n=\n \n3.14\n \n# pi is float\n\n\nempname\n \n=\n \npython is great\n \n# empname is string\n\n\n\na\n \n=\n \nb\n \n=\n \nc\n \n=\n \n100\n \n# this statement assign 100 to c, b and a.\n\n\n\n\n\n\n\n\nNote:\n\nIn the above code x stores reference to the 100 ( which is an int object ) , x don\u2019t store 100 itself.\n\n\n\n\nIn Python comments are preceded by a pound sign ( # ). Comments are not programming statements that python interpreter executes while running the program. Comments are used by programmers to remind themselves how the program works. They are also used to write program documentation.\n\n\n#display hello world\n\n\nprint\n(\nhello world\n)\n\n\n\n\n\n\nSimultaneous Assignments\n\n\nPython allow simultaneous assignment syntax like this:\n\n\nvar1\n,\n \nvar2\n,\n \n...\n,\n \nvarn\n \n=\n \nexp1\n,\n \nexp2\n,\n \n...\n,\n \nexpn\n\n\n\n\n\n\nthis statements tells the python to evaluate all the expression on the right and assign them to the corresponding variables on the left. Simultaneous Assignments is helpful to swap values of two variables. For e.g\n\n\n \nx\n \n=\n \n1\n\n\n \ny\n \n=\n \n2\n\n\n\n \ny\n,\n \nx\n \n=\n \nx\n,\n \ny\n \n# assign y value to x and x value to y\n\n\n\n\n\n\nPython Data Types\n\n\nPython has 5 standard data types namely.\n\na) \nNumbers\n\nb) \nString\n\nc) \nList\n\nd) \nTuple\n\ne) \nDictionary\n\nf) Boolean \u2013 In Python True and False are boolean literals. But the following values are also considered as false.\n\n\n[] \u2013 empty list , () \u2013 empty tuple , {} \u2013 empty dictionary\n \n\n\nReceiving input from Console\n\n\ninput() function is used to receive input from the console.\n\n\nSyntax: input([prompt]) -\n string\n\n\ninput() function accepts an optional string argument called prompt and returns a string.\n\n\n \nname\n \n=\n \ninput\n(\nEnter your name: \n)\n\n\n \nEnter\n \nyour\n \nname\n:\n \ntim\n\n\n \nname\n\n\ntim\n\n\n\n\n\n\nNote that input() returns string even if you enter a number, to convert it to an integer you can use int() or eval() .\n\n\n \nage\n \n=\n \nint\n(\ninput\n(\nEnter your age: \n))\n\n\nEnter\n \nyour\n \nage\n:\n \n22\n\n\n \nage\n\n\n22\n\n\n \ntype\n(\nage\n)\n\n\nclass\n \nint\n\n\n\n\n\n\n\n\nSource:\n \n\n\n http://thepythonguru.com\n\n\n\n\nUnderstanding Python variables and Memory Management\n\n\nHave you ever noticed any difference between variables in Python and C? For example, when you do an assignment like the following in C, it actually creates a block of memory space so that it can hold the value for that variable\n\n\nint\n \na\n \n=\n \n1\n;\n\n\n\n\n\n\nYou can think of it as putting the value assigned in a box with the variable name as shown below.\n\n\n\nAnd for all the variables you create a new box is created with the variable name to hold the value. If you change the value of the variable the box will be updated with the new value. That means doing\n\n\na\n \n=\n \n2\n;\n\n\n\n\n\n\nwill result in\n\n\n\n\nAssigning one variable to another makes a copy of the value and put that value in the new box.\n\n\nint\n \nb\n \n=\n \na\n;\n\n\n\n\n\n\n \n\n\nBut in Python variables work more like tags unlike the boxes you have seen before. When you do an assignment in Python, it tags the value with the variable name.\n\n\na\n \n=\n \n1\n\n\n\n\n\n\n\n\nand if you change the value of the varaible, it just changes the tag to the new value in memory. You dont need to do the housekeeping job of freeing the memory here. Python's Automatic Garbage Collection does it for you. When a value is without names/tags it is automatically removed from memory.\n\n\na\n \n=\n \n2\n\n\n\n\n\n\n\n\nAssigning one variable to another makes a new tag bound to the same value as show below.\n\n\nb\n \n=\n \na\n\n\n\n\n\n\n\nOther languages have 'variables'. Python has 'names'.\n\n\nA bit about Python's memory management\n\n\nAs you have seen before, a value will have only one copy in memory and all the variables having this value will refer to this memory location. For example when you have variables a, b, c having a value 10, it doesn't mean that there will be 3 copy of 10s in memory. There will be only one 10 and all the variables a, b, c will point to this value. Once a variable is updated, say you are doing a += 1 a new value 11 will be allocated in memory and a will be pointing to this.\n\n\nLet's check this behaviour with Python Interpreter. Start the Python Shell and try the following for yourselves.\n\n\n \na\n \n=\n \n10\n\n\n \nb\n \n=\n \n10\n\n\n \nc\n \n=\n \n10\n\n\n \nid\n(\na\n),\n \nid\n(\nb\n),\n \nid\n(\nc\n)\n\n\n(\n140621897573616\n,\n \n140621897573616\n,\n \n140621897573616\n)\n\n\n \na\n \n+=\n \n1\n\n\n \nid\n(\na\n)\n\n\n140621897573592\n\n\n\n\n\n\nid() will return an objects memory address (object's identity). As you have noticed, when you assign the same integer value to the variables, we see the same ids. But this assumption does not hold true all the time. See the following for example\n\n\n \nx\n \n=\n \n500\n\n\n \ny\n \n=\n \n500\n\n\n \nid\n(\nx\n)\n\n\n4338740848\n\n\n \nid\n(\ny\n)\n\n\n4338741040\n\n\n\n\n\n\nWhat happened here? Even after assigning the same integer values to different variable names, we are getting two different ids here. These are actually the effects of CPython optimization we are observing here. CPython implementation keeps an array of integer objects for all integers between -5 and 256. So when we create an integer in that range, they simply back reference to the existing object. You may refer the following \nlinks\n for more information.\n\n\nLet's take a look at strings now.\n\n\n \ns1\n \n=\n \nhello\n\n\n \ns2\n \n=\n \nhello\n\n\n \nid\n(\ns1\n),\n \nid\n(\ns2\n)\n\n\n(\n4454725888\n,\n \n4454725888\n)\n\n\n \ns1\n \n==\n \ns2\n\n\nTrue\n\n\n \ns1\n \nis\n \ns2\n\n\nTrue\n\n\n \ns3\n \n=\n \nhello, world!\n\n\n \ns4\n \n=\n \nhello, world!\n\n\n \nid\n(\ns3\n),\n \nid\n(\ns4\n)\n\n\n(\n4454721608\n,\n \n4454721664\n)\n\n\n \ns3\n \n==\n \ns4\n\n\nTrue\n\n\n \ns3\n \nis\n \ns4\n\n\nFalse\n\n\n\n\n\n\nLooks interesting, isn't it? When the string was a simple and shorter one the variable names where referring to the same object in memory. But when they became bigger, this was not the case. This is called interning, and Python does interning (to some extent) of shorter string literals (as in s1 and s2) which are created at compile time. But in general, Python string literals creates a new string object each time (as in s3 and s4). Interning is runtime dependant and is always a trade-off between memory use and the cost of checking if you are creating the same string. There's a built-in intern() function to forcefully apply interning. Read more about interning from the following links.\n\n\nStack Overflow: Does Python intern Strings?\n\n\nStack Overflow: Python String Interning\n\n\nInternals of Python String Interning\n\n\n\n\nSource:\n \n\n\n http://foobarnbaz.com/2012/07/08/understanding-python-variables/\n\n\n\n\nAssignment statements in Python are more interesting than you might think\n\n\nIn this article, we will take a deep look at three kinds of assignment statements in Python and discuss what\u2019s going on under the hood.\n\n\n \nmy_string\n \n=\n \nHello World\n \n# right hand side is a simple expression\n\n\n \nanother_string\n \n=\n \nmy_string\n \n# right hand side is another variable\n\n\n \nanother_string\n \n=\n \nanother_string\n \n+\n \n!\n \n# right hand side is an operation\n\n\n\n\n\n\nWhat we find may surprise you.\n\n\nWhat happens when the right hand side is a simple expression?\n\n\n \nmy_string\n \n=\n \nHello World\n\n\n\n\n\n\nIn simple terms, this creates a string \u201cHello World\u201d in memory and assigns the name my_string to it. If you are using CPython[1], then we can even check the memory address explicitly by using the built in function id .\n\n\n \nmy_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n \n\n \nid\n(\nmy_string\n)\n\n\n140400709562064\n\n\n\n\n\n\nThat big number 140400709562064 denotes where the data lives in the memory. It will be very useful for us in this entire discussion.\nWhat happens if we create another string with the same value?\n\n\n \nanother_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n\n\n\n\n\n\nDoes it reuse the previous \u201cHello World\u201d stored in memory or does it create an independent copy? Let\u2019s check this by querying the id function again.\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562208\n\n\n\n\n\n\nThis outputs a different id, so this must be an independent copy. We conclude that:\n\n\n\n\nNote:\n\nAssignment statements where the right hand side is a simple expression creates independent copies every time.\n\n\n\n\nWhile for everyday programming, this is the rule we should remember, there are actually some weird exceptions to this rule. Here\u2019s an example.\n\n\n \nmy_string\n \n=\n \n\u201c\nhello\n\u201d\n\n\n \nid\n(\nmy_string\n)\n\n\n140400709562016\n\n\n \nanother_string\n \n=\n \n\u201c\nhello\n\u201d\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562016\n\n\n\n\n\n\nIn this case, two consecutive assignment statements did not create independent copies. Why?\nIt gets interesting now.\nFor optimizing memory, Python treats a special set of objects differently. The string \u201chello\u201d belongs to this privileged set and has a different behavior. The exact set depends on the implementation like CPython, PyPy, Jython or IronPython. For CPython, the special rule applies to:\n\n\n\n\nStrings without whitespaces and less than 20 characters and\n\n\nIntegers from -5 to +255.\n\n\n\n\nThese objects are always reused or interned. The rationale behind doing this is as follows:\n\n\n\n\nSince programmers use these objects frequently, interning existing\n objects saves memory.\n\n\nSince immutable objects like tuples and strings cannot be modified,\n there is no risk in interning the same object.\n\n\n\n\nHowever, Python does not do this for all immutable objects because there is a runtime cost involved for this feature. For interning an object, it must first search for the object in memory, and searching takes time. This is why the special treatment only applies for small integers and strings, because finding them is not that costly.\n\n\nWhat happens when the right hand side is an existing Python variable?\n\nLet\u2019s move on to the second type of assignment statement where the right hand side is an existing Python variable.\n\n\n \nanother_string\n \n=\n \nmy_string\n\n\n\n\n\n\nIn this case, nothing is created in memory. After the assignment, both variables refer to the already existing object. It\u2019s basically like giving the object an additional nickname or alias. Let\u2019s confirm this by using the id function.\n\n\n \nmy_string\n \n=\n \n\u201c\nHello\n \nWorld\n\u201d\n\n\n \nid\n(\nmy_string\n)\n\n\n140400709562160\n\n\n \nanother_string\n \n=\n \nmy_string\n\n\n \nid\n(\nanother_string\n)\n\n\n140400709562160\n\n\n\n\n\n\nThe natural question at this stage is : what if, instead of just giving the existing object an alias, we wanted to create an independent copy?\nFor mutable objects, this is possible. You can either use the copy module of Python (which works on all objects) or you may use copy methods specific to the class. For a list, you have several possibilities for creating copies, all of which have different runtime.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \ncopy_of_my_list\n \n=\n \nmy_list\n.\ncopy\n()\n \n# fastest, works only on latest Python versions\n\n\n \ncopy_of_my_list\n \n=\n \nmy_list\n[:]\n \n# same runtime as List.copy()\n\n\n \ncopy_of_my_list\n \n=\n \nlist\n(\nmy_list\n)\n \n# slightly slower\n\n\n \nimport\n \ncopy\n\n\n \ncopy_of_my_list\n \n=\n \ncopy\n.\ncopy\n(\nmy_list\n)\n \n# slowest\n\n\n\n\n\n\nHow can you copy an immutable object? Well\u2026you can\u2019t! At least not in a straightforward way. If you try to use the copy module or the slicing notation, you will get back the same object and not an independent copy. Here\u2019s proof.\n\n\n# Standard ways of copying lists do not apply for tuples\n\n\n\n \nmy_tuple\n \n=\n \n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n \nid\n(\nmy_tuple\n)\n\n\n140371873244816\n\n\n \nanother_tuple\n \n=\n \nmy_tuple\n[:]\n\n\n \nid\n(\nanother_tuple\n)\n\n\n140371873244816\n\n\n\n# The copy module also doesn\u2019t help\n\n\n\n \nimport\n \ncopy\n \n\n \nanother_tuple\n \n=\n \ncopy\n.\ncopy\n(\nmy_tuple\n)\n\n\n \nid\n(\nanother_tuple\n)\n\n\n140371873244816\n\n\n\n\n\n\nMore importantly, there is no reason for explicitly copying an immutable object anyway. We will see why in a moment when we discuss the third kind of assignment statement.\n\nWhat happpens when the right hand side is an operation?\n\n\nIn this case, what happens depends on the result of the operation. We will discuss two simple cases:\n\n\n\n\nadding an element to an immutable object (like a tuple) and\n\n\nadding an element to a mutable object (like a list).\n\n\n\n\nLet\u2019s start with the case of the tuple.\n\n\n \nanother_tuple\n \n+=\n \n(\n4\n,)\n\n\n\n\n\n\nWhen you add a new element to a tuple using another_tuple += (4,), this creates a new object in memory. The immutability of tuples is key to understanding this. Since tuples are immutable, any operation that leads to a changed tuple would result in an independent copy.\nThis is the reason why you don\u2019t need to explicitly copy immutable objects : it happens automatically under the hood. Here\u2019s an example.\n\n\n \nmy_tuple\n \n=\n \n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n \nanother_tuple\n \n=\n \nmy_tuple\n \n# both variables point to the same object\n\n\n \nanother_tuple\n \n+=\n \n(\n4\n,)\n \n# this statement creates a new independent object\n\n\n \nprint\n(\nanother_tuple\n)\n \n\n(\n1\n,\n \n2\n,\n \n3\n,\n \n4\n)\n\n\n \nprint\n(\nmy_tuple\n)\n \n# the old one remains unharmed\n\n\n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n\n\n\n\nThe situation is much different for mutable objects and much more confusing. Let\u2019s try the same example, but now for lists.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n \n# both variables point to the same object\n\n\n \nanother_list\n \n+=\n \n[\n4\n,]\n \n# this statement modifies the object in place\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is modified\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n\n\n\n\nMutable objects can be modified in place. Some operations modify the list in place and some operations don\u2019t. In this case, the statement another_list += [4,] calls another_list.\niadd\n([4,]) and \niadd\n modifies the existing object in place.\nTo make things doubly confusing, we would have completely different results if we used a slightly different notation.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n \n# both variables point to the same object\n\n\n \nanother_list\n \n=\n \nanother_list\n \n+\n \n[\n4\n,]\n \n# this creates an independent copy\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is unharmed\n\n\n[\n1\n,\n \n2\n,\n \n3\n]\n \n\n\n\n\n\nWoah! What\u2019s going on? What changed?\nIt turns out that when we change the third line, Python now internally calls a different function another_list.\nadd\n([4,]) instead of \niadd\n. This function returns a new copy instead of modifying the list in place.\nTo prevent this confusion, it is always better to create a true copy of the list if you wish to prevent modification to the original.\nLet\u2019s remember the list copy methods from before. They were List.copy(), [:], list() and copy.copy(). This is what we should use.\n\n\n \nmy_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n.\ncopy\n()\n \n# this creates an independent copy\n\n\n \nanother_list\n \n+=\n \n[\n4\n,]\n \n# this statement modifies the independent copy\n\n\n \nprint\n(\nanother_list\n)\n\n\n[\n1\n,\n \n2\n,\n \n3\n,\n \n4\n]\n\n\n \nprint\n(\nmy_list\n)\n \n# the original list is unharmed\n\n\n[\n1\n,\n \n2\n,\n \n3\n]\n \n\n\n\n\n\nThere\u2019s one last gotcha that can happen when copying lists.\nSuppose we have a list that has a nested list inside it. We copy this list using List.copy() and then modify the nested list. Unfortunately, this will modify the original list again!\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nanother_list\n \n=\n \nmy_list\n.\ncopy\n()\n\n\n \nanother_list\n[\n0\n]\n \n+=\n \n[\n6\n,]\n\n\n \nprint\n(\nanother_list\n)\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n\n\n \nprint\n(\nmy_list\n)\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n \n\n\n\n\n\nWhy did that happen? Didn\u2019t we just copy the original list?\nThe truth is : we actually don\u2019t have a completely independent copy in this case. The copy() function generates a shallow copy. To see what it does, let\u2019s look at the ids of all the elements in my_list and the ids of all the elements in the copied list.\n\n\n# for my_list\n\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nid\n(\nmy_list\n)\n\n\n140371873277424\n\n\n \nprint\n([\nid\n(\nx\n)\n \nfor\n \nx\n \nin\n \nmy_list\n])\n\n\n[\n140371873599288\n,\n \n13820176\n,\n \n13820152\n]\n\n\n\n# for another_list obtained by my_list.copy()\n\n\n\n \nid\n(\nanother_list\n)\n\n\n140371873317016\n\n\n \nprint\n([\nid\n(\nx\n)\n \nfor\n \nx\n \nin\n \nanother_list\n])\n\n\n[\n140371873599288\n,\n \n13820176\n,\n \n13820152\n]\n\n\n\n\n\n\nWe see the ids of my_list and another_list are indeed different, indicating another_list is a copy. But the ids of the elements contained in another_list have the same ids as the elements in my_list . So the elements have not been copied!\nThis is the property of shallow copy. It creates a new copy of the object but reuses the attributes and elements of the old copy. Thus, when you modify the elements of the new copy, you are modifying the elements of the old copy too.\nTo solve this problem, we need to copy an object along with all its attributes and elements. This can be achieved by copy.deepcopy.\n\n\n \nmy_list\n \n=\n \n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n \nanother_list\n \n=\n \ncopy\n.\ndeepcopy\n(\nmy_list\n)\n\n\n \nanother_list\n[\n0\n]\n \n+=\n \n[\n6\n,]\n\n\n \nanother_list\n\n\n[[\n1\n,\n \n2\n,\n \n3\n,\n \n6\n],\n \n4\n,\n \n5\n]\n\n\n \nmy_list\n\n\n[[\n1\n,\n \n2\n,\n \n3\n],\n \n4\n,\n \n5\n]\n\n\n\n\n\n\nDeep copy is a quite time intensive operation and can take 1o times longer to complete compared to a shallow copy. But in some situations, it is unavoidable.\n\n\nConclusion\n\n\nThis brings me to the end of this discussion. To summarize, we have talked about the different scenarios which can arise in an assignment statement in Python. We found that:\n\n\n\n\nWhen the right hand side is a simple expression, a new copy is\n created every time. There are some exceptions to this rule, which\n depend on the implementation\n\n\nWhen the right hand side is an existing Python variable, then an\n alias is created for the existing copy.\n\n\nWhen the right hand side is an operation, then the outcome depends on\n the operation. In a simple case involving a tuple, we saw that an\n independent copy was created. In the same case with lists, we saw\n that the list was modified in place in one case (when we used\n \niadd\n) and a new copy was generated in another case (when we used \nadd\n).\n\n\nList item\n\n\nMutable objects can be copied but immutable objects cannot be copied\n in a straightforward way. There is also no need to copy immutable\n objects.\n\n\nTo copy a mutable object along with all its attributes and elements,\n we need to use deep copy.\n\n\n\n\n\n\nSource:\n \n\n\n https://medium.com/broken-window/many-names-one-memory-address-122f78734cb6", "title": "Variables and Assignment" - }, + }, { - "location": "/beginner/Variables_And_Assignment/#variables-and-assignment", - "text": "Variables are named locations which are used to store references to the object stored in memory. The names we choose for variables and functions are commonly known as Identifiers. In python Identifiers must obey the following rules. All identifiers must start with letter or underscore ( _ ) , you\n can\u2019t use digits. For e.g my_var is valid identifier while 1digit \n is not. Identifiers can contain letters, digits and underscores ( _ ). They can be of any length. Identifier can\u2019t be a keyword (keywords are reserved words that\n Python uses for special purpose).Following are Keywords in python 3. and exec not as finally or assert for pass break from print class global raise continue if return def import try del in while elif is with else lambda yield except", + "location": "/beginner/Variables_And_Assignment/#variables-and-assignment", + "text": "Variables are named locations which are used to store references to the object stored in memory. The names we choose for variables and functions are commonly known as Identifiers. In python Identifiers must obey the following rules. All identifiers must start with letter or underscore ( _ ) , you\n can\u2019t use digits. For e.g my_var is valid identifier while 1digit \n is not. Identifiers can contain letters, digits and underscores ( _ ). They can be of any length. Identifier can\u2019t be a keyword (keywords are reserved words that\n Python uses for special purpose).Following are Keywords in python 3. and exec not as finally or assert for pass break from print class global raise continue if return def import try del in while elif is with else lambda yield except", "title": "Variables and Assignment" - }, + }, { - "location": "/beginner/Variables_And_Assignment/#assigning-values-to-variables", - "text": "Values are basic things that programs works with. For e.g 1 , 11 , 3.14 , \"hello\" are all values. In programming terminology they are also commonly known as literals. Literals can be of different type for e.g 1 , 11 are of type int , 3.14 is float and \"hello\" is string . Remember in python everything is object even basic data types like int, float, string, we will elaborate more on this in later chapters. In python you don\u2019t need to declare types of variable ahead of time. Interpreter automatically detects the type of the variable by the data it contains. To assign value to a variable equal sign ( = ) is used. = is also known as assignment operator. Following are some examples of variable declaration: x = 100 # x is integer pi = 3.14 # pi is float empname = python is great # empname is string a = b = c = 100 # this statement assign 100 to c, b and a. Note: \nIn the above code x stores reference to the 100 ( which is an int object ) , x don\u2019t store 100 itself. In Python comments are preceded by a pound sign ( # ). Comments are not programming statements that python interpreter executes while running the program. Comments are used by programmers to remind themselves how the program works. They are also used to write program documentation. #display hello world print ( hello world )", + "location": "/beginner/Variables_And_Assignment/#assigning-values-to-variables", + "text": "Values are basic things that programs works with. For e.g 1 , 11 , 3.14 , \"hello\" are all values. In programming terminology they are also commonly known as literals. Literals can be of different type for e.g 1 , 11 are of type int , 3.14 is float and \"hello\" is string . Remember in python everything is object even basic data types like int, float, string, we will elaborate more on this in later chapters. In python you don\u2019t need to declare types of variable ahead of time. Interpreter automatically detects the type of the variable by the data it contains. To assign value to a variable equal sign ( = ) is used. = is also known as assignment operator. Following are some examples of variable declaration: x = 100 # x is integer pi = 3.14 # pi is float empname = python is great # empname is string a = b = c = 100 # this statement assign 100 to c, b and a. Note: \nIn the above code x stores reference to the 100 ( which is an int object ) , x don\u2019t store 100 itself. In Python comments are preceded by a pound sign ( # ). Comments are not programming statements that python interpreter executes while running the program. Comments are used by programmers to remind themselves how the program works. They are also used to write program documentation. #display hello world print ( hello world )", "title": "Assigning Values to Variables" - }, + }, { - "location": "/beginner/Variables_And_Assignment/#simultaneous-assignments", - "text": "Python allow simultaneous assignment syntax like this: var1 , var2 , ... , varn = exp1 , exp2 , ... , expn this statements tells the python to evaluate all the expression on the right and assign them to the corresponding variables on the left. Simultaneous Assignments is helpful to swap values of two variables. For e.g x = 1 y = 2 y , x = x , y # assign y value to x and x value to y", + "location": "/beginner/Variables_And_Assignment/#simultaneous-assignments", + "text": "Python allow simultaneous assignment syntax like this: var1 , var2 , ... , varn = exp1 , exp2 , ... , expn this statements tells the python to evaluate all the expression on the right and assign them to the corresponding variables on the left. Simultaneous Assignments is helpful to swap values of two variables. For e.g x = 1 y = 2 y , x = x , y # assign y value to x and x value to y", "title": "Simultaneous Assignments" - }, + }, { - "location": "/beginner/Variables_And_Assignment/#python-data-types", - "text": "Python has 5 standard data types namely. \na) Numbers \nb) String \nc) List \nd) Tuple \ne) Dictionary \nf) Boolean \u2013 In Python True and False are boolean literals. But the following values are also considered as false. [] \u2013 empty list , () \u2013 empty tuple , {} \u2013 empty dictionary", + "location": "/beginner/Variables_And_Assignment/#python-data-types", + "text": "Python has 5 standard data types namely. \na) Numbers \nb) String \nc) List \nd) Tuple \ne) Dictionary \nf) Boolean \u2013 In Python True and False are boolean literals. But the following values are also considered as false. [] \u2013 empty list , () \u2013 empty tuple , {} \u2013 empty dictionary", "title": "Python Data Types" - }, + }, { - "location": "/beginner/Variables_And_Assignment/#receiving-input-from-console", - "text": "input() function is used to receive input from the console. Syntax: input([prompt]) - string input() function accepts an optional string argument called prompt and returns a string. name = input ( Enter your name: ) Enter your name : tim name tim Note that input() returns string even if you enter a number, to convert it to an integer you can use int() or eval() . age = int ( input ( Enter your age: )) Enter your age : 22 age 22 type ( age ) class int Source: http://thepythonguru.com", + "location": "/beginner/Variables_And_Assignment/#receiving-input-from-console", + "text": "input() function is used to receive input from the console. Syntax: input([prompt]) - string input() function accepts an optional string argument called prompt and returns a string. name = input ( Enter your name: ) Enter your name : tim name tim Note that input() returns string even if you enter a number, to convert it to an integer you can use int() or eval() . age = int ( input ( Enter your age: )) Enter your age : 22 age 22 type ( age ) class int Source: http://thepythonguru.com", "title": "Receiving input from Console" - }, + }, { - "location": "/beginner/Variables_And_Assignment/#understanding-python-variables-and-memory-management", - "text": "Have you ever noticed any difference between variables in Python and C? For example, when you do an assignment like the following in C, it actually creates a block of memory space so that it can hold the value for that variable int a = 1 ; You can think of it as putting the value assigned in a box with the variable name as shown below. And for all the variables you create a new box is created with the variable name to hold the value. If you change the value of the variable the box will be updated with the new value. That means doing a = 2 ; will result in Assigning one variable to another makes a copy of the value and put that value in the new box. int b = a ; But in Python variables work more like tags unlike the boxes you have seen before. When you do an assignment in Python, it tags the value with the variable name. a = 1 and if you change the value of the varaible, it just changes the tag to the new value in memory. You dont need to do the housekeeping job of freeing the memory here. Python's Automatic Garbage Collection does it for you. When a value is without names/tags it is automatically removed from memory. a = 2 Assigning one variable to another makes a new tag bound to the same value as show below. b = a \nOther languages have 'variables'. Python has 'names'.", + "location": "/beginner/Variables_And_Assignment/#understanding-python-variables-and-memory-management", + "text": "Have you ever noticed any difference between variables in Python and C? For example, when you do an assignment like the following in C, it actually creates a block of memory space so that it can hold the value for that variable int a = 1 ; You can think of it as putting the value assigned in a box with the variable name as shown below. And for all the variables you create a new box is created with the variable name to hold the value. If you change the value of the variable the box will be updated with the new value. That means doing a = 2 ; will result in Assigning one variable to another makes a copy of the value and put that value in the new box. int b = a ; But in Python variables work more like tags unlike the boxes you have seen before. When you do an assignment in Python, it tags the value with the variable name. a = 1 and if you change the value of the varaible, it just changes the tag to the new value in memory. You dont need to do the housekeeping job of freeing the memory here. Python's Automatic Garbage Collection does it for you. When a value is without names/tags it is automatically removed from memory. a = 2 Assigning one variable to another makes a new tag bound to the same value as show below. b = a \nOther languages have 'variables'. Python has 'names'.", "title": "Understanding Python variables and Memory Management" - }, + }, { - "location": "/beginner/Variables_And_Assignment/#a-bit-about-pythons-memory-management", - "text": "As you have seen before, a value will have only one copy in memory and all the variables having this value will refer to this memory location. For example when you have variables a, b, c having a value 10, it doesn't mean that there will be 3 copy of 10s in memory. There will be only one 10 and all the variables a, b, c will point to this value. Once a variable is updated, say you are doing a += 1 a new value 11 will be allocated in memory and a will be pointing to this. Let's check this behaviour with Python Interpreter. Start the Python Shell and try the following for yourselves. a = 10 b = 10 c = 10 id ( a ), id ( b ), id ( c ) ( 140621897573616 , 140621897573616 , 140621897573616 ) a += 1 id ( a ) 140621897573592 id() will return an objects memory address (object's identity). As you have noticed, when you assign the same integer value to the variables, we see the same ids. But this assumption does not hold true all the time. See the following for example x = 500 y = 500 id ( x ) 4338740848 id ( y ) 4338741040 What happened here? Even after assigning the same integer values to different variable names, we are getting two different ids here. These are actually the effects of CPython optimization we are observing here. CPython implementation keeps an array of integer objects for all integers between -5 and 256. So when we create an integer in that range, they simply back reference to the existing object. You may refer the following links for more information. Let's take a look at strings now. s1 = hello s2 = hello id ( s1 ), id ( s2 ) ( 4454725888 , 4454725888 ) s1 == s2 True s1 is s2 True s3 = hello, world! s4 = hello, world! id ( s3 ), id ( s4 ) ( 4454721608 , 4454721664 ) s3 == s4 True s3 is s4 False Looks interesting, isn't it? When the string was a simple and shorter one the variable names where referring to the same object in memory. But when they became bigger, this was not the case. This is called interning, and Python does interning (to some extent) of shorter string literals (as in s1 and s2) which are created at compile time. But in general, Python string literals creates a new string object each time (as in s3 and s4). Interning is runtime dependant and is always a trade-off between memory use and the cost of checking if you are creating the same string. There's a built-in intern() function to forcefully apply interning. Read more about interning from the following links. Stack Overflow: Does Python intern Strings? Stack Overflow: Python String Interning Internals of Python String Interning Source: http://foobarnbaz.com/2012/07/08/understanding-python-variables/", + "location": "/beginner/Variables_And_Assignment/#a-bit-about-pythons-memory-management", + "text": "As you have seen before, a value will have only one copy in memory and all the variables having this value will refer to this memory location. For example when you have variables a, b, c having a value 10, it doesn't mean that there will be 3 copy of 10s in memory. There will be only one 10 and all the variables a, b, c will point to this value. Once a variable is updated, say you are doing a += 1 a new value 11 will be allocated in memory and a will be pointing to this. Let's check this behaviour with Python Interpreter. Start the Python Shell and try the following for yourselves. a = 10 b = 10 c = 10 id ( a ), id ( b ), id ( c ) ( 140621897573616 , 140621897573616 , 140621897573616 ) a += 1 id ( a ) 140621897573592 id() will return an objects memory address (object's identity). As you have noticed, when you assign the same integer value to the variables, we see the same ids. But this assumption does not hold true all the time. See the following for example x = 500 y = 500 id ( x ) 4338740848 id ( y ) 4338741040 What happened here? Even after assigning the same integer values to different variable names, we are getting two different ids here. These are actually the effects of CPython optimization we are observing here. CPython implementation keeps an array of integer objects for all integers between -5 and 256. So when we create an integer in that range, they simply back reference to the existing object. You may refer the following links for more information. Let's take a look at strings now. s1 = hello s2 = hello id ( s1 ), id ( s2 ) ( 4454725888 , 4454725888 ) s1 == s2 True s1 is s2 True s3 = hello, world! s4 = hello, world! id ( s3 ), id ( s4 ) ( 4454721608 , 4454721664 ) s3 == s4 True s3 is s4 False Looks interesting, isn't it? When the string was a simple and shorter one the variable names where referring to the same object in memory. But when they became bigger, this was not the case. This is called interning, and Python does interning (to some extent) of shorter string literals (as in s1 and s2) which are created at compile time. But in general, Python string literals creates a new string object each time (as in s3 and s4). Interning is runtime dependant and is always a trade-off between memory use and the cost of checking if you are creating the same string. There's a built-in intern() function to forcefully apply interning. Read more about interning from the following links. Stack Overflow: Does Python intern Strings? Stack Overflow: Python String Interning Internals of Python String Interning Source: http://foobarnbaz.com/2012/07/08/understanding-python-variables/", "title": "A bit about Python's memory management" - }, + }, { - "location": "/beginner/Variables_And_Assignment/#assignment-statements-in-python-are-more-interesting-than-you-might-think", - "text": "In this article, we will take a deep look at three kinds of assignment statements in Python and discuss what\u2019s going on under the hood. my_string = Hello World # right hand side is a simple expression another_string = my_string # right hand side is another variable another_string = another_string + ! # right hand side is an operation What we find may surprise you. What happens when the right hand side is a simple expression? my_string = Hello World In simple terms, this creates a string \u201cHello World\u201d in memory and assigns the name my_string to it. If you are using CPython[1], then we can even check the memory address explicitly by using the built in function id . my_string = \u201c Hello World \u201d id ( my_string ) 140400709562064 That big number 140400709562064 denotes where the data lives in the memory. It will be very useful for us in this entire discussion.\nWhat happens if we create another string with the same value? another_string = \u201c Hello World \u201d Does it reuse the previous \u201cHello World\u201d stored in memory or does it create an independent copy? Let\u2019s check this by querying the id function again. id ( another_string ) 140400709562208 This outputs a different id, so this must be an independent copy. We conclude that: Note: \nAssignment statements where the right hand side is a simple expression creates independent copies every time. While for everyday programming, this is the rule we should remember, there are actually some weird exceptions to this rule. Here\u2019s an example. my_string = \u201c hello \u201d id ( my_string ) 140400709562016 another_string = \u201c hello \u201d id ( another_string ) 140400709562016 In this case, two consecutive assignment statements did not create independent copies. Why?\nIt gets interesting now.\nFor optimizing memory, Python treats a special set of objects differently. The string \u201chello\u201d belongs to this privileged set and has a different behavior. The exact set depends on the implementation like CPython, PyPy, Jython or IronPython. For CPython, the special rule applies to: Strings without whitespaces and less than 20 characters and Integers from -5 to +255. These objects are always reused or interned. The rationale behind doing this is as follows: Since programmers use these objects frequently, interning existing\n objects saves memory. Since immutable objects like tuples and strings cannot be modified,\n there is no risk in interning the same object. However, Python does not do this for all immutable objects because there is a runtime cost involved for this feature. For interning an object, it must first search for the object in memory, and searching takes time. This is why the special treatment only applies for small integers and strings, because finding them is not that costly. What happens when the right hand side is an existing Python variable? \nLet\u2019s move on to the second type of assignment statement where the right hand side is an existing Python variable. another_string = my_string In this case, nothing is created in memory. After the assignment, both variables refer to the already existing object. It\u2019s basically like giving the object an additional nickname or alias. Let\u2019s confirm this by using the id function. my_string = \u201c Hello World \u201d id ( my_string ) 140400709562160 another_string = my_string id ( another_string ) 140400709562160 The natural question at this stage is : what if, instead of just giving the existing object an alias, we wanted to create an independent copy?\nFor mutable objects, this is possible. You can either use the copy module of Python (which works on all objects) or you may use copy methods specific to the class. For a list, you have several possibilities for creating copies, all of which have different runtime. my_list = [ 1 , 2 , 3 ] copy_of_my_list = my_list . copy () # fastest, works only on latest Python versions copy_of_my_list = my_list [:] # same runtime as List.copy() copy_of_my_list = list ( my_list ) # slightly slower import copy copy_of_my_list = copy . copy ( my_list ) # slowest How can you copy an immutable object? Well\u2026you can\u2019t! At least not in a straightforward way. If you try to use the copy module or the slicing notation, you will get back the same object and not an independent copy. Here\u2019s proof. # Standard ways of copying lists do not apply for tuples my_tuple = ( 1 , 2 , 3 ) id ( my_tuple ) 140371873244816 another_tuple = my_tuple [:] id ( another_tuple ) 140371873244816 # The copy module also doesn\u2019t help import copy another_tuple = copy . copy ( my_tuple ) id ( another_tuple ) 140371873244816 More importantly, there is no reason for explicitly copying an immutable object anyway. We will see why in a moment when we discuss the third kind of assignment statement. What happpens when the right hand side is an operation? In this case, what happens depends on the result of the operation. We will discuss two simple cases: adding an element to an immutable object (like a tuple) and adding an element to a mutable object (like a list). Let\u2019s start with the case of the tuple. another_tuple += ( 4 ,) When you add a new element to a tuple using another_tuple += (4,), this creates a new object in memory. The immutability of tuples is key to understanding this. Since tuples are immutable, any operation that leads to a changed tuple would result in an independent copy.\nThis is the reason why you don\u2019t need to explicitly copy immutable objects : it happens automatically under the hood. Here\u2019s an example. my_tuple = ( 1 , 2 , 3 ) another_tuple = my_tuple # both variables point to the same object another_tuple += ( 4 ,) # this statement creates a new independent object print ( another_tuple ) ( 1 , 2 , 3 , 4 ) print ( my_tuple ) # the old one remains unharmed ( 1 , 2 , 3 ) The situation is much different for mutable objects and much more confusing. Let\u2019s try the same example, but now for lists. my_list = [ 1 , 2 , 3 ] another_list = my_list # both variables point to the same object another_list += [ 4 ,] # this statement modifies the object in place print ( another_list ) [ 1 , 2 , 3 , 4 ] print ( my_list ) # the original list is modified [ 1 , 2 , 3 , 4 ] Mutable objects can be modified in place. Some operations modify the list in place and some operations don\u2019t. In this case, the statement another_list += [4,] calls another_list. iadd ([4,]) and iadd modifies the existing object in place.\nTo make things doubly confusing, we would have completely different results if we used a slightly different notation. my_list = [ 1 , 2 , 3 ] another_list = my_list # both variables point to the same object another_list = another_list + [ 4 ,] # this creates an independent copy print ( another_list ) [ 1 , 2 , 3 , 4 ] print ( my_list ) # the original list is unharmed [ 1 , 2 , 3 ] Woah! What\u2019s going on? What changed?\nIt turns out that when we change the third line, Python now internally calls a different function another_list. add ([4,]) instead of iadd . This function returns a new copy instead of modifying the list in place.\nTo prevent this confusion, it is always better to create a true copy of the list if you wish to prevent modification to the original.\nLet\u2019s remember the list copy methods from before. They were List.copy(), [:], list() and copy.copy(). This is what we should use. my_list = [ 1 , 2 , 3 ] another_list = my_list . copy () # this creates an independent copy another_list += [ 4 ,] # this statement modifies the independent copy print ( another_list ) [ 1 , 2 , 3 , 4 ] print ( my_list ) # the original list is unharmed [ 1 , 2 , 3 ] There\u2019s one last gotcha that can happen when copying lists.\nSuppose we have a list that has a nested list inside it. We copy this list using List.copy() and then modify the nested list. Unfortunately, this will modify the original list again! my_list = [[ 1 , 2 , 3 ], 4 , 5 ] another_list = my_list . copy () another_list [ 0 ] += [ 6 ,] print ( another_list ) [[ 1 , 2 , 3 , 6 ], 4 , 5 ] print ( my_list ) [[ 1 , 2 , 3 , 6 ], 4 , 5 ] Why did that happen? Didn\u2019t we just copy the original list?\nThe truth is : we actually don\u2019t have a completely independent copy in this case. The copy() function generates a shallow copy. To see what it does, let\u2019s look at the ids of all the elements in my_list and the ids of all the elements in the copied list. # for my_list my_list = [[ 1 , 2 , 3 ], 4 , 5 ] id ( my_list ) 140371873277424 print ([ id ( x ) for x in my_list ]) [ 140371873599288 , 13820176 , 13820152 ] # for another_list obtained by my_list.copy() id ( another_list ) 140371873317016 print ([ id ( x ) for x in another_list ]) [ 140371873599288 , 13820176 , 13820152 ] We see the ids of my_list and another_list are indeed different, indicating another_list is a copy. But the ids of the elements contained in another_list have the same ids as the elements in my_list . So the elements have not been copied!\nThis is the property of shallow copy. It creates a new copy of the object but reuses the attributes and elements of the old copy. Thus, when you modify the elements of the new copy, you are modifying the elements of the old copy too.\nTo solve this problem, we need to copy an object along with all its attributes and elements. This can be achieved by copy.deepcopy. my_list = [[ 1 , 2 , 3 ], 4 , 5 ] another_list = copy . deepcopy ( my_list ) another_list [ 0 ] += [ 6 ,] another_list [[ 1 , 2 , 3 , 6 ], 4 , 5 ] my_list [[ 1 , 2 , 3 ], 4 , 5 ] Deep copy is a quite time intensive operation and can take 1o times longer to complete compared to a shallow copy. But in some situations, it is unavoidable.", + "location": "/beginner/Variables_And_Assignment/#assignment-statements-in-python-are-more-interesting-than-you-might-think", + "text": "In this article, we will take a deep look at three kinds of assignment statements in Python and discuss what\u2019s going on under the hood. my_string = Hello World # right hand side is a simple expression another_string = my_string # right hand side is another variable another_string = another_string + ! # right hand side is an operation What we find may surprise you. What happens when the right hand side is a simple expression? my_string = Hello World In simple terms, this creates a string \u201cHello World\u201d in memory and assigns the name my_string to it. If you are using CPython[1], then we can even check the memory address explicitly by using the built in function id . my_string = \u201c Hello World \u201d id ( my_string ) 140400709562064 That big number 140400709562064 denotes where the data lives in the memory. It will be very useful for us in this entire discussion.\nWhat happens if we create another string with the same value? another_string = \u201c Hello World \u201d Does it reuse the previous \u201cHello World\u201d stored in memory or does it create an independent copy? Let\u2019s check this by querying the id function again. id ( another_string ) 140400709562208 This outputs a different id, so this must be an independent copy. We conclude that: Note: \nAssignment statements where the right hand side is a simple expression creates independent copies every time. While for everyday programming, this is the rule we should remember, there are actually some weird exceptions to this rule. Here\u2019s an example. my_string = \u201c hello \u201d id ( my_string ) 140400709562016 another_string = \u201c hello \u201d id ( another_string ) 140400709562016 In this case, two consecutive assignment statements did not create independent copies. Why?\nIt gets interesting now.\nFor optimizing memory, Python treats a special set of objects differently. The string \u201chello\u201d belongs to this privileged set and has a different behavior. The exact set depends on the implementation like CPython, PyPy, Jython or IronPython. For CPython, the special rule applies to: Strings without whitespaces and less than 20 characters and Integers from -5 to +255. These objects are always reused or interned. The rationale behind doing this is as follows: Since programmers use these objects frequently, interning existing\n objects saves memory. Since immutable objects like tuples and strings cannot be modified,\n there is no risk in interning the same object. However, Python does not do this for all immutable objects because there is a runtime cost involved for this feature. For interning an object, it must first search for the object in memory, and searching takes time. This is why the special treatment only applies for small integers and strings, because finding them is not that costly. What happens when the right hand side is an existing Python variable? \nLet\u2019s move on to the second type of assignment statement where the right hand side is an existing Python variable. another_string = my_string In this case, nothing is created in memory. After the assignment, both variables refer to the already existing object. It\u2019s basically like giving the object an additional nickname or alias. Let\u2019s confirm this by using the id function. my_string = \u201c Hello World \u201d id ( my_string ) 140400709562160 another_string = my_string id ( another_string ) 140400709562160 The natural question at this stage is : what if, instead of just giving the existing object an alias, we wanted to create an independent copy?\nFor mutable objects, this is possible. You can either use the copy module of Python (which works on all objects) or you may use copy methods specific to the class. For a list, you have several possibilities for creating copies, all of which have different runtime. my_list = [ 1 , 2 , 3 ] copy_of_my_list = my_list . copy () # fastest, works only on latest Python versions copy_of_my_list = my_list [:] # same runtime as List.copy() copy_of_my_list = list ( my_list ) # slightly slower import copy copy_of_my_list = copy . copy ( my_list ) # slowest How can you copy an immutable object? Well\u2026you can\u2019t! At least not in a straightforward way. If you try to use the copy module or the slicing notation, you will get back the same object and not an independent copy. Here\u2019s proof. # Standard ways of copying lists do not apply for tuples my_tuple = ( 1 , 2 , 3 ) id ( my_tuple ) 140371873244816 another_tuple = my_tuple [:] id ( another_tuple ) 140371873244816 # The copy module also doesn\u2019t help import copy another_tuple = copy . copy ( my_tuple ) id ( another_tuple ) 140371873244816 More importantly, there is no reason for explicitly copying an immutable object anyway. We will see why in a moment when we discuss the third kind of assignment statement. What happpens when the right hand side is an operation? In this case, what happens depends on the result of the operation. We will discuss two simple cases: adding an element to an immutable object (like a tuple) and adding an element to a mutable object (like a list). Let\u2019s start with the case of the tuple. another_tuple += ( 4 ,) When you add a new element to a tuple using another_tuple += (4,), this creates a new object in memory. The immutability of tuples is key to understanding this. Since tuples are immutable, any operation that leads to a changed tuple would result in an independent copy.\nThis is the reason why you don\u2019t need to explicitly copy immutable objects : it happens automatically under the hood. Here\u2019s an example. my_tuple = ( 1 , 2 , 3 ) another_tuple = my_tuple # both variables point to the same object another_tuple += ( 4 ,) # this statement creates a new independent object print ( another_tuple ) ( 1 , 2 , 3 , 4 ) print ( my_tuple ) # the old one remains unharmed ( 1 , 2 , 3 ) The situation is much different for mutable objects and much more confusing. Let\u2019s try the same example, but now for lists. my_list = [ 1 , 2 , 3 ] another_list = my_list # both variables point to the same object another_list += [ 4 ,] # this statement modifies the object in place print ( another_list ) [ 1 , 2 , 3 , 4 ] print ( my_list ) # the original list is modified [ 1 , 2 , 3 , 4 ] Mutable objects can be modified in place. Some operations modify the list in place and some operations don\u2019t. In this case, the statement another_list += [4,] calls another_list. iadd ([4,]) and iadd modifies the existing object in place.\nTo make things doubly confusing, we would have completely different results if we used a slightly different notation. my_list = [ 1 , 2 , 3 ] another_list = my_list # both variables point to the same object another_list = another_list + [ 4 ,] # this creates an independent copy print ( another_list ) [ 1 , 2 , 3 , 4 ] print ( my_list ) # the original list is unharmed [ 1 , 2 , 3 ] Woah! What\u2019s going on? What changed?\nIt turns out that when we change the third line, Python now internally calls a different function another_list. add ([4,]) instead of iadd . This function returns a new copy instead of modifying the list in place.\nTo prevent this confusion, it is always better to create a true copy of the list if you wish to prevent modification to the original.\nLet\u2019s remember the list copy methods from before. They were List.copy(), [:], list() and copy.copy(). This is what we should use. my_list = [ 1 , 2 , 3 ] another_list = my_list . copy () # this creates an independent copy another_list += [ 4 ,] # this statement modifies the independent copy print ( another_list ) [ 1 , 2 , 3 , 4 ] print ( my_list ) # the original list is unharmed [ 1 , 2 , 3 ] There\u2019s one last gotcha that can happen when copying lists.\nSuppose we have a list that has a nested list inside it. We copy this list using List.copy() and then modify the nested list. Unfortunately, this will modify the original list again! my_list = [[ 1 , 2 , 3 ], 4 , 5 ] another_list = my_list . copy () another_list [ 0 ] += [ 6 ,] print ( another_list ) [[ 1 , 2 , 3 , 6 ], 4 , 5 ] print ( my_list ) [[ 1 , 2 , 3 , 6 ], 4 , 5 ] Why did that happen? Didn\u2019t we just copy the original list?\nThe truth is : we actually don\u2019t have a completely independent copy in this case. The copy() function generates a shallow copy. To see what it does, let\u2019s look at the ids of all the elements in my_list and the ids of all the elements in the copied list. # for my_list my_list = [[ 1 , 2 , 3 ], 4 , 5 ] id ( my_list ) 140371873277424 print ([ id ( x ) for x in my_list ]) [ 140371873599288 , 13820176 , 13820152 ] # for another_list obtained by my_list.copy() id ( another_list ) 140371873317016 print ([ id ( x ) for x in another_list ]) [ 140371873599288 , 13820176 , 13820152 ] We see the ids of my_list and another_list are indeed different, indicating another_list is a copy. But the ids of the elements contained in another_list have the same ids as the elements in my_list . So the elements have not been copied!\nThis is the property of shallow copy. It creates a new copy of the object but reuses the attributes and elements of the old copy. Thus, when you modify the elements of the new copy, you are modifying the elements of the old copy too.\nTo solve this problem, we need to copy an object along with all its attributes and elements. This can be achieved by copy.deepcopy. my_list = [[ 1 , 2 , 3 ], 4 , 5 ] another_list = copy . deepcopy ( my_list ) another_list [ 0 ] += [ 6 ,] another_list [[ 1 , 2 , 3 , 6 ], 4 , 5 ] my_list [[ 1 , 2 , 3 ], 4 , 5 ] Deep copy is a quite time intensive operation and can take 1o times longer to complete compared to a shallow copy. But in some situations, it is unavoidable.", "title": "Assignment statements in Python are more interesting than you might think" - }, + }, { - "location": "/beginner/Variables_And_Assignment/#conclusion", - "text": "This brings me to the end of this discussion. To summarize, we have talked about the different scenarios which can arise in an assignment statement in Python. We found that: When the right hand side is a simple expression, a new copy is\n created every time. There are some exceptions to this rule, which\n depend on the implementation When the right hand side is an existing Python variable, then an\n alias is created for the existing copy. When the right hand side is an operation, then the outcome depends on\n the operation. In a simple case involving a tuple, we saw that an\n independent copy was created. In the same case with lists, we saw\n that the list was modified in place in one case (when we used\n iadd ) and a new copy was generated in another case (when we used add ). List item Mutable objects can be copied but immutable objects cannot be copied\n in a straightforward way. There is also no need to copy immutable\n objects. To copy a mutable object along with all its attributes and elements,\n we need to use deep copy. Source: https://medium.com/broken-window/many-names-one-memory-address-122f78734cb6", + "location": "/beginner/Variables_And_Assignment/#conclusion", + "text": "This brings me to the end of this discussion. To summarize, we have talked about the different scenarios which can arise in an assignment statement in Python. We found that: When the right hand side is a simple expression, a new copy is\n created every time. There are some exceptions to this rule, which\n depend on the implementation When the right hand side is an existing Python variable, then an\n alias is created for the existing copy. When the right hand side is an operation, then the outcome depends on\n the operation. In a simple case involving a tuple, we saw that an\n independent copy was created. In the same case with lists, we saw\n that the list was modified in place in one case (when we used\n iadd ) and a new copy was generated in another case (when we used add ). List item Mutable objects can be copied but immutable objects cannot be copied\n in a straightforward way. There is also no need to copy immutable\n objects. To copy a mutable object along with all its attributes and elements,\n we need to use deep copy. Source: https://medium.com/broken-window/many-names-one-memory-address-122f78734cb6", "title": "Conclusion" - }, + }, + { + "location": "/beginner/Conditions/", + "text": "Conditional Execution\n\n\nIn order to write useful programs, we almost always need the ability to check conditions\nand change the behavior of the program accordingly. Conditional statements give us this\nability. The simplest form is the if statement:\n\n\nif\n \nx\n \n \n0\n:\n\n \nprint\n \nx is positive\n\n\n\n\n\n\nThe boolean expression after if is called the condition. If it is true, then the indented\nstatement gets executed. If not, nothing happens.\nif statements have the same structure as function definitions: a header followed by an\nindented body. Statements like this are called compound statements.\nThere is no limit on the number of statements that can appear in the body, but there has\nto be at least one. Occasionally, it is useful to have a body with no statements (usually\nas a place keeper for code you haven\u2019t written yet). In that case, you can use the pass\nstatement, which does nothing.\n\n\nif\n \nx\n \n \n0\n:\n\n \npass\n \n# need to handle negative values!\n\n\n\n\n\n\nAlternative Execution\n\n\nA second form of the if statement is alternative execution, in which there are two\npossibilities and the condition determines which one gets executed. The syntax looks\nlike this:\n\n\nif\n \nx\n%\n2\n \n==\n \n0\n:\n\n \nprint\n \nx is even\n\n\nelse\n:\n\n \nprint\n \nx is odd\n\n\n\n\n\n\nIf the remainder when x is divided by 2 is 0, then we know that x is even, and the program\ndisplays a message to that effect. If the condition is false, the second set of statements is\nexecuted. Since the condition must be true or false, exactly one of the alternatives will\nbe executed. The alternatives are called branches, because they are branches in the flow\nof execution.\n\n\nChained Conditionals\n\n\nSometimes there are more than two possibilities and we need more than two branches.\nOne way to express a computation like that is a chained conditional: \n\n\nif\n \nx\n \n \ny\n:\n\n \nprint\n \nx is less than y\n\n\nelif\n \nx\n \n \ny\n:\n\n \nprint\n \nx is greater than y\n\n\nelse\n:\n\n \nprint\n \nx and y are equal\n\n\n\n\n\n\nelif is an abbreviation of \u201celse if.\u201d Again, exactly one branch will be executed. There is\nno limit on the number of elif statements. If there is an else clause, it has to be at the\nend, but there doesn\u2019t have to be one. \n\n\nif\n \nchoice\n \n==\n \na\n:\n\n \ndraw_a\n()\n\n\nelif\n \nchoice\n \n==\n \nb\n:\n\n \ndraw_b\n()\n\n\nelif\n \nchoice\n \n==\n \nc\n:\n\n \ndraw_c\n()\n\n\n\n\n\n\nEach condition is checked in order. If the first is false, the next is checked, and so on. If\none of them is true, the corresponding branch executes, and the statement ends. Even\nif more than one condition is true, only the first true branch executes.\n\n\nNested Conditionals\n\n\nOne conditional can also be nested within another. We could have written the tri\nchotomy example like this:\n\n\nif\n \nx\n \n==\n \ny\n:\n\n \nprint\n \nx and y are equal\n\n\nelse\n:\n\n \nif\n \nx\n \n \ny\n:\n\n \nprint\n \nx is less than y\n\n \nelse\n:\n\n \nprint\n \nx is greater than y\n\n\n\n\n\n\nThe outer conditional contains two branches. The first branch contains a simple state\nment. The second branch contains another if statement, which has two branches of its\nown. Those two branches are both simple statements, although they could have been\nconditional statements as well.\n\nAlthough the indentation of the statements makes the structure apparent, nested\nconditionals become difficult to read very quickly. In general, it is a good idea to avoid\nthem when you can.\n\nLogical operators often provide a way to simplify nested conditional statements. For\nexample, we can rewrite the following code using a single conditional: \n\n\nif\n \n0\n \n \nx\n:\n\n \nif\n \nx\n \n \n10\n:\n\n \nprint\n \nx is a positive single-digit number.\n\n\n\n\n\n\nThe print statement is executed only if we make it past both conditionals, so we can\nget the same effect with the and operator: \n\n\nif\n \n0\n \n \nx\n \nand\n \nx\n \n \n10\n:\n\n \nprint\n \nx is a positive single-digit number.\n\n\n\n\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nIf-Else statements in Python By Udemy\n\n\nThe if-else statement is a staple of most programming languages. It is used to test different conditions and execute code accordingly. You can think of it as a \u2018map\u2019 used to make decisions in the program.\n\n\nThe basic syntax is as follows:\n\n\nif\n \ncondition1\n \n=\n \nTrue\n:\n\n \nexecute\n \ncode1\n\n\nelse\n:\n \n \nexecute\n \ncode2\n\n\n\n\n\n\nIn plain English, this can be described as follows:\n\nIf condition1 is true, then execute the code included in code1. If it is not true, then run code2\n\n\nA few things to note about the syntax:\n- Each if/else statement must close with a colon (:)\n- Code to be executed as part of any if/else statement must be indented by four spaces, equivalent to one press of the Tab key.\n- Although not explicitly required, every if statement must also include an else statement \u2013 it just makes for a better program.\n\n\nYou use if-else statements a lot in your every day. Virtually every decision you make involves some form of if-else statements. \u201cIf the bacon is cheap, I\u2019ll buy a pound. If not, I\u2019ll grab some mac and cheese\u201d, \u201cif I wake up before 6, I\u2019ll head out for a jog. Otherwise, I\u2019ll head straight to work\u201d, and \u201cif the traffic is light, we\u2019ll make the movie theater in time. Else, we\u2019ll just have to grab dinner and go back home\u201d \u2013 these are some simple if-else decisions we\u2019ve all made in our everyday life. Thus, by using if-else statements in Python, you give the program the ability to make decisions depending on the user input.\n\n\nBut enough talk; let\u2019s try to understand if-else statements with an example:\n\n\nx\n \n=\n \n5\n\n\nif\n \nx\n \n \n5\n:\n\n \nprint\n \nX is larger than five!\n\n\nelse\n:\n\n \nprint\n \nX is smaller than or equal to five!\n\n\n\n\n\n\nthis program basically instructs Python to:\n- Check the value of x.\n- If the value of x is more than 5, print that \u201cX is larger than five\u201d.\n- If the value of x is less than or equal to 5, print \u201cX is smaller than or equal to five\u201d.\n\n\nAs we\u2019ll learn below, the decision making capabilities of if-else conditions will come very handy when you want to create complicated programs.\n\n\nTesting Multiple Conditions with Elif\n\n\nThe above if-else syntax is great if you want to test just one condition, but what happens when you want to check multiple conditions?\n\n\nThis is where the Elif statement comes in handy.\n\nElif is a shortened form of Else-If. The syntax can be seen as follows:\n\n\nif\n \ncondition1\n \n=\n \nTrue\n:\n\n \nexecute\n \ncode1\n\n\nelif\n \ncondition2\n \n=\n \nTrue\n:\n\n \nexecute\n \ncode2\n\n\nelse\n:\n \n \nexecute\n \ncode3\n\n\n\n\n\n\nIn plain English, you can read this as follows:\n\nIf condition1 is true, execute code1. Else, if condition2 is true, execute code2. If neither condition1 or condition2 are true, execute code3.\n\n\nThere is no limit to the number of elif statements you can include in a Python program. You can test dozens of conditions using multiple elif statements as long as you close with an else statement.\n\nLet\u2019s try to understand this with an example: \n\n\nx\n \n=\n \n5\n\n\nif\n \nx\n \n==\n \n5\n:\n\n \nprint\n \nWow, X is EXACTLY five!\n\n\nelif\n \nx\n \n \n5\n:\n\n \nprint\n \nX is now MORE than five!\n\n\nelse\n:\n\n \nprint\n \nX is now LESS than five!\n\n\n\n\n\n\nSo what exactly is happening here? Let\u2019s break it down into individual steps: \n\n\n\n\nPython first checks if the value of x is exactly equal to 5, as given in the first if statement.\n\n\nIf x is equal to five, Python executes the code included within the first if statement and exits the program.\n\n\nIf, however, x is not equal to 5, Python goes to the second elif statement. It now checks if x is greater than 5.\n\n\nIn case x is more than 5, Python executes the second block of code under the elif statement and exits the program.\n\n\nHowever, if both conditions are not met, that is, x is neither equal to, nor greater than five, Python displays the output under the third else statement.\n\n\n\n\nAs mentioned above, an if-else conditional block can include as many elif statements as you want.\n\n\nNested If-Else Statements\n\n\nSo far, we\u2019ve used just a single level of if-else statements. But what if you want to make decisions within decisions? That\u2019s like saying: \u201cif the oranges are fresh, buy a dozen if they are more than $5/lb, and two dozen if they are less than $5/lb\u201d\n\n\nIn programmer-speak (i.e. algorithmically) this can be written as follows: \n\n\norange_quality\n \n=\n \n\u201c\nfresh\n\u201d\n\n\norange_price\n \n=\n \n4.0\n\n\nif\n \norange_quality\n \n==\n \n\u201c\nfresh\n\u201d\n:\n\n \nif\n \norange_price\n \n \n5\n:\n\n \nbuy\n \n24.0\n\n \nelse\n:\n \n \nbuy\n \n12.0\n\n\nelse\n:\n\n \ndon\n\u2019\nt_buy_oranges\n\n\n\n\n\n\nThis is an example of a nested if-else statement \u2013 an if-else statement inside another if-else statement. These can help you make more complex decisions and give you even finer control over the program flow. In terms of syntax, they can be written as follows: \n\n\nif\n \ncondition1\n \n=\n \nTrue\n:\n\n \nif\n \ncondition2\n \n=\n \nTrue\n:\n\n \nexecute\n \ncode1\n\n \nelif\n \ncondition3\n \n=\n \nTrue\n:\n\n \nexecute\n \ncode2\n\n \nelse\n:\n\n \nexecute\n \ncode3\n\n\nelse\n:\n\n \nexecute\n \ncode4\n\n\n\n\n\n\nThus, the syntax rules are the same as a standard if-statement \u2013 i.e. nested statements must be tabbed in. Theoretically, you can nest as many if-else statements as you want, but it is poor practice to go more than two levels deep. \n\n\n\n\nSource:\n \n\n\n https://blog.udemy.com/python-if-else/\n\n\n\n\nHow To Write Conditional Statements in Python 3\n\n\nConditional statements are part of every programming language. With conditional statements, we can have code that sometimes runs and at other times does not run, depending on the conditions of the program at that time.\n\n\nWhen we fully execute each statement of a program, moving from the top to the bottom with each line executed in order, we are not asking the program to evaluate specific conditions. By using conditional statements, programs can determine whether certain conditions are being met and then be told what to do next. \n\n\nLet\u2019s look at some examples where we would use conditional statements: \n\n\n\n\nIf the student receives over 65% on her test, report that her grade passes; if not, report that her grade fails\n\n\nIf he has money in his account, calculate interest; if he doesn\u2019t, charge a penalty fee\n\n\nIf they buy 10 oranges or more, calculate a discount of 5%; if they buy fewer, then don\u2019t\n\n\n\n\nThrough evaluating conditions and assigning code to run based on whether or not those conditions are met, we are writing conditional code. \n\n\nThis tutorial will take you through writing conditional statements in the Python programming language. \n\n\nIf statement\n\n\nWe will start with the if statement, which will evaluate whether a statement is true or false, and run code only in the case that the statement is true.\n\n\nIn a plain text editor, open a file and write the following code: \n\n\ngrade\n \n=\n \n70\n\n\n\nif\n \ngrade\n \n=\n \n65\n:\n\n \nprint\n(\nPassing grade\n)\n\n\n\n\n\n\nWith this code, we have the variable grade and are giving it the integer value of 70. We are then using the if statement to evaluate whether or not the variable grade is greater than or equal ( \n= ) to 65. If it does meet this condition, we are telling the program to print out the string Passing grade.\n\n\nIn this case, the grade of 70 does meet the condition of being greater than or equal to 65, so you will receive the following output once you run the program: \n\n\nOutput\n\n\nPassing\n \ngrade\n\n\n\n\n\n\nLet\u2019s now change the result of this program by changing the value of the grade variable to 60:\n\n\ngrade\n \n=\n \n60\n\n\n\nif\n \ngrade\n \n=\n \n65\n:\n\n \nprint\n(\nPassing grade\n)\n\n\n\n\n\n\nWhen we save and run this code, we will receive no output because the condition was not met and we did not tell the program to execute another statement.\n\n\nTo give one more example, let us calculate whether a bank account balance is below 0. Let\u2019s create a file called \naccount.py\n and write the following program:\n\n\nbalance\n \n=\n \n-\n5\n\n\n\nif\n \nbalance\n \n \n0\n:\n\n \nprint\n(\nBalance is below 0, add funds now or you will be charged a penalty.\n)\n\n\n\n\n\n\nWhen we run the program with python account.py, we\u2019ll receive the following output:\n\n\nOutput\n\n\nBalance\n \nis\n \nbelow\n \n0\n,\n \nadd\n \nfunds\n \nnow\n \nor\n \nyou\n \nwill\n \nbe\n \ncharged\n \na\n \npenalty\n.\n\n\n\n\n\n\nIn the program we initialized the variable \nbalance\n with the value of -5, which is less than 0. Since the balance met the condition of the if statement (balance \n 0), once we save and run the code, we will receive the string output. Again, if we change the balance to 0 or a positive number, we will receive no output.\n\n\nElse Statement\n\n\nIt is likely that we will want the program to do something even when an \nif\n statement evaluates to false. In our grade example, we will want output whether the grade is passing or failing.\n\n\nTo do this, we will add an else statement to the grade condition above that is constructed like this:\n\n\ngrade\n \n=\n \n60\n\n\n\nif\n \ngrade\n \n=\n \n65\n:\n\n \nprint\n(\nPassing grade\n)\n\n\n\nelse\n:\n\n \nprint\n(\nFailing grade\n)\n\n\n\n\n\n\nSince the grade variable above has the value of 60, the if statement evaluates as false, so the program will not print out Passing grade. The else statement that follows tells the program to do something anyway.\n\n\nWhen we save and run the program, we\u2019ll receive the following output:\n\n\nOutput\n\n\nFailing\n \ngrade\n\n\n\n\n\n\nIf we then rewrite the program to give the grade a value of \n65\n or higher, we will instead receive the output \nPassing grade\n.\n\n\nTo add an else statement to the bank account example, we rewrite the code like this:\n\n\nbalance\n \n=\n \n522\n\n\n\nif\n \nbalance\n \n \n0\n:\n\n \nprint\n(\nBalance is below 0, add funds now or you will be charged a penalty.\n)\n\n\n\nelse\n:\n\n \nprint\n(\nYour balance is 0 or above.\n)\n\n\n\n\n\n\nHere, we changed the balance variable value to a positive number so that the else statement will print. To get the first if statement to print, we can rewrite the value to a negative number.\n\n\nBy combining an if statement with an else statement, you are constructing a two-part conditional statement that will tell the computer to execute certain code whether or not the if condition is met. \n\n\nElse if statement\n\n\nSo far, we have presented a Boolean option for conditional statements, with each if statement evaluating to either true or false. In many cases, we will want a program that evaluates more than two possible outcomes. For this, we will use an else if statement, which is written in Python as elif. The elif or else if statement looks like the if statement and will evaluate another condition.\n\n\nIn the bank account program, we may want to have three discrete outputs for three different situations:\n\n\n\n\nThe balance is below 0\n\n\nThe balance is equal to 0\n\n\nThe balance is above 0\n\n\n\n\nThe \nelif\n statement will be placed between the if statement and the else statement as follows:\n\n\n.\n \n.\n \n.\n\n\nif\n \nbalance\n \n \n0\n:\n\n \nprint\n(\nBalance is below 0, add funds now or you will be charged a penalty.\n)\n\n\n\nelif\n \nbalance\n \n==\n \n0\n:\n\n \nprint\n(\nBalance is equal to 0, add funds soon.\n)\n\n\n\nelse\n:\n\n \nprint\n(\nYour balance is 0 or above.\n)\n\n\n\n\n\n\nNow, there are three possible outputs that can occur once we run the program:\n- If the variable balance is equal to 0 we will receive the output from the elif statement (Balance is equal to 0, add funds soon.)\n- If the variable balance is set to a positive number, we will receive the output from the else statement (Your balance is 0 or above.).\n- If the variable balance is set to a negative number, the output will be the string from the if statement (Balance is below 0, add funds now or you will be charged a penalty).\n\n\nWhat if we want to have more than three possibilities, though? We can do this by writing more than one elif statement into our code.\n\n\nIn the \ngrade.py\n program, let\u2019s rewrite the code so that there are a few letter grades corresponding to ranges of numerical grades:\n\n\n\n\n90 or above is equivalent to an A grade\n\n\n80-89 is equivalent to a B grade\n\n\n70-79 is equivalent to a C grade\n\n\n65-69 is equivalent to a D grade\n\n\n64 or below is equivalent to an F grade\n\n\n\n\nTo run this code, we will need one \nif\n statement, three \nelif\n statements, and an \nelse\n statement that will handle all failing cases.\n\n\nLet\u2019s rewrite the code from the example above to have strings that print out each of the letter grades. We can keep our else statement the same.\n\n\n.\n \n.\n \n.\n\n\nif\n \ngrade\n \n=\n \n90\n:\n\n \nprint\n(\nA grade\n)\n\n\n\nelif\n \ngrade\n \n=\n80\n:\n\n \nprint\n(\nB grade\n)\n\n\n\nelif\n \ngrade\n \n=\n70\n:\n\n \nprint\n(\nC grade\n)\n\n\n\nelif\n \ngrade\n \n=\n \n65\n:\n\n \nprint\n(\nD grade\n)\n\n\n\nelse\n:\n\n \nprint\n(\nFailing grade\n)\n\n\n\n\n\n\nSince elif statements will evaluate in order, we can keep our statements pretty basic. This program is completing the following steps:\n\n\n\n\nIf the grade is greater than 90, the program will print A grade, if the grade is less than 90, the program will continue to the next statement...\n\n\nIf the grade is greater than or equal to 80, the program will print B grade, if the grade is 79 or less, the program will continue to the next statement...\n\n\nIf the grade is greater than or equal to 70, the program will print C grade, if the grade is 69 or less, the program will continue to the next statement...\n\n\nIf the grade is greater than or equal to 65, the program will print D grade, if the grade is 64 or less, the program will continue to the next statement...\n\n\nThe program will print Failing grade because all of the above conditions were not met.\n\n\n\n\nNested If Statements\n\n\nOnce you are feeling comfortable with the if, elif, and else statements, you can move on to nested conditional statements. We can use nested if statements for situations where we want to check for a secondary condition if the first condition executes as true. For this, we can have an if-else statement inside of another if-else statement. Let\u2019s look at the syntax of a nested if statement:\n\n\nif\n \nstatement1\n:\n \n#outer if statement\n\n \nprint\n(\ntrue\n)\n\n\n \nif\n \nnested_statement\n:\n \n#nested if statement\n\n \nprint\n(\nyes\n)\n\n\n \nelse\n:\n \n#nested else statement\n\n \nprint\n(\nno\n)\n\n\n\nelse\n:\n \n#outer else statement\n\n \nprint\n(\nfalse\n)\n\n\n\n\n\n\nA few possible outputs can result from this code:\n\n- If \nstatement1\n evaluates to true, the program will then evaluate whether the nested_statement also evaluates to true. If both cases are true, the output will be:\n\n\nOutput\n\n\ntrue\n\n\nyes\n\n\n\n\n\n\n\n\nIf, however, statement1 evaluates to true, but nested_statement evaluates to false, then the output will be:\n\n\n\n\nOutput\n\n\ntrue\n\n\nno\n\n\n\n\n\n\n\n\nAnd if statement1 evaluates to false, the nested if-else statement will not run, so the else statement will run alone, and the output will be:\n\n\n\n\nOutput\n\n\nfalse\n\n\n\n\n\n\nWe can also have multiple if statements nested throughout our code:\n\n\nif\n \nstatement1\n:\n \n#outer if \n\n \nprint\n(\nhello world\n)\n\n\n \nif\n \nnested_statement1\n:\n \n#first nested if \n\n \nprint\n(\nyes\n)\n\n\n \nelif\n \nnested_statement2\n:\n \n#first nested elif\n\n \nprint\n(\nmaybe\n)\n\n\n \nelse\n:\n \n#first nested else\n\n \nprint\n(\nno\n)\n\n\n\nelif\n \nstatement2\n:\n \n#outer elif\n\n \nprint\n(\nhello galaxy\n)\n\n\n \nif\n \nnested_statement3\n:\n \n#second nested if\n\n \nprint\n(\nyes\n)\n\n\n \nelif\n \nnested_statement4\n:\n \n#second nested elif\n\n \nprint\n(\nmaybe\n)\n\n\n \nelse\n:\n \n#second nested else\n\n \nprint\n(\nno\n)\n\n\n\nelse\n:\n \n#outer else\n\n \nstatement\n(\nhello universe\n)\n\n\n\n\n\n\nIn the above code, there is a nested if statement inside each if statement in addition to the elif statement. This will allow for more options within each condition.\n\n\nLet\u2019s look at an example of nested if statements with our grade.py program. We can check for whether a grade is passing first (greater than or equal to 65%), then evaluate which letter grade the numerical grade should be equivalent to. If the grade is not passing, though, we do not need to run through the letter grades, and instead can have the program report that the grade is failing. Our modified code with the nested if statement will look like this:\n\n\n.\n \n.\n \n.\n\n\nif\n \ngrade\n \n=\n \n65\n:\n\n \nprint\n(\nPassing grade of:\n)\n\n\n \nif\n \ngrade\n \n=\n \n90\n:\n\n \nprint\n(\nA\n)\n\n\n \nelif\n \ngrade\n \n=\n80\n:\n\n \nprint\n(\nB\n)\n\n\n \nelif\n \ngrade\n \n=\n70\n:\n\n \nprint\n(\nC\n)\n\n\n \nelif\n \ngrade\n \n=\n \n65\n:\n\n \nprint\n(\nD\n)\n\n\n\nelse\n:\n\n \nprint\n(\nFailing grade\n)\n\n\n\n\n\n\nIf we run the code with the variable grade set to the integer value 92, the first condition is met, and the program will print out Passing grade of:. Next, it will check to see if the grade is greater than or equal to 90, and since this condition is also met, it will print out A.\n\n\nIf we run the code with the grade variable set to 60, then the first condition is not met, so the program will skip the nested if statements and move down to the else statement, with the program printing out \nFailing grade\n.\n\n\nWe can of course add even more options to this, and use a second layer of nested if statements. Perhaps we will want to evaluate for grades of A+, A and A- separately. We can do so by first checking if the grade is passing, then checkingto see if the grade is 90 or above, then checkingto see if the grade is over 96 for an A+ for instance:\n\n\n.\n \n.\n \n.\n\n\nif\n \ngrade\n \n=\n \n65\n:\n\n \nprint\n(\nPassing grade of:\n)\n\n\n \nif\n \ngrade\n \n=\n \n90\n:\n\n \nif\n \ngrade\n \n \n96\n:\n\n \nprint\n(\nA+\n)\n\n\n \nelif\n \ngrade\n \n \n93\n \nand\n \ngrade\n \n=\n \n96\n:\n\n \nprint\n(\nA\n)\n\n\n \nelif\n \ngrade\n \n=\n \n90\n:\n\n \nprint\n(\nA-\n)\n\n\n.\n \n.\n \n.\n\n\n\n\n\n\nIn the code above, for a grade variable set to 96, the program will run the following:\n\n\n\n\nCheck if the grade is greater than or equal to 65 (true)\n\n\nPrint out Passing grade of:\n\n\nCheck if the grade is greater than or equal to 90 (true)\n\n\nCheck if the grade is greater than 96 (false)\n\n\nCheck if the grade is greater than 93 and also less than or equal to 96 (true)\n\n\nPrint A\n\n\nLeave these nested conditional statements and continue with remaining code\n\n\n\n\nThe output of the program for a grade of 96 therefore looks like this:\n\n\nOutput\n\n\nPassing\n \ngrade\n \nof\n:\n\n\nA\n\n\n\n\n\n\nNested if statements can provide the opportunity to add several specific levels of conditions to your code.\n\n\nConclusion\n\n\nBy using conditional statements like the if statement, you will have greater control over what your program executes. Conditional statements tell the program to evaluate whether a certain condition is being met. If the condition is met it will execute specific code, but if it is not met the program will continue to move down to other code.\n\n\n\n\nSource:\n \n\n\n https://www.digitalocean.com/community/tutorials/how-to-write-conditional-statements-in-python-3-2", + "title": "Conditions" + }, + { + "location": "/beginner/Conditions/#conditional-execution", + "text": "In order to write useful programs, we almost always need the ability to check conditions\nand change the behavior of the program accordingly. Conditional statements give us this\nability. The simplest form is the if statement: if x 0 : \n print x is positive The boolean expression after if is called the condition. If it is true, then the indented\nstatement gets executed. If not, nothing happens.\nif statements have the same structure as function definitions: a header followed by an\nindented body. Statements like this are called compound statements.\nThere is no limit on the number of statements that can appear in the body, but there has\nto be at least one. Occasionally, it is useful to have a body with no statements (usually\nas a place keeper for code you haven\u2019t written yet). In that case, you can use the pass\nstatement, which does nothing. if x 0 : \n pass # need to handle negative values!", + "title": "Conditional Execution" + }, + { + "location": "/beginner/Conditions/#alternative-execution", + "text": "A second form of the if statement is alternative execution, in which there are two\npossibilities and the condition determines which one gets executed. The syntax looks\nlike this: if x % 2 == 0 : \n print x is even else : \n print x is odd If the remainder when x is divided by 2 is 0, then we know that x is even, and the program\ndisplays a message to that effect. If the condition is false, the second set of statements is\nexecuted. Since the condition must be true or false, exactly one of the alternatives will\nbe executed. The alternatives are called branches, because they are branches in the flow\nof execution.", + "title": "Alternative Execution" + }, + { + "location": "/beginner/Conditions/#chained-conditionals", + "text": "Sometimes there are more than two possibilities and we need more than two branches.\nOne way to express a computation like that is a chained conditional: if x y : \n print x is less than y elif x y : \n print x is greater than y else : \n print x and y are equal elif is an abbreviation of \u201celse if.\u201d Again, exactly one branch will be executed. There is\nno limit on the number of elif statements. If there is an else clause, it has to be at the\nend, but there doesn\u2019t have to be one. if choice == a : \n draw_a () elif choice == b : \n draw_b () elif choice == c : \n draw_c () Each condition is checked in order. If the first is false, the next is checked, and so on. If\none of them is true, the corresponding branch executes, and the statement ends. Even\nif more than one condition is true, only the first true branch executes.", + "title": "Chained Conditionals" + }, + { + "location": "/beginner/Conditions/#nested-conditionals", + "text": "One conditional can also be nested within another. We could have written the tri\nchotomy example like this: if x == y : \n print x and y are equal else : \n if x y : \n print x is less than y \n else : \n print x is greater than y The outer conditional contains two branches. The first branch contains a simple state\nment. The second branch contains another if statement, which has two branches of its\nown. Those two branches are both simple statements, although they could have been\nconditional statements as well. \nAlthough the indentation of the statements makes the structure apparent, nested\nconditionals become difficult to read very quickly. In general, it is a good idea to avoid\nthem when you can. \nLogical operators often provide a way to simplify nested conditional statements. For\nexample, we can rewrite the following code using a single conditional: if 0 x : \n if x 10 : \n print x is a positive single-digit number. The print statement is executed only if we make it past both conditionals, so we can\nget the same effect with the and operator: if 0 x and x 10 : \n print x is a positive single-digit number. Source: Think Python by Allen B. Downey - 2012", + "title": "Nested Conditionals" + }, + { + "location": "/beginner/Conditions/#if-else-statements-in-python-by-udemy", + "text": "The if-else statement is a staple of most programming languages. It is used to test different conditions and execute code accordingly. You can think of it as a \u2018map\u2019 used to make decisions in the program. The basic syntax is as follows: if condition1 = True : \n execute code1 else : \n execute code2 In plain English, this can be described as follows: If condition1 is true, then execute the code included in code1. If it is not true, then run code2 A few things to note about the syntax:\n- Each if/else statement must close with a colon (:)\n- Code to be executed as part of any if/else statement must be indented by four spaces, equivalent to one press of the Tab key.\n- Although not explicitly required, every if statement must also include an else statement \u2013 it just makes for a better program. You use if-else statements a lot in your every day. Virtually every decision you make involves some form of if-else statements. \u201cIf the bacon is cheap, I\u2019ll buy a pound. If not, I\u2019ll grab some mac and cheese\u201d, \u201cif I wake up before 6, I\u2019ll head out for a jog. Otherwise, I\u2019ll head straight to work\u201d, and \u201cif the traffic is light, we\u2019ll make the movie theater in time. Else, we\u2019ll just have to grab dinner and go back home\u201d \u2013 these are some simple if-else decisions we\u2019ve all made in our everyday life. Thus, by using if-else statements in Python, you give the program the ability to make decisions depending on the user input. But enough talk; let\u2019s try to understand if-else statements with an example: x = 5 if x 5 : \n print X is larger than five! else : \n print X is smaller than or equal to five! this program basically instructs Python to:\n- Check the value of x.\n- If the value of x is more than 5, print that \u201cX is larger than five\u201d.\n- If the value of x is less than or equal to 5, print \u201cX is smaller than or equal to five\u201d. As we\u2019ll learn below, the decision making capabilities of if-else conditions will come very handy when you want to create complicated programs.", + "title": "If-Else statements in Python By Udemy" + }, + { + "location": "/beginner/Conditions/#testing-multiple-conditions-with-elif", + "text": "The above if-else syntax is great if you want to test just one condition, but what happens when you want to check multiple conditions? This is where the Elif statement comes in handy. \nElif is a shortened form of Else-If. The syntax can be seen as follows: if condition1 = True : \n execute code1 elif condition2 = True : \n execute code2 else : \n execute code3 In plain English, you can read this as follows: If condition1 is true, execute code1. Else, if condition2 is true, execute code2. If neither condition1 or condition2 are true, execute code3. There is no limit to the number of elif statements you can include in a Python program. You can test dozens of conditions using multiple elif statements as long as you close with an else statement. \nLet\u2019s try to understand this with an example: x = 5 if x == 5 : \n print Wow, X is EXACTLY five! elif x 5 : \n print X is now MORE than five! else : \n print X is now LESS than five! So what exactly is happening here? Let\u2019s break it down into individual steps: Python first checks if the value of x is exactly equal to 5, as given in the first if statement. If x is equal to five, Python executes the code included within the first if statement and exits the program. If, however, x is not equal to 5, Python goes to the second elif statement. It now checks if x is greater than 5. In case x is more than 5, Python executes the second block of code under the elif statement and exits the program. However, if both conditions are not met, that is, x is neither equal to, nor greater than five, Python displays the output under the third else statement. As mentioned above, an if-else conditional block can include as many elif statements as you want.", + "title": "Testing Multiple Conditions with Elif" + }, + { + "location": "/beginner/Conditions/#nested-if-else-statements", + "text": "So far, we\u2019ve used just a single level of if-else statements. But what if you want to make decisions within decisions? That\u2019s like saying: \u201cif the oranges are fresh, buy a dozen if they are more than $5/lb, and two dozen if they are less than $5/lb\u201d In programmer-speak (i.e. algorithmically) this can be written as follows: orange_quality = \u201c fresh \u201d orange_price = 4.0 if orange_quality == \u201c fresh \u201d : \n if orange_price 5 : \n buy 24.0 \n else : \n buy 12.0 else : \n don \u2019 t_buy_oranges This is an example of a nested if-else statement \u2013 an if-else statement inside another if-else statement. These can help you make more complex decisions and give you even finer control over the program flow. In terms of syntax, they can be written as follows: if condition1 = True : \n if condition2 = True : \n execute code1 \n elif condition3 = True : \n execute code2 \n else : \n execute code3 else : \n execute code4 Thus, the syntax rules are the same as a standard if-statement \u2013 i.e. nested statements must be tabbed in. Theoretically, you can nest as many if-else statements as you want, but it is poor practice to go more than two levels deep. Source: https://blog.udemy.com/python-if-else/", + "title": "Nested If-Else Statements" + }, + { + "location": "/beginner/Conditions/#how-to-write-conditional-statements-in-python-3", + "text": "Conditional statements are part of every programming language. With conditional statements, we can have code that sometimes runs and at other times does not run, depending on the conditions of the program at that time. When we fully execute each statement of a program, moving from the top to the bottom with each line executed in order, we are not asking the program to evaluate specific conditions. By using conditional statements, programs can determine whether certain conditions are being met and then be told what to do next. Let\u2019s look at some examples where we would use conditional statements: If the student receives over 65% on her test, report that her grade passes; if not, report that her grade fails If he has money in his account, calculate interest; if he doesn\u2019t, charge a penalty fee If they buy 10 oranges or more, calculate a discount of 5%; if they buy fewer, then don\u2019t Through evaluating conditions and assigning code to run based on whether or not those conditions are met, we are writing conditional code. This tutorial will take you through writing conditional statements in the Python programming language.", + "title": "How To Write Conditional Statements in Python 3" + }, + { + "location": "/beginner/Conditions/#if-statement", + "text": "We will start with the if statement, which will evaluate whether a statement is true or false, and run code only in the case that the statement is true. In a plain text editor, open a file and write the following code: grade = 70 if grade = 65 : \n print ( Passing grade ) With this code, we have the variable grade and are giving it the integer value of 70. We are then using the if statement to evaluate whether or not the variable grade is greater than or equal ( = ) to 65. If it does meet this condition, we are telling the program to print out the string Passing grade. In this case, the grade of 70 does meet the condition of being greater than or equal to 65, so you will receive the following output once you run the program: Output Passing grade Let\u2019s now change the result of this program by changing the value of the grade variable to 60: grade = 60 if grade = 65 : \n print ( Passing grade ) When we save and run this code, we will receive no output because the condition was not met and we did not tell the program to execute another statement. To give one more example, let us calculate whether a bank account balance is below 0. Let\u2019s create a file called account.py and write the following program: balance = - 5 if balance 0 : \n print ( Balance is below 0, add funds now or you will be charged a penalty. ) When we run the program with python account.py, we\u2019ll receive the following output: Output Balance is below 0 , add funds now or you will be charged a penalty . In the program we initialized the variable balance with the value of -5, which is less than 0. Since the balance met the condition of the if statement (balance 0), once we save and run the code, we will receive the string output. Again, if we change the balance to 0 or a positive number, we will receive no output.", + "title": "If statement" + }, + { + "location": "/beginner/Conditions/#else-statement", + "text": "It is likely that we will want the program to do something even when an if statement evaluates to false. In our grade example, we will want output whether the grade is passing or failing. To do this, we will add an else statement to the grade condition above that is constructed like this: grade = 60 if grade = 65 : \n print ( Passing grade ) else : \n print ( Failing grade ) Since the grade variable above has the value of 60, the if statement evaluates as false, so the program will not print out Passing grade. The else statement that follows tells the program to do something anyway. When we save and run the program, we\u2019ll receive the following output: Output Failing grade If we then rewrite the program to give the grade a value of 65 or higher, we will instead receive the output Passing grade . To add an else statement to the bank account example, we rewrite the code like this: balance = 522 if balance 0 : \n print ( Balance is below 0, add funds now or you will be charged a penalty. ) else : \n print ( Your balance is 0 or above. ) Here, we changed the balance variable value to a positive number so that the else statement will print. To get the first if statement to print, we can rewrite the value to a negative number. By combining an if statement with an else statement, you are constructing a two-part conditional statement that will tell the computer to execute certain code whether or not the if condition is met.", + "title": "Else Statement" + }, + { + "location": "/beginner/Conditions/#else-if-statement", + "text": "So far, we have presented a Boolean option for conditional statements, with each if statement evaluating to either true or false. In many cases, we will want a program that evaluates more than two possible outcomes. For this, we will use an else if statement, which is written in Python as elif. The elif or else if statement looks like the if statement and will evaluate another condition. In the bank account program, we may want to have three discrete outputs for three different situations: The balance is below 0 The balance is equal to 0 The balance is above 0 The elif statement will be placed between the if statement and the else statement as follows: . . . if balance 0 : \n print ( Balance is below 0, add funds now or you will be charged a penalty. ) elif balance == 0 : \n print ( Balance is equal to 0, add funds soon. ) else : \n print ( Your balance is 0 or above. ) Now, there are three possible outputs that can occur once we run the program:\n- If the variable balance is equal to 0 we will receive the output from the elif statement (Balance is equal to 0, add funds soon.)\n- If the variable balance is set to a positive number, we will receive the output from the else statement (Your balance is 0 or above.).\n- If the variable balance is set to a negative number, the output will be the string from the if statement (Balance is below 0, add funds now or you will be charged a penalty). What if we want to have more than three possibilities, though? We can do this by writing more than one elif statement into our code. In the grade.py program, let\u2019s rewrite the code so that there are a few letter grades corresponding to ranges of numerical grades: 90 or above is equivalent to an A grade 80-89 is equivalent to a B grade 70-79 is equivalent to a C grade 65-69 is equivalent to a D grade 64 or below is equivalent to an F grade To run this code, we will need one if statement, three elif statements, and an else statement that will handle all failing cases. Let\u2019s rewrite the code from the example above to have strings that print out each of the letter grades. We can keep our else statement the same. . . . if grade = 90 : \n print ( A grade ) elif grade = 80 : \n print ( B grade ) elif grade = 70 : \n print ( C grade ) elif grade = 65 : \n print ( D grade ) else : \n print ( Failing grade ) Since elif statements will evaluate in order, we can keep our statements pretty basic. This program is completing the following steps: If the grade is greater than 90, the program will print A grade, if the grade is less than 90, the program will continue to the next statement... If the grade is greater than or equal to 80, the program will print B grade, if the grade is 79 or less, the program will continue to the next statement... If the grade is greater than or equal to 70, the program will print C grade, if the grade is 69 or less, the program will continue to the next statement... If the grade is greater than or equal to 65, the program will print D grade, if the grade is 64 or less, the program will continue to the next statement... The program will print Failing grade because all of the above conditions were not met.", + "title": "Else if statement" + }, + { + "location": "/beginner/Conditions/#nested-if-statements", + "text": "Once you are feeling comfortable with the if, elif, and else statements, you can move on to nested conditional statements. We can use nested if statements for situations where we want to check for a secondary condition if the first condition executes as true. For this, we can have an if-else statement inside of another if-else statement. Let\u2019s look at the syntax of a nested if statement: if statement1 : #outer if statement \n print ( true ) \n\n if nested_statement : #nested if statement \n print ( yes ) \n\n else : #nested else statement \n print ( no ) else : #outer else statement \n print ( false ) A few possible outputs can result from this code: \n- If statement1 evaluates to true, the program will then evaluate whether the nested_statement also evaluates to true. If both cases are true, the output will be: Output true yes If, however, statement1 evaluates to true, but nested_statement evaluates to false, then the output will be: Output true no And if statement1 evaluates to false, the nested if-else statement will not run, so the else statement will run alone, and the output will be: Output false We can also have multiple if statements nested throughout our code: if statement1 : #outer if \n print ( hello world ) \n\n if nested_statement1 : #first nested if \n print ( yes ) \n\n elif nested_statement2 : #first nested elif \n print ( maybe ) \n\n else : #first nested else \n print ( no ) elif statement2 : #outer elif \n print ( hello galaxy ) \n\n if nested_statement3 : #second nested if \n print ( yes ) \n\n elif nested_statement4 : #second nested elif \n print ( maybe ) \n\n else : #second nested else \n print ( no ) else : #outer else \n statement ( hello universe ) In the above code, there is a nested if statement inside each if statement in addition to the elif statement. This will allow for more options within each condition. Let\u2019s look at an example of nested if statements with our grade.py program. We can check for whether a grade is passing first (greater than or equal to 65%), then evaluate which letter grade the numerical grade should be equivalent to. If the grade is not passing, though, we do not need to run through the letter grades, and instead can have the program report that the grade is failing. Our modified code with the nested if statement will look like this: . . . if grade = 65 : \n print ( Passing grade of: ) \n\n if grade = 90 : \n print ( A ) \n\n elif grade = 80 : \n print ( B ) \n\n elif grade = 70 : \n print ( C ) \n\n elif grade = 65 : \n print ( D ) else : \n print ( Failing grade ) If we run the code with the variable grade set to the integer value 92, the first condition is met, and the program will print out Passing grade of:. Next, it will check to see if the grade is greater than or equal to 90, and since this condition is also met, it will print out A. If we run the code with the grade variable set to 60, then the first condition is not met, so the program will skip the nested if statements and move down to the else statement, with the program printing out Failing grade . We can of course add even more options to this, and use a second layer of nested if statements. Perhaps we will want to evaluate for grades of A+, A and A- separately. We can do so by first checking if the grade is passing, then checkingto see if the grade is 90 or above, then checkingto see if the grade is over 96 for an A+ for instance: . . . if grade = 65 : \n print ( Passing grade of: ) \n\n if grade = 90 : \n if grade 96 : \n print ( A+ ) \n\n elif grade 93 and grade = 96 : \n print ( A ) \n\n elif grade = 90 : \n print ( A- ) . . . In the code above, for a grade variable set to 96, the program will run the following: Check if the grade is greater than or equal to 65 (true) Print out Passing grade of: Check if the grade is greater than or equal to 90 (true) Check if the grade is greater than 96 (false) Check if the grade is greater than 93 and also less than or equal to 96 (true) Print A Leave these nested conditional statements and continue with remaining code The output of the program for a grade of 96 therefore looks like this: Output Passing grade of : A Nested if statements can provide the opportunity to add several specific levels of conditions to your code.", + "title": "Nested If Statements" + }, + { + "location": "/beginner/Conditions/#conclusion", + "text": "By using conditional statements like the if statement, you will have greater control over what your program executes. Conditional statements tell the program to evaluate whether a certain condition is being met. If the condition is met it will execute specific code, but if it is not met the program will continue to move down to other code. Source: https://www.digitalocean.com/community/tutorials/how-to-write-conditional-statements-in-python-3-2", + "title": "Conclusion" + }, + { + "location": "/beginner/For_Loop/", + "text": "How To Construct For Loops in Python 3\n\n\nUsing loops in computer programming allows us to automate and repeat similar tasks multiple times. In this tutorial, we\u2019ll be covering Python\u2019s for loop.\n\n\nA for loop implements the repeated execution of code based on a loop counter or loop variable. This means that for loops are used most often when the number of iterations is known before entering the loop, unlike while loops which are conditionally based.\n\n\nFor Loops\n\n\nIn Python, for loops are constructed like so: \n\n\nfor\n \n[\niterating\n \nvariable\n]\n \nin\n \n[\nsequence\n]:\n\n \n[\ndo\n \nsomething\n]\n\n\n\n\n\n\nThe something that is being done will be executed until the sequence is over. \n\n\nLet\u2019s look at a for loop that iterates through a range of values: \n\n\nfor\n \ni\n \nin\n \nrange\n(\n0\n,\n5\n):\n\n \nprint\n(\ni\n)\n\n\n\n\n\n\nWhen we run this program, the output looks like this:\n\n\nOutput\n\n\n0\n\n\n1\n\n\n2\n\n\n3\n\n\n4\n\n\n\n\n\n\nThis for loop sets up i as its iterating variable, and the sequence exists in the range of 0 to 5. \n\n\nThen within the loop we print out one integer per loop iteration. Keep in mind that in programming we tend to begin at index 0, so that is why although 5 numbers are printed out, they range from 0-4. \n\n\nYou\u2019ll commonly see and use for loops when a program needs to repeat a block of code a number of times. \n\n\nFor Loops using range()\n\n\nOne of Python\u2019s built-in immutable sequence types is range(). In loops, range() is used to control how many times the loop will be repeated.\n\nWhen working with range(), you can pass between 1 and 3 integer arguments to it: \n\n\n\n\nstart states the integer value at which the sequence begins, if this is not included then start begins at 0\n\n\nstop is always required and is the integer that is counted up to but not included\n\n\nstep sets how much to increase (or decrease in the case of negative numbers) the next iteration, if this is omitted then step defaults to 1\n\n\n\n\nWe\u2019ll look at some examples of passing different arguments to \nrange()\n.\n\n\nFirst, let\u2019s only pass the stop argument, so that our sequence set up is \nrange(stop)\n:\n\n\nfor\n \ni\n \nin\n \nrange\n(\n6\n):\n\n \nprint\n(\ni\n)\n\n\n\n\n\n\nIn the program above, the stop argument is 6, so the code will iterate from 0-6 (exclusive of 6):\n\n\nOutput\n\n\n0\n\n\n1\n\n\n2\n\n\n3\n\n\n4\n\n\n5\n\n\n\n\n\n\nNext, we\u2019ll look at range(start, stop), with values passed for when the iteration should start and for when it should stop: \n\n\nfor\n \ni\n \nin\n \nrange\n(\n20\n,\n25\n):\n\n \nprint\n(\ni\n)\n\n\n\n\n\n\nHere, the range goes from 20 (inclusive) to 25 (exclusive), so the output looks like this: \n\n\nOutput\n\n\n20\n\n\n21\n\n\n22\n\n\n23\n\n\n24\n\n\n\n\n\n\nThe step argument of range() is similar to specifying stride while slicing strings in that it can be used to skip values within the sequence.\n\n\nWith all three arguments, step comes in the final position: range(start, stop, step). First, let\u2019s use a step with a positive value: \n\n\nfor\n \ni\n \nin\n \nrange\n(\n0\n,\n15\n,\n3\n):\n\n \nprint\n(\ni\n)\n\n\n\n\n\n\nIn this case, the for loop is set up so that the numbers from 0 to 15 print out, but at a step of 3, so that only every third number is printed, like so:\n\n\nOutput\n\n\n0\n\n\n3\n\n\n6\n\n\n9\n\n\n12\n\n\n\n\n\n\nWe can also use a negative value for our step argument to iterate backwards, but we\u2019ll have to adjust our start and stop arguments accordingly: \n\n\nfor\n \ni\n \nin\n \nrange\n(\n100\n,\n0\n,\n-\n10\n):\n\n \nprint\n(\ni\n)\n\n\n\n\n\n\nHere, 100 is the start value, 0 is the stop value, and -10 is the range, so the loop begins at 100 and ends at 0, decreasing by 10 with each iteration. We can see this occur in the output:\n\n\nOutput\n\n\n100\n\n\n90\n\n\n80\n\n\n70\n\n\n60\n\n\n50\n\n\n40\n\n\n30\n\n\n20\n\n\n10\n\n\n\n\n\n\nWhen programming in Python, \nfor\n loops often make use of the range() sequence type as its parameters for iteration.\n\n\nFor Loops using Sequential Data Types\n\n\nLists and other data sequence types can also be leveraged as iteration parameters in for loops. Rather than iterating through a range(), you can define a list and iterate through that list.\n\n\nWe\u2019ll assign a list to a variable, and then iterate through the list: \n\n\nsharks\n \n=\n \n[\nhammerhead\n,\n \ngreat white\n,\n \ndogfish\n,\n \nfrilled\n,\n \nbullhead\n,\n \nrequiem\n]\n\n\n\nfor\n \nshark\n \nin\n \nsharks\n:\n\n \nprint\n(\nshark\n)\n\n\n\n\n\n\nIn this case, we are printing out each item in the list. Though we used the variable shark, we could have called the variable any other valid variable name and we would get the same output:\n\n\nOutput\n\n\nhammerhead\n\n\ngreat\n \nwhite\n\n\ndogfish\n\n\nfrilled\n\n\nbullhead\n\n\nrequiem\n\n\n\n\n\n\nThe output above shows that the for loop iterated through the list, and printed each item from the list per line.\n\n\nLists and other sequence-based data types like strings and tuples are common to use with loops because they are iterable. You can combine these data types with range() to add items to a list, for example:\n\n\nsharks\n \n=\n \n[\nhammerhead\n,\n \ngreat white\n,\n \ndogfish\n,\n \nfrilled\n,\n \nbullhead\n,\n \nrequiem\n]\n\n\n\nfor\n \nitem\n \nin\n \nrange\n(\nlen\n(\nsharks\n)):\n\n \nsharks\n.\nappend\n(\nshark\n)\n\n\n\nprint\n(\nsharks\n)\n\n\n\n\n\n\nOutput\n\n\n[\nhammerhead\n,\n \ngreat white\n,\n \ndogfish\n,\n \nfrilled\n,\n \nbullhead\n,\n \nrequiem\n,\n \nshark\n,\n \nshark\n,\n \nshark\n,\n \nshark\n,\n \nshark\n,\n \nshark\n]\n\n\n\n\n\n\nHere, we have added a placeholder string of 'shark' for each item of the length of the sharks list.\n\n\nYou can also use a for loop to construct a list from scratch:\n\n\nintegers\n \n=\n \n[]\n\n\n\nfor\n \ni\n \nin\n \nrange\n(\n10\n):\n\n \nintegers\n.\nappend\n(\ni\n)\n\n\n\nprint\n(\nintegers\n)\n\n\n\n\n\n\nIn this example, the list integers is initialized empty, but the for loop populates the list like so:\n\n\nOutput\n\n\n[\n0\n,\n \n1\n,\n \n2\n,\n \n3\n,\n \n4\n,\n \n5\n,\n \n6\n,\n \n7\n,\n \n8\n,\n \n9\n]\n\n\n\n\n\n\nSimilarly, we can iterate through strings:\n\n\nsammy\n \n=\n \nSammy\n\n\n\nfor\n \nletter\n \nin\n \nsammy\n:\n\n \nprint\n(\nletter\n)\n\n\n\n\n\n\nOutput\n\n\nS\n\n\na\n\n\nm\n\n\nm\n\n\ny\n\n\n\n\n\n\nIterating through tuples is done in the same format as iterating through lists or strings above.\n\n\nWhen iterating through a dictionary, it\u2019s important to keep the key : value structure in mind to ensure that you are calling the correct element of the dictionary. Here is an example that calls both the key and the value:\n\n\nsammy_shark\n \n=\n \n{\nname\n:\n \nSammy\n,\n \nanimal\n:\n \nshark\n,\n \ncolor\n:\n \nblue\n,\n \nlocation\n:\n \nocean\n}\n\n\n\nfor\n \nkey\n \nin\n \nsammy_shark\n:\n\n \nprint\n(\nkey\n \n+\n \n: \n \n+\n \nsammy_shark\n[\nkey\n])\n\n\n\n\n\n\nOutput\n\n\nname\n:\n \nSammy\n\n\nanimal\n:\n \nshark\n\n\nlocation\n:\n \nocean\n\n\ncolor\n:\n \nblue\n\n\n\n\n\n\nWhen using dictionaries with for loops, the iterating variable corresponds to the keys of the dictionary, and dictionary_variable[iterating_variable] corresponds to the values. In the case above, the iterating variable key was used to stand for key, and sammy_shark[key] was used to stand for the values.\n\n\nLoops are often used to iterate and manipulate sequential data types. \n\n\nNested For Loops\n\n\nLoops can be nested in Python, as they can with other programming languages.\n\n\nA nested loop is a loop that occurs within another loop, structurally similar to nested if statements. These are constructed like so: \n\n\nfor\n \n[\nfirst\n \niterating\n \nvariable\n]\n \nin\n \n[\nouter\n \nloop\n]:\n \n# Outer loop\n\n \n[\ndo\n \nsomething\n]\n \n# Optional\n\n \nfor\n \n[\nsecond\n \niterating\n \nvariable\n]\n \nin\n \n[\nnested\n \nloop\n]:\n \n# Nested loop\n\n \n[\ndo\n \nsomething\n]\n \n\n\n\n\n\nThe program first encounters the outer loop, executing its first iteration. This first iteration triggers the inner, nested loop, which then runs to completion. Then the program returns back to the top of the outer loop, completing the second iteration and again triggering the nested loop. Again, the nested loop runs to completion, and the program returns back to the top of the outer loop until the sequence is complete or a break or other statement disrupts the process.\n\n\nLet\u2019s implement a nested for loop so we can take a closer look. In this example, the outer loop will iterate through a list of integers called num_list, and the inner loop will iterate through a list of strings called alpha_list.\n\n\nnum_list\n \n=\n \n[\n1\n,\n \n2\n,\n \n3\n]\n\n\nalpha_list\n \n=\n \n[\na\n,\n \nb\n,\n \nc\n]\n\n\n\nfor\n \nnumber\n \nin\n \nnum_list\n:\n\n \nprint\n(\nnumber\n)\n\n \nfor\n \nletter\n \nin\n \nalpha_list\n:\n\n \nprint\n(\nletter\n)\n\n\n\n\n\n\nWhen we run this program, we\u2019ll receive the following output: \n\n\nOutput\n\n\n1\n\n\na\n\n\nb\n\n\nc\n\n\n2\n\n\na\n\n\nb\n\n\nc\n\n\n3\n\n\na\n\n\nb\n\n\nc\n\n\n\n\n\n\nThe output illustrates that the program completes the first iteration of the outer loop by printing 1, which then triggers completion of the inner loop, printing a, b, c consecutively. Once the inner loop has completed, the program returns to the top of the outer loop, prints 2, then again prints the inner loop in its entirety (a, b, c), etc.\n\n\nNested for loops can be useful for iterating through items within lists composed of lists. In a list composed of lists, if we employ just one for loop, the program will output each internal list as an item:\n\n\nlist_of_lists\n \n=\n \n[[\nhammerhead\n,\n \ngreat white\n,\n \ndogfish\n],[\n0\n,\n \n1\n,\n \n2\n],[\n9.9\n,\n \n8.8\n,\n \n7.7\n]]\n\n\n\nfor\n \nlist\n \nin\n \nlist_of_lists\n:\n\n \nprint\n(\nlist\n)\n\n\n\n\n\n\nOutput\n\n\n[\nhammerhead\n,\n \ngreat white\n,\n \ndogfish\n]\n\n\n[\n0\n,\n \n1\n,\n \n2\n]\n\n\n[\n9.9\n,\n \n8.8\n,\n \n7.7\n]\n\n\n\n\n\n\nIn order to access each individual item of the internal lists, we\u2019ll implement a nested for loop:\n\n\nlist_of_lists\n \n=\n \n[[\nhammerhead\n,\n \ngreat white\n,\n \ndogfish\n],[\n0\n,\n \n1\n,\n \n2\n],[\n9.9\n,\n \n8.8\n,\n \n7.7\n]]\n\n\n\nfor\n \nlist\n \nin\n \nlist_of_lists\n:\n\n \nfor\n \nitem\n \nin\n \nlist\n:\n\n \nprint\n(\nitem\n)\n\n\n\n\n\n\nOutput\n\n\nhammerhead\n\n\ngreat\n \nwhite\n\n\ndogfish\n\n\n0\n\n\n1\n\n\n2\n\n\n9.9\n\n\n8.8\n\n\n7.7\n\n\n\n\n\n\nWhen we utilize a nested for loop we are able to iterate over the individual items contained in the lists.\n\n\nConclusion\n\n\nThis tutorial went over how for loops work in Python and how to construct them. For loops continue to loop through a block of code provided a certain number of times.\n\n\nFrom here, you can continue to learn about looping by reading tutorials on \nwhile\n loops and \nbreak, continue, and pass statements.", + "title": "For Loop" + }, + { + "location": "/beginner/For_Loop/#how-to-construct-for-loops-in-python-3", + "text": "Using loops in computer programming allows us to automate and repeat similar tasks multiple times. In this tutorial, we\u2019ll be covering Python\u2019s for loop. A for loop implements the repeated execution of code based on a loop counter or loop variable. This means that for loops are used most often when the number of iterations is known before entering the loop, unlike while loops which are conditionally based.", + "title": "How To Construct For Loops in Python 3" + }, + { + "location": "/beginner/For_Loop/#for-loops", + "text": "In Python, for loops are constructed like so: for [ iterating variable ] in [ sequence ]: \n [ do something ] The something that is being done will be executed until the sequence is over. Let\u2019s look at a for loop that iterates through a range of values: for i in range ( 0 , 5 ): \n print ( i ) When we run this program, the output looks like this: Output 0 1 2 3 4 This for loop sets up i as its iterating variable, and the sequence exists in the range of 0 to 5. Then within the loop we print out one integer per loop iteration. Keep in mind that in programming we tend to begin at index 0, so that is why although 5 numbers are printed out, they range from 0-4. You\u2019ll commonly see and use for loops when a program needs to repeat a block of code a number of times.", + "title": "For Loops" + }, + { + "location": "/beginner/For_Loop/#for-loops-using-range", + "text": "One of Python\u2019s built-in immutable sequence types is range(). In loops, range() is used to control how many times the loop will be repeated. \nWhen working with range(), you can pass between 1 and 3 integer arguments to it: start states the integer value at which the sequence begins, if this is not included then start begins at 0 stop is always required and is the integer that is counted up to but not included step sets how much to increase (or decrease in the case of negative numbers) the next iteration, if this is omitted then step defaults to 1 We\u2019ll look at some examples of passing different arguments to range() . First, let\u2019s only pass the stop argument, so that our sequence set up is range(stop) : for i in range ( 6 ): \n print ( i ) In the program above, the stop argument is 6, so the code will iterate from 0-6 (exclusive of 6): Output 0 1 2 3 4 5 Next, we\u2019ll look at range(start, stop), with values passed for when the iteration should start and for when it should stop: for i in range ( 20 , 25 ): \n print ( i ) Here, the range goes from 20 (inclusive) to 25 (exclusive), so the output looks like this: Output 20 21 22 23 24 The step argument of range() is similar to specifying stride while slicing strings in that it can be used to skip values within the sequence. With all three arguments, step comes in the final position: range(start, stop, step). First, let\u2019s use a step with a positive value: for i in range ( 0 , 15 , 3 ): \n print ( i ) In this case, the for loop is set up so that the numbers from 0 to 15 print out, but at a step of 3, so that only every third number is printed, like so: Output 0 3 6 9 12 We can also use a negative value for our step argument to iterate backwards, but we\u2019ll have to adjust our start and stop arguments accordingly: for i in range ( 100 , 0 , - 10 ): \n print ( i ) Here, 100 is the start value, 0 is the stop value, and -10 is the range, so the loop begins at 100 and ends at 0, decreasing by 10 with each iteration. We can see this occur in the output: Output 100 90 80 70 60 50 40 30 20 10 When programming in Python, for loops often make use of the range() sequence type as its parameters for iteration.", + "title": "For Loops using range()" + }, + { + "location": "/beginner/For_Loop/#for-loops-using-sequential-data-types", + "text": "Lists and other data sequence types can also be leveraged as iteration parameters in for loops. Rather than iterating through a range(), you can define a list and iterate through that list. We\u2019ll assign a list to a variable, and then iterate through the list: sharks = [ hammerhead , great white , dogfish , frilled , bullhead , requiem ] for shark in sharks : \n print ( shark ) In this case, we are printing out each item in the list. Though we used the variable shark, we could have called the variable any other valid variable name and we would get the same output: Output hammerhead great white dogfish frilled bullhead requiem The output above shows that the for loop iterated through the list, and printed each item from the list per line. Lists and other sequence-based data types like strings and tuples are common to use with loops because they are iterable. You can combine these data types with range() to add items to a list, for example: sharks = [ hammerhead , great white , dogfish , frilled , bullhead , requiem ] for item in range ( len ( sharks )): \n sharks . append ( shark ) print ( sharks ) Output [ hammerhead , great white , dogfish , frilled , bullhead , requiem , shark , shark , shark , shark , shark , shark ] Here, we have added a placeholder string of 'shark' for each item of the length of the sharks list. You can also use a for loop to construct a list from scratch: integers = [] for i in range ( 10 ): \n integers . append ( i ) print ( integers ) In this example, the list integers is initialized empty, but the for loop populates the list like so: Output [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ] Similarly, we can iterate through strings: sammy = Sammy for letter in sammy : \n print ( letter ) Output S a m m y Iterating through tuples is done in the same format as iterating through lists or strings above. When iterating through a dictionary, it\u2019s important to keep the key : value structure in mind to ensure that you are calling the correct element of the dictionary. Here is an example that calls both the key and the value: sammy_shark = { name : Sammy , animal : shark , color : blue , location : ocean } for key in sammy_shark : \n print ( key + : + sammy_shark [ key ]) Output name : Sammy animal : shark location : ocean color : blue When using dictionaries with for loops, the iterating variable corresponds to the keys of the dictionary, and dictionary_variable[iterating_variable] corresponds to the values. In the case above, the iterating variable key was used to stand for key, and sammy_shark[key] was used to stand for the values. Loops are often used to iterate and manipulate sequential data types.", + "title": "For Loops using Sequential Data Types" + }, + { + "location": "/beginner/For_Loop/#nested-for-loops", + "text": "Loops can be nested in Python, as they can with other programming languages. A nested loop is a loop that occurs within another loop, structurally similar to nested if statements. These are constructed like so: for [ first iterating variable ] in [ outer loop ]: # Outer loop \n [ do something ] # Optional \n for [ second iterating variable ] in [ nested loop ]: # Nested loop \n [ do something ] The program first encounters the outer loop, executing its first iteration. This first iteration triggers the inner, nested loop, which then runs to completion. Then the program returns back to the top of the outer loop, completing the second iteration and again triggering the nested loop. Again, the nested loop runs to completion, and the program returns back to the top of the outer loop until the sequence is complete or a break or other statement disrupts the process. Let\u2019s implement a nested for loop so we can take a closer look. In this example, the outer loop will iterate through a list of integers called num_list, and the inner loop will iterate through a list of strings called alpha_list. num_list = [ 1 , 2 , 3 ] alpha_list = [ a , b , c ] for number in num_list : \n print ( number ) \n for letter in alpha_list : \n print ( letter ) When we run this program, we\u2019ll receive the following output: Output 1 a b c 2 a b c 3 a b c The output illustrates that the program completes the first iteration of the outer loop by printing 1, which then triggers completion of the inner loop, printing a, b, c consecutively. Once the inner loop has completed, the program returns to the top of the outer loop, prints 2, then again prints the inner loop in its entirety (a, b, c), etc. Nested for loops can be useful for iterating through items within lists composed of lists. In a list composed of lists, if we employ just one for loop, the program will output each internal list as an item: list_of_lists = [[ hammerhead , great white , dogfish ],[ 0 , 1 , 2 ],[ 9.9 , 8.8 , 7.7 ]] for list in list_of_lists : \n print ( list ) Output [ hammerhead , great white , dogfish ] [ 0 , 1 , 2 ] [ 9.9 , 8.8 , 7.7 ] In order to access each individual item of the internal lists, we\u2019ll implement a nested for loop: list_of_lists = [[ hammerhead , great white , dogfish ],[ 0 , 1 , 2 ],[ 9.9 , 8.8 , 7.7 ]] for list in list_of_lists : \n for item in list : \n print ( item ) Output hammerhead great white dogfish 0 1 2 9.9 8.8 7.7 When we utilize a nested for loop we are able to iterate over the individual items contained in the lists.", + "title": "Nested For Loops" + }, + { + "location": "/beginner/For_Loop/#conclusion", + "text": "This tutorial went over how for loops work in Python and how to construct them. For loops continue to loop through a block of code provided a certain number of times. From here, you can continue to learn about looping by reading tutorials on while loops and break, continue, and pass statements.", + "title": "Conclusion" + }, { - "location": "/beginner/Functions/", - "text": "Function Calls\n\n\nIn the context of programming, a function is a named sequence of statements that\nperforms a computation. When you define a function, you specify the name and the\nsequence of statements. Later, you can \u201ccall\u201d the function by name. We have already seen\none example of a function call:\n\n\n \ntype\n(\n32\n)\n\n\ntype\n \nint\n\n\n\n\n\n\nThe name of the function is type. The expression in parentheses is called the argument\nof the function. The result, for this function, is the type of the argument.\n\nIt is common to say that a function \u201ctakes\u201d an argument and \u201creturns\u201d a result. The result\nis called the return value.\n\n\nType Conversion Functions\n\n\nPython provides built-in functions that convert values from one type to another. The\nint function takes any value and converts it to an integer, if it can, or complains\notherwise:\n\n\n \nint\n(\n32\n)\n\n\n32\n\n\n \nint\n(\nHello\n)\n\n\nValueError\n:\n \ninvalid\n \nliteral\n \nfor\n \nint\n():\n \nHello\n\n\n\n\n\n\nint can convert floating-point values to integers, but it doesn\u2019t round off; it chops off\nthe fraction part:\n\n\n \nint\n(\n3.99999\n)\n\n\n3\n\n\n \nint\n(\n-\n2.3\n)\n\n\n-\n2\n\n\n\n\n\n\nfloat converts integers and strings to floating-point numbers:\n\n\n \nfloat\n(\n32\n)\n\n\n32.0\n\n\n \nfloat\n(\n3.14159\n)\n\n\n3.14159\n\n\n\n\n\n\nFinally, str converts its argument to a string:\n\n\n \nstr\n(\n32\n)\n\n\n32\n\n\n \nstr\n(\n3.14159\n)\n\n\n3.14159\n\n\n\n\n\n\nAdding New Functions\n\n\nSo far, we have only been using the functions that come with Python, but it is also possible\nto add new functions. A function definition specifies the name of a new function and\nthe sequence of statements that execute when the function is called.\n\nHere is an example:\n\n\ndef\n \nprint_lyrics\n():\n\n \nprint\n \nI\nm a lumberjack, and I\nm okay.\n\n \nprint\n \nI sleep all night and I work all day.\n\n\n\n\n\n\ndef\n is a keyword that indicates that this is a function definition. The name of the function\nis print_lyrics. The rules for function names are the same as for variable names: letters,\nnumbers and some punctuation marks are legal, but the first character can\u2019t be a number.\nYou can\u2019t use a keyword as the name of a function, and you should avoid having a variable\nand a function with the same name.\n\nThe empty parentheses after the name indicate that this function doesn\u2019t take any\narguments.\n\nThe first line of the function definition is called the header; the rest is called the body.\nThe header has to end with a colon and the body has to be indented. By convention, the\nindentation is always four spaces; see \u201cDebugging\u201d (page 33). The body can contain any\nnumber of statements.\n\nThe strings in the print statements are enclosed in double quotes. Single quotes and\ndouble quotes do the same thing; most people use single quotes except in cases like this\nwhere a single quote (which is also an apostrophe) appears in the string.\nIf you type a function definition in interactive mode, the interpreter prints ellipses (...)\nto let you know that the definition isn\u2019t complete:\n\n\ndef\n \nprint_lyrics\n():\n\n \nprint\n \nI\nm a lumberjack, and I\nm okay.\n\n \nprint\n \nI sleep all night and I work all day.\n\n\n\n\n\n\nTo end the function, you have to enter an empty line (this is not necessary in a script).\nDefining a function creates a variable with the same name.\n\n\n \nprint\n \nprint_lyrics\n\n\nfunction\n \nprint_lyrics\n \nat\n \n0xb7e99e9c\n\n\n \ntype\n(\nprint_lyrics\n)\n\n\ntype\n \nfunction\n\n\n\n\n\n\nThe value of print_lyrics is a function object, which has type 'function'.\nThe syntax for calling the new function is the same as for built-in functions:\n\n\n \nprint_lyrics\n()\n\n\nI\nm a lumberjack, and I\nm\n \nokay\n.\n\n\nI\n \nsleep\n \nall\n \nnight\n \nand\n \nI\n \nwork\n \nall\n \nday\n.\n\n\n\n\n\n\nOnce you have defined a function, you can use it inside another function. For example,\nto repeat the previous refrain, we could write a function called repeat_lyrics: \n\n\ndef\n \nrepeat_lyrics\n():\n\n \nprint_lyrics\n()\n\n \nprint_lyrics\n()\n\n\n\n\n\n\nAnd then call repeat_lyrics: \n\n\n \nrepeat_lyrics\n()\n\n\nI\nm a lumberjack, and I\nm\n \nokay\n.\n\n\nI\n \nsleep\n \nall\n \nnight\n \nand\n \nI\n \nwork\n \nall\n \nday\n.\n\n\nI\nm a lumberjack, and I\nm\n \nokay\n.\n\n\nI\n \nsleep\n \nall\n \nnight\n \nand\n \nI\n \nwork\n \nall\n \nday\n.\n\n\n\n\n\n\nBut that\u2019s not really how the song goes.\n\n\nDefinitions and Uses\n\n\nPulling together the code fragments from the previous section, the whole program looks\nlike this:\n\n\ndef\n \nprint_lyrics\n():\n\n \nprint\n \nI\nm a lumberjack, and I\nm okay.\n\n \nprint\n \nI sleep all night and I work all day.\n\n\ndef\n \nrepeat_lyrics\n():\n\n \nprint_lyrics\n()\n\n \nprint_lyrics\n()\n \n\n\nrepeat_lyrics\n()\n\n\n\n\n\n\nThis program contains two function definitions: print_lyrics and repeat_lyrics.\nFunction definitions get executed just like other statements, but the result creates func\ntion objects. The statements inside the function do not get executed until the function\nis called, and the function definition generates no output.\n\nAs you might expect, you have to create a function before you can execute it. In other\nwords, the function definition has to be executed before the function is called the first\ntime. \n\n\nFlow of Execution\n\n\nIn order to ensure that a function is defined before its first use, you have to know the\norder in which statements are executed, which is called the flow of execution.\n\nExecution always begins at the first statement of the program. Statements are executed\none at a time, in order, from top to bottom.\n\n\nFunction definitions do not alter the flow of execution of the program, but remember\nthat statements inside the function are not executed until the function is called.\nA function call is like a detour in the flow of execution. Instead of going to the next\nstatement, the flow jumps to the body of the function, executes all the statements there,\nand then comes back to pick up where it left off.\n\nThat sounds simple enough, until you remember that one function can call another.\nWhile in the middle of one function, the program might have to execute the statements\nin another function. But while executing that new function, the program might have to\nexecute yet another function!\n\nFortunately, Python is good at keeping track of where it is, so each time a function\ncompletes, the program picks up where it left off in the function that called it. When it\ngets to the end of the program, it terminates.\n\nWhat\u2019s the moral of this sordid tale? When you read a program, you don\u2019t always want\nto read from top to bottom. Sometimes it makes more sense if you follow the flow of\nexecution. \n\n\nParameters and Arguments\n\n\nSome of the built-in functions we have seen require arguments. For example, when you\ncall math.sin you pass a number as an argument. Some functions take more than one\nargument: \nmath.pow\n takes two, the base and the exponent.\nInside the function, the arguments are assigned to variables called parameters. Here is\nan example of a user-defined function that takes an argument:\n\n\n \ndef\n \nprint_twice\n(\nbruce\n):\n\n \nprint\n \nbruce\n\n \nprint\n \nbruce\n\n\n\n\n\n\nThis function assigns the argument to a parameter named bruce. When the function is\ncalled, it prints the value of the parameter (whatever it is) twice.\n\nThis function works with any value that can be printed.\n\n\n \nprint_twice\n(\nSpam\n)\n\n\nSpam\n\n\nSpam\n\n\n \nprint_twice\n(\n17\n)\n\n\n17\n\n\n17\n\n\n \nprint_twice\n(\nmath\n.\npi\n)\n\n\n3.14159265359\n\n\n3.14159265359\n \n\n\n\n\n\nThe same rules of composition that apply to built-in functions also apply to user-defined\nfunctions, so we can use any kind of expression as an argument for \nprint_twice\n:\n\n\n \nprint_twice\n(\nSpam \n*\n4\n)\n\n\nSpam\n \nSpam\n \nSpam\n \nSpam\n\n\nSpam\n \nSpam\n \nSpam\n \nSpam\n\n\n \nprint_twice\n(\nmath\n.\ncos\n(\nmath\n.\npi\n))\n\n\n-\n1.0\n\n\n-\n1.0\n\n\n\n\n\n\nThe argument is evaluated before the function is called, so in the examples the expres\nsions 'Spam '*4 and math.cos(math.pi) are only evaluated once.\n\nYou can also use a variable as an argument:\n\n\n \nmichael\n \n=\n \nEric, the half a bee.\n\n\n \nprint_twice\n(\nmichael\n)\n\n\nEric\n,\n \nthe\n \nhalf\n \na\n \nbee\n.\n\n\nEric\n,\n \nthe\n \nhalf\n \na\n \nbee\n.\n\n\n\n\n\n\nThe name of the variable we pass as an argument (michael) has nothing to do with the\nname of the parameter (bruce). It doesn\u2019t matter what the value was called back home\n(in the caller); here in print_twice, we call everybody bruce.\n\n\nVariables and Parameters Are Local\n\n\nWhen you create a variable inside a function, it is local, which means that it only exists\ninside the function. For example:\n\n\ndef\n \ncat_twice\n(\npart1\n,\n \npart2\n):\n\n \ncat\n \n=\n \npart1\n \n+\n \npart2\n\n \nprint_twice\n(\ncat\n)\n\n\n\n\n\n\nThis function takes two arguments, concatenates them, and prints the result twice. Here\nis an example that uses it:\n\n\n \nline1\n \n=\n \nBing tiddle \n\n\n \nline2\n \n=\n \ntiddle bang.\n\n\n \ncat_twice\n(\nline1\n,\n \nline2\n)\n\n\nBing\n \ntiddle\n \ntiddle\n \nbang\n.\n\n\nBing\n \ntiddle\n \ntiddle\n \nbang\n.\n\n\n\n\n\n\nWhen cat_twice terminates, the variable cat is destroyed. If we try to print it, we get\nan exception:\n\n\n \nprint\n \ncat\n\n\nNameError\n:\n \nname\n \ncat\n \nis\n \nnot\n \ndefined\n\n\n\n\n\n\nParameters are also local. For example, outside print_twice, there is no such thing as\nbruce.\n\n\nStack Diagrams\n\n\nTo keep track of which variables can be used where, it is sometimes useful to draw a\nstack diagram. Like state diagrams, stack diagrams show the value of each variable, but\nthey also show the function each variable belongs to.\n\nEach function is represented by a frame. A frame is a box with the name of a function\nbeside it and the parameters and variables of the function inside it. The stack diagram\nfor the previous example is shown in Figure 3-1.\n\n\n\n\nThe frames are arranged in a stack that indicates which function called which, and so\non. In this example, print_twice was called by cat_twice, and cat_twice was called\nby \n\\__main\\__\n, which is a special name for the topmost frame. When you create a variable\noutside of any function, it belongs to \n\\__main\\__\n.\n\n\nEach parameter refers to the same value as its corresponding argument. So, part1 has\nthe same value as line1, part2 has the same value as line2, and bruce has the same\nvalue as cat.\nIf an error occurs during a function call, Python prints the name of the function, and\nthe name of the function that called it, and the name of the function that called that, all\nthe way back to \n\\__main__\\\n.\n\n\nFor example, if you try to access cat from within print_twice, you get a NameError:\n\n\nTraceback\n \n(\ninnermost\n \nlast\n):\n\n \nFile\n \ntest.py\n,\n \nline\n \n13\n,\n \nin\n \n__main__\n\n \ncat_twice\n(\nline1\n,\n \nline2\n)\n\n \nFile\n \ntest.py\n,\n \nline\n \n5\n,\n \nin\n \ncat_twice\n\n \nprint_twice\n(\ncat\n)\n\n \nFile\n \ntest.py\n,\n \nline\n \n9\n,\n \nin\n \nprint_twice\n\n \nprint\n \ncat\n\n \nNameError\n:\n \nname\n \ncat\n \nis\n \nnot\n \ndefined\n\n\n\n\n\n\nThis list of functions is called a traceback. It tells you what program file the error oc\ncurred in, and what line, and what functions were executing at the time. It also shows\nthe line of code that caused the error.\nThe order of the functions in the traceback is the same as the order of the frames in the\nstack diagram. The function that is currently running is listed at the bottom.\n\n\nFruitful Functions and Void Functions\n\n\nSome of the functions we are using, such as the math functions, yield results; for lack of\na better name, I call them fruitful functions. Other functions, like print_twice, per\nform an action but don\u2019t return a value. They are called void functions.\nWhen you call a fruitful function, you almost always want to do something with the\nresult; for example, you might assign it to a variable or use it as part of an expression:\n\n\nx\n \n=\n \nmath\n.\ncos\n(\nradians\n)\n\n\ngolden\n \n=\n \n(\nmath\n.\nsqrt\n(\n5\n)\n \n+\n \n1\n)\n \n/\n \n2\n\n\n\n\n\n\nWhen you call a function in interactive mode, Python displays the result:\n\n\n \nmath\n.\nsqrt\n(\n5\n)\n\n\n2.2360679774997898\n\n\n\n\n\n\nBut in a script, if you call a fruitful function all by itself, the return value is lost forever!\n\n\nmath\n.\nsqrt\n(\n5\n)\n\n\n\n\n\n\nThis script computes the square root of 5, but since it doesn\u2019t store or display the result,\nit is not very useful.\nVoid functions might display something on the screen or have some other effect, but\nthey don\u2019t have a return value. If you try to assign the result to a variable, you get a special\nvalue called None.\n\n\n \nresult\n \n=\n \nprint_twice\n(\nBing\n)\n\n\nBing\n\n\nBing\n\n\n \nprint\n \nresult\n\n\nNone\n\n\n\n\n\n\nThe value None is not the same as the string 'None'. It is a special value that has its own\ntype:\n\n\n \nprint\n \ntype\n(\nNone\n)\n\n\ntype\n \nNoneType\n\n\n\n\n\n\nThe functions we have written so far are all void. We will start writing fruitful functions\nin a few chapters.\n\n\nWhy Functions?\n\n\nIt may not be clear why it is worth the trouble to divide a program into functions. There\nare several reasons:\n\n- Creating a new function gives you an opportunity to name a group of statements,\nwhich makes your program easier to read and debug.\n- Functions can make a program smaller by eliminating repetitive code. Later, if you\nmake a change, you only have to make it in one place.\n- Dividing a long program into functions allows you to debug the parts one at a time\nand then assemble them into a working whole.\n- Well-designed functions are often useful for many programs. Once you write and\ndebug one, you can reuse it.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nFunctions by by Mark Lutz (Learning Python, Fourth Edition)\n\n\nFunction Basics\n\n\nIn Part III, we looked at basic procedural statements in Python. Here, we\u2019ll move on to\nexplore a set of additional statements that we can use to create functions of our own.\n\nIn simple terms, a function is a device that groups a set of statements so they can be run\nmore than once in a program. Functions also can compute a result value and let us\nspecify parameters that serve as function inputs, which may differ each time the code\nis run. Coding an operation as a function makes it a generally useful tool, which we\ncan use in a variety of contexts.\n\nMore fundamentally, functions are the alternative to programming by cutting and\npasting\u2014rather than having multiple redundant copies of an operation\u2019s code, we can\nfactor it into a single function. In so doing, we reduce our future work radically: if the\noperation must be changed later, we only have one copy to update, not many.\n\nFunctions are the most basic program structure Python provides for maximizing code\nreuse and minimizing code redundancy. As we\u2019ll see, functions are also a design tool\nthat lets us split complex systems into manageable parts. Table 16-1 summarizes the\nprimary function-related tools we\u2019ll study in this part of the book.\n\n\n\n\n\n\n\n\nStatement\n\n\nExamples\n\n\n\n\n\n\n\n\n\n\nCalls\n\n\nmyfunc('spam', 'eggs', meat=ham)\n\n\n\n\n\n\ndef, return\n\n\ndef adder(a, b=1, *c): return a + b + c[0]\n\n\n\n\n\n\nglobal\n\n\ndef changer():global x; x = 'new'\n\n\n\n\n\n\nnonlocal\n\n\ndef changer():nonlocal x; x = 'new'\n\n\n\n\n\n\nyield\n\n\ndef squares(x):for i in range(x): yield i ** 2\n\n\n\n\n\n\nlambda\n\n\nfuncs = [lambda x: x*\n2, lambda x: x\n3]\n\n\n\n\n\n\n\n\nWhy Use Functions?\n\n\nBefore we get into the details, let\u2019s establish a clear picture of what functions are all\nabout. Functions are a nearly universal program-structuring device. You may have\ncome across them before in other languages, where they may have been called subroutines\nor procedures. As a brief introduction, functions serve two primary development\nroles:\n\n\nMaximizing code reuse and minimizing redundancy\n\nAs in most programming languages, Python functions are the simplest way to\npackage logic you may wish to use in more than one place and more than one time.\nUp until now, all the code we\u2019ve been writing has run immediately. Functions allow\nus to group and generalize code to be used arbitrarily many times later. Because\nthey allow us to code an operation in a single place and use it in many places,\nPython functions are the most basic factoring tool in the language: they allow us\nto reduce code redundancy in our programs, and thereby reduce maintenance\neffort. \n\n\nProcedural decomposition\n\nFunctions also provide a tool for splitting systems into pieces that have well-defined\nroles. For instance, to make a pizza from scratch, you would start by mixing the\ndough, rolling it out, adding toppings, baking it, and so on. If you were programming\na pizza-making robot, functions would help you divide the overall \u201cmake\npizza\u201d task into chunks\u2014one function for each subtask in the process. It\u2019s easier\nto implement the smaller tasks in isolation than it is to implement the entire process\nat once. In general, functions are about procedure\u2014how to do something, rather\nthan what you\u2019re doing it to. We\u2019ll see why this distinction matters in Part VI, when\nwe start making new object with classes. \n\n\n\n\nIn this part of the book, we\u2019ll explore the tools used to code functions in Python: function\nbasics, scope rules, and argument passing, along with a few related concepts such\nas generators and functional tools. Because its importance begins to become more apparent\nat this level of coding, we\u2019ll also revisit the notion of polymorphism introduced\nearlier in the book. As you\u2019ll see, functions don\u2019t imply much new syntax, but they do\nlead us to some bigger programming ideas.\n\n\nCoding Functions\n\n\nAlthough it wasn\u2019t made very formal, we\u2019ve already used some functions in earlier\nchapters. For instance, to make a file object, we called the built-in open function; similarly,\nwe used the len built-in function to ask for the number of items in a collection\nobject.\n\nIn this chapter, we will explore how to write new functions in Python. Functions we\nwrite behave the same way as the built-ins we\u2019ve already seen: they are called in expressions, are passed values, and return results. But writing new functions requires\nthe application of a few additional ideas that haven\u2019t yet been introduced. Moreover,\nfunctions behave very differently in Python than they do in compiled languages like C.\nHere is a brief introduction to the main concepts behind Python functions, all of which\nwe will study in this part of the book: \n\n\n\n\ndef is executable code.\n Python functions are written with a new statement, the\ndef. Unlike functions in compiled languages such as C, def is an executable statement\u2014\nyour function does not exist until Python reaches and runs the def. In fact,\nit\u2019s legal (and even occasionally useful) to nest def statements inside if statements,\nwhile loops, and even other defs. In typical operation, def statements are coded in\nmodule files and are naturally run to generate functions when a module file is first\nimported.\n\n\n\n\ndef creates an object and assigns it to a name.\n When Python reaches and runs\na def statement, it generates a new function object and assigns it to the function\u2019s\nname. As with all assignments, the function name becomes a reference to the function\nobject. There\u2019s nothing magic about the name of a function\u2014as you\u2019ll see,\nthe function object can be assigned to other names, stored in a list, and so on.\nFunction objects may also have arbitrary user-defined attributes attached to them\nto record data.\n\n\n\n\n\n\nlambda creates an object but returns it as a result.\n Functions may also be created\nwith the lambda expression, a feature that allows us to in-line function definitions\nin places where a def statement won\u2019t work syntactically\n\n\n\n\n\n\nreturn sends a result object back to the caller.\n When a function is called, the\ncaller stops until the function finishes its work and returns control to the caller.\nFunctions that compute a value send it back to the caller with a return statement;\nthe returned value becomes the result of the function call.\n\n\n\n\n\n\nyield sends a result object back to the caller, but remembers where it left\noff.\n Functions known as generators may also use the yield statement to send back\na value and suspend their state such that they may be resumed later, to produce a\nseries of results over time. This is another advanced topic covered later in this part\nof the book.\n\n\n\n\n\n\nglobal declares module-level variables that are to be assigned.\n By default, all\nnames assigned in a function are local to that function and exist only while the\nfunction runs. To assign a name in the enclosing module, functions need to list it\nin a global statement. More generally, names are always looked up in scopes\u2014\nplaces where variables are stored\u2014and assignments bind names to scopes.\n\n\n\n\n\n\nnonlocal declares enclosing function variables that are to be assigned.\n Similarly,\nthe nonlocal statement added in Python 3.0 allows a function to assign a\nname that exists in the scope of a syntactically enclosing def statement. This allows\nenclosing functions to serve as a place to retain state\u2014information remembered\nwhen a function is called\u2014without using shared global names.\n\n\n\n\n\n\nArguments are passed by assignment (object reference).\n In Python, arguments\nare passed to functions by assignment (which, as we\u2019ve learned, means by object\nreference). As you\u2019ll see, in Python\u2019s model the caller and function share objects\nby references, but there is no name aliasing. Changing an argument name within\na function does not also change the corresponding name in the caller, but changing\npassed-in mutable objects can change objects shared by the caller.\n\n\n\n\n\n\nArguments, return values, and variables are not declared.\n As with everything\nin Python, there are no type constraints on functions. In fact, nothing about a\nfunction needs to be declared ahead of time: you can pass in arguments of any type,\nreturn any kind of object, and so on. As one consequence, a single function can\noften be applied to a variety of object types\u2014any objects that sport a compatible\ninterface (methods and expressions) will do, regardless of their specific types.\n\n\n\n\n\n\nIf some of the preceding words didn\u2019t sink in, don\u2019t worry\u2014we\u2019ll explore all of these\nconcepts with real code in this part of the book. Let\u2019s get started by expanding on some\nof these ideas and looking at a few examples.\n\n\ndef Statements\n\n\nThe def statement creates a function object and assigns it to a name. Its general format\nis as follows:\n\n\ndef\n \nname\n(\narg1\n,\n \narg2\n,\n...\n \nargN\n):\n\n \nstatements\n\n\n\n\n\n\nAs with all compound Python statements, def consists of a header line followed by a\nblock of statements, usually indented (or a simple statement after the colon). The\nstatement block becomes the function\u2019s body\u2014that is, the code Python executes each\ntime the function is called.\n\nThe def header line specifies a function name that is assigned the function object, along\nwith a list of zero or more arguments (sometimes called parameters) in parentheses.\nThe argument names in the header are assigned to the objects passed in parentheses at\nthe point of call.\n\n\nFunction bodies often contain a return statement:\n\n\ndef\n \nname\n(\narg1\n,\n \narg2\n,\n...\n \nargN\n):\n\n \n...\n\n \nreturn\n \nvalue\n\n\n\n\n\n\nThe Python return statement can show up anywhere in a function body; it ends the\nfunction call and sends a result back to the caller. The return statement consists of an\nobject expression that gives the function\u2019s result. The return statement is optional; if\nit\u2019s not present, the function exits when the control flow falls off the end of the function\nbody. Technically, a function without a return statement returns the None object automatically,\nbut this return value is usually ignored.\n\n\ndef Executes at Runtime\n\n\nThe Python def is a true executable statement: when it runs, it creates a new function\nobject and assigns it to a name. (Remember, all we have in Python is runtime; there is\nno such thing as a separate compile time.) Because it\u2019s a statement, a def can appear\nanywhere a statement can\u2014even nested in other statements. For instance, although\ndefs normally are run when the module enclosing them is imported, it\u2019s also completely\nlegal to nest a function def inside an if statement to select between alternative\ndefinitions:\n\n\nif\n \ntest\n:\n\n \ndef\n \nfunc\n():\n \n# Define func this way\n\n\n...\n\n\nelse\n:\n\n \ndef\n \nfunc\n():\n \n# Or else this way\n\n \n...\n\n \n...\n\n\nfunc\n()\n \n# Call the version selected and built\n\n\n\n\n\n\nOne way to understand this code is to realize that the def is much like an = statement:\nit simply assigns a name at runtime. Unlike in compiled languages such as C, Python\nfunctions do not need to be fully defined before the program runs. More generally,\ndefs are not evaluated until they are reached and run, and the code inside defs is not\nevaluated until the functions are later called.\nBecause function definition happens at runtime, there\u2019s nothing special about the\nfunction name. What\u2019s important is the object to which it refers: \n\n\nothername\n \n=\n \nfunc\n \n# Assign function object\n\n\nothername\n()\n \n# Call func again\n\n\n\n\n\n\nHere, the function was assigned to a different name and called through the new name.\nLike everything else in Python, functions are just objects; they are recorded explicitly\nin memory at program execution time. In fact, besides calls, functions allow arbitrary\nattributes to be attached to record information for later use:\n\n\ndef\n \nfunc\n():\n \n...\n \n# Create function object\n\n\nfunc\n()\n \n# Call object\n\n\nfunc\n.\nattr\n \n=\n \nvalue\n \n# Attach attributes\n\n\n\n\n\n\nA First Example: Definitions and Calls\n\n\nApart from such runtime concepts (which tend to seem most unique to programmers\nwith backgrounds in traditional compiled languages), Python functions are straightforward\nto use. Let\u2019s code a first real example to demonstrate the basics. As you\u2019ll see,\nthere are two sides to the function picture: a definition (the def that creates a function)\nand a call (an expression that tells Python to run the function\u2019s body).\n\n\nDefinition\n\n\nHere\u2019s a definition typed interactively that defines a function called times, which returns\nthe product of its two arguments:\n\n\n \ndef\n \ntimes\n(\nx\n,\n \ny\n):\n \n# Create and assign function\n\n\n...\n \nreturn\n \nx\n \n*\n \ny\n \n# Body executed when called\n\n\n...\n\n\n\n\n\n\nWhen Python reaches and runs this def, it creates a new function object that packages\nthe function\u2019s code and assigns the object to the name times. Typically, such a statement\nis coded in a module file and runs when the enclosing file is imported; for something\nthis small, though, the interactive prompt suffices.\n\n\nCalls\n\n\nAfter the def has run, you can call (run) the function in your program by adding\nparentheses after the function\u2019s name. The parentheses may optionally contain one or\nmore object arguments, to be passed (assigned) to the names in the function\u2019s header:\n\n\n \ntimes\n(\n2\n,\n \n4\n)\n \n# Arguments in parentheses\n\n\n8\n\n\n\n\n\n\nThis expression passes two arguments to times. As mentioned previously, arguments\nare passed by assignment, so in this case the name x in the function header is assigned\nthe value 2, y is assigned the value 4, and the function\u2019s body is run. For this function,\nthe body is just a return statement that sends back the result as the value of the call\nexpression. The returned object was printed here interactively (as in most languages,\n2 * 4 is 8 in Python), but if we needed to use it later we could instead assign it to a\nvariable. For example:\n\n\n \nx\n \n=\n \ntimes\n(\n3.14\n,\n \n4\n)\n \n# Save the result object\n\n\n \nx\n\n\n12.56\n\n\n\n\n\n\nNow, watch what happens when the function is called a third time, with very different\nkinds of objects passed in:\n\n\n \ntimes\n(\nNi\n,\n \n4\n)\n \n# Functions are \ntypeless\n\n\nNiNiNiNi\n\n\n\n\n\n\nThis time, our function means something completely different (Monty Python reference\nagain intended). In this third call, a string and an integer are passed to x and y, instead\nof two numbers. Recall that * works on both numbers and sequences; because we never\ndeclare the types of variables, arguments, or return values in Python, we can use\ntimes to either multiply numbers or repeat sequences.\n\nIn other words, what our times function means and does depends on what we pass into\nit. This is a core idea in Python (and perhaps the key to using the language well), which\nwe\u2019ll explore in the next section.\n\n\n\n\nSource:\n \n\n\n \nLearning Python, Fourth Edition\n by Mark Lutz - 2009\n\n\n\n\nHow To Define Functions in Python 3\n\n\nA function is a block of instructions that performs an action and, once defined, can be reused. Functions make code more modular, allowing you to use the same code over and over again.\n\n\nPython has a number of built-in functions that you may be familiar with, including: \n\n\n\n\nprint() which will print an object to the terminal\n\n\nint() which will convert a string or number data type to an integer data type\n\n\nlen() which returns the length of an object\n\n\n\n\nFunction names include parentheses and may include parameters. \n\n\nIn this tutorial, we\u2019ll go over how to define your own functions to use in your coding projects.\n\n\nDefining a Function\n\n\nLet\u2019s start with turning the classic \u201cHello, World!\u201d program into a function.\n\n\nWe\u2019ll create a new text file in our text editor of choice, and call the program hello.py. Then, we\u2019ll define the function.\n\n\nA function is defined by using the def keyword, followed by a name of your choosing, followed by a set of parentheses which hold any parameters the function will take (they can be empty), and ending with a colon.\n\n\nIn this case, we\u2019ll define a function named hello():\n\n\ndef\n \nhello\n():\n\n\n\n\n\n\nThis sets up the initial statement for creating a function.\n\n\nFrom here, we\u2019ll add a second line with a 4-space indent to provide the instructions for what the function does. In this case, we\u2019ll be printing Hello, World! to the console:\n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\n\n\n\nOur function is now fully defined, but if we run the program at this point, nothing will happen since we didn\u2019t call the function.\n\n\nSo, outside of our defined function block, let\u2019s call the function with hello(): \n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\nhello\n()\n\n\n\n\n\n\nNow, let\u2019s run the program:\n\n\npython\n \nhello\n.\npy\n\n\n\n\n\n\nYou should receive the following output:\n\n\nHello\n,\n \nWorld\n!\n\n\n\n\n\n\nFunctions can be more complicated than the \nhello()\n function we defined above. For example, we can use for loops, conditional statements, and more within our function block.\n\n\nFor example, the function defined below utilizes a conditional statement to check if the input for the name variable contains a vowel, then uses a \nfor\n loop to iterate over the letters in the \nname\n string.\n\n\n# Define function names()\n\n\ndef\n \nnames\n():\n\n \n# Set up name variable with input\n\n \nname\n \n=\n \nstr\n(\ninput\n(\nEnter your name: \n))\n\n \n# Check whether name has a vowel\n\n \nif\n \nset\n(\naeiou\n)\n.\nintersection\n(\nname\n.\nlower\n()):\n\n \nprint\n(\nYour name contains a vowel.\n)\n\n \nelse\n:\n\n \nprint\n(\nYour name does not contain a vowel.\n)\n\n\n \n# Iterate over name\n\n \nfor\n \nletter\n \nin\n \nname\n:\n\n \nprint\n(\nletter\n)\n\n\n\n# Call the function\n\n\nnames\n()\n\n\n\n\n\n\nThe \nnames()\n function we defined above sets up a conditional statement and a for loop, showing how code can be organized within a function definition. However, depending on what we intend with our program and how we want to set up our code, we may want to define the conditional statement and the for loop as two separate functions.\n\n\nDefining functions within a program makes our code modular and reusable so that we can call the same functions without rewriting them.\n\n\nWorking with Parameters\n\n\nSo far we have looked at functions with empty parentheses that do not take arguments, but we can define parameters in function definitions within their parentheses.\n\n\nA parameter is a named entity in a function definition, specifying an argument that the function can accept.\n\n\nLet\u2019s create a small program that takes in parameters x, y, and z. We\u2019ll create a function that adds the parameters together in different configurations. The sums of these will be printed by the function. Then we\u2019ll call the function and pass numbers into the function.\n\n\ndef\n \nadd_numbers\n(\nx\n,\n \ny\n,\n \nz\n):\n\n \na\n \n=\n \nx\n \n+\n \ny\n\n \nb\n \n=\n \nx\n \n+\n \nz\n\n \nc\n \n=\n \ny\n \n+\n \nz\n\n \nprint\n(\na\n,\n \nb\n,\n \nc\n)\n\n\n\nadd_numbers\n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n\n\n\n\nWe passed the number 1 in for the x parameter, 2 in for the y parameter, and 3 in for the z parameter. These values correspond with each parameter in the order they are given.\n\n\nThe program is essentially doing the following math based on the values we passed to the parameters:\n\n\na\n \n=\n \n1\n \n+\n \n2\n\n\nb\n \n=\n \n1\n \n+\n \n3\n\n\nc\n \n=\n \n2\n \n+\n \n3\n\n\n\n\n\n\nThe function also prints a, b, and c, and based on the math above we would expect a to be equal to 3, b to be 4, and c to be 5. Let\u2019s run the program:\n\n\npython\n \nadd_numbers\n.\npy\n\n\nOutput\n \n:\n \n3\n \n4\n \n5\n\n\n\n\n\n\nWhen we pass 1, 2, and 3 as parameters to the add_numbers() function, we receive the expected output.\n\n\nParameters are arguments that are typically defined as variables within function definitions. They can be assigned values when you run the method, passing the arguments into the function.\n\n\nKeyword Arguments\n\n\nIn addition to calling parameters in order, you can use \nkeyword arguments\n in a function call, in which the caller identifies the arguments by the parameter name.\n\n\nWhen you use keyword arguments, you can use parameters out of order because the Python interpreter will use the keywords provided to match the values to the parameters.\n\n\nLet\u2019s create a function that will show us profile information for a user. We\u2019ll pass parameters to it in the form of \nusername\n (intended as a string), and \nfollowers\n (intended as an integer).\n\n\n# Define function with parameters\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n \n\n\n\n\n\nWithin the function definition statement, \nusername\n and \nfollowers\n are contained in the parentheses of the profile_info() function. The block of the function prints out information about the user as strings, making use of the two parameters.\n\n\nNow, we can call the function and assign parameters to it:\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n\n\n\n# Call function with parameters assigned as above\n\n\nprofile_info\n(\nsammyshark\n,\n \n945\n)\n\n\n\n# Call function with keyword arguments\n\n\nprofile_info\n(\nusername\n=\nAlexAnglerfish\n,\n \nfollowers\n=\n342\n)\n\n\n\n\n\n\nIn the first function call, we have filled in the information with a username of sammyshark and followers being 945, in the second function call we used keyword arguments, assigning values to the argument variables.\n\n\nLet\u2019s run the program:\n\n\npython\n \nprofile\n.\npy\n\n\nOutput\n \n:\n \n\nUsername\n:\n \nsammyshark\n\n\nFollowers\n:\n \n945\n\n\nUsername\n:\n \nAlexAnglerfish\n\n\nFollowers\n:\n \n342\n\n\n\n\n\n\nThe output shows us the usernames and numbers of followers for both users.\n\n\nThis also permits us to modify the order of the parameters, as in this example of the same program with a different call:\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n\n\n\n# Change order of parameters\n\n\nprofile_info\n(\nfollowers\n=\n820\n,\n \nusername\n=\ncameron-catfish\n)\n\n\n\n\n\n\nWhen we run the program again with the python profile.py command, we\u2019ll receive the following output:\n\n\nOutput\n:\n\n\nUsername\n:\n \ncameron\n-\ncatfish\n\n\nFollowers\n:\n \n820\n\n\n\n\n\n\nBecause the function definition maintains the same order of print() statements, if we use keyword arguments, it does not matter which order we pass them into the function call.\n\n\nDefault Argument Values\n\n\nWe can also provide default values for one or both of the parameters. Let\u2019s create a default value for the \nfollowers\n parameter with a value of 1:\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n=\n1\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n\n\n\n\n\n\nNow, we can run the function with only the username function assigned, and the number of followers will automatically default to 1. We can also still change the number of followers if we would like.\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n=\n1\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n\n\n\nprofile_info\n(\nusername\n=\nJOctopus\n)\n\n\nprofile_info\n(\nusername\n=\nsammyshark\n,\n \nfollowers\n=\n945\n)\n\n\n\n\n\n\nWhen we run the program with the python profile.py command, we\u2019ll receive the following output:\n\n\nOutput\n:\n\n\nUsername\n:\n \nJOctopus\n\n\nFollowers\n:\n \n1\n\n\nUsername\n:\n \nsammyshark\n\n\nFollowers\n:\n \n945\n\n\n\n\n\n\nProviding default parameters with values can let us skip defining values for each argument that already has a default.\n\n\nReturning a Value\n\n\nYou can pass a parameter value into a function, and a function can also produce a value.\n\n\nA function can produce a value with the return statement, which will exit a function and optionally pass an expression back to the caller. If you use a return statement with no arguments, the function will return None.\n\n\nSo far, we have used the print() statement instead of the return statement in our functions. Let\u2019s create a program that instead of printing will return a variable.\n\n\nIn a new text file called square.py, we\u2019ll create a program that squares the parameter x and returns the variable y. We issue a call to print the result variable, which is formed by running the square() function with 3 passed into it.\n\n\ndef\n \nsquare\n(\nx\n):\n\n \ny\n \n=\n \nx\n \n**\n \n2\n\n \nreturn\n \ny\n\n\n\nresult\n \n=\n \nsquare\n(\n3\n)\n\n\nprint\n(\nresult\n)\n\n\n\n\n\n\nWe can run the program and see the output:\n\n\npython\n \nsquare\n.\npy\n\n\nOutput\n:\n\n\n9\n\n\n\n\n\n\nThe integer 9 is returned as output, which is what we would expect by asking Python to find the square of 3.\n\n\nTo further understand how the \nreturn\n statement works, we can comment out the \nreturn\n statement in the program:\n\n\ndef\n \nsquare\n(\nx\n):\n\n \ny\n \n=\n \nx\n \n**\n \n2\n\n \n# return y\n\n\n\nresult\n \n=\n \nsquare\n(\n3\n)\n\n\nprint\n(\nresult\n)\n\n\n\n\n\n\nNow, let\u2019s run the program again:\n\n\npython\n \nsquare\n.\npy\n\n\nOutput\n:\n\n\nNone\n\n\n\n\n\n\nWithout using the \nreturn\n statement here, the program cannot return a value so the value defaults to None.\n\n\nAs another example, in the \nadd_numbers.py\n program above, we could swap out the \nprint()\n statement for a return statement.\n\n\ndef\n \nadd_numbers\n(\nx\n,\n \ny\n,\n \nz\n):\n\n \na\n \n=\n \nx\n \n+\n \ny\n\n \nb\n \n=\n \nx\n \n+\n \nz\n\n \nc\n \n=\n \ny\n \n+\n \nz\n\n \nreturn\n \na\n,\n \nb\n,\n \nc\n\n\n\nsums\n \n=\n \nadd_numbers\n(\n1\n,\n \n2\n,\n \n3\n)\n\n\nprint\n(\nsums\n)\n\n\n\n\n\n\nOutside of the function, we set the variable sums equal to the result of the function taking in 1, 2, and 3 as we did above. Then we called a print of the sums variable.\n\n\nLet\u2019s run the program again now that it has the return statement:\n\n\nOutput\n:\n\n\n(\n3\n,\n \n4\n,\n \n5\n)\n\n\n\n\n\n\nWe receive the same numbers 3, 4, and 5 as output that we received previously by using the print() statement in the function. This time it is delivered as a tuple because the return statement\u2019s expression list has at least one comma.\n\n\nFunctions exit immediately when they hit a return statement, whether or not they\u2019re returning a value.\n\n\ndef\n \nloop_five\n():\n\n \nfor\n \nx\n \nin\n \nrange\n(\n0\n,\n \n25\n):\n\n \nprint\n(\nx\n)\n\n \nif\n \nx\n \n==\n \n5\n:\n\n \n# Stop function at x == 5\n\n \nreturn\n\n \nprint\n(\nThis line will not execute.\n)\n\n\n\nloop_five\n()\n\n\n\n\n\n\nUsing the \nreturn\n statement within the \nfor\n loop ends the function, so the line that is outside of the loop will not run. If, instead, we had used a \nbreak\n statement, only the loop would have exited at that time, and the last print() line would run.\n\n\nThe \nreturn\n statement exits a function, and may return a value when issued with a parameter.\n\n\nUsing \nmain()\n as a Function\n\n\nAlthough in Python you can call the function at the bottom of your program and it will run (as we have done in the examples above), many programming languages (like C++ and Java) require a main function in order to execute. Including a main() function, though not required, can structure our Python programs in a logical way that puts the most important components of the program into one function. It can also make our programs easier for non-Python programmers to read.\n\n\nWe\u2019ll start with adding a main() function to the hello.py program above. We\u2019ll keep our hello() function, and then define a main() function:\n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\ndef\n \nmain\n():\n\n\n\n\n\n\nWithin the main() function, let\u2019s include a print() statement to let us know that we\u2019re in the main() function. Additionally, let\u2019s call the hello() function within the main() function:\n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\n\ndef\n \nmain\n():\n\n \nprint\n(\nThis is the main function\n)\n\n \nhello\n()\n\n\n\n\n\n\nFinally, at the bottom of the program we\u2019ll call the main() function:\n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\ndef\n \nmain\n():\n\n \nprint\n(\nThis is the main function.\n)\n\n \nhello\n()\n\n\n\nmain\n()\n\n\n\n\n\n\nAt this point, we can run our program:\n\n\npython\n \nhello\n.\npy\n\n\nOutput\n:\n\n\nThis\n \nis\n \nthe\n \nmain\n \nfunction\n.\n\n\nHello\n,\n \nWorld\n!\n\n\n\n\n\n\nBecause we called the \nhello()\n function within main() and then only called \nmain()\n to run, the \nHello, World!\n text printed only once, after the string that told us we were in the main function.\n\n\nNext we\u2019re going to be working with multiple functions, so it is worth reviewing the variable scope of global and local variables. If you define a variable within a function block, you\u2019ll only be able to use that variable within that function. If you would like to use variables across functions it may be better to declare a global variable.\n\n\nIn Python, '_\nmain_\n' is the name of the scope where top-level code will execute. When a program is run from standard input, a script, or from an interactive prompt, its _\nname_\n is set equal to '_\nmain_\n'.\n\n\nBecause of this, there is a convention to use the following construction:\n\n\nif\n \n__name__\n \n==\n \n__main__\n:\n\n \n# Code to run when this is the main program here\n\n\n\n\n\n\nThis lets program files be used either:\n- as the main program and run what follows the if statement\n- as a module and not run what follows the if statement.\n\n\nAny code that is not contained within this statement will be executed upon running. If you\u2019re using your program file as a module, the code that is not in this statement will also execute upon its import while running the secondary file.\n\n\nLet\u2019s expand on our names.py program above, and create a new file called more_names.py. In this program we\u2019ll declare a global variable and modify our original names() function so that the instructions are in two discrete functions.\n\n\nThe first function, \nhas_vowel()\n will check to see if the name string contains a vowel.\n\n\nThe second function \nprint_letters()\n will print each letter of the \nname\n string.\n\n\n# Declare global variable name for use in all functions\n\n\nname\n \n=\n \nstr\n(\ninput\n(\nEnter your name: \n))\n\n\n\n\n# Define function to check if name contains a vowel\n\n\ndef\n \nhas_vowel\n():\n\n \nif\n \nset\n(\naeiou\n)\n.\nintersection\n(\nname\n.\nlower\n()):\n\n \nprint\n(\nYour name contains a vowel.\n)\n\n \nelse\n:\n\n \nprint\n(\nYour name does not contain a vowel.\n)\n\n\n\n\n# Iterate over letters in name string\n\n\ndef\n \nprint_letters\n():\n\n \nfor\n \nletter\n \nin\n \nname\n:\n\n \nprint\n(\nletter\n)\n\n\n\n\n\n\nWith this set up, let\u2019s define the main() function which will contain a call to both the has_vowel() and the print_letters() functions.\n\n\n# Declare global variable name for use in all functions\n\n\nname\n \n=\n \nstr\n(\ninput\n(\nEnter your name: \n))\n\n\n\n\n# Define function to check if name contains a vowel\n\n\ndef\n \nhas_vowel\n():\n\n \nif\n \nset\n(\naeiou\n)\n.\nintersection\n(\nname\n.\nlower\n()):\n\n \nprint\n(\nYour name contains a vowel.\n)\n\n \nelse\n:\n\n \nprint\n(\nYour name does not contain a vowel.\n)\n\n\n\n\n# Iterate over letters in name string\n\n\ndef\n \nprint_letters\n():\n\n \nfor\n \nletter\n \nin\n \nname\n:\n\n \nprint\n(\nletter\n)\n\n\n\n\n# Define main method that calls other functions\n\n\ndef\n \nmain\n():\n\n \nhas_vowel\n()\n\n \nprint_letters\n()\n\n\n\n\n\n\nFinally, we\u2019ll add the \nif \\__name\\__ == '\\__main\\__':\n construction at the bottom of the file. For our purposes, since we have put all the functions we would like to do in the \nmain()\n function, we\u2019ll call the \nmain()\n function following this if statement.\n\n\n# Declare global variable name for use in all functions\n\n\nname\n \n=\n \nstr\n(\ninput\n(\nEnter your name: \n))\n\n\n\n\n# Define function to check if name contains a vowel\n\n\ndef\n \nhas_vowel\n():\n\n \nif\n \nset\n(\naeiou\n)\n.\nintersection\n(\nname\n.\nlower\n()):\n\n \nprint\n(\nYour name contains a vowel.\n)\n\n \nelse\n:\n\n \nprint\n(\nYour name does not contain a vowel.\n)\n\n\n\n\n# Iterate over letters in name string\n\n\ndef\n \nprint_letters\n():\n\n \nfor\n \nletter\n \nin\n \nname\n:\n\n \nprint\n(\nletter\n)\n\n\n\n\n# Define main method that calls other functions\n\n\ndef\n \nmain\n():\n\n \nhas_vowel\n()\n\n \nprint_letters\n()\n\n\n\n\n# Execute main() function\n\n\nif\n \n__name__\n \n==\n \n__main__\n:\n\n \nmain\n()\n\n\n\n\n\n\nWe can now run the program:\n\n\npython\n \nmore_names\n.\npy\n\n\n\n\n\n\nThe program will show the same output as the names.py program, but here the code is more organized and can be used in a modular way without modification.\n\n\nIf you did not want to declare a main() function, you alternatively could have ended the program like this:\n\n\nif\n \n__name__\n \n==\n \n__main__\n:\n\n \nhas_vowel\n()\n\n \nprint_letters\n()\n\n\n\n\n\n\nUsing \nmain()\n as a function and the if _\nname_\n == '_\nmain_\n': statement can organize your code in a logical way, making it more readable and modular.\n\n\nConclusion\n\n\nFunctions are code blocks of instructions that perform actions within a program, helping to make our code reusable and modular.\n\n\nTo learn more about how to make your code more modular, you can read our guide on \nHow To Write Modules in Python 3.\n\n\n\n\nSource:\n \n\n\n https://stackoverflow.com/questions/1909512/what-is-python-used-for\n\n\n\n\nPrefer Exceptions to Returning None\n\n\nWhen writing utility functions, there\u2019s a draw for Python programmers to give special\nmeaning to the return value of None. It seems to makes sense in some cases. For example,\nsay you want a helper function that divides one number by another. In the case of dividing\nby zero, returning None seems natural because the result is undefined.\n\n\ndef\n \ndivide\n(\na\n,\n \nb\n):\n\n \ntry\n:\n\n \nreturn\n \na\n \n/\n \nb\n\n \nexcept\n \nZeroDivisionError\n:\n\n \nreturn\n \nNone\n\n\n\n\n\n\nCode using this function can interpret the return value accordingly.\n\n\nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nif\n \nresult\n \nis\n \nNone\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n\n\n\n\n\n\nWhat happens when the numerator is zero? That will cause the return value to also be zero\n(if the denominator is non-zero). This can cause problems when you evaluate the result in\na condition like an if statement. You may accidentally look for any False equivalent\nvalue to indicate errors instead of only looking for None.\n\n\nx\n,\n \ny\n \n=\n \n0\n,\n \n5\n\n\nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nif\n \nnot\n \nresult\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n \n# This is wrong!\n\n\n\n\n\n\nThis is a common mistake in Python code when None has special meaning. This is why\nreturning None from a function is error prone. There are two ways to reduce the chance of\nsuch errors. \n\n\nThe first way is to split the return value into a two-tuple. The first part of the tuple\nindicates that the operation was a success or failure. The second part is the actual result\nthat was computed.\n\n\ndef\n \ndivide\n(\na\n,\n \nb\n):\n\n \ntry\n:\n\n \nreturn\n \nTrue\n,\n \na\n \n/\n \nb\n\n \nexcept\n \nZeroDivisionError\n:\n\n \nreturn\n \nFalse\n,\n \nNone\n\n\n\n\n\n\nCallers of this function have to unpack the tuple. That forces them to consider the status\npart of the tuple instead of just looking at the result of division.\n\n\nsuccess\n,\n \nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nif\n \nnot\n \nsuccess\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n\n\n\n\n\n\nThe problem is that callers can easily ignore the first part of the tuple (using the\nunderscore variable name, a Python convention for unused variables). The resulting code\ndoesn\u2019t look wrong at first glance. This is as bad as just returning None.\n\n\n_\n,\n \nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nif\n \nnot\n \nresult\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n\n\n\n\n\n\nThe second, better way to reduce these errors is to never return None at all. Instead, raise\nan exception up to the caller and make them deal with it. Here, I turn a\nZeroDivisionError into a ValueError to indicate to the caller that the input\nvalues are bad: \n\n\ndef\n \ndivide\n(\na\n,\n \nb\n):\n\n \ntry\n:\n\n \nreturn\n \na\n \n/\n \nb\n\n \nexcept\n \nZeroDivisionError\n \nas\n \ne\n:\n\n \nraise\n \nValueError\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n \nfrom\n \ne\n\n\n\n\n\n\nNow the caller should handle the exception for the invalid input case.\nThe caller no longer requires a condition on the return value of the function. If the\nfunction didn\u2019t raise an exception, then the return value must be good. The outcome of\nexception handling is clear.\n\n\nx\n,\n \ny\n \n=\n \n5\n,\n \n2\n\n\ntry\n:\n\n \nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nexcept\n \nValueError\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n\n\nelse\n:\n\n \nprint\n(\n\u2018\nResult\n \nis\n \n%.\n1\nf\n\u2019\n \n%\n \nresult\n)\n\n\n\n\nResult\n \nis\n \n2.5\n\n\n\n\n\n\nThings to Remember\n\n\n\n\nFunctions that return None to indicate special meaning are error prone because\nNone and other values (e.g., zero, the empty string) all evaluate to False in\nconditional expressions. \n\n\nRaise exceptions to indicate special situations instead of returning None. Expect the\ncalling code to handle exceptions properly when they\u2019re documented.\n\n\n\n\n\n\nSource:\n \n\n\n \nEffective Python\n by Brett Slatkin", + "location": "/beginner/Functions/", + "text": "Function Calls\n\n\nIn the context of programming, a function is a named sequence of statements that\nperforms a computation. When you define a function, you specify the name and the\nsequence of statements. Later, you can \u201ccall\u201d the function by name. We have already seen\none example of a function call:\n\n\n \ntype\n(\n32\n)\n\n\ntype\n \nint\n\n\n\n\n\n\nThe name of the function is type. The expression in parentheses is called the argument\nof the function. The result, for this function, is the type of the argument.\n\nIt is common to say that a function \u201ctakes\u201d an argument and \u201creturns\u201d a result. The result\nis called the return value.\n\n\nType Conversion Functions\n\n\nPython provides built-in functions that convert values from one type to another. The\nint function takes any value and converts it to an integer, if it can, or complains\notherwise:\n\n\n \nint\n(\n32\n)\n\n\n32\n\n\n \nint\n(\nHello\n)\n\n\nValueError\n:\n \ninvalid\n \nliteral\n \nfor\n \nint\n():\n \nHello\n\n\n\n\n\n\nint can convert floating-point values to integers, but it doesn\u2019t round off; it chops off\nthe fraction part:\n\n\n \nint\n(\n3.99999\n)\n\n\n3\n\n\n \nint\n(\n-\n2.3\n)\n\n\n-\n2\n\n\n\n\n\n\nfloat converts integers and strings to floating-point numbers:\n\n\n \nfloat\n(\n32\n)\n\n\n32.0\n\n\n \nfloat\n(\n3.14159\n)\n\n\n3.14159\n\n\n\n\n\n\nFinally, str converts its argument to a string:\n\n\n \nstr\n(\n32\n)\n\n\n32\n\n\n \nstr\n(\n3.14159\n)\n\n\n3.14159\n\n\n\n\n\n\nAdding New Functions\n\n\nSo far, we have only been using the functions that come with Python, but it is also possible\nto add new functions. A function definition specifies the name of a new function and\nthe sequence of statements that execute when the function is called.\n\nHere is an example:\n\n\ndef\n \nprint_lyrics\n():\n\n \nprint\n \nI\nm a lumberjack, and I\nm okay.\n\n \nprint\n \nI sleep all night and I work all day.\n\n\n\n\n\n\ndef\n is a keyword that indicates that this is a function definition. The name of the function\nis print_lyrics. The rules for function names are the same as for variable names: letters,\nnumbers and some punctuation marks are legal, but the first character can\u2019t be a number.\nYou can\u2019t use a keyword as the name of a function, and you should avoid having a variable\nand a function with the same name.\n\nThe empty parentheses after the name indicate that this function doesn\u2019t take any\narguments.\n\nThe first line of the function definition is called the header; the rest is called the body.\nThe header has to end with a colon and the body has to be indented. By convention, the\nindentation is always four spaces; see \u201cDebugging\u201d (page 33). The body can contain any\nnumber of statements.\n\nThe strings in the print statements are enclosed in double quotes. Single quotes and\ndouble quotes do the same thing; most people use single quotes except in cases like this\nwhere a single quote (which is also an apostrophe) appears in the string.\nIf you type a function definition in interactive mode, the interpreter prints ellipses (...)\nto let you know that the definition isn\u2019t complete:\n\n\ndef\n \nprint_lyrics\n():\n\n \nprint\n \nI\nm a lumberjack, and I\nm okay.\n\n \nprint\n \nI sleep all night and I work all day.\n\n\n\n\n\n\nTo end the function, you have to enter an empty line (this is not necessary in a script).\nDefining a function creates a variable with the same name.\n\n\n \nprint\n \nprint_lyrics\n\n\nfunction\n \nprint_lyrics\n \nat\n \n0xb7e99e9c\n\n\n \ntype\n(\nprint_lyrics\n)\n\n\ntype\n \nfunction\n\n\n\n\n\n\nThe value of print_lyrics is a function object, which has type 'function'.\nThe syntax for calling the new function is the same as for built-in functions:\n\n\n \nprint_lyrics\n()\n\n\nI\nm a lumberjack, and I\nm\n \nokay\n.\n\n\nI\n \nsleep\n \nall\n \nnight\n \nand\n \nI\n \nwork\n \nall\n \nday\n.\n\n\n\n\n\n\nOnce you have defined a function, you can use it inside another function. For example,\nto repeat the previous refrain, we could write a function called repeat_lyrics: \n\n\ndef\n \nrepeat_lyrics\n():\n\n \nprint_lyrics\n()\n\n \nprint_lyrics\n()\n\n\n\n\n\n\nAnd then call repeat_lyrics: \n\n\n \nrepeat_lyrics\n()\n\n\nI\nm a lumberjack, and I\nm\n \nokay\n.\n\n\nI\n \nsleep\n \nall\n \nnight\n \nand\n \nI\n \nwork\n \nall\n \nday\n.\n\n\nI\nm a lumberjack, and I\nm\n \nokay\n.\n\n\nI\n \nsleep\n \nall\n \nnight\n \nand\n \nI\n \nwork\n \nall\n \nday\n.\n\n\n\n\n\n\nBut that\u2019s not really how the song goes.\n\n\nDefinitions and Uses\n\n\nPulling together the code fragments from the previous section, the whole program looks\nlike this:\n\n\ndef\n \nprint_lyrics\n():\n\n \nprint\n \nI\nm a lumberjack, and I\nm okay.\n\n \nprint\n \nI sleep all night and I work all day.\n\n\ndef\n \nrepeat_lyrics\n():\n\n \nprint_lyrics\n()\n\n \nprint_lyrics\n()\n \n\n\nrepeat_lyrics\n()\n\n\n\n\n\n\nThis program contains two function definitions: print_lyrics and repeat_lyrics.\nFunction definitions get executed just like other statements, but the result creates func\ntion objects. The statements inside the function do not get executed until the function\nis called, and the function definition generates no output.\n\nAs you might expect, you have to create a function before you can execute it. In other\nwords, the function definition has to be executed before the function is called the first\ntime. \n\n\nFlow of Execution\n\n\nIn order to ensure that a function is defined before its first use, you have to know the\norder in which statements are executed, which is called the flow of execution.\n\nExecution always begins at the first statement of the program. Statements are executed\none at a time, in order, from top to bottom.\n\n\nFunction definitions do not alter the flow of execution of the program, but remember\nthat statements inside the function are not executed until the function is called.\nA function call is like a detour in the flow of execution. Instead of going to the next\nstatement, the flow jumps to the body of the function, executes all the statements there,\nand then comes back to pick up where it left off.\n\nThat sounds simple enough, until you remember that one function can call another.\nWhile in the middle of one function, the program might have to execute the statements\nin another function. But while executing that new function, the program might have to\nexecute yet another function!\n\nFortunately, Python is good at keeping track of where it is, so each time a function\ncompletes, the program picks up where it left off in the function that called it. When it\ngets to the end of the program, it terminates.\n\nWhat\u2019s the moral of this sordid tale? When you read a program, you don\u2019t always want\nto read from top to bottom. Sometimes it makes more sense if you follow the flow of\nexecution. \n\n\nParameters and Arguments\n\n\nSome of the built-in functions we have seen require arguments. For example, when you\ncall math.sin you pass a number as an argument. Some functions take more than one\nargument: \nmath.pow\n takes two, the base and the exponent.\nInside the function, the arguments are assigned to variables called parameters. Here is\nan example of a user-defined function that takes an argument:\n\n\n \ndef\n \nprint_twice\n(\nbruce\n):\n\n \nprint\n \nbruce\n\n \nprint\n \nbruce\n\n\n\n\n\n\nThis function assigns the argument to a parameter named bruce. When the function is\ncalled, it prints the value of the parameter (whatever it is) twice.\n\nThis function works with any value that can be printed.\n\n\n \nprint_twice\n(\nSpam\n)\n\n\nSpam\n\n\nSpam\n\n\n \nprint_twice\n(\n17\n)\n\n\n17\n\n\n17\n\n\n \nprint_twice\n(\nmath\n.\npi\n)\n\n\n3.14159265359\n\n\n3.14159265359\n \n\n\n\n\n\nThe same rules of composition that apply to built-in functions also apply to user-defined\nfunctions, so we can use any kind of expression as an argument for \nprint_twice\n:\n\n\n \nprint_twice\n(\nSpam \n*\n4\n)\n\n\nSpam\n \nSpam\n \nSpam\n \nSpam\n\n\nSpam\n \nSpam\n \nSpam\n \nSpam\n\n\n \nprint_twice\n(\nmath\n.\ncos\n(\nmath\n.\npi\n))\n\n\n-\n1.0\n\n\n-\n1.0\n\n\n\n\n\n\nThe argument is evaluated before the function is called, so in the examples the expres\nsions 'Spam '*4 and math.cos(math.pi) are only evaluated once.\n\nYou can also use a variable as an argument:\n\n\n \nmichael\n \n=\n \nEric, the half a bee.\n\n\n \nprint_twice\n(\nmichael\n)\n\n\nEric\n,\n \nthe\n \nhalf\n \na\n \nbee\n.\n\n\nEric\n,\n \nthe\n \nhalf\n \na\n \nbee\n.\n\n\n\n\n\n\nThe name of the variable we pass as an argument (michael) has nothing to do with the\nname of the parameter (bruce). It doesn\u2019t matter what the value was called back home\n(in the caller); here in print_twice, we call everybody bruce.\n\n\nVariables and Parameters Are Local\n\n\nWhen you create a variable inside a function, it is local, which means that it only exists\ninside the function. For example:\n\n\ndef\n \ncat_twice\n(\npart1\n,\n \npart2\n):\n\n \ncat\n \n=\n \npart1\n \n+\n \npart2\n\n \nprint_twice\n(\ncat\n)\n\n\n\n\n\n\nThis function takes two arguments, concatenates them, and prints the result twice. Here\nis an example that uses it:\n\n\n \nline1\n \n=\n \nBing tiddle \n\n\n \nline2\n \n=\n \ntiddle bang.\n\n\n \ncat_twice\n(\nline1\n,\n \nline2\n)\n\n\nBing\n \ntiddle\n \ntiddle\n \nbang\n.\n\n\nBing\n \ntiddle\n \ntiddle\n \nbang\n.\n\n\n\n\n\n\nWhen cat_twice terminates, the variable cat is destroyed. If we try to print it, we get\nan exception:\n\n\n \nprint\n \ncat\n\n\nNameError\n:\n \nname\n \ncat\n \nis\n \nnot\n \ndefined\n\n\n\n\n\n\nParameters are also local. For example, outside print_twice, there is no such thing as\nbruce.\n\n\nStack Diagrams\n\n\nTo keep track of which variables can be used where, it is sometimes useful to draw a\nstack diagram. Like state diagrams, stack diagrams show the value of each variable, but\nthey also show the function each variable belongs to.\n\nEach function is represented by a frame. A frame is a box with the name of a function\nbeside it and the parameters and variables of the function inside it. The stack diagram\nfor the previous example is shown in Figure 3-1.\n\n\n\n\nThe frames are arranged in a stack that indicates which function called which, and so\non. In this example, print_twice was called by cat_twice, and cat_twice was called\nby \n\\__main\\__\n, which is a special name for the topmost frame. When you create a variable\noutside of any function, it belongs to \n\\__main\\__\n.\n\n\nEach parameter refers to the same value as its corresponding argument. So, part1 has\nthe same value as line1, part2 has the same value as line2, and bruce has the same\nvalue as cat.\nIf an error occurs during a function call, Python prints the name of the function, and\nthe name of the function that called it, and the name of the function that called that, all\nthe way back to \n\\__main__\\\n.\n\n\nFor example, if you try to access cat from within print_twice, you get a NameError:\n\n\nTraceback\n \n(\ninnermost\n \nlast\n):\n\n \nFile\n \ntest.py\n,\n \nline\n \n13\n,\n \nin\n \n__main__\n\n \ncat_twice\n(\nline1\n,\n \nline2\n)\n\n \nFile\n \ntest.py\n,\n \nline\n \n5\n,\n \nin\n \ncat_twice\n\n \nprint_twice\n(\ncat\n)\n\n \nFile\n \ntest.py\n,\n \nline\n \n9\n,\n \nin\n \nprint_twice\n\n \nprint\n \ncat\n\n \nNameError\n:\n \nname\n \ncat\n \nis\n \nnot\n \ndefined\n\n\n\n\n\n\nThis list of functions is called a traceback. It tells you what program file the error oc\ncurred in, and what line, and what functions were executing at the time. It also shows\nthe line of code that caused the error.\nThe order of the functions in the traceback is the same as the order of the frames in the\nstack diagram. The function that is currently running is listed at the bottom.\n\n\nFruitful Functions and Void Functions\n\n\nSome of the functions we are using, such as the math functions, yield results; for lack of\na better name, I call them fruitful functions. Other functions, like print_twice, per\nform an action but don\u2019t return a value. They are called void functions.\nWhen you call a fruitful function, you almost always want to do something with the\nresult; for example, you might assign it to a variable or use it as part of an expression:\n\n\nx\n \n=\n \nmath\n.\ncos\n(\nradians\n)\n\n\ngolden\n \n=\n \n(\nmath\n.\nsqrt\n(\n5\n)\n \n+\n \n1\n)\n \n/\n \n2\n\n\n\n\n\n\nWhen you call a function in interactive mode, Python displays the result:\n\n\n \nmath\n.\nsqrt\n(\n5\n)\n\n\n2.2360679774997898\n\n\n\n\n\n\nBut in a script, if you call a fruitful function all by itself, the return value is lost forever!\n\n\nmath\n.\nsqrt\n(\n5\n)\n\n\n\n\n\n\nThis script computes the square root of 5, but since it doesn\u2019t store or display the result,\nit is not very useful.\nVoid functions might display something on the screen or have some other effect, but\nthey don\u2019t have a return value. If you try to assign the result to a variable, you get a special\nvalue called None.\n\n\n \nresult\n \n=\n \nprint_twice\n(\nBing\n)\n\n\nBing\n\n\nBing\n\n\n \nprint\n \nresult\n\n\nNone\n\n\n\n\n\n\nThe value None is not the same as the string 'None'. It is a special value that has its own\ntype:\n\n\n \nprint\n \ntype\n(\nNone\n)\n\n\ntype\n \nNoneType\n\n\n\n\n\n\nThe functions we have written so far are all void. We will start writing fruitful functions\nin a few chapters.\n\n\nWhy Functions?\n\n\nIt may not be clear why it is worth the trouble to divide a program into functions. There\nare several reasons:\n\n- Creating a new function gives you an opportunity to name a group of statements,\nwhich makes your program easier to read and debug.\n- Functions can make a program smaller by eliminating repetitive code. Later, if you\nmake a change, you only have to make it in one place.\n- Dividing a long program into functions allows you to debug the parts one at a time\nand then assemble them into a working whole.\n- Well-designed functions are often useful for many programs. Once you write and\ndebug one, you can reuse it.\n\n\n\n\nSource:\n \n\n\n \nThink Python\n by Allen B. Downey - 2012\n\n\n\n\nFunctions by by Mark Lutz (Learning Python, Fourth Edition)\n\n\nFunction Basics\n\n\nIn Part III, we looked at basic procedural statements in Python. Here, we\u2019ll move on to\nexplore a set of additional statements that we can use to create functions of our own.\n\nIn simple terms, a function is a device that groups a set of statements so they can be run\nmore than once in a program. Functions also can compute a result value and let us\nspecify parameters that serve as function inputs, which may differ each time the code\nis run. Coding an operation as a function makes it a generally useful tool, which we\ncan use in a variety of contexts.\n\nMore fundamentally, functions are the alternative to programming by cutting and\npasting\u2014rather than having multiple redundant copies of an operation\u2019s code, we can\nfactor it into a single function. In so doing, we reduce our future work radically: if the\noperation must be changed later, we only have one copy to update, not many.\n\nFunctions are the most basic program structure Python provides for maximizing code\nreuse and minimizing code redundancy. As we\u2019ll see, functions are also a design tool\nthat lets us split complex systems into manageable parts. Table 16-1 summarizes the\nprimary function-related tools we\u2019ll study in this part of the book.\n\n\n\n\n\n\n\n\nStatement\n\n\nExamples\n\n\n\n\n\n\n\n\n\n\n\n\nCalls\n\n\nmyfunc('spam', 'eggs', meat=ham)\n\n\n\n\n\n\n\n\ndef, return\n\n\ndef adder(a, b=1, *c): return a + b + c[0]\n\n\n\n\n\n\n\n\nglobal\n\n\ndef changer():global x; x = 'new'\n\n\n\n\n\n\n\n\nnonlocal\n\n\ndef changer():nonlocal x; x = 'new'\n\n\n\n\n\n\n\n\nyield\n\n\ndef squares(x):for i in range(x): yield i ** 2\n\n\n\n\n\n\n\n\nlambda\n\n\nfuncs = [lambda x: x*\n2, lambda x: x\n3]\n\n\n\n\n\n\n\n\n\n\nWhy Use Functions?\n\n\nBefore we get into the details, let\u2019s establish a clear picture of what functions are all\nabout. Functions are a nearly universal program-structuring device. You may have\ncome across them before in other languages, where they may have been called subroutines\nor procedures. As a brief introduction, functions serve two primary development\nroles:\n\n\nMaximizing code reuse and minimizing redundancy\n\nAs in most programming languages, Python functions are the simplest way to\npackage logic you may wish to use in more than one place and more than one time.\nUp until now, all the code we\u2019ve been writing has run immediately. Functions allow\nus to group and generalize code to be used arbitrarily many times later. Because\nthey allow us to code an operation in a single place and use it in many places,\nPython functions are the most basic factoring tool in the language: they allow us\nto reduce code redundancy in our programs, and thereby reduce maintenance\neffort. \n\n\nProcedural decomposition\n\nFunctions also provide a tool for splitting systems into pieces that have well-defined\nroles. For instance, to make a pizza from scratch, you would start by mixing the\ndough, rolling it out, adding toppings, baking it, and so on. If you were programming\na pizza-making robot, functions would help you divide the overall \u201cmake\npizza\u201d task into chunks\u2014one function for each subtask in the process. It\u2019s easier\nto implement the smaller tasks in isolation than it is to implement the entire process\nat once. In general, functions are about procedure\u2014how to do something, rather\nthan what you\u2019re doing it to. We\u2019ll see why this distinction matters in Part VI, when\nwe start making new object with classes. \n\n\n\n\nIn this part of the book, we\u2019ll explore the tools used to code functions in Python: function\nbasics, scope rules, and argument passing, along with a few related concepts such\nas generators and functional tools. Because its importance begins to become more apparent\nat this level of coding, we\u2019ll also revisit the notion of polymorphism introduced\nearlier in the book. As you\u2019ll see, functions don\u2019t imply much new syntax, but they do\nlead us to some bigger programming ideas.\n\n\nCoding Functions\n\n\nAlthough it wasn\u2019t made very formal, we\u2019ve already used some functions in earlier\nchapters. For instance, to make a file object, we called the built-in open function; similarly,\nwe used the len built-in function to ask for the number of items in a collection\nobject.\n\nIn this chapter, we will explore how to write new functions in Python. Functions we\nwrite behave the same way as the built-ins we\u2019ve already seen: they are called in expressions, are passed values, and return results. But writing new functions requires\nthe application of a few additional ideas that haven\u2019t yet been introduced. Moreover,\nfunctions behave very differently in Python than they do in compiled languages like C.\nHere is a brief introduction to the main concepts behind Python functions, all of which\nwe will study in this part of the book: \n\n\n\n\ndef is executable code.\n Python functions are written with a new statement, the\ndef. Unlike functions in compiled languages such as C, def is an executable statement\u2014\nyour function does not exist until Python reaches and runs the def. In fact,\nit\u2019s legal (and even occasionally useful) to nest def statements inside if statements,\nwhile loops, and even other defs. In typical operation, def statements are coded in\nmodule files and are naturally run to generate functions when a module file is first\nimported.\n\n\n\n\ndef creates an object and assigns it to a name.\n When Python reaches and runs\na def statement, it generates a new function object and assigns it to the function\u2019s\nname. As with all assignments, the function name becomes a reference to the function\nobject. There\u2019s nothing magic about the name of a function\u2014as you\u2019ll see,\nthe function object can be assigned to other names, stored in a list, and so on.\nFunction objects may also have arbitrary user-defined attributes attached to them\nto record data.\n\n\n\n\n\n\nlambda creates an object but returns it as a result.\n Functions may also be created\nwith the lambda expression, a feature that allows us to in-line function definitions\nin places where a def statement won\u2019t work syntactically\n\n\n\n\n\n\nreturn sends a result object back to the caller.\n When a function is called, the\ncaller stops until the function finishes its work and returns control to the caller.\nFunctions that compute a value send it back to the caller with a return statement;\nthe returned value becomes the result of the function call.\n\n\n\n\n\n\nyield sends a result object back to the caller, but remembers where it left\noff.\n Functions known as generators may also use the yield statement to send back\na value and suspend their state such that they may be resumed later, to produce a\nseries of results over time. This is another advanced topic covered later in this part\nof the book.\n\n\n\n\n\n\nglobal declares module-level variables that are to be assigned.\n By default, all\nnames assigned in a function are local to that function and exist only while the\nfunction runs. To assign a name in the enclosing module, functions need to list it\nin a global statement. More generally, names are always looked up in scopes\u2014\nplaces where variables are stored\u2014and assignments bind names to scopes.\n\n\n\n\n\n\nnonlocal declares enclosing function variables that are to be assigned.\n Similarly,\nthe nonlocal statement added in Python 3.0 allows a function to assign a\nname that exists in the scope of a syntactically enclosing def statement. This allows\nenclosing functions to serve as a place to retain state\u2014information remembered\nwhen a function is called\u2014without using shared global names.\n\n\n\n\n\n\nArguments are passed by assignment (object reference).\n In Python, arguments\nare passed to functions by assignment (which, as we\u2019ve learned, means by object\nreference). As you\u2019ll see, in Python\u2019s model the caller and function share objects\nby references, but there is no name aliasing. Changing an argument name within\na function does not also change the corresponding name in the caller, but changing\npassed-in mutable objects can change objects shared by the caller.\n\n\n\n\n\n\nArguments, return values, and variables are not declared.\n As with everything\nin Python, there are no type constraints on functions. In fact, nothing about a\nfunction needs to be declared ahead of time: you can pass in arguments of any type,\nreturn any kind of object, and so on. As one consequence, a single function can\noften be applied to a variety of object types\u2014any objects that sport a compatible\ninterface (methods and expressions) will do, regardless of their specific types.\n\n\n\n\n\n\nIf some of the preceding words didn\u2019t sink in, don\u2019t worry\u2014we\u2019ll explore all of these\nconcepts with real code in this part of the book. Let\u2019s get started by expanding on some\nof these ideas and looking at a few examples.\n\n\ndef Statements\n\n\nThe def statement creates a function object and assigns it to a name. Its general format\nis as follows:\n\n\ndef\n \nname\n(\narg1\n,\n \narg2\n,\n...\n \nargN\n):\n\n \nstatements\n\n\n\n\n\n\nAs with all compound Python statements, def consists of a header line followed by a\nblock of statements, usually indented (or a simple statement after the colon). The\nstatement block becomes the function\u2019s body\u2014that is, the code Python executes each\ntime the function is called.\n\nThe def header line specifies a function name that is assigned the function object, along\nwith a list of zero or more arguments (sometimes called parameters) in parentheses.\nThe argument names in the header are assigned to the objects passed in parentheses at\nthe point of call.\n\n\nFunction bodies often contain a return statement:\n\n\ndef\n \nname\n(\narg1\n,\n \narg2\n,\n...\n \nargN\n):\n\n \n...\n\n \nreturn\n \nvalue\n\n\n\n\n\n\nThe Python return statement can show up anywhere in a function body; it ends the\nfunction call and sends a result back to the caller. The return statement consists of an\nobject expression that gives the function\u2019s result. The return statement is optional; if\nit\u2019s not present, the function exits when the control flow falls off the end of the function\nbody. Technically, a function without a return statement returns the None object automatically,\nbut this return value is usually ignored.\n\n\ndef Executes at Runtime\n\n\nThe Python def is a true executable statement: when it runs, it creates a new function\nobject and assigns it to a name. (Remember, all we have in Python is runtime; there is\nno such thing as a separate compile time.) Because it\u2019s a statement, a def can appear\nanywhere a statement can\u2014even nested in other statements. For instance, although\ndefs normally are run when the module enclosing them is imported, it\u2019s also completely\nlegal to nest a function def inside an if statement to select between alternative\ndefinitions:\n\n\nif\n \ntest\n:\n\n \ndef\n \nfunc\n():\n \n# Define func this way\n\n\n...\n\n\nelse\n:\n\n \ndef\n \nfunc\n():\n \n# Or else this way\n\n \n...\n\n \n...\n\n\nfunc\n()\n \n# Call the version selected and built\n\n\n\n\n\n\nOne way to understand this code is to realize that the def is much like an = statement:\nit simply assigns a name at runtime. Unlike in compiled languages such as C, Python\nfunctions do not need to be fully defined before the program runs. More generally,\ndefs are not evaluated until they are reached and run, and the code inside defs is not\nevaluated until the functions are later called.\nBecause function definition happens at runtime, there\u2019s nothing special about the\nfunction name. What\u2019s important is the object to which it refers: \n\n\nothername\n \n=\n \nfunc\n \n# Assign function object\n\n\nothername\n()\n \n# Call func again\n\n\n\n\n\n\nHere, the function was assigned to a different name and called through the new name.\nLike everything else in Python, functions are just objects; they are recorded explicitly\nin memory at program execution time. In fact, besides calls, functions allow arbitrary\nattributes to be attached to record information for later use:\n\n\ndef\n \nfunc\n():\n \n...\n \n# Create function object\n\n\nfunc\n()\n \n# Call object\n\n\nfunc\n.\nattr\n \n=\n \nvalue\n \n# Attach attributes\n\n\n\n\n\n\nA First Example: Definitions and Calls\n\n\nApart from such runtime concepts (which tend to seem most unique to programmers\nwith backgrounds in traditional compiled languages), Python functions are straightforward\nto use. Let\u2019s code a first real example to demonstrate the basics. As you\u2019ll see,\nthere are two sides to the function picture: a definition (the def that creates a function)\nand a call (an expression that tells Python to run the function\u2019s body).\n\n\nDefinition\n\n\nHere\u2019s a definition typed interactively that defines a function called times, which returns\nthe product of its two arguments:\n\n\n \ndef\n \ntimes\n(\nx\n,\n \ny\n):\n \n# Create and assign function\n\n\n...\n \nreturn\n \nx\n \n*\n \ny\n \n# Body executed when called\n\n\n...\n\n\n\n\n\n\nWhen Python reaches and runs this def, it creates a new function object that packages\nthe function\u2019s code and assigns the object to the name times. Typically, such a statement\nis coded in a module file and runs when the enclosing file is imported; for something\nthis small, though, the interactive prompt suffices.\n\n\nCalls\n\n\nAfter the def has run, you can call (run) the function in your program by adding\nparentheses after the function\u2019s name. The parentheses may optionally contain one or\nmore object arguments, to be passed (assigned) to the names in the function\u2019s header:\n\n\n \ntimes\n(\n2\n,\n \n4\n)\n \n# Arguments in parentheses\n\n\n8\n\n\n\n\n\n\nThis expression passes two arguments to times. As mentioned previously, arguments\nare passed by assignment, so in this case the name x in the function header is assigned\nthe value 2, y is assigned the value 4, and the function\u2019s body is run. For this function,\nthe body is just a return statement that sends back the result as the value of the call\nexpression. The returned object was printed here interactively (as in most languages,\n2 * 4 is 8 in Python), but if we needed to use it later we could instead assign it to a\nvariable. For example:\n\n\n \nx\n \n=\n \ntimes\n(\n3.14\n,\n \n4\n)\n \n# Save the result object\n\n\n \nx\n\n\n12.56\n\n\n\n\n\n\nNow, watch what happens when the function is called a third time, with very different\nkinds of objects passed in:\n\n\n \ntimes\n(\nNi\n,\n \n4\n)\n \n# Functions are \ntypeless\n\n\nNiNiNiNi\n\n\n\n\n\n\nThis time, our function means something completely different (Monty Python reference\nagain intended). In this third call, a string and an integer are passed to x and y, instead\nof two numbers. Recall that * works on both numbers and sequences; because we never\ndeclare the types of variables, arguments, or return values in Python, we can use\ntimes to either multiply numbers or repeat sequences.\n\nIn other words, what our times function means and does depends on what we pass into\nit. This is a core idea in Python (and perhaps the key to using the language well), which\nwe\u2019ll explore in the next section.\n\n\n\n\nSource:\n \n\n\n \nLearning Python, Fourth Edition\n by Mark Lutz - 2009\n\n\n\n\nHow To Define Functions in Python 3\n\n\nA function is a block of instructions that performs an action and, once defined, can be reused. Functions make code more modular, allowing you to use the same code over and over again.\n\n\nPython has a number of built-in functions that you may be familiar with, including: \n\n\n\n\nprint() which will print an object to the terminal\n\n\nint() which will convert a string or number data type to an integer data type\n\n\nlen() which returns the length of an object\n\n\n\n\nFunction names include parentheses and may include parameters. \n\n\nIn this tutorial, we\u2019ll go over how to define your own functions to use in your coding projects.\n\n\nDefining a Function\n\n\nLet\u2019s start with turning the classic \u201cHello, World!\u201d program into a function.\n\n\nWe\u2019ll create a new text file in our text editor of choice, and call the program hello.py. Then, we\u2019ll define the function.\n\n\nA function is defined by using the def keyword, followed by a name of your choosing, followed by a set of parentheses which hold any parameters the function will take (they can be empty), and ending with a colon.\n\n\nIn this case, we\u2019ll define a function named hello():\n\n\ndef\n \nhello\n():\n\n\n\n\n\n\nThis sets up the initial statement for creating a function.\n\n\nFrom here, we\u2019ll add a second line with a 4-space indent to provide the instructions for what the function does. In this case, we\u2019ll be printing Hello, World! to the console:\n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\n\n\n\nOur function is now fully defined, but if we run the program at this point, nothing will happen since we didn\u2019t call the function.\n\n\nSo, outside of our defined function block, let\u2019s call the function with hello(): \n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\nhello\n()\n\n\n\n\n\n\nNow, let\u2019s run the program:\n\n\npython\n \nhello\n.\npy\n\n\n\n\n\n\nYou should receive the following output:\n\n\nHello\n,\n \nWorld\n!\n\n\n\n\n\n\nFunctions can be more complicated than the \nhello()\n function we defined above. For example, we can use for loops, conditional statements, and more within our function block.\n\n\nFor example, the function defined below utilizes a conditional statement to check if the input for the name variable contains a vowel, then uses a \nfor\n loop to iterate over the letters in the \nname\n string.\n\n\n# Define function names()\n\n\ndef\n \nnames\n():\n\n \n# Set up name variable with input\n\n \nname\n \n=\n \nstr\n(\ninput\n(\nEnter your name: \n))\n\n \n# Check whether name has a vowel\n\n \nif\n \nset\n(\naeiou\n)\n.\nintersection\n(\nname\n.\nlower\n()):\n\n \nprint\n(\nYour name contains a vowel.\n)\n\n \nelse\n:\n\n \nprint\n(\nYour name does not contain a vowel.\n)\n\n\n \n# Iterate over name\n\n \nfor\n \nletter\n \nin\n \nname\n:\n\n \nprint\n(\nletter\n)\n\n\n\n# Call the function\n\n\nnames\n()\n\n\n\n\n\n\nThe \nnames()\n function we defined above sets up a conditional statement and a for loop, showing how code can be organized within a function definition. However, depending on what we intend with our program and how we want to set up our code, we may want to define the conditional statement and the for loop as two separate functions.\n\n\nDefining functions within a program makes our code modular and reusable so that we can call the same functions without rewriting them.\n\n\nWorking with Parameters\n\n\nSo far we have looked at functions with empty parentheses that do not take arguments, but we can define parameters in function definitions within their parentheses.\n\n\nA parameter is a named entity in a function definition, specifying an argument that the function can accept.\n\n\nLet\u2019s create a small program that takes in parameters x, y, and z. We\u2019ll create a function that adds the parameters together in different configurations. The sums of these will be printed by the function. Then we\u2019ll call the function and pass numbers into the function.\n\n\ndef\n \nadd_numbers\n(\nx\n,\n \ny\n,\n \nz\n):\n\n \na\n \n=\n \nx\n \n+\n \ny\n\n \nb\n \n=\n \nx\n \n+\n \nz\n\n \nc\n \n=\n \ny\n \n+\n \nz\n\n \nprint\n(\na\n,\n \nb\n,\n \nc\n)\n\n\n\nadd_numbers\n(\n1\n,\n \n2\n,\n \n3\n)\n\n\n\n\n\n\nWe passed the number 1 in for the x parameter, 2 in for the y parameter, and 3 in for the z parameter. These values correspond with each parameter in the order they are given.\n\n\nThe program is essentially doing the following math based on the values we passed to the parameters:\n\n\na\n \n=\n \n1\n \n+\n \n2\n\n\nb\n \n=\n \n1\n \n+\n \n3\n\n\nc\n \n=\n \n2\n \n+\n \n3\n\n\n\n\n\n\nThe function also prints a, b, and c, and based on the math above we would expect a to be equal to 3, b to be 4, and c to be 5. Let\u2019s run the program:\n\n\npython\n \nadd_numbers\n.\npy\n\n\nOutput\n \n:\n \n3\n \n4\n \n5\n\n\n\n\n\n\nWhen we pass 1, 2, and 3 as parameters to the add_numbers() function, we receive the expected output.\n\n\nParameters are arguments that are typically defined as variables within function definitions. They can be assigned values when you run the method, passing the arguments into the function.\n\n\nKeyword Arguments\n\n\nIn addition to calling parameters in order, you can use \nkeyword arguments\n in a function call, in which the caller identifies the arguments by the parameter name.\n\n\nWhen you use keyword arguments, you can use parameters out of order because the Python interpreter will use the keywords provided to match the values to the parameters.\n\n\nLet\u2019s create a function that will show us profile information for a user. We\u2019ll pass parameters to it in the form of \nusername\n (intended as a string), and \nfollowers\n (intended as an integer).\n\n\n# Define function with parameters\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n \n\n\n\n\n\nWithin the function definition statement, \nusername\n and \nfollowers\n are contained in the parentheses of the profile_info() function. The block of the function prints out information about the user as strings, making use of the two parameters.\n\n\nNow, we can call the function and assign parameters to it:\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n\n\n\n# Call function with parameters assigned as above\n\n\nprofile_info\n(\nsammyshark\n,\n \n945\n)\n\n\n\n# Call function with keyword arguments\n\n\nprofile_info\n(\nusername\n=\nAlexAnglerfish\n,\n \nfollowers\n=\n342\n)\n\n\n\n\n\n\nIn the first function call, we have filled in the information with a username of sammyshark and followers being 945, in the second function call we used keyword arguments, assigning values to the argument variables.\n\n\nLet\u2019s run the program:\n\n\npython\n \nprofile\n.\npy\n\n\nOutput\n \n:\n \n\nUsername\n:\n \nsammyshark\n\n\nFollowers\n:\n \n945\n\n\nUsername\n:\n \nAlexAnglerfish\n\n\nFollowers\n:\n \n342\n\n\n\n\n\n\nThe output shows us the usernames and numbers of followers for both users.\n\n\nThis also permits us to modify the order of the parameters, as in this example of the same program with a different call:\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n\n\n\n# Change order of parameters\n\n\nprofile_info\n(\nfollowers\n=\n820\n,\n \nusername\n=\ncameron-catfish\n)\n\n\n\n\n\n\nWhen we run the program again with the python profile.py command, we\u2019ll receive the following output:\n\n\nOutput\n:\n\n\nUsername\n:\n \ncameron\n-\ncatfish\n\n\nFollowers\n:\n \n820\n\n\n\n\n\n\nBecause the function definition maintains the same order of print() statements, if we use keyword arguments, it does not matter which order we pass them into the function call.\n\n\nDefault Argument Values\n\n\nWe can also provide default values for one or both of the parameters. Let\u2019s create a default value for the \nfollowers\n parameter with a value of 1:\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n=\n1\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n\n\n\n\n\n\nNow, we can run the function with only the username function assigned, and the number of followers will automatically default to 1. We can also still change the number of followers if we would like.\n\n\ndef\n \nprofile_info\n(\nusername\n,\n \nfollowers\n=\n1\n):\n\n \nprint\n(\nUsername: \n \n+\n \nusername\n)\n\n \nprint\n(\nFollowers: \n \n+\n \nstr\n(\nfollowers\n))\n\n\n\nprofile_info\n(\nusername\n=\nJOctopus\n)\n\n\nprofile_info\n(\nusername\n=\nsammyshark\n,\n \nfollowers\n=\n945\n)\n\n\n\n\n\n\nWhen we run the program with the python profile.py command, we\u2019ll receive the following output:\n\n\nOutput\n:\n\n\nUsername\n:\n \nJOctopus\n\n\nFollowers\n:\n \n1\n\n\nUsername\n:\n \nsammyshark\n\n\nFollowers\n:\n \n945\n\n\n\n\n\n\nProviding default parameters with values can let us skip defining values for each argument that already has a default.\n\n\nReturning a Value\n\n\nYou can pass a parameter value into a function, and a function can also produce a value.\n\n\nA function can produce a value with the return statement, which will exit a function and optionally pass an expression back to the caller. If you use a return statement with no arguments, the function will return None.\n\n\nSo far, we have used the print() statement instead of the return statement in our functions. Let\u2019s create a program that instead of printing will return a variable.\n\n\nIn a new text file called square.py, we\u2019ll create a program that squares the parameter x and returns the variable y. We issue a call to print the result variable, which is formed by running the square() function with 3 passed into it.\n\n\ndef\n \nsquare\n(\nx\n):\n\n \ny\n \n=\n \nx\n \n**\n \n2\n\n \nreturn\n \ny\n\n\n\nresult\n \n=\n \nsquare\n(\n3\n)\n\n\nprint\n(\nresult\n)\n\n\n\n\n\n\nWe can run the program and see the output:\n\n\npython\n \nsquare\n.\npy\n\n\nOutput\n:\n\n\n9\n\n\n\n\n\n\nThe integer 9 is returned as output, which is what we would expect by asking Python to find the square of 3.\n\n\nTo further understand how the \nreturn\n statement works, we can comment out the \nreturn\n statement in the program:\n\n\ndef\n \nsquare\n(\nx\n):\n\n \ny\n \n=\n \nx\n \n**\n \n2\n\n \n# return y\n\n\n\nresult\n \n=\n \nsquare\n(\n3\n)\n\n\nprint\n(\nresult\n)\n\n\n\n\n\n\nNow, let\u2019s run the program again:\n\n\npython\n \nsquare\n.\npy\n\n\nOutput\n:\n\n\nNone\n\n\n\n\n\n\nWithout using the \nreturn\n statement here, the program cannot return a value so the value defaults to None.\n\n\nAs another example, in the \nadd_numbers.py\n program above, we could swap out the \nprint()\n statement for a return statement.\n\n\ndef\n \nadd_numbers\n(\nx\n,\n \ny\n,\n \nz\n):\n\n \na\n \n=\n \nx\n \n+\n \ny\n\n \nb\n \n=\n \nx\n \n+\n \nz\n\n \nc\n \n=\n \ny\n \n+\n \nz\n\n \nreturn\n \na\n,\n \nb\n,\n \nc\n\n\n\nsums\n \n=\n \nadd_numbers\n(\n1\n,\n \n2\n,\n \n3\n)\n\n\nprint\n(\nsums\n)\n\n\n\n\n\n\nOutside of the function, we set the variable sums equal to the result of the function taking in 1, 2, and 3 as we did above. Then we called a print of the sums variable.\n\n\nLet\u2019s run the program again now that it has the return statement:\n\n\nOutput\n:\n\n\n(\n3\n,\n \n4\n,\n \n5\n)\n\n\n\n\n\n\nWe receive the same numbers 3, 4, and 5 as output that we received previously by using the print() statement in the function. This time it is delivered as a tuple because the return statement\u2019s expression list has at least one comma.\n\n\nFunctions exit immediately when they hit a return statement, whether or not they\u2019re returning a value.\n\n\ndef\n \nloop_five\n():\n\n \nfor\n \nx\n \nin\n \nrange\n(\n0\n,\n \n25\n):\n\n \nprint\n(\nx\n)\n\n \nif\n \nx\n \n==\n \n5\n:\n\n \n# Stop function at x == 5\n\n \nreturn\n\n \nprint\n(\nThis line will not execute.\n)\n\n\n\nloop_five\n()\n\n\n\n\n\n\nUsing the \nreturn\n statement within the \nfor\n loop ends the function, so the line that is outside of the loop will not run. If, instead, we had used a \nbreak\n statement, only the loop would have exited at that time, and the last print() line would run.\n\n\nThe \nreturn\n statement exits a function, and may return a value when issued with a parameter.\n\n\nUsing \nmain()\n as a Function\n\n\nAlthough in Python you can call the function at the bottom of your program and it will run (as we have done in the examples above), many programming languages (like C++ and Java) require a main function in order to execute. Including a main() function, though not required, can structure our Python programs in a logical way that puts the most important components of the program into one function. It can also make our programs easier for non-Python programmers to read.\n\n\nWe\u2019ll start with adding a main() function to the hello.py program above. We\u2019ll keep our hello() function, and then define a main() function:\n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\ndef\n \nmain\n():\n\n\n\n\n\n\nWithin the main() function, let\u2019s include a print() statement to let us know that we\u2019re in the main() function. Additionally, let\u2019s call the hello() function within the main() function:\n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\n\ndef\n \nmain\n():\n\n \nprint\n(\nThis is the main function\n)\n\n \nhello\n()\n\n\n\n\n\n\nFinally, at the bottom of the program we\u2019ll call the main() function:\n\n\ndef\n \nhello\n():\n\n \nprint\n(\nHello, World!\n)\n\n\n\ndef\n \nmain\n():\n\n \nprint\n(\nThis is the main function.\n)\n\n \nhello\n()\n\n\n\nmain\n()\n\n\n\n\n\n\nAt this point, we can run our program:\n\n\npython\n \nhello\n.\npy\n\n\nOutput\n:\n\n\nThis\n \nis\n \nthe\n \nmain\n \nfunction\n.\n\n\nHello\n,\n \nWorld\n!\n\n\n\n\n\n\nBecause we called the \nhello()\n function within main() and then only called \nmain()\n to run, the \nHello, World!\n text printed only once, after the string that told us we were in the main function.\n\n\nNext we\u2019re going to be working with multiple functions, so it is worth reviewing the variable scope of global and local variables. If you define a variable within a function block, you\u2019ll only be able to use that variable within that function. If you would like to use variables across functions it may be better to declare a global variable.\n\n\nIn Python, '_\nmain_\n' is the name of the scope where top-level code will execute. When a program is run from standard input, a script, or from an interactive prompt, its _\nname_\n is set equal to '_\nmain_\n'.\n\n\nBecause of this, there is a convention to use the following construction:\n\n\nif\n \n__name__\n \n==\n \n__main__\n:\n\n \n# Code to run when this is the main program here\n\n\n\n\n\n\nThis lets program files be used either:\n- as the main program and run what follows the if statement\n- as a module and not run what follows the if statement.\n\n\nAny code that is not contained within this statement will be executed upon running. If you\u2019re using your program file as a module, the code that is not in this statement will also execute upon its import while running the secondary file.\n\n\nLet\u2019s expand on our names.py program above, and create a new file called more_names.py. In this program we\u2019ll declare a global variable and modify our original names() function so that the instructions are in two discrete functions.\n\n\nThe first function, \nhas_vowel()\n will check to see if the name string contains a vowel.\n\n\nThe second function \nprint_letters()\n will print each letter of the \nname\n string.\n\n\n# Declare global variable name for use in all functions\n\n\nname\n \n=\n \nstr\n(\ninput\n(\nEnter your name: \n))\n\n\n\n\n# Define function to check if name contains a vowel\n\n\ndef\n \nhas_vowel\n():\n\n \nif\n \nset\n(\naeiou\n)\n.\nintersection\n(\nname\n.\nlower\n()):\n\n \nprint\n(\nYour name contains a vowel.\n)\n\n \nelse\n:\n\n \nprint\n(\nYour name does not contain a vowel.\n)\n\n\n\n\n# Iterate over letters in name string\n\n\ndef\n \nprint_letters\n():\n\n \nfor\n \nletter\n \nin\n \nname\n:\n\n \nprint\n(\nletter\n)\n\n\n\n\n\n\nWith this set up, let\u2019s define the main() function which will contain a call to both the has_vowel() and the print_letters() functions.\n\n\n# Declare global variable name for use in all functions\n\n\nname\n \n=\n \nstr\n(\ninput\n(\nEnter your name: \n))\n\n\n\n\n# Define function to check if name contains a vowel\n\n\ndef\n \nhas_vowel\n():\n\n \nif\n \nset\n(\naeiou\n)\n.\nintersection\n(\nname\n.\nlower\n()):\n\n \nprint\n(\nYour name contains a vowel.\n)\n\n \nelse\n:\n\n \nprint\n(\nYour name does not contain a vowel.\n)\n\n\n\n\n# Iterate over letters in name string\n\n\ndef\n \nprint_letters\n():\n\n \nfor\n \nletter\n \nin\n \nname\n:\n\n \nprint\n(\nletter\n)\n\n\n\n\n# Define main method that calls other functions\n\n\ndef\n \nmain\n():\n\n \nhas_vowel\n()\n\n \nprint_letters\n()\n\n\n\n\n\n\nFinally, we\u2019ll add the \nif \\__name\\__ == '\\__main\\__':\n construction at the bottom of the file. For our purposes, since we have put all the functions we would like to do in the \nmain()\n function, we\u2019ll call the \nmain()\n function following this if statement.\n\n\n# Declare global variable name for use in all functions\n\n\nname\n \n=\n \nstr\n(\ninput\n(\nEnter your name: \n))\n\n\n\n\n# Define function to check if name contains a vowel\n\n\ndef\n \nhas_vowel\n():\n\n \nif\n \nset\n(\naeiou\n)\n.\nintersection\n(\nname\n.\nlower\n()):\n\n \nprint\n(\nYour name contains a vowel.\n)\n\n \nelse\n:\n\n \nprint\n(\nYour name does not contain a vowel.\n)\n\n\n\n\n# Iterate over letters in name string\n\n\ndef\n \nprint_letters\n():\n\n \nfor\n \nletter\n \nin\n \nname\n:\n\n \nprint\n(\nletter\n)\n\n\n\n\n# Define main method that calls other functions\n\n\ndef\n \nmain\n():\n\n \nhas_vowel\n()\n\n \nprint_letters\n()\n\n\n\n\n# Execute main() function\n\n\nif\n \n__name__\n \n==\n \n__main__\n:\n\n \nmain\n()\n\n\n\n\n\n\nWe can now run the program:\n\n\npython\n \nmore_names\n.\npy\n\n\n\n\n\n\nThe program will show the same output as the names.py program, but here the code is more organized and can be used in a modular way without modification.\n\n\nIf you did not want to declare a main() function, you alternatively could have ended the program like this:\n\n\nif\n \n__name__\n \n==\n \n__main__\n:\n\n \nhas_vowel\n()\n\n \nprint_letters\n()\n\n\n\n\n\n\nUsing \nmain()\n as a function and the if _\nname_\n == '_\nmain_\n': statement can organize your code in a logical way, making it more readable and modular.\n\n\nConclusion\n\n\nFunctions are code blocks of instructions that perform actions within a program, helping to make our code reusable and modular.\n\n\nTo learn more about how to make your code more modular, you can read our guide on \nHow To Write Modules in Python 3.\n\n\n\n\nSource:\n \n\n\n https://stackoverflow.com/questions/1909512/what-is-python-used-for\n\n\n\n\nPrefer Exceptions to Returning None\n\n\nWhen writing utility functions, there\u2019s a draw for Python programmers to give special\nmeaning to the return value of None. It seems to makes sense in some cases. For example,\nsay you want a helper function that divides one number by another. In the case of dividing\nby zero, returning None seems natural because the result is undefined.\n\n\ndef\n \ndivide\n(\na\n,\n \nb\n):\n\n \ntry\n:\n\n \nreturn\n \na\n \n/\n \nb\n\n \nexcept\n \nZeroDivisionError\n:\n\n \nreturn\n \nNone\n\n\n\n\n\n\nCode using this function can interpret the return value accordingly.\n\n\nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nif\n \nresult\n \nis\n \nNone\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n\n\n\n\n\n\nWhat happens when the numerator is zero? That will cause the return value to also be zero\n(if the denominator is non-zero). This can cause problems when you evaluate the result in\na condition like an if statement. You may accidentally look for any False equivalent\nvalue to indicate errors instead of only looking for None.\n\n\nx\n,\n \ny\n \n=\n \n0\n,\n \n5\n\n\nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nif\n \nnot\n \nresult\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n \n# This is wrong!\n\n\n\n\n\n\nThis is a common mistake in Python code when None has special meaning. This is why\nreturning None from a function is error prone. There are two ways to reduce the chance of\nsuch errors. \n\n\nThe first way is to split the return value into a two-tuple. The first part of the tuple\nindicates that the operation was a success or failure. The second part is the actual result\nthat was computed.\n\n\ndef\n \ndivide\n(\na\n,\n \nb\n):\n\n \ntry\n:\n\n \nreturn\n \nTrue\n,\n \na\n \n/\n \nb\n\n \nexcept\n \nZeroDivisionError\n:\n\n \nreturn\n \nFalse\n,\n \nNone\n\n\n\n\n\n\nCallers of this function have to unpack the tuple. That forces them to consider the status\npart of the tuple instead of just looking at the result of division.\n\n\nsuccess\n,\n \nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nif\n \nnot\n \nsuccess\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n\n\n\n\n\n\nThe problem is that callers can easily ignore the first part of the tuple (using the\nunderscore variable name, a Python convention for unused variables). The resulting code\ndoesn\u2019t look wrong at first glance. This is as bad as just returning None.\n\n\n_\n,\n \nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nif\n \nnot\n \nresult\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n\n\n\n\n\n\nThe second, better way to reduce these errors is to never return None at all. Instead, raise\nan exception up to the caller and make them deal with it. Here, I turn a\nZeroDivisionError into a ValueError to indicate to the caller that the input\nvalues are bad: \n\n\ndef\n \ndivide\n(\na\n,\n \nb\n):\n\n \ntry\n:\n\n \nreturn\n \na\n \n/\n \nb\n\n \nexcept\n \nZeroDivisionError\n \nas\n \ne\n:\n\n \nraise\n \nValueError\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n \nfrom\n \ne\n\n\n\n\n\n\nNow the caller should handle the exception for the invalid input case.\nThe caller no longer requires a condition on the return value of the function. If the\nfunction didn\u2019t raise an exception, then the return value must be good. The outcome of\nexception handling is clear.\n\n\nx\n,\n \ny\n \n=\n \n5\n,\n \n2\n\n\ntry\n:\n\n \nresult\n \n=\n \ndivide\n(\nx\n,\n \ny\n)\n\n\nexcept\n \nValueError\n:\n\n \nprint\n(\n\u2018\nInvalid\n \ninputs\n\u2019\n)\n\n\nelse\n:\n\n \nprint\n(\n\u2018\nResult\n \nis\n \n%.\n1\nf\n\u2019\n \n%\n \nresult\n)\n\n\n\n\nResult\n \nis\n \n2.5\n\n\n\n\n\n\nThings to Remember\n\n\n\n\nFunctions that return None to indicate special meaning are error prone because\nNone and other values (e.g., zero, the empty string) all evaluate to False in\nconditional expressions. \n\n\nRaise exceptions to indicate special situations instead of returning None. Expect the\ncalling code to handle exceptions properly when they\u2019re documented.\n\n\n\n\n\n\nSource:\n \n\n\n \nEffective Python\n by Brett Slatkin", "title": "Functions" - }, + }, { - "location": "/beginner/Functions/#function-calls", - "text": "In the context of programming, a function is a named sequence of statements that\nperforms a computation. When you define a function, you specify the name and the\nsequence of statements. Later, you can \u201ccall\u201d the function by name. We have already seen\none example of a function call: type ( 32 ) type int The name of the function is type. The expression in parentheses is called the argument\nof the function. The result, for this function, is the type of the argument. \nIt is common to say that a function \u201ctakes\u201d an argument and \u201creturns\u201d a result. The result\nis called the return value.", + "location": "/beginner/Functions/#function-calls", + "text": "In the context of programming, a function is a named sequence of statements that\nperforms a computation. When you define a function, you specify the name and the\nsequence of statements. Later, you can \u201ccall\u201d the function by name. We have already seen\none example of a function call: type ( 32 ) type int The name of the function is type. The expression in parentheses is called the argument\nof the function. The result, for this function, is the type of the argument. \nIt is common to say that a function \u201ctakes\u201d an argument and \u201creturns\u201d a result. The result\nis called the return value.", "title": "Function Calls" - }, + }, { - "location": "/beginner/Functions/#type-conversion-functions", - "text": "Python provides built-in functions that convert values from one type to another. The\nint function takes any value and converts it to an integer, if it can, or complains\notherwise: int ( 32 ) 32 int ( Hello ) ValueError : invalid literal for int (): Hello int can convert floating-point values to integers, but it doesn\u2019t round off; it chops off\nthe fraction part: int ( 3.99999 ) 3 int ( - 2.3 ) - 2 float converts integers and strings to floating-point numbers: float ( 32 ) 32.0 float ( 3.14159 ) 3.14159 Finally, str converts its argument to a string: str ( 32 ) 32 str ( 3.14159 ) 3.14159", + "location": "/beginner/Functions/#type-conversion-functions", + "text": "Python provides built-in functions that convert values from one type to another. The\nint function takes any value and converts it to an integer, if it can, or complains\notherwise: int ( 32 ) 32 int ( Hello ) ValueError : invalid literal for int (): Hello int can convert floating-point values to integers, but it doesn\u2019t round off; it chops off\nthe fraction part: int ( 3.99999 ) 3 int ( - 2.3 ) - 2 float converts integers and strings to floating-point numbers: float ( 32 ) 32.0 float ( 3.14159 ) 3.14159 Finally, str converts its argument to a string: str ( 32 ) 32 str ( 3.14159 ) 3.14159", "title": "Type Conversion Functions" - }, + }, { - "location": "/beginner/Functions/#adding-new-functions", - "text": "So far, we have only been using the functions that come with Python, but it is also possible\nto add new functions. A function definition specifies the name of a new function and\nthe sequence of statements that execute when the function is called. \nHere is an example: def print_lyrics (): \n print I m a lumberjack, and I m okay. \n print I sleep all night and I work all day. def is a keyword that indicates that this is a function definition. The name of the function\nis print_lyrics. The rules for function names are the same as for variable names: letters,\nnumbers and some punctuation marks are legal, but the first character can\u2019t be a number.\nYou can\u2019t use a keyword as the name of a function, and you should avoid having a variable\nand a function with the same name. \nThe empty parentheses after the name indicate that this function doesn\u2019t take any\narguments. \nThe first line of the function definition is called the header; the rest is called the body.\nThe header has to end with a colon and the body has to be indented. By convention, the\nindentation is always four spaces; see \u201cDebugging\u201d (page 33). The body can contain any\nnumber of statements. \nThe strings in the print statements are enclosed in double quotes. Single quotes and\ndouble quotes do the same thing; most people use single quotes except in cases like this\nwhere a single quote (which is also an apostrophe) appears in the string.\nIf you type a function definition in interactive mode, the interpreter prints ellipses (...)\nto let you know that the definition isn\u2019t complete: def print_lyrics (): \n print I m a lumberjack, and I m okay. \n print I sleep all night and I work all day. To end the function, you have to enter an empty line (this is not necessary in a script).\nDefining a function creates a variable with the same name. print print_lyrics function print_lyrics at 0xb7e99e9c type ( print_lyrics ) type function The value of print_lyrics is a function object, which has type 'function'.\nThe syntax for calling the new function is the same as for built-in functions: print_lyrics () I m a lumberjack, and I m okay . I sleep all night and I work all day . Once you have defined a function, you can use it inside another function. For example,\nto repeat the previous refrain, we could write a function called repeat_lyrics: def repeat_lyrics (): \n print_lyrics () \n print_lyrics () And then call repeat_lyrics: repeat_lyrics () I m a lumberjack, and I m okay . I sleep all night and I work all day . I m a lumberjack, and I m okay . I sleep all night and I work all day . But that\u2019s not really how the song goes.", + "location": "/beginner/Functions/#adding-new-functions", + "text": "So far, we have only been using the functions that come with Python, but it is also possible\nto add new functions. A function definition specifies the name of a new function and\nthe sequence of statements that execute when the function is called. \nHere is an example: def print_lyrics (): \n print I m a lumberjack, and I m okay. \n print I sleep all night and I work all day. def is a keyword that indicates that this is a function definition. The name of the function\nis print_lyrics. The rules for function names are the same as for variable names: letters,\nnumbers and some punctuation marks are legal, but the first character can\u2019t be a number.\nYou can\u2019t use a keyword as the name of a function, and you should avoid having a variable\nand a function with the same name. \nThe empty parentheses after the name indicate that this function doesn\u2019t take any\narguments. \nThe first line of the function definition is called the header; the rest is called the body.\nThe header has to end with a colon and the body has to be indented. By convention, the\nindentation is always four spaces; see \u201cDebugging\u201d (page 33). The body can contain any\nnumber of statements. \nThe strings in the print statements are enclosed in double quotes. Single quotes and\ndouble quotes do the same thing; most people use single quotes except in cases like this\nwhere a single quote (which is also an apostrophe) appears in the string.\nIf you type a function definition in interactive mode, the interpreter prints ellipses (...)\nto let you know that the definition isn\u2019t complete: def print_lyrics (): \n print I m a lumberjack, and I m okay. \n print I sleep all night and I work all day. To end the function, you have to enter an empty line (this is not necessary in a script).\nDefining a function creates a variable with the same name. print print_lyrics function print_lyrics at 0xb7e99e9c type ( print_lyrics ) type function The value of print_lyrics is a function object, which has type 'function'.\nThe syntax for calling the new function is the same as for built-in functions: print_lyrics () I m a lumberjack, and I m okay . I sleep all night and I work all day . Once you have defined a function, you can use it inside another function. For example,\nto repeat the previous refrain, we could write a function called repeat_lyrics: def repeat_lyrics (): \n print_lyrics () \n print_lyrics () And then call repeat_lyrics: repeat_lyrics () I m a lumberjack, and I m okay . I sleep all night and I work all day . I m a lumberjack, and I m okay . I sleep all night and I work all day . But that\u2019s not really how the song goes.", "title": "Adding New Functions" - }, + }, { - "location": "/beginner/Functions/#definitions-and-uses", - "text": "Pulling together the code fragments from the previous section, the whole program looks\nlike this: def print_lyrics (): \n print I m a lumberjack, and I m okay. \n print I sleep all night and I work all day. def repeat_lyrics (): \n print_lyrics () \n print_lyrics () repeat_lyrics () This program contains two function definitions: print_lyrics and repeat_lyrics.\nFunction definitions get executed just like other statements, but the result creates func\ntion objects. The statements inside the function do not get executed until the function\nis called, and the function definition generates no output. \nAs you might expect, you have to create a function before you can execute it. In other\nwords, the function definition has to be executed before the function is called the first\ntime.", + "location": "/beginner/Functions/#definitions-and-uses", + "text": "Pulling together the code fragments from the previous section, the whole program looks\nlike this: def print_lyrics (): \n print I m a lumberjack, and I m okay. \n print I sleep all night and I work all day. def repeat_lyrics (): \n print_lyrics () \n print_lyrics () repeat_lyrics () This program contains two function definitions: print_lyrics and repeat_lyrics.\nFunction definitions get executed just like other statements, but the result creates func\ntion objects. The statements inside the function do not get executed until the function\nis called, and the function definition generates no output. \nAs you might expect, you have to create a function before you can execute it. In other\nwords, the function definition has to be executed before the function is called the first\ntime.", "title": "Definitions and Uses" - }, + }, { - "location": "/beginner/Functions/#flow-of-execution", - "text": "In order to ensure that a function is defined before its first use, you have to know the\norder in which statements are executed, which is called the flow of execution. \nExecution always begins at the first statement of the program. Statements are executed\none at a time, in order, from top to bottom. Function definitions do not alter the flow of execution of the program, but remember\nthat statements inside the function are not executed until the function is called.\nA function call is like a detour in the flow of execution. Instead of going to the next\nstatement, the flow jumps to the body of the function, executes all the statements there,\nand then comes back to pick up where it left off. \nThat sounds simple enough, until you remember that one function can call another.\nWhile in the middle of one function, the program might have to execute the statements\nin another function. But while executing that new function, the program might have to\nexecute yet another function! \nFortunately, Python is good at keeping track of where it is, so each time a function\ncompletes, the program picks up where it left off in the function that called it. When it\ngets to the end of the program, it terminates. \nWhat\u2019s the moral of this sordid tale? When you read a program, you don\u2019t always want\nto read from top to bottom. Sometimes it makes more sense if you follow the flow of\nexecution.", + "location": "/beginner/Functions/#flow-of-execution", + "text": "In order to ensure that a function is defined before its first use, you have to know the\norder in which statements are executed, which is called the flow of execution. \nExecution always begins at the first statement of the program. Statements are executed\none at a time, in order, from top to bottom. Function definitions do not alter the flow of execution of the program, but remember\nthat statements inside the function are not executed until the function is called.\nA function call is like a detour in the flow of execution. Instead of going to the next\nstatement, the flow jumps to the body of the function, executes all the statements there,\nand then comes back to pick up where it left off. \nThat sounds simple enough, until you remember that one function can call another.\nWhile in the middle of one function, the program might have to execute the statements\nin another function. But while executing that new function, the program might have to\nexecute yet another function! \nFortunately, Python is good at keeping track of where it is, so each time a function\ncompletes, the program picks up where it left off in the function that called it. When it\ngets to the end of the program, it terminates. \nWhat\u2019s the moral of this sordid tale? When you read a program, you don\u2019t always want\nto read from top to bottom. Sometimes it makes more sense if you follow the flow of\nexecution.", "title": "Flow of Execution" - }, + }, { - "location": "/beginner/Functions/#parameters-and-arguments", - "text": "Some of the built-in functions we have seen require arguments. For example, when you\ncall math.sin you pass a number as an argument. Some functions take more than one\nargument: math.pow takes two, the base and the exponent.\nInside the function, the arguments are assigned to variables called parameters. Here is\nan example of a user-defined function that takes an argument: def print_twice ( bruce ): \n print bruce \n print bruce This function assigns the argument to a parameter named bruce. When the function is\ncalled, it prints the value of the parameter (whatever it is) twice. \nThis function works with any value that can be printed. print_twice ( Spam ) Spam Spam print_twice ( 17 ) 17 17 print_twice ( math . pi ) 3.14159265359 3.14159265359 The same rules of composition that apply to built-in functions also apply to user-defined\nfunctions, so we can use any kind of expression as an argument for print_twice : print_twice ( Spam * 4 ) Spam Spam Spam Spam Spam Spam Spam Spam print_twice ( math . cos ( math . pi )) - 1.0 - 1.0 The argument is evaluated before the function is called, so in the examples the expres\nsions 'Spam '*4 and math.cos(math.pi) are only evaluated once. \nYou can also use a variable as an argument: michael = Eric, the half a bee. print_twice ( michael ) Eric , the half a bee . Eric , the half a bee . The name of the variable we pass as an argument (michael) has nothing to do with the\nname of the parameter (bruce). It doesn\u2019t matter what the value was called back home\n(in the caller); here in print_twice, we call everybody bruce.", + "location": "/beginner/Functions/#parameters-and-arguments", + "text": "Some of the built-in functions we have seen require arguments. For example, when you\ncall math.sin you pass a number as an argument. Some functions take more than one\nargument: math.pow takes two, the base and the exponent.\nInside the function, the arguments are assigned to variables called parameters. Here is\nan example of a user-defined function that takes an argument: def print_twice ( bruce ): \n print bruce \n print bruce This function assigns the argument to a parameter named bruce. When the function is\ncalled, it prints the value of the parameter (whatever it is) twice. \nThis function works with any value that can be printed. print_twice ( Spam ) Spam Spam print_twice ( 17 ) 17 17 print_twice ( math . pi ) 3.14159265359 3.14159265359 The same rules of composition that apply to built-in functions also apply to user-defined\nfunctions, so we can use any kind of expression as an argument for print_twice : print_twice ( Spam * 4 ) Spam Spam Spam Spam Spam Spam Spam Spam print_twice ( math . cos ( math . pi )) - 1.0 - 1.0 The argument is evaluated before the function is called, so in the examples the expres\nsions 'Spam '*4 and math.cos(math.pi) are only evaluated once. \nYou can also use a variable as an argument: michael = Eric, the half a bee. print_twice ( michael ) Eric , the half a bee . Eric , the half a bee . The name of the variable we pass as an argument (michael) has nothing to do with the\nname of the parameter (bruce). It doesn\u2019t matter what the value was called back home\n(in the caller); here in print_twice, we call everybody bruce.", "title": "Parameters and Arguments" - }, + }, { - "location": "/beginner/Functions/#variables-and-parameters-are-local", - "text": "When you create a variable inside a function, it is local, which means that it only exists\ninside the function. For example: def cat_twice ( part1 , part2 ): \n cat = part1 + part2 \n print_twice ( cat ) This function takes two arguments, concatenates them, and prints the result twice. Here\nis an example that uses it: line1 = Bing tiddle line2 = tiddle bang. cat_twice ( line1 , line2 ) Bing tiddle tiddle bang . Bing tiddle tiddle bang . When cat_twice terminates, the variable cat is destroyed. If we try to print it, we get\nan exception: print cat NameError : name cat is not defined Parameters are also local. For example, outside print_twice, there is no such thing as\nbruce.", + "location": "/beginner/Functions/#variables-and-parameters-are-local", + "text": "When you create a variable inside a function, it is local, which means that it only exists\ninside the function. For example: def cat_twice ( part1 , part2 ): \n cat = part1 + part2 \n print_twice ( cat ) This function takes two arguments, concatenates them, and prints the result twice. Here\nis an example that uses it: line1 = Bing tiddle line2 = tiddle bang. cat_twice ( line1 , line2 ) Bing tiddle tiddle bang . Bing tiddle tiddle bang . When cat_twice terminates, the variable cat is destroyed. If we try to print it, we get\nan exception: print cat NameError : name cat is not defined Parameters are also local. For example, outside print_twice, there is no such thing as\nbruce.", "title": "Variables and Parameters Are Local" - }, + }, { - "location": "/beginner/Functions/#stack-diagrams", - "text": "To keep track of which variables can be used where, it is sometimes useful to draw a\nstack diagram. Like state diagrams, stack diagrams show the value of each variable, but\nthey also show the function each variable belongs to. \nEach function is represented by a frame. A frame is a box with the name of a function\nbeside it and the parameters and variables of the function inside it. The stack diagram\nfor the previous example is shown in Figure 3-1. The frames are arranged in a stack that indicates which function called which, and so\non. In this example, print_twice was called by cat_twice, and cat_twice was called\nby \\__main\\__ , which is a special name for the topmost frame. When you create a variable\noutside of any function, it belongs to \\__main\\__ . Each parameter refers to the same value as its corresponding argument. So, part1 has\nthe same value as line1, part2 has the same value as line2, and bruce has the same\nvalue as cat.\nIf an error occurs during a function call, Python prints the name of the function, and\nthe name of the function that called it, and the name of the function that called that, all\nthe way back to \\__main__\\ . For example, if you try to access cat from within print_twice, you get a NameError: Traceback ( innermost last ): \n File test.py , line 13 , in __main__ \n cat_twice ( line1 , line2 ) \n File test.py , line 5 , in cat_twice \n print_twice ( cat ) \n File test.py , line 9 , in print_twice \n print cat \n NameError : name cat is not defined This list of functions is called a traceback. It tells you what program file the error oc\ncurred in, and what line, and what functions were executing at the time. It also shows\nthe line of code that caused the error.\nThe order of the functions in the traceback is the same as the order of the frames in the\nstack diagram. The function that is currently running is listed at the bottom.", + "location": "/beginner/Functions/#stack-diagrams", + "text": "To keep track of which variables can be used where, it is sometimes useful to draw a\nstack diagram. Like state diagrams, stack diagrams show the value of each variable, but\nthey also show the function each variable belongs to. \nEach function is represented by a frame. A frame is a box with the name of a function\nbeside it and the parameters and variables of the function inside it. The stack diagram\nfor the previous example is shown in Figure 3-1. The frames are arranged in a stack that indicates which function called which, and so\non. In this example, print_twice was called by cat_twice, and cat_twice was called\nby \\__main\\__ , which is a special name for the topmost frame. When you create a variable\noutside of any function, it belongs to \\__main\\__ . Each parameter refers to the same value as its corresponding argument. So, part1 has\nthe same value as line1, part2 has the same value as line2, and bruce has the same\nvalue as cat.\nIf an error occurs during a function call, Python prints the name of the function, and\nthe name of the function that called it, and the name of the function that called that, all\nthe way back to \\__main__\\ . For example, if you try to access cat from within print_twice, you get a NameError: Traceback ( innermost last ): \n File test.py , line 13 , in __main__ \n cat_twice ( line1 , line2 ) \n File test.py , line 5 , in cat_twice \n print_twice ( cat ) \n File test.py , line 9 , in print_twice \n print cat \n NameError : name cat is not defined This list of functions is called a traceback. It tells you what program file the error oc\ncurred in, and what line, and what functions were executing at the time. It also shows\nthe line of code that caused the error.\nThe order of the functions in the traceback is the same as the order of the frames in the\nstack diagram. The function that is currently running is listed at the bottom.", "title": "Stack Diagrams" - }, + }, { - "location": "/beginner/Functions/#fruitful-functions-and-void-functions", - "text": "Some of the functions we are using, such as the math functions, yield results; for lack of\na better name, I call them fruitful functions. Other functions, like print_twice, per\nform an action but don\u2019t return a value. They are called void functions.\nWhen you call a fruitful function, you almost always want to do something with the\nresult; for example, you might assign it to a variable or use it as part of an expression: x = math . cos ( radians ) golden = ( math . sqrt ( 5 ) + 1 ) / 2 When you call a function in interactive mode, Python displays the result: math . sqrt ( 5 ) 2.2360679774997898 But in a script, if you call a fruitful function all by itself, the return value is lost forever! math . sqrt ( 5 ) This script computes the square root of 5, but since it doesn\u2019t store or display the result,\nit is not very useful.\nVoid functions might display something on the screen or have some other effect, but\nthey don\u2019t have a return value. If you try to assign the result to a variable, you get a special\nvalue called None. result = print_twice ( Bing ) Bing Bing print result None The value None is not the same as the string 'None'. It is a special value that has its own\ntype: print type ( None ) type NoneType The functions we have written so far are all void. We will start writing fruitful functions\nin a few chapters.", + "location": "/beginner/Functions/#fruitful-functions-and-void-functions", + "text": "Some of the functions we are using, such as the math functions, yield results; for lack of\na better name, I call them fruitful functions. Other functions, like print_twice, per\nform an action but don\u2019t return a value. They are called void functions.\nWhen you call a fruitful function, you almost always want to do something with the\nresult; for example, you might assign it to a variable or use it as part of an expression: x = math . cos ( radians ) golden = ( math . sqrt ( 5 ) + 1 ) / 2 When you call a function in interactive mode, Python displays the result: math . sqrt ( 5 ) 2.2360679774997898 But in a script, if you call a fruitful function all by itself, the return value is lost forever! math . sqrt ( 5 ) This script computes the square root of 5, but since it doesn\u2019t store or display the result,\nit is not very useful.\nVoid functions might display something on the screen or have some other effect, but\nthey don\u2019t have a return value. If you try to assign the result to a variable, you get a special\nvalue called None. result = print_twice ( Bing ) Bing Bing print result None The value None is not the same as the string 'None'. It is a special value that has its own\ntype: print type ( None ) type NoneType The functions we have written so far are all void. We will start writing fruitful functions\nin a few chapters.", "title": "Fruitful Functions and Void Functions" - }, + }, { - "location": "/beginner/Functions/#why-functions", - "text": "It may not be clear why it is worth the trouble to divide a program into functions. There\nare several reasons: \n- Creating a new function gives you an opportunity to name a group of statements,\nwhich makes your program easier to read and debug.\n- Functions can make a program smaller by eliminating repetitive code. Later, if you\nmake a change, you only have to make it in one place.\n- Dividing a long program into functions allows you to debug the parts one at a time\nand then assemble them into a working whole.\n- Well-designed functions are often useful for many programs. Once you write and\ndebug one, you can reuse it. Source: Think Python by Allen B. Downey - 2012", + "location": "/beginner/Functions/#why-functions", + "text": "It may not be clear why it is worth the trouble to divide a program into functions. There\nare several reasons: \n- Creating a new function gives you an opportunity to name a group of statements,\nwhich makes your program easier to read and debug.\n- Functions can make a program smaller by eliminating repetitive code. Later, if you\nmake a change, you only have to make it in one place.\n- Dividing a long program into functions allows you to debug the parts one at a time\nand then assemble them into a working whole.\n- Well-designed functions are often useful for many programs. Once you write and\ndebug one, you can reuse it. Source: Think Python by Allen B. Downey - 2012", "title": "Why Functions?" - }, + }, { - "location": "/beginner/Functions/#functions-by-by-mark-lutz-learning-python-fourth-edition", - "text": "", + "location": "/beginner/Functions/#functions-by-by-mark-lutz-learning-python-fourth-edition", + "text": "", "title": "Functions by by Mark Lutz (Learning Python, Fourth Edition)" - }, + }, { - "location": "/beginner/Functions/#function-basics", - "text": "In Part III, we looked at basic procedural statements in Python. Here, we\u2019ll move on to\nexplore a set of additional statements that we can use to create functions of our own. \nIn simple terms, a function is a device that groups a set of statements so they can be run\nmore than once in a program. Functions also can compute a result value and let us\nspecify parameters that serve as function inputs, which may differ each time the code\nis run. Coding an operation as a function makes it a generally useful tool, which we\ncan use in a variety of contexts. \nMore fundamentally, functions are the alternative to programming by cutting and\npasting\u2014rather than having multiple redundant copies of an operation\u2019s code, we can\nfactor it into a single function. In so doing, we reduce our future work radically: if the\noperation must be changed later, we only have one copy to update, not many. \nFunctions are the most basic program structure Python provides for maximizing code\nreuse and minimizing code redundancy. As we\u2019ll see, functions are also a design tool\nthat lets us split complex systems into manageable parts. Table 16-1 summarizes the\nprimary function-related tools we\u2019ll study in this part of the book. Statement Examples Calls myfunc('spam', 'eggs', meat=ham) def, return def adder(a, b=1, *c): return a + b + c[0] global def changer():global x; x = 'new' nonlocal def changer():nonlocal x; x = 'new' yield def squares(x):for i in range(x): yield i ** 2 lambda funcs = [lambda x: x* 2, lambda x: x 3]", + "location": "/beginner/Functions/#function-basics", + "text": "In Part III, we looked at basic procedural statements in Python. Here, we\u2019ll move on to\nexplore a set of additional statements that we can use to create functions of our own. \nIn simple terms, a function is a device that groups a set of statements so they can be run\nmore than once in a program. Functions also can compute a result value and let us\nspecify parameters that serve as function inputs, which may differ each time the code\nis run. Coding an operation as a function makes it a generally useful tool, which we\ncan use in a variety of contexts. \nMore fundamentally, functions are the alternative to programming by cutting and\npasting\u2014rather than having multiple redundant copies of an operation\u2019s code, we can\nfactor it into a single function. In so doing, we reduce our future work radically: if the\noperation must be changed later, we only have one copy to update, not many. \nFunctions are the most basic program structure Python provides for maximizing code\nreuse and minimizing code redundancy. As we\u2019ll see, functions are also a design tool\nthat lets us split complex systems into manageable parts. Table 16-1 summarizes the\nprimary function-related tools we\u2019ll study in this part of the book. Statement Examples Calls myfunc('spam', 'eggs', meat=ham) def, return def adder(a, b=1, *c): return a + b + c[0] global def changer():global x; x = 'new' nonlocal def changer():nonlocal x; x = 'new' yield def squares(x):for i in range(x): yield i ** 2 lambda funcs = [lambda x: x* 2, lambda x: x 3]", "title": "Function Basics" - }, + }, { - "location": "/beginner/Functions/#why-use-functions", - "text": "Before we get into the details, let\u2019s establish a clear picture of what functions are all\nabout. Functions are a nearly universal program-structuring device. You may have\ncome across them before in other languages, where they may have been called subroutines\nor procedures. As a brief introduction, functions serve two primary development\nroles: Maximizing code reuse and minimizing redundancy \nAs in most programming languages, Python functions are the simplest way to\npackage logic you may wish to use in more than one place and more than one time.\nUp until now, all the code we\u2019ve been writing has run immediately. Functions allow\nus to group and generalize code to be used arbitrarily many times later. Because\nthey allow us to code an operation in a single place and use it in many places,\nPython functions are the most basic factoring tool in the language: they allow us\nto reduce code redundancy in our programs, and thereby reduce maintenance\neffort. Procedural decomposition \nFunctions also provide a tool for splitting systems into pieces that have well-defined\nroles. For instance, to make a pizza from scratch, you would start by mixing the\ndough, rolling it out, adding toppings, baking it, and so on. If you were programming\na pizza-making robot, functions would help you divide the overall \u201cmake\npizza\u201d task into chunks\u2014one function for each subtask in the process. It\u2019s easier\nto implement the smaller tasks in isolation than it is to implement the entire process\nat once. In general, functions are about procedure\u2014how to do something, rather\nthan what you\u2019re doing it to. We\u2019ll see why this distinction matters in Part VI, when\nwe start making new object with classes. In this part of the book, we\u2019ll explore the tools used to code functions in Python: function\nbasics, scope rules, and argument passing, along with a few related concepts such\nas generators and functional tools. Because its importance begins to become more apparent\nat this level of coding, we\u2019ll also revisit the notion of polymorphism introduced\nearlier in the book. As you\u2019ll see, functions don\u2019t imply much new syntax, but they do\nlead us to some bigger programming ideas.", + "location": "/beginner/Functions/#why-use-functions", + "text": "Before we get into the details, let\u2019s establish a clear picture of what functions are all\nabout. Functions are a nearly universal program-structuring device. You may have\ncome across them before in other languages, where they may have been called subroutines\nor procedures. As a brief introduction, functions serve two primary development\nroles: Maximizing code reuse and minimizing redundancy \nAs in most programming languages, Python functions are the simplest way to\npackage logic you may wish to use in more than one place and more than one time.\nUp until now, all the code we\u2019ve been writing has run immediately. Functions allow\nus to group and generalize code to be used arbitrarily many times later. Because\nthey allow us to code an operation in a single place and use it in many places,\nPython functions are the most basic factoring tool in the language: they allow us\nto reduce code redundancy in our programs, and thereby reduce maintenance\neffort. Procedural decomposition \nFunctions also provide a tool for splitting systems into pieces that have well-defined\nroles. For instance, to make a pizza from scratch, you would start by mixing the\ndough, rolling it out, adding toppings, baking it, and so on. If you were programming\na pizza-making robot, functions would help you divide the overall \u201cmake\npizza\u201d task into chunks\u2014one function for each subtask in the process. It\u2019s easier\nto implement the smaller tasks in isolation than it is to implement the entire process\nat once. In general, functions are about procedure\u2014how to do something, rather\nthan what you\u2019re doing it to. We\u2019ll see why this distinction matters in Part VI, when\nwe start making new object with classes. In this part of the book, we\u2019ll explore the tools used to code functions in Python: function\nbasics, scope rules, and argument passing, along with a few related concepts such\nas generators and functional tools. Because its importance begins to become more apparent\nat this level of coding, we\u2019ll also revisit the notion of polymorphism introduced\nearlier in the book. As you\u2019ll see, functions don\u2019t imply much new syntax, but they do\nlead us to some bigger programming ideas.", "title": "Why Use Functions?" - }, + }, { - "location": "/beginner/Functions/#coding-functions", - "text": "Although it wasn\u2019t made very formal, we\u2019ve already used some functions in earlier\nchapters. For instance, to make a file object, we called the built-in open function; similarly,\nwe used the len built-in function to ask for the number of items in a collection\nobject. \nIn this chapter, we will explore how to write new functions in Python. Functions we\nwrite behave the same way as the built-ins we\u2019ve already seen: they are called in expressions, are passed values, and return results. But writing new functions requires\nthe application of a few additional ideas that haven\u2019t yet been introduced. Moreover,\nfunctions behave very differently in Python than they do in compiled languages like C.\nHere is a brief introduction to the main concepts behind Python functions, all of which\nwe will study in this part of the book: def is executable code. Python functions are written with a new statement, the\ndef. Unlike functions in compiled languages such as C, def is an executable statement\u2014\nyour function does not exist until Python reaches and runs the def. In fact,\nit\u2019s legal (and even occasionally useful) to nest def statements inside if statements,\nwhile loops, and even other defs. In typical operation, def statements are coded in\nmodule files and are naturally run to generate functions when a module file is first\nimported. def creates an object and assigns it to a name. When Python reaches and runs\na def statement, it generates a new function object and assigns it to the function\u2019s\nname. As with all assignments, the function name becomes a reference to the function\nobject. There\u2019s nothing magic about the name of a function\u2014as you\u2019ll see,\nthe function object can be assigned to other names, stored in a list, and so on.\nFunction objects may also have arbitrary user-defined attributes attached to them\nto record data. lambda creates an object but returns it as a result. Functions may also be created\nwith the lambda expression, a feature that allows us to in-line function definitions\nin places where a def statement won\u2019t work syntactically return sends a result object back to the caller. When a function is called, the\ncaller stops until the function finishes its work and returns control to the caller.\nFunctions that compute a value send it back to the caller with a return statement;\nthe returned value becomes the result of the function call. yield sends a result object back to the caller, but remembers where it left\noff. Functions known as generators may also use the yield statement to send back\na value and suspend their state such that they may be resumed later, to produce a\nseries of results over time. This is another advanced topic covered later in this part\nof the book. global declares module-level variables that are to be assigned. By default, all\nnames assigned in a function are local to that function and exist only while the\nfunction runs. To assign a name in the enclosing module, functions need to list it\nin a global statement. More generally, names are always looked up in scopes\u2014\nplaces where variables are stored\u2014and assignments bind names to scopes. nonlocal declares enclosing function variables that are to be assigned. Similarly,\nthe nonlocal statement added in Python 3.0 allows a function to assign a\nname that exists in the scope of a syntactically enclosing def statement. This allows\nenclosing functions to serve as a place to retain state\u2014information remembered\nwhen a function is called\u2014without using shared global names. Arguments are passed by assignment (object reference). In Python, arguments\nare passed to functions by assignment (which, as we\u2019ve learned, means by object\nreference). As you\u2019ll see, in Python\u2019s model the caller and function share objects\nby references, but there is no name aliasing. Changing an argument name within\na function does not also change the corresponding name in the caller, but changing\npassed-in mutable objects can change objects shared by the caller. Arguments, return values, and variables are not declared. As with everything\nin Python, there are no type constraints on functions. In fact, nothing about a\nfunction needs to be declared ahead of time: you can pass in arguments of any type,\nreturn any kind of object, and so on. As one consequence, a single function can\noften be applied to a variety of object types\u2014any objects that sport a compatible\ninterface (methods and expressions) will do, regardless of their specific types. If some of the preceding words didn\u2019t sink in, don\u2019t worry\u2014we\u2019ll explore all of these\nconcepts with real code in this part of the book. Let\u2019s get started by expanding on some\nof these ideas and looking at a few examples.", + "location": "/beginner/Functions/#coding-functions", + "text": "Although it wasn\u2019t made very formal, we\u2019ve already used some functions in earlier\nchapters. For instance, to make a file object, we called the built-in open function; similarly,\nwe used the len built-in function to ask for the number of items in a collection\nobject. \nIn this chapter, we will explore how to write new functions in Python. Functions we\nwrite behave the same way as the built-ins we\u2019ve already seen: they are called in expressions, are passed values, and return results. But writing new functions requires\nthe application of a few additional ideas that haven\u2019t yet been introduced. Moreover,\nfunctions behave very differently in Python than they do in compiled languages like C.\nHere is a brief introduction to the main concepts behind Python functions, all of which\nwe will study in this part of the book: def is executable code. Python functions are written with a new statement, the\ndef. Unlike functions in compiled languages such as C, def is an executable statement\u2014\nyour function does not exist until Python reaches and runs the def. In fact,\nit\u2019s legal (and even occasionally useful) to nest def statements inside if statements,\nwhile loops, and even other defs. In typical operation, def statements are coded in\nmodule files and are naturally run to generate functions when a module file is first\nimported. def creates an object and assigns it to a name. When Python reaches and runs\na def statement, it generates a new function object and assigns it to the function\u2019s\nname. As with all assignments, the function name becomes a reference to the function\nobject. There\u2019s nothing magic about the name of a function\u2014as you\u2019ll see,\nthe function object can be assigned to other names, stored in a list, and so on.\nFunction objects may also have arbitrary user-defined attributes attached to them\nto record data. lambda creates an object but returns it as a result. Functions may also be created\nwith the lambda expression, a feature that allows us to in-line function definitions\nin places where a def statement won\u2019t work syntactically return sends a result object back to the caller. When a function is called, the\ncaller stops until the function finishes its work and returns control to the caller.\nFunctions that compute a value send it back to the caller with a return statement;\nthe returned value becomes the result of the function call. yield sends a result object back to the caller, but remembers where it left\noff. Functions known as generators may also use the yield statement to send back\na value and suspend their state such that they may be resumed later, to produce a\nseries of results over time. This is another advanced topic covered later in this part\nof the book. global declares module-level variables that are to be assigned. By default, all\nnames assigned in a function are local to that function and exist only while the\nfunction runs. To assign a name in the enclosing module, functions need to list it\nin a global statement. More generally, names are always looked up in scopes\u2014\nplaces where variables are stored\u2014and assignments bind names to scopes. nonlocal declares enclosing function variables that are to be assigned. Similarly,\nthe nonlocal statement added in Python 3.0 allows a function to assign a\nname that exists in the scope of a syntactically enclosing def statement. This allows\nenclosing functions to serve as a place to retain state\u2014information remembered\nwhen a function is called\u2014without using shared global names. Arguments are passed by assignment (object reference). In Python, arguments\nare passed to functions by assignment (which, as we\u2019ve learned, means by object\nreference). As you\u2019ll see, in Python\u2019s model the caller and function share objects\nby references, but there is no name aliasing. Changing an argument name within\na function does not also change the corresponding name in the caller, but changing\npassed-in mutable objects can change objects shared by the caller. Arguments, return values, and variables are not declared. As with everything\nin Python, there are no type constraints on functions. In fact, nothing about a\nfunction needs to be declared ahead of time: you can pass in arguments of any type,\nreturn any kind of object, and so on. As one consequence, a single function can\noften be applied to a variety of object types\u2014any objects that sport a compatible\ninterface (methods and expressions) will do, regardless of their specific types. If some of the preceding words didn\u2019t sink in, don\u2019t worry\u2014we\u2019ll explore all of these\nconcepts with real code in this part of the book. Let\u2019s get started by expanding on some\nof these ideas and looking at a few examples.", "title": "Coding Functions" - }, + }, { - "location": "/beginner/Functions/#def-statements", - "text": "The def statement creates a function object and assigns it to a name. Its general format\nis as follows: def name ( arg1 , arg2 , ... argN ): \n statements As with all compound Python statements, def consists of a header line followed by a\nblock of statements, usually indented (or a simple statement after the colon). The\nstatement block becomes the function\u2019s body\u2014that is, the code Python executes each\ntime the function is called. \nThe def header line specifies a function name that is assigned the function object, along\nwith a list of zero or more arguments (sometimes called parameters) in parentheses.\nThe argument names in the header are assigned to the objects passed in parentheses at\nthe point of call. Function bodies often contain a return statement: def name ( arg1 , arg2 , ... argN ): \n ... \n return value The Python return statement can show up anywhere in a function body; it ends the\nfunction call and sends a result back to the caller. The return statement consists of an\nobject expression that gives the function\u2019s result. The return statement is optional; if\nit\u2019s not present, the function exits when the control flow falls off the end of the function\nbody. Technically, a function without a return statement returns the None object automatically,\nbut this return value is usually ignored.", + "location": "/beginner/Functions/#def-statements", + "text": "The def statement creates a function object and assigns it to a name. Its general format\nis as follows: def name ( arg1 , arg2 , ... argN ): \n statements As with all compound Python statements, def consists of a header line followed by a\nblock of statements, usually indented (or a simple statement after the colon). The\nstatement block becomes the function\u2019s body\u2014that is, the code Python executes each\ntime the function is called. \nThe def header line specifies a function name that is assigned the function object, along\nwith a list of zero or more arguments (sometimes called parameters) in parentheses.\nThe argument names in the header are assigned to the objects passed in parentheses at\nthe point of call. Function bodies often contain a return statement: def name ( arg1 , arg2 , ... argN ): \n ... \n return value The Python return statement can show up anywhere in a function body; it ends the\nfunction call and sends a result back to the caller. The return statement consists of an\nobject expression that gives the function\u2019s result. The return statement is optional; if\nit\u2019s not present, the function exits when the control flow falls off the end of the function\nbody. Technically, a function without a return statement returns the None object automatically,\nbut this return value is usually ignored.", "title": "def Statements" - }, + }, { - "location": "/beginner/Functions/#def-executes-at-runtime", - "text": "The Python def is a true executable statement: when it runs, it creates a new function\nobject and assigns it to a name. (Remember, all we have in Python is runtime; there is\nno such thing as a separate compile time.) Because it\u2019s a statement, a def can appear\nanywhere a statement can\u2014even nested in other statements. For instance, although\ndefs normally are run when the module enclosing them is imported, it\u2019s also completely\nlegal to nest a function def inside an if statement to select between alternative\ndefinitions: if test : \n def func (): # Define func this way ... else : \n def func (): # Or else this way \n ... \n ... func () # Call the version selected and built One way to understand this code is to realize that the def is much like an = statement:\nit simply assigns a name at runtime. Unlike in compiled languages such as C, Python\nfunctions do not need to be fully defined before the program runs. More generally,\ndefs are not evaluated until they are reached and run, and the code inside defs is not\nevaluated until the functions are later called.\nBecause function definition happens at runtime, there\u2019s nothing special about the\nfunction name. What\u2019s important is the object to which it refers: othername = func # Assign function object othername () # Call func again Here, the function was assigned to a different name and called through the new name.\nLike everything else in Python, functions are just objects; they are recorded explicitly\nin memory at program execution time. In fact, besides calls, functions allow arbitrary\nattributes to be attached to record information for later use: def func (): ... # Create function object func () # Call object func . attr = value # Attach attributes", + "location": "/beginner/Functions/#def-executes-at-runtime", + "text": "The Python def is a true executable statement: when it runs, it creates a new function\nobject and assigns it to a name. (Remember, all we have in Python is runtime; there is\nno such thing as a separate compile time.) Because it\u2019s a statement, a def can appear\nanywhere a statement can\u2014even nested in other statements. For instance, although\ndefs normally are run when the module enclosing them is imported, it\u2019s also completely\nlegal to nest a function def inside an if statement to select between alternative\ndefinitions: if test : \n def func (): # Define func this way ... else : \n def func (): # Or else this way \n ... \n ... func () # Call the version selected and built One way to understand this code is to realize that the def is much like an = statement:\nit simply assigns a name at runtime. Unlike in compiled languages such as C, Python\nfunctions do not need to be fully defined before the program runs. More generally,\ndefs are not evaluated until they are reached and run, and the code inside defs is not\nevaluated until the functions are later called.\nBecause function definition happens at runtime, there\u2019s nothing special about the\nfunction name. What\u2019s important is the object to which it refers: othername = func # Assign function object othername () # Call func again Here, the function was assigned to a different name and called through the new name.\nLike everything else in Python, functions are just objects; they are recorded explicitly\nin memory at program execution time. In fact, besides calls, functions allow arbitrary\nattributes to be attached to record information for later use: def func (): ... # Create function object func () # Call object func . attr = value # Attach attributes", "title": "def Executes at Runtime" - }, + }, { - "location": "/beginner/Functions/#a-first-example-definitions-and-calls", - "text": "Apart from such runtime concepts (which tend to seem most unique to programmers\nwith backgrounds in traditional compiled languages), Python functions are straightforward\nto use. Let\u2019s code a first real example to demonstrate the basics. As you\u2019ll see,\nthere are two sides to the function picture: a definition (the def that creates a function)\nand a call (an expression that tells Python to run the function\u2019s body).", + "location": "/beginner/Functions/#a-first-example-definitions-and-calls", + "text": "Apart from such runtime concepts (which tend to seem most unique to programmers\nwith backgrounds in traditional compiled languages), Python functions are straightforward\nto use. Let\u2019s code a first real example to demonstrate the basics. As you\u2019ll see,\nthere are two sides to the function picture: a definition (the def that creates a function)\nand a call (an expression that tells Python to run the function\u2019s body).", "title": "A First Example: Definitions and Calls" - }, + }, { - "location": "/beginner/Functions/#definition", - "text": "Here\u2019s a definition typed interactively that defines a function called times, which returns\nthe product of its two arguments: def times ( x , y ): # Create and assign function ... return x * y # Body executed when called ... When Python reaches and runs this def, it creates a new function object that packages\nthe function\u2019s code and assigns the object to the name times. Typically, such a statement\nis coded in a module file and runs when the enclosing file is imported; for something\nthis small, though, the interactive prompt suffices.", + "location": "/beginner/Functions/#definition", + "text": "Here\u2019s a definition typed interactively that defines a function called times, which returns\nthe product of its two arguments: def times ( x , y ): # Create and assign function ... return x * y # Body executed when called ... When Python reaches and runs this def, it creates a new function object that packages\nthe function\u2019s code and assigns the object to the name times. Typically, such a statement\nis coded in a module file and runs when the enclosing file is imported; for something\nthis small, though, the interactive prompt suffices.", "title": "Definition" - }, + }, { - "location": "/beginner/Functions/#calls", - "text": "After the def has run, you can call (run) the function in your program by adding\nparentheses after the function\u2019s name. The parentheses may optionally contain one or\nmore object arguments, to be passed (assigned) to the names in the function\u2019s header: times ( 2 , 4 ) # Arguments in parentheses 8 This expression passes two arguments to times. As mentioned previously, arguments\nare passed by assignment, so in this case the name x in the function header is assigned\nthe value 2, y is assigned the value 4, and the function\u2019s body is run. For this function,\nthe body is just a return statement that sends back the result as the value of the call\nexpression. The returned object was printed here interactively (as in most languages,\n2 * 4 is 8 in Python), but if we needed to use it later we could instead assign it to a\nvariable. For example: x = times ( 3.14 , 4 ) # Save the result object x 12.56 Now, watch what happens when the function is called a third time, with very different\nkinds of objects passed in: times ( Ni , 4 ) # Functions are typeless NiNiNiNi This time, our function means something completely different (Monty Python reference\nagain intended). In this third call, a string and an integer are passed to x and y, instead\nof two numbers. Recall that * works on both numbers and sequences; because we never\ndeclare the types of variables, arguments, or return values in Python, we can use\ntimes to either multiply numbers or repeat sequences. \nIn other words, what our times function means and does depends on what we pass into\nit. This is a core idea in Python (and perhaps the key to using the language well), which\nwe\u2019ll explore in the next section. Source: Learning Python, Fourth Edition by Mark Lutz - 2009", + "location": "/beginner/Functions/#calls", + "text": "After the def has run, you can call (run) the function in your program by adding\nparentheses after the function\u2019s name. The parentheses may optionally contain one or\nmore object arguments, to be passed (assigned) to the names in the function\u2019s header: times ( 2 , 4 ) # Arguments in parentheses 8 This expression passes two arguments to times. As mentioned previously, arguments\nare passed by assignment, so in this case the name x in the function header is assigned\nthe value 2, y is assigned the value 4, and the function\u2019s body is run. For this function,\nthe body is just a return statement that sends back the result as the value of the call\nexpression. The returned object was printed here interactively (as in most languages,\n2 * 4 is 8 in Python), but if we needed to use it later we could instead assign it to a\nvariable. For example: x = times ( 3.14 , 4 ) # Save the result object x 12.56 Now, watch what happens when the function is called a third time, with very different\nkinds of objects passed in: times ( Ni , 4 ) # Functions are typeless NiNiNiNi This time, our function means something completely different (Monty Python reference\nagain intended). In this third call, a string and an integer are passed to x and y, instead\nof two numbers. Recall that * works on both numbers and sequences; because we never\ndeclare the types of variables, arguments, or return values in Python, we can use\ntimes to either multiply numbers or repeat sequences. \nIn other words, what our times function means and does depends on what we pass into\nit. This is a core idea in Python (and perhaps the key to using the language well), which\nwe\u2019ll explore in the next section. Source: Learning Python, Fourth Edition by Mark Lutz - 2009", "title": "Calls" - }, + }, { - "location": "/beginner/Functions/#how-to-define-functions-in-python-3", - "text": "A function is a block of instructions that performs an action and, once defined, can be reused. Functions make code more modular, allowing you to use the same code over and over again. Python has a number of built-in functions that you may be familiar with, including: print() which will print an object to the terminal int() which will convert a string or number data type to an integer data type len() which returns the length of an object Function names include parentheses and may include parameters. In this tutorial, we\u2019ll go over how to define your own functions to use in your coding projects.", + "location": "/beginner/Functions/#how-to-define-functions-in-python-3", + "text": "A function is a block of instructions that performs an action and, once defined, can be reused. Functions make code more modular, allowing you to use the same code over and over again. Python has a number of built-in functions that you may be familiar with, including: print() which will print an object to the terminal int() which will convert a string or number data type to an integer data type len() which returns the length of an object Function names include parentheses and may include parameters. In this tutorial, we\u2019ll go over how to define your own functions to use in your coding projects.", "title": "How To Define Functions in Python 3" - }, + }, { - "location": "/beginner/Functions/#defining-a-function", - "text": "Let\u2019s start with turning the classic \u201cHello, World!\u201d program into a function. We\u2019ll create a new text file in our text editor of choice, and call the program hello.py. Then, we\u2019ll define the function. A function is defined by using the def keyword, followed by a name of your choosing, followed by a set of parentheses which hold any parameters the function will take (they can be empty), and ending with a colon. In this case, we\u2019ll define a function named hello(): def hello (): This sets up the initial statement for creating a function. From here, we\u2019ll add a second line with a 4-space indent to provide the instructions for what the function does. In this case, we\u2019ll be printing Hello, World! to the console: def hello (): \n print ( Hello, World! ) Our function is now fully defined, but if we run the program at this point, nothing will happen since we didn\u2019t call the function. So, outside of our defined function block, let\u2019s call the function with hello(): def hello (): \n print ( Hello, World! ) hello () Now, let\u2019s run the program: python hello . py You should receive the following output: Hello , World ! Functions can be more complicated than the hello() function we defined above. For example, we can use for loops, conditional statements, and more within our function block. For example, the function defined below utilizes a conditional statement to check if the input for the name variable contains a vowel, then uses a for loop to iterate over the letters in the name string. # Define function names() def names (): \n # Set up name variable with input \n name = str ( input ( Enter your name: )) \n # Check whether name has a vowel \n if set ( aeiou ) . intersection ( name . lower ()): \n print ( Your name contains a vowel. ) \n else : \n print ( Your name does not contain a vowel. ) \n\n # Iterate over name \n for letter in name : \n print ( letter ) # Call the function names () The names() function we defined above sets up a conditional statement and a for loop, showing how code can be organized within a function definition. However, depending on what we intend with our program and how we want to set up our code, we may want to define the conditional statement and the for loop as two separate functions. Defining functions within a program makes our code modular and reusable so that we can call the same functions without rewriting them.", + "location": "/beginner/Functions/#defining-a-function", + "text": "Let\u2019s start with turning the classic \u201cHello, World!\u201d program into a function. We\u2019ll create a new text file in our text editor of choice, and call the program hello.py. Then, we\u2019ll define the function. A function is defined by using the def keyword, followed by a name of your choosing, followed by a set of parentheses which hold any parameters the function will take (they can be empty), and ending with a colon. In this case, we\u2019ll define a function named hello(): def hello (): This sets up the initial statement for creating a function. From here, we\u2019ll add a second line with a 4-space indent to provide the instructions for what the function does. In this case, we\u2019ll be printing Hello, World! to the console: def hello (): \n print ( Hello, World! ) Our function is now fully defined, but if we run the program at this point, nothing will happen since we didn\u2019t call the function. So, outside of our defined function block, let\u2019s call the function with hello(): def hello (): \n print ( Hello, World! ) hello () Now, let\u2019s run the program: python hello . py You should receive the following output: Hello , World ! Functions can be more complicated than the hello() function we defined above. For example, we can use for loops, conditional statements, and more within our function block. For example, the function defined below utilizes a conditional statement to check if the input for the name variable contains a vowel, then uses a for loop to iterate over the letters in the name string. # Define function names() def names (): \n # Set up name variable with input \n name = str ( input ( Enter your name: )) \n # Check whether name has a vowel \n if set ( aeiou ) . intersection ( name . lower ()): \n print ( Your name contains a vowel. ) \n else : \n print ( Your name does not contain a vowel. ) \n\n # Iterate over name \n for letter in name : \n print ( letter ) # Call the function names () The names() function we defined above sets up a conditional statement and a for loop, showing how code can be organized within a function definition. However, depending on what we intend with our program and how we want to set up our code, we may want to define the conditional statement and the for loop as two separate functions. Defining functions within a program makes our code modular and reusable so that we can call the same functions without rewriting them.", "title": "Defining a Function" - }, + }, { - "location": "/beginner/Functions/#working-with-parameters", - "text": "So far we have looked at functions with empty parentheses that do not take arguments, but we can define parameters in function definitions within their parentheses. A parameter is a named entity in a function definition, specifying an argument that the function can accept. Let\u2019s create a small program that takes in parameters x, y, and z. We\u2019ll create a function that adds the parameters together in different configurations. The sums of these will be printed by the function. Then we\u2019ll call the function and pass numbers into the function. def add_numbers ( x , y , z ): \n a = x + y \n b = x + z \n c = y + z \n print ( a , b , c ) add_numbers ( 1 , 2 , 3 ) We passed the number 1 in for the x parameter, 2 in for the y parameter, and 3 in for the z parameter. These values correspond with each parameter in the order they are given. The program is essentially doing the following math based on the values we passed to the parameters: a = 1 + 2 b = 1 + 3 c = 2 + 3 The function also prints a, b, and c, and based on the math above we would expect a to be equal to 3, b to be 4, and c to be 5. Let\u2019s run the program: python add_numbers . py Output : 3 4 5 When we pass 1, 2, and 3 as parameters to the add_numbers() function, we receive the expected output. Parameters are arguments that are typically defined as variables within function definitions. They can be assigned values when you run the method, passing the arguments into the function.", + "location": "/beginner/Functions/#working-with-parameters", + "text": "So far we have looked at functions with empty parentheses that do not take arguments, but we can define parameters in function definitions within their parentheses. A parameter is a named entity in a function definition, specifying an argument that the function can accept. Let\u2019s create a small program that takes in parameters x, y, and z. We\u2019ll create a function that adds the parameters together in different configurations. The sums of these will be printed by the function. Then we\u2019ll call the function and pass numbers into the function. def add_numbers ( x , y , z ): \n a = x + y \n b = x + z \n c = y + z \n print ( a , b , c ) add_numbers ( 1 , 2 , 3 ) We passed the number 1 in for the x parameter, 2 in for the y parameter, and 3 in for the z parameter. These values correspond with each parameter in the order they are given. The program is essentially doing the following math based on the values we passed to the parameters: a = 1 + 2 b = 1 + 3 c = 2 + 3 The function also prints a, b, and c, and based on the math above we would expect a to be equal to 3, b to be 4, and c to be 5. Let\u2019s run the program: python add_numbers . py Output : 3 4 5 When we pass 1, 2, and 3 as parameters to the add_numbers() function, we receive the expected output. Parameters are arguments that are typically defined as variables within function definitions. They can be assigned values when you run the method, passing the arguments into the function.", "title": "Working with Parameters" - }, + }, { - "location": "/beginner/Functions/#keyword-arguments", - "text": "In addition to calling parameters in order, you can use keyword arguments in a function call, in which the caller identifies the arguments by the parameter name. When you use keyword arguments, you can use parameters out of order because the Python interpreter will use the keywords provided to match the values to the parameters. Let\u2019s create a function that will show us profile information for a user. We\u2019ll pass parameters to it in the form of username (intended as a string), and followers (intended as an integer). # Define function with parameters def profile_info ( username , followers ): \n print ( Username: + username ) \n print ( Followers: + str ( followers )) Within the function definition statement, username and followers are contained in the parentheses of the profile_info() function. The block of the function prints out information about the user as strings, making use of the two parameters. Now, we can call the function and assign parameters to it: def profile_info ( username , followers ): \n print ( Username: + username ) \n print ( Followers: + str ( followers )) # Call function with parameters assigned as above profile_info ( sammyshark , 945 ) # Call function with keyword arguments profile_info ( username = AlexAnglerfish , followers = 342 ) In the first function call, we have filled in the information with a username of sammyshark and followers being 945, in the second function call we used keyword arguments, assigning values to the argument variables. Let\u2019s run the program: python profile . py Output : Username : sammyshark Followers : 945 Username : AlexAnglerfish Followers : 342 The output shows us the usernames and numbers of followers for both users. This also permits us to modify the order of the parameters, as in this example of the same program with a different call: def profile_info ( username , followers ): \n print ( Username: + username ) \n print ( Followers: + str ( followers )) # Change order of parameters profile_info ( followers = 820 , username = cameron-catfish ) When we run the program again with the python profile.py command, we\u2019ll receive the following output: Output : Username : cameron - catfish Followers : 820 Because the function definition maintains the same order of print() statements, if we use keyword arguments, it does not matter which order we pass them into the function call.", + "location": "/beginner/Functions/#keyword-arguments", + "text": "In addition to calling parameters in order, you can use keyword arguments in a function call, in which the caller identifies the arguments by the parameter name. When you use keyword arguments, you can use parameters out of order because the Python interpreter will use the keywords provided to match the values to the parameters. Let\u2019s create a function that will show us profile information for a user. We\u2019ll pass parameters to it in the form of username (intended as a string), and followers (intended as an integer). # Define function with parameters def profile_info ( username , followers ): \n print ( Username: + username ) \n print ( Followers: + str ( followers )) Within the function definition statement, username and followers are contained in the parentheses of the profile_info() function. The block of the function prints out information about the user as strings, making use of the two parameters. Now, we can call the function and assign parameters to it: def profile_info ( username , followers ): \n print ( Username: + username ) \n print ( Followers: + str ( followers )) # Call function with parameters assigned as above profile_info ( sammyshark , 945 ) # Call function with keyword arguments profile_info ( username = AlexAnglerfish , followers = 342 ) In the first function call, we have filled in the information with a username of sammyshark and followers being 945, in the second function call we used keyword arguments, assigning values to the argument variables. Let\u2019s run the program: python profile . py Output : Username : sammyshark Followers : 945 Username : AlexAnglerfish Followers : 342 The output shows us the usernames and numbers of followers for both users. This also permits us to modify the order of the parameters, as in this example of the same program with a different call: def profile_info ( username , followers ): \n print ( Username: + username ) \n print ( Followers: + str ( followers )) # Change order of parameters profile_info ( followers = 820 , username = cameron-catfish ) When we run the program again with the python profile.py command, we\u2019ll receive the following output: Output : Username : cameron - catfish Followers : 820 Because the function definition maintains the same order of print() statements, if we use keyword arguments, it does not matter which order we pass them into the function call.", "title": "Keyword Arguments" - }, + }, { - "location": "/beginner/Functions/#default-argument-values", - "text": "We can also provide default values for one or both of the parameters. Let\u2019s create a default value for the followers parameter with a value of 1: def profile_info ( username , followers = 1 ): \n print ( Username: + username ) \n print ( Followers: + str ( followers )) Now, we can run the function with only the username function assigned, and the number of followers will automatically default to 1. We can also still change the number of followers if we would like. def profile_info ( username , followers = 1 ): \n print ( Username: + username ) \n print ( Followers: + str ( followers )) profile_info ( username = JOctopus ) profile_info ( username = sammyshark , followers = 945 ) When we run the program with the python profile.py command, we\u2019ll receive the following output: Output : Username : JOctopus Followers : 1 Username : sammyshark Followers : 945 Providing default parameters with values can let us skip defining values for each argument that already has a default.", + "location": "/beginner/Functions/#default-argument-values", + "text": "We can also provide default values for one or both of the parameters. Let\u2019s create a default value for the followers parameter with a value of 1: def profile_info ( username , followers = 1 ): \n print ( Username: + username ) \n print ( Followers: + str ( followers )) Now, we can run the function with only the username function assigned, and the number of followers will automatically default to 1. We can also still change the number of followers if we would like. def profile_info ( username , followers = 1 ): \n print ( Username: + username ) \n print ( Followers: + str ( followers )) profile_info ( username = JOctopus ) profile_info ( username = sammyshark , followers = 945 ) When we run the program with the python profile.py command, we\u2019ll receive the following output: Output : Username : JOctopus Followers : 1 Username : sammyshark Followers : 945 Providing default parameters with values can let us skip defining values for each argument that already has a default.", "title": "Default Argument Values" - }, + }, { - "location": "/beginner/Functions/#returning-a-value", - "text": "You can pass a parameter value into a function, and a function can also produce a value. A function can produce a value with the return statement, which will exit a function and optionally pass an expression back to the caller. If you use a return statement with no arguments, the function will return None. So far, we have used the print() statement instead of the return statement in our functions. Let\u2019s create a program that instead of printing will return a variable. In a new text file called square.py, we\u2019ll create a program that squares the parameter x and returns the variable y. We issue a call to print the result variable, which is formed by running the square() function with 3 passed into it. def square ( x ): \n y = x ** 2 \n return y result = square ( 3 ) print ( result ) We can run the program and see the output: python square . py Output : 9 The integer 9 is returned as output, which is what we would expect by asking Python to find the square of 3. To further understand how the return statement works, we can comment out the return statement in the program: def square ( x ): \n y = x ** 2 \n # return y result = square ( 3 ) print ( result ) Now, let\u2019s run the program again: python square . py Output : None Without using the return statement here, the program cannot return a value so the value defaults to None. As another example, in the add_numbers.py program above, we could swap out the print() statement for a return statement. def add_numbers ( x , y , z ): \n a = x + y \n b = x + z \n c = y + z \n return a , b , c sums = add_numbers ( 1 , 2 , 3 ) print ( sums ) Outside of the function, we set the variable sums equal to the result of the function taking in 1, 2, and 3 as we did above. Then we called a print of the sums variable. Let\u2019s run the program again now that it has the return statement: Output : ( 3 , 4 , 5 ) We receive the same numbers 3, 4, and 5 as output that we received previously by using the print() statement in the function. This time it is delivered as a tuple because the return statement\u2019s expression list has at least one comma. Functions exit immediately when they hit a return statement, whether or not they\u2019re returning a value. def loop_five (): \n for x in range ( 0 , 25 ): \n print ( x ) \n if x == 5 : \n # Stop function at x == 5 \n return \n print ( This line will not execute. ) loop_five () Using the return statement within the for loop ends the function, so the line that is outside of the loop will not run. If, instead, we had used a break statement, only the loop would have exited at that time, and the last print() line would run. The return statement exits a function, and may return a value when issued with a parameter.", + "location": "/beginner/Functions/#returning-a-value", + "text": "You can pass a parameter value into a function, and a function can also produce a value. A function can produce a value with the return statement, which will exit a function and optionally pass an expression back to the caller. If you use a return statement with no arguments, the function will return None. So far, we have used the print() statement instead of the return statement in our functions. Let\u2019s create a program that instead of printing will return a variable. In a new text file called square.py, we\u2019ll create a program that squares the parameter x and returns the variable y. We issue a call to print the result variable, which is formed by running the square() function with 3 passed into it. def square ( x ): \n y = x ** 2 \n return y result = square ( 3 ) print ( result ) We can run the program and see the output: python square . py Output : 9 The integer 9 is returned as output, which is what we would expect by asking Python to find the square of 3. To further understand how the return statement works, we can comment out the return statement in the program: def square ( x ): \n y = x ** 2 \n # return y result = square ( 3 ) print ( result ) Now, let\u2019s run the program again: python square . py Output : None Without using the return statement here, the program cannot return a value so the value defaults to None. As another example, in the add_numbers.py program above, we could swap out the print() statement for a return statement. def add_numbers ( x , y , z ): \n a = x + y \n b = x + z \n c = y + z \n return a , b , c sums = add_numbers ( 1 , 2 , 3 ) print ( sums ) Outside of the function, we set the variable sums equal to the result of the function taking in 1, 2, and 3 as we did above. Then we called a print of the sums variable. Let\u2019s run the program again now that it has the return statement: Output : ( 3 , 4 , 5 ) We receive the same numbers 3, 4, and 5 as output that we received previously by using the print() statement in the function. This time it is delivered as a tuple because the return statement\u2019s expression list has at least one comma. Functions exit immediately when they hit a return statement, whether or not they\u2019re returning a value. def loop_five (): \n for x in range ( 0 , 25 ): \n print ( x ) \n if x == 5 : \n # Stop function at x == 5 \n return \n print ( This line will not execute. ) loop_five () Using the return statement within the for loop ends the function, so the line that is outside of the loop will not run. If, instead, we had used a break statement, only the loop would have exited at that time, and the last print() line would run. The return statement exits a function, and may return a value when issued with a parameter.", "title": "Returning a Value" - }, + }, { - "location": "/beginner/Functions/#using-main-as-a-function", - "text": "Although in Python you can call the function at the bottom of your program and it will run (as we have done in the examples above), many programming languages (like C++ and Java) require a main function in order to execute. Including a main() function, though not required, can structure our Python programs in a logical way that puts the most important components of the program into one function. It can also make our programs easier for non-Python programmers to read. We\u2019ll start with adding a main() function to the hello.py program above. We\u2019ll keep our hello() function, and then define a main() function: def hello (): \n print ( Hello, World! ) def main (): Within the main() function, let\u2019s include a print() statement to let us know that we\u2019re in the main() function. Additionally, let\u2019s call the hello() function within the main() function: def hello (): \n print ( Hello, World! ) def main (): \n print ( This is the main function ) \n hello () Finally, at the bottom of the program we\u2019ll call the main() function: def hello (): \n print ( Hello, World! ) def main (): \n print ( This is the main function. ) \n hello () main () At this point, we can run our program: python hello . py Output : This is the main function . Hello , World ! Because we called the hello() function within main() and then only called main() to run, the Hello, World! text printed only once, after the string that told us we were in the main function. Next we\u2019re going to be working with multiple functions, so it is worth reviewing the variable scope of global and local variables. If you define a variable within a function block, you\u2019ll only be able to use that variable within that function. If you would like to use variables across functions it may be better to declare a global variable. In Python, '_ main_ ' is the name of the scope where top-level code will execute. When a program is run from standard input, a script, or from an interactive prompt, its _ name_ is set equal to '_ main_ '. Because of this, there is a convention to use the following construction: if __name__ == __main__ : \n # Code to run when this is the main program here This lets program files be used either:\n- as the main program and run what follows the if statement\n- as a module and not run what follows the if statement. Any code that is not contained within this statement will be executed upon running. If you\u2019re using your program file as a module, the code that is not in this statement will also execute upon its import while running the secondary file. Let\u2019s expand on our names.py program above, and create a new file called more_names.py. In this program we\u2019ll declare a global variable and modify our original names() function so that the instructions are in two discrete functions. The first function, has_vowel() will check to see if the name string contains a vowel. The second function print_letters() will print each letter of the name string. # Declare global variable name for use in all functions name = str ( input ( Enter your name: )) # Define function to check if name contains a vowel def has_vowel (): \n if set ( aeiou ) . intersection ( name . lower ()): \n print ( Your name contains a vowel. ) \n else : \n print ( Your name does not contain a vowel. ) # Iterate over letters in name string def print_letters (): \n for letter in name : \n print ( letter ) With this set up, let\u2019s define the main() function which will contain a call to both the has_vowel() and the print_letters() functions. # Declare global variable name for use in all functions name = str ( input ( Enter your name: )) # Define function to check if name contains a vowel def has_vowel (): \n if set ( aeiou ) . intersection ( name . lower ()): \n print ( Your name contains a vowel. ) \n else : \n print ( Your name does not contain a vowel. ) # Iterate over letters in name string def print_letters (): \n for letter in name : \n print ( letter ) # Define main method that calls other functions def main (): \n has_vowel () \n print_letters () Finally, we\u2019ll add the if \\__name\\__ == '\\__main\\__': construction at the bottom of the file. For our purposes, since we have put all the functions we would like to do in the main() function, we\u2019ll call the main() function following this if statement. # Declare global variable name for use in all functions name = str ( input ( Enter your name: )) # Define function to check if name contains a vowel def has_vowel (): \n if set ( aeiou ) . intersection ( name . lower ()): \n print ( Your name contains a vowel. ) \n else : \n print ( Your name does not contain a vowel. ) # Iterate over letters in name string def print_letters (): \n for letter in name : \n print ( letter ) # Define main method that calls other functions def main (): \n has_vowel () \n print_letters () # Execute main() function if __name__ == __main__ : \n main () We can now run the program: python more_names . py The program will show the same output as the names.py program, but here the code is more organized and can be used in a modular way without modification. If you did not want to declare a main() function, you alternatively could have ended the program like this: if __name__ == __main__ : \n has_vowel () \n print_letters () Using main() as a function and the if _ name_ == '_ main_ ': statement can organize your code in a logical way, making it more readable and modular.", + "location": "/beginner/Functions/#using-main-as-a-function", + "text": "Although in Python you can call the function at the bottom of your program and it will run (as we have done in the examples above), many programming languages (like C++ and Java) require a main function in order to execute. Including a main() function, though not required, can structure our Python programs in a logical way that puts the most important components of the program into one function. It can also make our programs easier for non-Python programmers to read. We\u2019ll start with adding a main() function to the hello.py program above. We\u2019ll keep our hello() function, and then define a main() function: def hello (): \n print ( Hello, World! ) def main (): Within the main() function, let\u2019s include a print() statement to let us know that we\u2019re in the main() function. Additionally, let\u2019s call the hello() function within the main() function: def hello (): \n print ( Hello, World! ) def main (): \n print ( This is the main function ) \n hello () Finally, at the bottom of the program we\u2019ll call the main() function: def hello (): \n print ( Hello, World! ) def main (): \n print ( This is the main function. ) \n hello () main () At this point, we can run our program: python hello . py Output : This is the main function . Hello , World ! Because we called the hello() function within main() and then only called main() to run, the Hello, World! text printed only once, after the string that told us we were in the main function. Next we\u2019re going to be working with multiple functions, so it is worth reviewing the variable scope of global and local variables. If you define a variable within a function block, you\u2019ll only be able to use that variable within that function. If you would like to use variables across functions it may be better to declare a global variable. In Python, '_ main_ ' is the name of the scope where top-level code will execute. When a program is run from standard input, a script, or from an interactive prompt, its _ name_ is set equal to '_ main_ '. Because of this, there is a convention to use the following construction: if __name__ == __main__ : \n # Code to run when this is the main program here This lets program files be used either:\n- as the main program and run what follows the if statement\n- as a module and not run what follows the if statement. Any code that is not contained within this statement will be executed upon running. If you\u2019re using your program file as a module, the code that is not in this statement will also execute upon its import while running the secondary file. Let\u2019s expand on our names.py program above, and create a new file called more_names.py. In this program we\u2019ll declare a global variable and modify our original names() function so that the instructions are in two discrete functions. The first function, has_vowel() will check to see if the name string contains a vowel. The second function print_letters() will print each letter of the name string. # Declare global variable name for use in all functions name = str ( input ( Enter your name: )) # Define function to check if name contains a vowel def has_vowel (): \n if set ( aeiou ) . intersection ( name . lower ()): \n print ( Your name contains a vowel. ) \n else : \n print ( Your name does not contain a vowel. ) # Iterate over letters in name string def print_letters (): \n for letter in name : \n print ( letter ) With this set up, let\u2019s define the main() function which will contain a call to both the has_vowel() and the print_letters() functions. # Declare global variable name for use in all functions name = str ( input ( Enter your name: )) # Define function to check if name contains a vowel def has_vowel (): \n if set ( aeiou ) . intersection ( name . lower ()): \n print ( Your name contains a vowel. ) \n else : \n print ( Your name does not contain a vowel. ) # Iterate over letters in name string def print_letters (): \n for letter in name : \n print ( letter ) # Define main method that calls other functions def main (): \n has_vowel () \n print_letters () Finally, we\u2019ll add the if \\__name\\__ == '\\__main\\__': construction at the bottom of the file. For our purposes, since we have put all the functions we would like to do in the main() function, we\u2019ll call the main() function following this if statement. # Declare global variable name for use in all functions name = str ( input ( Enter your name: )) # Define function to check if name contains a vowel def has_vowel (): \n if set ( aeiou ) . intersection ( name . lower ()): \n print ( Your name contains a vowel. ) \n else : \n print ( Your name does not contain a vowel. ) # Iterate over letters in name string def print_letters (): \n for letter in name : \n print ( letter ) # Define main method that calls other functions def main (): \n has_vowel () \n print_letters () # Execute main() function if __name__ == __main__ : \n main () We can now run the program: python more_names . py The program will show the same output as the names.py program, but here the code is more organized and can be used in a modular way without modification. If you did not want to declare a main() function, you alternatively could have ended the program like this: if __name__ == __main__ : \n has_vowel () \n print_letters () Using main() as a function and the if _ name_ == '_ main_ ': statement can organize your code in a logical way, making it more readable and modular.", "title": "Using main() as a Function" - }, + }, { - "location": "/beginner/Functions/#conclusion", - "text": "Functions are code blocks of instructions that perform actions within a program, helping to make our code reusable and modular. To learn more about how to make your code more modular, you can read our guide on How To Write Modules in Python 3. Source: https://stackoverflow.com/questions/1909512/what-is-python-used-for", + "location": "/beginner/Functions/#conclusion", + "text": "Functions are code blocks of instructions that perform actions within a program, helping to make our code reusable and modular. To learn more about how to make your code more modular, you can read our guide on How To Write Modules in Python 3. Source: https://stackoverflow.com/questions/1909512/what-is-python-used-for", "title": "Conclusion" - }, + }, { - "location": "/beginner/Functions/#prefer-exceptions-to-returning-none", - "text": "When writing utility functions, there\u2019s a draw for Python programmers to give special\nmeaning to the return value of None. It seems to makes sense in some cases. For example,\nsay you want a helper function that divides one number by another. In the case of dividing\nby zero, returning None seems natural because the result is undefined. def divide ( a , b ): \n try : \n return a / b \n except ZeroDivisionError : \n return None Code using this function can interpret the return value accordingly. result = divide ( x , y ) if result is None : \n print ( \u2018 Invalid inputs \u2019 ) What happens when the numerator is zero? That will cause the return value to also be zero\n(if the denominator is non-zero). This can cause problems when you evaluate the result in\na condition like an if statement. You may accidentally look for any False equivalent\nvalue to indicate errors instead of only looking for None. x , y = 0 , 5 result = divide ( x , y ) if not result : \n print ( \u2018 Invalid inputs \u2019 ) # This is wrong! This is a common mistake in Python code when None has special meaning. This is why\nreturning None from a function is error prone. There are two ways to reduce the chance of\nsuch errors. The first way is to split the return value into a two-tuple. The first part of the tuple\nindicates that the operation was a success or failure. The second part is the actual result\nthat was computed. def divide ( a , b ): \n try : \n return True , a / b \n except ZeroDivisionError : \n return False , None Callers of this function have to unpack the tuple. That forces them to consider the status\npart of the tuple instead of just looking at the result of division. success , result = divide ( x , y ) if not success : \n print ( \u2018 Invalid inputs \u2019 ) The problem is that callers can easily ignore the first part of the tuple (using the\nunderscore variable name, a Python convention for unused variables). The resulting code\ndoesn\u2019t look wrong at first glance. This is as bad as just returning None. _ , result = divide ( x , y ) if not result : \n print ( \u2018 Invalid inputs \u2019 ) The second, better way to reduce these errors is to never return None at all. Instead, raise\nan exception up to the caller and make them deal with it. Here, I turn a\nZeroDivisionError into a ValueError to indicate to the caller that the input\nvalues are bad: def divide ( a , b ): \n try : \n return a / b \n except ZeroDivisionError as e : \n raise ValueError ( \u2018 Invalid inputs \u2019 ) from e Now the caller should handle the exception for the invalid input case.\nThe caller no longer requires a condition on the return value of the function. If the\nfunction didn\u2019t raise an exception, then the return value must be good. The outcome of\nexception handling is clear. x , y = 5 , 2 try : \n result = divide ( x , y ) except ValueError : \n print ( \u2018 Invalid inputs \u2019 ) else : \n print ( \u2018 Result is %. 1 f \u2019 % result ) Result is 2.5", + "location": "/beginner/Functions/#prefer-exceptions-to-returning-none", + "text": "When writing utility functions, there\u2019s a draw for Python programmers to give special\nmeaning to the return value of None. It seems to makes sense in some cases. For example,\nsay you want a helper function that divides one number by another. In the case of dividing\nby zero, returning None seems natural because the result is undefined. def divide ( a , b ): \n try : \n return a / b \n except ZeroDivisionError : \n return None Code using this function can interpret the return value accordingly. result = divide ( x , y ) if result is None : \n print ( \u2018 Invalid inputs \u2019 ) What happens when the numerator is zero? That will cause the return value to also be zero\n(if the denominator is non-zero). This can cause problems when you evaluate the result in\na condition like an if statement. You may accidentally look for any False equivalent\nvalue to indicate errors instead of only looking for None. x , y = 0 , 5 result = divide ( x , y ) if not result : \n print ( \u2018 Invalid inputs \u2019 ) # This is wrong! This is a common mistake in Python code when None has special meaning. This is why\nreturning None from a function is error prone. There are two ways to reduce the chance of\nsuch errors. The first way is to split the return value into a two-tuple. The first part of the tuple\nindicates that the operation was a success or failure. The second part is the actual result\nthat was computed. def divide ( a , b ): \n try : \n return True , a / b \n except ZeroDivisionError : \n return False , None Callers of this function have to unpack the tuple. That forces them to consider the status\npart of the tuple instead of just looking at the result of division. success , result = divide ( x , y ) if not success : \n print ( \u2018 Invalid inputs \u2019 ) The problem is that callers can easily ignore the first part of the tuple (using the\nunderscore variable name, a Python convention for unused variables). The resulting code\ndoesn\u2019t look wrong at first glance. This is as bad as just returning None. _ , result = divide ( x , y ) if not result : \n print ( \u2018 Invalid inputs \u2019 ) The second, better way to reduce these errors is to never return None at all. Instead, raise\nan exception up to the caller and make them deal with it. Here, I turn a\nZeroDivisionError into a ValueError to indicate to the caller that the input\nvalues are bad: def divide ( a , b ): \n try : \n return a / b \n except ZeroDivisionError as e : \n raise ValueError ( \u2018 Invalid inputs \u2019 ) from e Now the caller should handle the exception for the invalid input case.\nThe caller no longer requires a condition on the return value of the function. If the\nfunction didn\u2019t raise an exception, then the return value must be good. The outcome of\nexception handling is clear. x , y = 5 , 2 try : \n result = divide ( x , y ) except ValueError : \n print ( \u2018 Invalid inputs \u2019 ) else : \n print ( \u2018 Result is %. 1 f \u2019 % result ) Result is 2.5", "title": "Prefer Exceptions to Returning None" - }, + }, { - "location": "/beginner/Functions/#things-to-remember", - "text": "Functions that return None to indicate special meaning are error prone because\nNone and other values (e.g., zero, the empty string) all evaluate to False in\nconditional expressions. Raise exceptions to indicate special situations instead of returning None. Expect the\ncalling code to handle exceptions properly when they\u2019re documented. Source: Effective Python by Brett Slatkin", + "location": "/beginner/Functions/#things-to-remember", + "text": "Functions that return None to indicate special meaning are error prone because\nNone and other values (e.g., zero, the empty string) all evaluate to False in\nconditional expressions. Raise exceptions to indicate special situations instead of returning None. Expect the\ncalling code to handle exceptions properly when they\u2019re documented. Source: Effective Python by Brett Slatkin", "title": "Things to Remember" - }, + }, { - "location": "/advanced/Context_Managers/", - "text": "How Exactly Do Context Managers Work?\n\n\nContext managers (PEP 343) are pretty important in Python. You probably use one every time you open a file:\n\n\nwith\n \nopen\n(\ncake.txt\n)\n \nas\n \nc\n:\n\n \ngobble_gobble\n(\nc\n)\n\n\n\n\n\n\nBut how well do you understand what\u2019s going on behind the scenes?\n\n\nCONTEXT MANAGER CLASSES\n\n\nIt\u2019s actually quite simple. A context manager is a class that implements an \n__enter__\n and an \n__exit__\n method.\n\n\nLet\u2019s imagine you want to you print a line of text to the console surrounded with asterisks. Here\u2019s a context manager to do it:\n\n\nclass\n \nasterisks\n():\n\n \ndef\n \n__enter__\n(\nself\n):\n\n \nprint\n(\n*\n \n*\n \n32\n)\n\n\n \ndef\n \n__exit__\n(\nself\n,\n \nexc_type\n,\n \nexc_val\n,\n \nexc_tb\n):\n\n \nprint\n(\n*\n \n*\n \n32\n)\n\n\n\n\n\n\nThe \n__exit__\n method takes three arguments apart from \nself\n. Those arguments contain information about any errors that occurred inside the \nwith\n block.\n\n\nYou can use \nasterisks\n in the same way as any of the built-in context managers:\n\n\n \nwith\n \nasterisks\n():\n\n\n \nprint\n(\nContext Managers Rock!\n)\n\n\n********************************\n\n\nContext\n \nManagers\n \nRock\n!\n\n\n********************************\n\n\n\n\n\n\nACCESSING THE CONTEXT INSIDE THE WITH BLOCK\n\n\nIf you need to get something back and use it inside the with block \u2013 such as a file descriptor \u2013 you simply return it from \n__enter__\n:\n\n\nclass\n \nmyopen\n():\n\n \ndef\n \n__init__\n(\nself\n,\n \nfilename\n,\n \nfilemode\n):\n\n \nself\n.\nfilename\n \n=\n \nfilename\n\n \nself\n.\nfilemode\n \n=\n \nfilemode\n\n\n \ndef\n \n__enter__\n(\nself\n):\n\n \nself\n.\nfile\n \n=\n \nopen\n(\nself\n.\nfilename\n,\n \nself\n.\nfilemode\n)\n\n \nreturn\n \nself\n.\nfile\n\n\n \ndef\n \n__exit__\n(\nself\n,\n \nexc_type\n,\n \nexc_val\n,\n \nexc_tb\n):\n\n \nself\n.\nfile\n.\nclose\n()\n\n\n\n\n\n\nmyopen\n works identically to the built-in \nopen\n:\n\n\nwith\n \nmyopen\n(\nbeer.txt\n)\n \nas\n \nb\n:\n\n \nguzzle_guzzle\n(\nb\n)\n\n\n\n\n\n\nTHE CONTEXTMANAGER DECORATOR\n\n\nThankfully, you don\u2019t have to implement a class every time. The \ncontextlib\n package has a \ncontextmanager\n decorator that you can apply to generators to automatically transform them into context managers:\n\n\nfrom\n \ncontextlib\n \nimport\n \ncontextmanager\n\n\n\n@contextmanager\n\n\ndef\n \nspoiler\n():\n\n \nprint\n(\nspoiler\n)\n\n \nyield\n\n \nprint\n(\n/spoiler\n)\n\n\n\n\n\n\nThe code before \nyield\n corresponds to \n__enter__\n and the code after \nyield\n corresponds to \n__exit__\n. A context manager generator should have exactly one \nyield\n in it.\n\n\nIt works the same as the class version:\n\n\n \nwith\n \nspoiler\n():\n\n\n \nprint\n(\nJon Snow is Luke\ns father.\n)\n\n\nspoiler\n\n\nJon\n \nSnow\n \nis\n \nLuke\ns father.\n\n\n/\nspoiler\n\n\n\n\n\n\nROLL YOUR OWN CONTEXTMANAGER DECORATOR\n\n\nThe implementation in \ncontextlib\n is complicated, but it\u2019s not hard to write something that works similarly with the exception of a few edge cases:\n\n\ndef\n \ncontextmanager\n(\ngen\n):\n\n \nclass\n \nCMWrapper\n(\nobject\n):\n\n \ndef\n \n__init__\n(\nself\n,\n \nwrapped\n):\n\n \nself\n.\ngenerator\n \n=\n \nwrapped\n\n\n \ndef\n \n__enter__\n(\nself\n):\n\n \nreturn\n \nnext\n(\nself\n.\ngenerator\n)\n\n\n \ndef\n \n__exit__\n(\nself\n,\n \nex_type\n,\n \nvalue\n,\n \ntraceback\n):\n\n \ntry\n:\n\n \nnext\n(\nself\n.\ngenerator\n)\n\n \nexcept\n \nStopIteration\n:\n\n \npass\n\n\n \ndef\n \ninner\n(\n*\nargs\n,\n \n**\nkwargs\n):\n\n \nreturn\n \nCMWrapper\n(\ngen\n(\n*\nargs\n,\n \n**\nkwargs\n))\n\n\n \nreturn\n \ninner\n\n\n\n\n\n\nIt\u2019s not as robust as the real implementation, but it should be understandable. Here are the key points:\n- The inner function instantiates a copy of the nested CMWrapper class with a handle on the generator passed into the decorator.\n\n- \n__enter__\n calls next() on the generator and returns the yielded value so it can be used in the with block.\n\n- \n__exit__\n calls next() again and catches the StopIteration exception that the generator throws when it finishes. \n\n\nThat\u2019s it for now. If you want to learn more about context managers, I recommend you take a look at the code for \ncontextlib\n.\n\n\n\n\nSource:\n \n\n\n https://www.smallsurething.com/how-exactly-do-context-managers-work/\n\n\n\n\nPython Context Managers and the \"with\" Statement (\nenter\n \n \nexit\n) \nVIDEO", + "location": "/advanced/Context_Managers/", + "text": "How Exactly Do Context Managers Work?\n\n\nContext managers (PEP 343) are pretty important in Python. You probably use one every time you open a file:\n\n\nwith\n \nopen\n(\ncake.txt\n)\n \nas\n \nc\n:\n\n \ngobble_gobble\n(\nc\n)\n\n\n\n\n\n\nBut how well do you understand what\u2019s going on behind the scenes?\n\n\nCONTEXT MANAGER CLASSES\n\n\nIt\u2019s actually quite simple. A context manager is a class that implements an \n__enter__\n and an \n__exit__\n method.\n\n\nLet\u2019s imagine you want to you print a line of text to the console surrounded with asterisks. Here\u2019s a context manager to do it:\n\n\nclass\n \nasterisks\n():\n\n \ndef\n \n__enter__\n(\nself\n):\n\n \nprint\n(\n*\n \n*\n \n32\n)\n\n\n \ndef\n \n__exit__\n(\nself\n,\n \nexc_type\n,\n \nexc_val\n,\n \nexc_tb\n):\n\n \nprint\n(\n*\n \n*\n \n32\n)\n\n\n\n\n\n\nThe \n__exit__\n method takes three arguments apart from \nself\n. Those arguments contain information about any errors that occurred inside the \nwith\n block.\n\n\nYou can use \nasterisks\n in the same way as any of the built-in context managers:\n\n\n \nwith\n \nasterisks\n():\n\n\n \nprint\n(\nContext Managers Rock!\n)\n\n\n********************************\n\n\nContext\n \nManagers\n \nRock\n!\n\n\n********************************\n\n\n\n\n\n\nACCESSING THE CONTEXT INSIDE THE WITH BLOCK\n\n\nIf you need to get something back and use it inside the with block \u2013 such as a file descriptor \u2013 you simply return it from \n__enter__\n:\n\n\nclass\n \nmyopen\n():\n\n \ndef\n \n__init__\n(\nself\n,\n \nfilename\n,\n \nfilemode\n):\n\n \nself\n.\nfilename\n \n=\n \nfilename\n\n \nself\n.\nfilemode\n \n=\n \nfilemode\n\n\n \ndef\n \n__enter__\n(\nself\n):\n\n \nself\n.\nfile\n \n=\n \nopen\n(\nself\n.\nfilename\n,\n \nself\n.\nfilemode\n)\n\n \nreturn\n \nself\n.\nfile\n\n\n \ndef\n \n__exit__\n(\nself\n,\n \nexc_type\n,\n \nexc_val\n,\n \nexc_tb\n):\n\n \nself\n.\nfile\n.\nclose\n()\n\n\n\n\n\n\nmyopen\n works identically to the built-in \nopen\n:\n\n\nwith\n \nmyopen\n(\nbeer.txt\n)\n \nas\n \nb\n:\n\n \nguzzle_guzzle\n(\nb\n)\n\n\n\n\n\n\nTHE CONTEXTMANAGER DECORATOR\n\n\nThankfully, you don\u2019t have to implement a class every time. The \ncontextlib\n package has a \ncontextmanager\n decorator that you can apply to generators to automatically transform them into context managers:\n\n\nfrom\n \ncontextlib\n \nimport\n \ncontextmanager\n\n\n\n@contextmanager\n\n\ndef\n \nspoiler\n():\n\n \nprint\n(\nspoiler\n)\n\n \nyield\n\n \nprint\n(\n/spoiler\n)\n\n\n\n\n\n\nThe code before \nyield\n corresponds to \n__enter__\n and the code after \nyield\n corresponds to \n__exit__\n. A context manager generator should have exactly one \nyield\n in it.\n\n\nIt works the same as the class version:\n\n\n \nwith\n \nspoiler\n():\n\n\n \nprint\n(\nJon Snow is Luke\ns father.\n)\n\n\nspoiler\n\n\nJon\n \nSnow\n \nis\n \nLuke\ns father.\n\n\n/\nspoiler\n\n\n\n\n\n\nROLL YOUR OWN CONTEXTMANAGER DECORATOR\n\n\nThe implementation in \ncontextlib\n is complicated, but it\u2019s not hard to write something that works similarly with the exception of a few edge cases:\n\n\ndef\n \ncontextmanager\n(\ngen\n):\n\n \nclass\n \nCMWrapper\n(\nobject\n):\n\n \ndef\n \n__init__\n(\nself\n,\n \nwrapped\n):\n\n \nself\n.\ngenerator\n \n=\n \nwrapped\n\n\n \ndef\n \n__enter__\n(\nself\n):\n\n \nreturn\n \nnext\n(\nself\n.\ngenerator\n)\n\n\n \ndef\n \n__exit__\n(\nself\n,\n \nex_type\n,\n \nvalue\n,\n \ntraceback\n):\n\n \ntry\n:\n\n \nnext\n(\nself\n.\ngenerator\n)\n\n \nexcept\n \nStopIteration\n:\n\n \npass\n\n\n \ndef\n \ninner\n(\n*\nargs\n,\n \n**\nkwargs\n):\n\n \nreturn\n \nCMWrapper\n(\ngen\n(\n*\nargs\n,\n \n**\nkwargs\n))\n\n\n \nreturn\n \ninner\n\n\n\n\n\n\nIt\u2019s not as robust as the real implementation, but it should be understandable. Here are the key points:\n- The inner function instantiates a copy of the nested CMWrapper class with a handle on the generator passed into the decorator.\n\n- \n__enter__\n calls next() on the generator and returns the yielded value so it can be used in the with block.\n\n- \n__exit__\n calls next() again and catches the StopIteration exception that the generator throws when it finishes. \n\n\nThat\u2019s it for now. If you want to learn more about context managers, I recommend you take a look at the code for \ncontextlib\n.\n\n\n\n\nSource:\n \n\n\n https://www.smallsurething.com/how-exactly-do-context-managers-work/\n\n\n\n\nPython Context Managers and the \"with\" Statement (\nenter\n \n \nexit\n) \nVIDEO", "title": "Context Managers" - }, + }, { - "location": "/advanced/Context_Managers/#how-exactly-do-context-managers-work", - "text": "Context managers (PEP 343) are pretty important in Python. You probably use one every time you open a file: with open ( cake.txt ) as c : \n gobble_gobble ( c ) But how well do you understand what\u2019s going on behind the scenes?", + "location": "/advanced/Context_Managers/#how-exactly-do-context-managers-work", + "text": "Context managers (PEP 343) are pretty important in Python. You probably use one every time you open a file: with open ( cake.txt ) as c : \n gobble_gobble ( c ) But how well do you understand what\u2019s going on behind the scenes?", "title": "How Exactly Do Context Managers Work?" - }, + }, { - "location": "/advanced/Context_Managers/#context-manager-classes", - "text": "It\u2019s actually quite simple. A context manager is a class that implements an __enter__ and an __exit__ method. Let\u2019s imagine you want to you print a line of text to the console surrounded with asterisks. Here\u2019s a context manager to do it: class asterisks (): \n def __enter__ ( self ): \n print ( * * 32 ) \n\n def __exit__ ( self , exc_type , exc_val , exc_tb ): \n print ( * * 32 ) The __exit__ method takes three arguments apart from self . Those arguments contain information about any errors that occurred inside the with block. You can use asterisks in the same way as any of the built-in context managers: with asterisks (): print ( Context Managers Rock! ) ******************************** Context Managers Rock ! ********************************", + "location": "/advanced/Context_Managers/#context-manager-classes", + "text": "It\u2019s actually quite simple. A context manager is a class that implements an __enter__ and an __exit__ method. Let\u2019s imagine you want to you print a line of text to the console surrounded with asterisks. Here\u2019s a context manager to do it: class asterisks (): \n def __enter__ ( self ): \n print ( * * 32 ) \n\n def __exit__ ( self , exc_type , exc_val , exc_tb ): \n print ( * * 32 ) The __exit__ method takes three arguments apart from self . Those arguments contain information about any errors that occurred inside the with block. You can use asterisks in the same way as any of the built-in context managers: with asterisks (): print ( Context Managers Rock! ) ******************************** Context Managers Rock ! ********************************", "title": "CONTEXT MANAGER CLASSES" - }, + }, { - "location": "/advanced/Context_Managers/#accessing-the-context-inside-the-with-block", - "text": "If you need to get something back and use it inside the with block \u2013 such as a file descriptor \u2013 you simply return it from __enter__ : class myopen (): \n def __init__ ( self , filename , filemode ): \n self . filename = filename \n self . filemode = filemode \n\n def __enter__ ( self ): \n self . file = open ( self . filename , self . filemode ) \n return self . file \n\n def __exit__ ( self , exc_type , exc_val , exc_tb ): \n self . file . close () myopen works identically to the built-in open : with myopen ( beer.txt ) as b : \n guzzle_guzzle ( b )", + "location": "/advanced/Context_Managers/#accessing-the-context-inside-the-with-block", + "text": "If you need to get something back and use it inside the with block \u2013 such as a file descriptor \u2013 you simply return it from __enter__ : class myopen (): \n def __init__ ( self , filename , filemode ): \n self . filename = filename \n self . filemode = filemode \n\n def __enter__ ( self ): \n self . file = open ( self . filename , self . filemode ) \n return self . file \n\n def __exit__ ( self , exc_type , exc_val , exc_tb ): \n self . file . close () myopen works identically to the built-in open : with myopen ( beer.txt ) as b : \n guzzle_guzzle ( b )", "title": "ACCESSING THE CONTEXT INSIDE THE WITH BLOCK" - }, + }, { - "location": "/advanced/Context_Managers/#the-contextmanager-decorator", - "text": "Thankfully, you don\u2019t have to implement a class every time. The contextlib package has a contextmanager decorator that you can apply to generators to automatically transform them into context managers: from contextlib import contextmanager @contextmanager def spoiler (): \n print ( spoiler ) \n yield \n print ( /spoiler ) The code before yield corresponds to __enter__ and the code after yield corresponds to __exit__ . A context manager generator should have exactly one yield in it. It works the same as the class version: with spoiler (): print ( Jon Snow is Luke s father. ) spoiler Jon Snow is Luke s father. / spoiler", + "location": "/advanced/Context_Managers/#the-contextmanager-decorator", + "text": "Thankfully, you don\u2019t have to implement a class every time. The contextlib package has a contextmanager decorator that you can apply to generators to automatically transform them into context managers: from contextlib import contextmanager @contextmanager def spoiler (): \n print ( spoiler ) \n yield \n print ( /spoiler ) The code before yield corresponds to __enter__ and the code after yield corresponds to __exit__ . A context manager generator should have exactly one yield in it. It works the same as the class version: with spoiler (): print ( Jon Snow is Luke s father. ) spoiler Jon Snow is Luke s father. / spoiler", "title": "THE CONTEXTMANAGER DECORATOR" - }, + }, { - "location": "/advanced/Context_Managers/#roll-your-own-contextmanager-decorator", - "text": "The implementation in contextlib is complicated, but it\u2019s not hard to write something that works similarly with the exception of a few edge cases: def contextmanager ( gen ): \n class CMWrapper ( object ): \n def __init__ ( self , wrapped ): \n self . generator = wrapped \n\n def __enter__ ( self ): \n return next ( self . generator ) \n\n def __exit__ ( self , ex_type , value , traceback ): \n try : \n next ( self . generator ) \n except StopIteration : \n pass \n\n def inner ( * args , ** kwargs ): \n return CMWrapper ( gen ( * args , ** kwargs )) \n\n return inner It\u2019s not as robust as the real implementation, but it should be understandable. Here are the key points:\n- The inner function instantiates a copy of the nested CMWrapper class with a handle on the generator passed into the decorator. \n- __enter__ calls next() on the generator and returns the yielded value so it can be used in the with block. \n- __exit__ calls next() again and catches the StopIteration exception that the generator throws when it finishes. That\u2019s it for now. If you want to learn more about context managers, I recommend you take a look at the code for contextlib . Source: https://www.smallsurething.com/how-exactly-do-context-managers-work/", + "location": "/advanced/Context_Managers/#roll-your-own-contextmanager-decorator", + "text": "The implementation in contextlib is complicated, but it\u2019s not hard to write something that works similarly with the exception of a few edge cases: def contextmanager ( gen ): \n class CMWrapper ( object ): \n def __init__ ( self , wrapped ): \n self . generator = wrapped \n\n def __enter__ ( self ): \n return next ( self . generator ) \n\n def __exit__ ( self , ex_type , value , traceback ): \n try : \n next ( self . generator ) \n except StopIteration : \n pass \n\n def inner ( * args , ** kwargs ): \n return CMWrapper ( gen ( * args , ** kwargs )) \n\n return inner It\u2019s not as robust as the real implementation, but it should be understandable. Here are the key points:\n- The inner function instantiates a copy of the nested CMWrapper class with a handle on the generator passed into the decorator. \n- __enter__ calls next() on the generator and returns the yielded value so it can be used in the with block. \n- __exit__ calls next() again and catches the StopIteration exception that the generator throws when it finishes. That\u2019s it for now. If you want to learn more about context managers, I recommend you take a look at the code for contextlib . Source: https://www.smallsurething.com/how-exactly-do-context-managers-work/", "title": "ROLL YOUR OWN CONTEXTMANAGER DECORATOR" - }, + }, { - "location": "/advanced/Context_Managers/#python-context-managers-and-the-with-statement-enter-exit-video", - "text": "", + "location": "/advanced/Context_Managers/#python-context-managers-and-the-with-statement-enter-exit-video", + "text": "", "title": "Python Context Managers and the \"with\" Statement (enter & exit) VIDEO" - }, + }, { - "location": "/advanced/Python_Metaclasses/", - "text": "Quick Tip: What Is a Metaclass in Python\n\n\nThis quick tip gives a brief overview of what we mean by a metaclass in Python and shows some examples of the concept.\n\n\nBefore delving into this article, I should point out an important point \nabout classes in Python\n which makes it easier for us to grasp the concept of metaclasses.\n\n\nIs a Class an Object in Python?!\n\n\nIf you've used a programming language other than Python, the concept you understood about classes is most likely that it is a way used to create new objects. This is also true in Python, but Python even takes it one more step further\u2014classes are also considered objects!\n\n\nSo, if you created the following class in Python:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \npass\n\n\n\n\n\n\nThis simply means that an object with the name myClass has been created in memory. Since this object is able to create new objects, it is considered a class. This means we can apply object operations on classes in Python, as classes are objects themselves.\n\n\nWe can thus do operations on classes like assigning the class to a variable, as follows:\n\n\nclass_object\n \n=\n \nmyClass\n()\n\n\nprint\n \nclass_object\n\n\n\n\n\n\nWhich returns:\n\n\n__main__\n.\nmyClass\n \nobject\n \nat\n \n0x102623610\n\n\n\n\n\n\nYou can even pass the class \nmyClass\n as a parameter to a method, as follows:\n\n\ndef\n \nclass_object\n(\nobject\n):\n\n \nprint\n \nobject\n\n\n\nclass_object\n(\nmyClass\n)\n\n\n\n\n\n\nWhich returns the following output:\n\n\nclass\n \n__main__\n.\nmyClass\n\n\n\n\n\n\nIn addition to other operations you can normally apply on objects.\n\n\nMetaclasses\n\n\nMaybe you have come across the \ntype\n keyword in Python? You most likely used it to check the type of some object, as shown in the following examples:\n\n\nprint\n \ntype\n(\nabder\n)\n\n\nprint\n \ntype\n(\n100\n)\n\n\nprint\n \ntype\n(\n100.0\n)\n\n\nprint\n \ntype\n(\nint\n)\n\n\n\n\n\n\nIn which case you would get the following output:\n\n\ntype\n \nstr\n\n\ntype\n \nint\n\n\ntype\n \nfloat\n\n\ntype\n \ntype\n\n\n\n\n\n\nLooking at the output, everything seems pretty clear until you come to the type type. To see what this might mean, let's go back to our class we defined at the beginning of this article:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \npass\n\n\n\n\n\n\nNow, do the following:\n\n\nprint\n \ntype\n(\nmyClass\n)\n\n\n\n\n\n\nWhat would be the output of this statement? It will surprisingly be:\n\n\ntype\n \ntype\n\n\n\n\n\n\nSo, we can conclude that the type of classes in Python is \ntype\n!\n\n\nWhat is the relation between a \ntype\n and a \nmetaclass\n? Well, a \ntype\n is a \nmetaclass\n, provided that the default \nmetaclass\n is \ntype\n. I know this might be confusing, especially that type can be used to return the class of some object as shown above, but this is due to the backward compatibility in Python. So, if you write:\n\n\nprint\n \ntype\n(\ntype\n)\n\n\n\n\n\n\nYou will get:\n\n\ntype\n \ntype\n\n\n\n\n\n\nMeaning that a \ntype\n is a \ntype\n!\n\n\nThe term \nmetaclass\n simply means something used to create classes. In other words, it is the class of a class, meaning that the instance of a class in this case is a class. Thus, \ntype\n is considered a \nmetaclass\n since the instance of a \ntype\n is a class.\n\n\nFor instance, when we mentioned the following statement above:\n\n\nclass_object\n \n=\n \nmyClass\n()\n\n\n\n\n\n\nThis simply builds an object/instance of the class \nmyClass\n. In other words, we used a class to create an object. \n\n\nIn the same way, when we did the following:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \npass\n\n\n\n\n\n\nThe \nmetaclass\n was used to create the class \nmyClass\n (which is considered a \ntype\n). So, like the object being an instance of a class, a class is an instance of a \nmetaclass\n.\n\n\nUsing Metaclass to Create a Class\n\n\nIn this section, we are going to see how we can use a \nmetaclass\n to create a class, rather than using the \nclass\n statement as we saw in the classes and objects tutorial. As we saw above, the default \nmetaclass\n is \ntype\n. Thus, we can use the following statement to create a new class:\n\n\nnew_class\n \n=\n \ntype\n(\nmyClass\n,(),{})\n\n\n\n\n\n\nIf you want to make things simpler, you can assign the same class name myClass to the variable name.\n\n\nThe dictionary \n{ }\n here is used to define the attributes of the class. So, having the following statement:\n\n\nmyClass\n \n=\n \ntype\n(\nmyClass\n,(),{\na\n:\nTrue\n})\n\n\n\n\n\n\nIs similar to:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \na\n \n=\n \nTrue\n\n\n\n\n\n\nThe \nmetaclass\n Attribute\n\n\nSay that we created the class \nmyClass\n as follows:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \n__metaclass__\n \n=\n \nmyMetaClass\n\n \npass\n\n\n\n\n\n\nIn this case, class creation will occur using myMetaClass instead of type, as follows:\n\n\nmyClass\n \n=\n \nmyMetaClass\n(\nclassName\n,\n \nbases\n,\n \ndictionary\n)\n\n\n\n\n\n\nCreation and Initialization of a Metaclass\n\n\nIf you want to have control on how you create and initialize a class after its creation, you can simply use the metaclass \nnew\n method and \ninit\n constructor, respectively. So, when myMetaClass above is called, this is what will be happening behind the scenes:\n\n\nmyClass\n \n=\n \nmyMetaClass\n.\n__new__\n(\nmyMetaClass\n,\n \nname\n,\n \nbases\n,\n \ndictionary\n)\n\n\nmyMetaClass\n.\n__init__\n(\nmyClass\n,\n \nname\n,\n \nbases\n,\n \ndictionary\n)\n\n\n\n\n\n\n\n\nSource:\n \n\n\n https://code.tutsplus.com/tutorials/quick-tip-what-is-a-metaclass-in-python--cms-26016\n\n\n\n\n\n\nUnderstanding Python metaclasses from Ionelmc.ro\n\n\nA quick overview\n\n\nA high level explanation is necessary before we get down to the details.\n\n\nA class is an object, and just like any other object, it's an instance of something: a metaclass. The default metaclass is type. Unfortunately, due to backwards compatibility, type is a bit confusing: it can also be used as a function that return the class [13] of an object:\n\n\n \nclass\n \nFoobar\n:\n\n\n...\n \npass\n\n\n...\n\n\n \ntype\n(\nFoobar\n)\n\n\nclass\n \ntype\n\n\n \nfoo\n \n=\n \nFoobar\n()\n\n\n \ntype\n(\nfoo\n)\n\n\nclass\n \n__main__\n.\nFoobar\n\n\n\n\n\n\nIf you're familiar with the isinstance builtin then you'll know this:\n\n\n \nisinstance\n(\nfoo\n,\n \nFoobar\n)\n\n\nTrue\n\n\n \nisinstance\n(\nFoobar\n,\n \ntype\n)\n\n\nTrue\n\n\n\n\n\n\nTo put this in picture:\n\n\n \n\n\nBut lets go back to making classes ...\n\n\nSimple metaclass use\n\n\nWe can use type directly to make a class, without any class statement:\n\n\n \nMyClass\n \n=\n \ntype\n(\nMyClass\n,\n \n(),\n \n{})\n\n\n \nMyClass\n\n\nclass\n \n__main__\n.\nMyClass\n\n\n\n\n\n\nThe class statement isn't just syntactic sugar, it does some extra things, like setting an adequate \nqualname\n and \ndoc\n properties or calling \nprepare\n.\n\n\nWe can make a custom metaclass:\n\n\n \nclass\n \nMeta\n(\ntype\n):\n\n\n...\n \npass\n\n\n\n\n\n\nAnd then we can use it :\n\n\n \nclass\n \nComplex\n(\nmetaclass\n=\nMeta\n):\n\n\n...\n \npass\n\n\n \ntype\n(\nComplex\n)\n\n\nclass\n \n__main__\n.\nMeta\n\n\n\n\n\n\nNow we got a rough idea of what we'll be dealing with ...\n\n\nMagic methods\n\n\nOne distinctive feature of Python is magic methods: they allow the programmer to override behavior for various operators and behavior of objects. To override the call operator you'd do this:\n\n\n \nclass\n \nFunky\n:\n\n\n...\n \ndef\n \n__call__\n(\nself\n):\n\n\n...\n \nprint\n(\nLook at me, I work like a function!\n)\n\n\n \nf\n \n=\n \nFunky\n()\n\n\n \nf\n()\n\n\nLook\n \nat\n \nme\n,\n \nI\n \nwork\n \nlike\n \na\n \nfunction\n!\n\n\n\n\n\n\nMetaclasses rely on several magic methods so it's quite useful to know a bit more about them.\n\n\nThe slots\n\n\nWhen you define a magic method in your class the function will end up as a pointer in a struct that describes the class, in addition to the entry in \ndict\n. That struct [7] has a field for each magic method. For some reason these fields are called type slots.\n\n\nNow there's another feature, implemented via the \nslots\n attribute. A class with \nslots\n will create instances that don't have a \ndict\n (they use a little bit less memory). A side-effect of this is that instances cannot have other fields than what was specified in \nslots\n: if you try to set an unexpected field you'll get an exception.\n\n\nFor the scope of this article when slots are mentioned it will mean the type slots, not \nslots\n.\n\n\nObject attribute lookup\n\n\nNow this is something that's easy to get wrong because of the many slight differences to old-style objects in Python 2. \n\n\nAssuming Class is the class and instance is an instance of Class, evaluating instance.foobar roughly equates to this:\n\n\n\n\nCall the type slot for Class.\ngetattribute\n (tp_getattro). The default does this: \n\n\nDoes Class.\ndict\n have a foobar item that is a data descriptor ? \n\n\nIf yes, return the result of Class.\ndict\n['foobar'].\nget\n(instance, Class). \n\n\n\n\n\n\nDoes instance.\ndict\n have a foobar item in it? \n\n\nIf yes, return instance.\ndict\n['foobar']. \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item that is not a data descriptor ? \n\n\nIf yes, return the result of Class.\ndict\n['foobar'].\nget\n(instance, klass). \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item ? \n\n\nIf yes, return the result of Class.\ndict\n['foobar']. \n\n\n\n\n\n\n\n\n\n\nIf the attribute still wasn't found, and there's a Class.\ngetattr\n, call Class.\ngetattr\n('foobar').\n\n\n\n\nStill not clear? Perhaps a diagram normal attribute lookup helps:\n\n\n\n\n\nTo avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.\n\n\n\n\nClass attribute lookup\n\n\nBecause classes needs to be able support the classmethod and staticmethod properties [6] when you evaluate something like Class.foobar the lookup is slightly different than what would happen when you evaluate instance.foobar.\n\n\nAssuming Class is an instance of Metaclass, evaluating Class.foobar roughly equates to this:\n\n\n\n\nCall the type slot for Metaclass.\ngetattribute\n (tp_getattro). The default does this: \n\n\nDoes Metaclass.\ndict\n have a foobar item that is a data descriptor ?\n\n\nIf yes, return the result of Metaclass.\ndict\n['foobar'].\nget\n(Class, Metaclass). \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item that is a descriptor (of any kind)?\n\n\nIf yes, return the result of Class.\ndict\n['foobar'].\nget\n(None, Class). \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item in it?\n\n\nIf yes, return Class.\ndict\n['foobar'].\n\n\n\n\n\n\nDoes Metaclass.\ndict\n have a foobar item that is not a data descriptor ?\n\n\nIf yes, return the result of Metaclass.\ndict\n['foobar'].\nget\n(Class, Metaclass).\n\n\n\n\n\n\nDoes Metaclass.\ndict\n have any foobar item?\n\n\nIf yes, return Metaclass.\ndict\n['foobar'].\n\n\n\n\n\n\n\n\n\n\nIf the attribute still wasn't found, and there's a Metaclass.\ngetattr\n, call Metaclass.\ngetattr\n('foobar').\n\n\n\n\nThe whole shebang would look like this in a diagram:\n\n\n\n\n\nTo avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.\n\n\n\n\nMagic method lookup\n\n\nFor magic methods the lookup is done on the class, directly in the big struct with the slots:\n\n\n\n\nDoes the object's class have a slot for that magic method (roughly object-\nob_type-\ntp_\n in C code)? If yes, use it. If it's NULL then the operation is not supported.\n\n\n\n\n\n\nIn C internals parlance:\n - object-\nob_type is the class of the object. \n\n - ob_type-\ntp_\n is the type slot.\n\n\n\n\nThis looks much simpler, however, the type slots are filled with wrappers around your functions, so descriptors work as expected:\n\n\n \nclass\n \nMagic\n:\n\n\n...\n \n@property\n\n\n...\n \ndef\n \n__repr__\n(\nself\n):\n\n\n...\n \ndef\n \ninner\n():\n\n\n...\n \nreturn\n \nIt works!\n\n\n...\n \nreturn\n \ninner\n\n\n...\n\n\n \nrepr\n(\nMagic\n())\n\n\nIt works!\n\n\n\n\n\n\nThats it. Does that mean there are places that don't follow those rules and lookup the slot differently? Sadly yes, read on ...\n\n\nThe \nnew\n method\n\n\nOne of the most common point of confusion with both classes and metaclasses is the \nnew\n method. It has some very special conventions.\n\n\nThe \nnew\n method is the constructor (it returns the new instance) while \ninit\n is just a initializer (the instance is already created when \ninit\n is called).\n\n\nSuppose have a class like this:\n\n\nclass\n \nFoobar\n:\n\n \ndef\n \n__new__\n(\ncls\n):\n\n \nreturn\n \nsuper\n()\n.\n__new__\n(\ncls\n)\n\n\n\n\n\n\nNow if you recall the previous section, you'd expect that __new__ would be looked up on the metaclass, but alas, it wouldn't be so useful that way so it's looked up statically.\n\n\nWhen the Foobar class wants this magic method it will be looked up on the same object (the class), not on a upper level like all the other magic methods. This is very important to understand, because both the class and the metaclass can define this method:\n\n\n\n\nFoobar.__new__ is used to create instances of Foobar\n\n\ntype.__new__ is used to create the Foobar class (an instance of type in the example)\n\n\n\n\nThe \nprepare\n method\n\n\nThis method is called before the class body is executed and it must return a dictionary-like object that's used as the local namespace for all the code from the class body. It was added in Python 3.0, see \nPEP-3115\n.\n\n\nIf your __prepare__ returns an object x then this:\n\n\nclass\n \nClass\n(\nmetaclass\n=\nMeta\n):\n\n \na\n \n=\n \n1\n\n \nb\n \n=\n \n2\n\n \nc\n \n=\n \n3\n\n\n\n\n\n\nWill make the following changes to x:\n\n\nx\n[\na\n]\n \n=\n \n1\n\n\nx\n[\nb\n]\n \n=\n \n2\n\n\nx\n[\nc\n]\n \n=\n \n3\n\n\n\n\n\n\nThis x object needs to look like a dictionary. Note that this x object will end up as an argument to Metaclass.__new\n and if it's not an instance of dict you need to convert it before calling super().__new\n.\n\n\nInterestingly enough this method doesn't have __new__'s special lookup. It appears it doesn't have it's own type slot and it's looked up via the class attribute lookup, if you read back a bit. \n\n\nPutting it all together\n\n\nTo start things off, a diagram of how instances are constructed:\n\n\n\nHow to read this swim lane diagram: \n\n\n\n\nThe horizontal lanes is the place where you define the functions.\n\n\nSolid lines mean a function call.\n\n\nA line from Metaclass.__call\n to Class.__new\n means Metaclass.__call\n will call Class.__new\n.\n\n\n\n\n\n\nDashed lines means something is returned.\n\n\nClass.\nnew\n returns the instance of Class.\n\n\nMetaclass.\ncall\n returns whatever Class.\nnew\n returned (and if it returned an instance of Class it will also call Class.\ninit\n on it). \n\n\n\n\n\n\nThe number in the red circle signifies the call order.\n\n\n\n\nCreating a class is quite similar:\n\n\n\nFew more notes:\n- Metaclass.\nprepare\n just returns the namespace object (a dictionary-like object as explained before).\n- Metaclass.\nnew\n returns the Class object.\n- MetaMetaclass.\ncall\n returns whatever Metaclass.\nnew\n returned (and if it returned an instance of Metaclass it will also call Metaclass.\ninit\n on it). \n\n\nSo you see, metaclasses allow you to customize almost every part of an object life-cycle.\n\n\nMetaclasses are callables\n\n\nIf you look again at the diagrams, you'll notice that making an instance goes through Metaclass.\ncall\n. This means you can use any callable as the metaclass:\n\n\n \nclass\n \nFoo\n(\nmetaclass\n=\nprint\n):\n \n# pointless, but illustrative\n\n\n...\n \npass\n\n\n...\n\n\nFoo\n \n()\n \n{\n__module__\n:\n \n__main__\n,\n \n__qualname__\n:\n \nFoo\n}\n\n\n \nprint\n(\nFoo\n)\n\n\nNone\n\n\n\n\n\n\nIf you use a function as the metaclass then subclasses won't inherit your function metaclass, but the type of whatever that function returned.\n\n\nSubclasses inherit the metaclass\n\n\nOne advantage compared to class decorators is the fact that subclasses inherit the metaclass.\n\n\nThis is a consequence of the fact that Metaclass(...) returns an object which usually has Metaclass as the \nclass\n.\n\n\nRestrictions with multiple metaclasses\n\n\nIn the same tone of classes allowing you to have multiple baseclasses, each one of those baseclasses may have a different metaclass. But with a twist: everything has to be linear - the inheritance tree must have a single leaf.\n\n\nFor example, this is not accepted because there would be two leafs (Meta1 and Meta2):\n\n\n \nclass\n \nMeta1\n(\ntype\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nMeta2\n(\ntype\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase1\n(\nmetaclass\n=\nMeta1\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase2\n(\nmetaclass\n=\nMeta2\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nFoobar\n(\nBase1\n,\n \nBase2\n):\n\n\n...\n \npass\n\n\n...\n\n\nTraceback\n \n(\nmost\n \nrecent\n \ncall\n \nlast\n):\n\n \nFile\n \nstdin\n,\n \nline\n \n1\n,\n \nin\n \nmodule\n\n\nTypeError\n:\n \nmetaclass\n \nconflict\n:\n \nthe\n \nmetaclass\n \nof\n \na\n \nderived\n \nclass\n \nmust\n \nbe\n \na\n \n(\nnon\n-\nstrict\n)\n \nsubclass\n \nof\n \nthe\n \nmetaclasses\n \nof\n \nall\n \nits\n \nbases\n\n\n\n\n\n\nThis will work (and will use the leaf as the metaclass):\n\n\n \nclass\n \nMeta\n(\ntype\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nSubMeta\n(\nMeta\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase1\n(\nmetaclass\n=\nMeta\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase2\n(\nmetaclass\n=\nSubMeta\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nFoobar\n(\nBase1\n,\n \nBase2\n):\n\n\n...\n \npass\n\n\n...\n\n\n \ntype\n(\nFoobar\n)\n\n\nclass\n \n__main__\n.\nSubMeta\n\n\n\n\n\n\nThe method signatures\n\n\nThere are still few important details missing, like the method signatures. Lets look at class and metaclass with all the important stuff implemented.\n\n\nNote the extra **kwargs - those are the extra keywords arguments you can pass in the class statement. \n\n\n \nclass\n \nMeta\n(\ntype\n):\n\n\n...\n \n@classmethod\n\n\n...\n \ndef\n \n__prepare__\n(\nmcs\n,\n \nname\n,\n \nbases\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__prepare__(mcs=\n%s\n, name=\n%r\n, bases=\n%s\n, **\n%s\n)\n \n%\n \n(\n\n\n...\n \nmcs\n,\n \nname\n,\n \nbases\n,\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \n{}\n\n\n\n\n\n\nAs mentioned before, __prepare\n can return objects that are not dict instances, so you need to make sure your __new\n handles that.\n\n\n...\n \ndef\n \n__new__\n(\nmcs\n,\n \nname\n,\n \nbases\n,\n \nattrs\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__new__(mcs=\n%s\n, name=\n%r\n, bases=\n%s\n, attrs=[\n%s\n], **\n%s\n)\n \n%\n \n(\n\n\n...\n \nmcs\n,\n \nname\n,\n \nbases\n,\n \n, \n.\njoin\n(\nattrs\n),\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__new__\n(\nmcs\n,\n \nname\n,\n \nbases\n,\n \nattrs\n)\n\n\n\n\n\n\nIt's uncommon to see \ninit\n being implemented in a metaclass because it's not that powerful - the class is already constructed when \ninit\n is called. It roughly equates to having a class decorator with the difference that \ninit\n would get run when making subclasses, while class decorators are not called for subclasses.\n\n\n...\n \ndef\n \n__init__\n(\ncls\n,\n \nname\n,\n \nbases\n,\n \nattrs\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__init__(cls=\n%s\n, name=\n%r\n, bases=\n%s\n, attrs=[\n%s\n], **\n%s\n)\n \n%\n \n(\n\n\n...\n \ncls\n,\n \nname\n,\n \nbases\n,\n \n, \n.\njoin\n(\nattrs\n),\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__init__\n(\nname\n,\n \nbases\n,\n \nattrs\n)\n\n\n\n\n\n\nThe __call__ method will be called when you make instances of Class.\n\n\n...\n \ndef\n \n__call__\n(\ncls\n,\n \n*\nargs\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__call__(cls=\n%s\n, args=\n%s\n, kwargs=\n%s\n)\n \n%\n \n(\n\n\n...\n \ncls\n,\n \nargs\n,\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__call__\n(\n*\nargs\n,\n \n**\nkwargs\n)\n\n\n...\n\n\n\n\n\n\nUsing Meta, note the extra=1: \n\n\n \nclass\n \nClass\n(\nmetaclass\n=\nMeta\n,\n \nextra\n=\n1\n):\n\n\n...\n \ndef\n \n__new__\n(\ncls\n,\n \nmyarg\n):\n\n\n...\n \nprint\n(\n Class.__new__(cls=\n%s\n, myarg=\n%s\n)\n \n%\n \n(\n\n\n...\n \ncls\n,\n \nmyarg\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__new__\n(\ncls\n)\n\n\n...\n\n\n...\n \ndef\n \n__init__\n(\nself\n,\n \nmyarg\n):\n\n\n...\n \nprint\n(\n Class.__init__(self=\n%s\n, myarg=\n%s\n)\n \n%\n \n(\n\n\n...\n \nself\n,\n \nmyarg\n\n\n...\n \n))\n\n\n...\n \nself\n.\nmyarg\n \n=\n \nmyarg\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__init__\n()\n\n\n...\n\n\n...\n \ndef\n \n__str__\n(\nself\n):\n\n\n...\n \nreturn\n \ninstance of Class; myargs=\n%s\n \n%\n \n(\n\n\n...\n \ngetattr\n(\nself\n,\n \nmyarg\n,\n \nMISSING\n),\n\n\n...\n \n)\n\n \nMeta\n.\n__prepare__\n(\nmcs\n=\nclass\n \n__main__\n.\nMeta\n, name=\nClass\n, bases=(),\n\n \n**\n{\nextra\n:\n \n1\n})\n\n \nMeta\n.\n__new__\n(\nmcs\n=\nclass\n \n__main__\n.\nMeta\n, name=\nClass\n, bases=(),\n\n \nattrs\n=\n[\n__qualname__\n,\n \n__new__\n,\n \n__init__\n,\n \n__str__\n,\n \n__module__\n],\n\n \n**\n{\nextra\n:\n \n1\n})\n\n \nMeta\n.\n__init__\n(\ncls\n=\nclass\n \n__main__\n.\nClass\n, name=\nClass\n, bases=(),\n\n \nattrs\n=\n[\n__qualname__\n,\n \n__new__\n,\n \n__init__\n,\n \n__str__\n,\n \n__module__\n],\n\n \n**\n{\nextra\n:\n \n1\n})\n\n\n\n\n\n\nNote that Meta.__call__ is called when we make instance of Class:\n\n\n \nClass\n(\n1\n)\n\n \nMeta\n.\n__call__\n(\ncls\n=\nclass\n \n__main__\n.\nClass\n, args=(1,), kwargs={})\n\n \nClass\n.\n__new__\n(\ncls\n=\nclass\n \n__main__\n.\nClass\n, myarg=1)\n\n \nClass\n.\n__init__\n(\nself\n=\ninstance\n \nof\n \nClass\n;\n \nmyargs\n=\nMISSING\n,\n \nmyarg\n=\n1\n)\n\n\ninstance\n \nof\n \nClass\n;\n \nmyargs\n=\n1\n\n\n\n\n\n\n\n\nSource:\n \n\n\n https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/", + "location": "/advanced/Python_Metaclasses/", + "text": "Quick Tip: What Is a Metaclass in Python\n\n\nThis quick tip gives a brief overview of what we mean by a metaclass in Python and shows some examples of the concept.\n\n\nBefore delving into this article, I should point out an important point \nabout classes in Python\n which makes it easier for us to grasp the concept of metaclasses.\n\n\nIs a Class an Object in Python?!\n\n\nIf you've used a programming language other than Python, the concept you understood about classes is most likely that it is a way used to create new objects. This is also true in Python, but Python even takes it one more step further\u2014classes are also considered objects!\n\n\nSo, if you created the following class in Python:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \npass\n\n\n\n\n\n\nThis simply means that an object with the name myClass has been created in memory. Since this object is able to create new objects, it is considered a class. This means we can apply object operations on classes in Python, as classes are objects themselves.\n\n\nWe can thus do operations on classes like assigning the class to a variable, as follows:\n\n\nclass_object\n \n=\n \nmyClass\n()\n\n\nprint\n \nclass_object\n\n\n\n\n\n\nWhich returns:\n\n\n__main__\n.\nmyClass\n \nobject\n \nat\n \n0x102623610\n\n\n\n\n\n\nYou can even pass the class \nmyClass\n as a parameter to a method, as follows:\n\n\ndef\n \nclass_object\n(\nobject\n):\n\n \nprint\n \nobject\n\n\n\nclass_object\n(\nmyClass\n)\n\n\n\n\n\n\nWhich returns the following output:\n\n\nclass\n \n__main__\n.\nmyClass\n\n\n\n\n\n\nIn addition to other operations you can normally apply on objects.\n\n\nMetaclasses\n\n\nMaybe you have come across the \ntype\n keyword in Python? You most likely used it to check the type of some object, as shown in the following examples:\n\n\nprint\n \ntype\n(\nabder\n)\n\n\nprint\n \ntype\n(\n100\n)\n\n\nprint\n \ntype\n(\n100.0\n)\n\n\nprint\n \ntype\n(\nint\n)\n\n\n\n\n\n\nIn which case you would get the following output:\n\n\ntype\n \nstr\n\n\ntype\n \nint\n\n\ntype\n \nfloat\n\n\ntype\n \ntype\n\n\n\n\n\n\nLooking at the output, everything seems pretty clear until you come to the type type. To see what this might mean, let's go back to our class we defined at the beginning of this article:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \npass\n\n\n\n\n\n\nNow, do the following:\n\n\nprint\n \ntype\n(\nmyClass\n)\n\n\n\n\n\n\nWhat would be the output of this statement? It will surprisingly be:\n\n\ntype\n \ntype\n\n\n\n\n\n\nSo, we can conclude that the type of classes in Python is \ntype\n!\n\n\nWhat is the relation between a \ntype\n and a \nmetaclass\n? Well, a \ntype\n is a \nmetaclass\n, provided that the default \nmetaclass\n is \ntype\n. I know this might be confusing, especially that type can be used to return the class of some object as shown above, but this is due to the backward compatibility in Python. So, if you write:\n\n\nprint\n \ntype\n(\ntype\n)\n\n\n\n\n\n\nYou will get:\n\n\ntype\n \ntype\n\n\n\n\n\n\nMeaning that a \ntype\n is a \ntype\n!\n\n\nThe term \nmetaclass\n simply means something used to create classes. In other words, it is the class of a class, meaning that the instance of a class in this case is a class. Thus, \ntype\n is considered a \nmetaclass\n since the instance of a \ntype\n is a class.\n\n\nFor instance, when we mentioned the following statement above:\n\n\nclass_object\n \n=\n \nmyClass\n()\n\n\n\n\n\n\nThis simply builds an object/instance of the class \nmyClass\n. In other words, we used a class to create an object. \n\n\nIn the same way, when we did the following:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \npass\n\n\n\n\n\n\nThe \nmetaclass\n was used to create the class \nmyClass\n (which is considered a \ntype\n). So, like the object being an instance of a class, a class is an instance of a \nmetaclass\n.\n\n\nUsing Metaclass to Create a Class\n\n\nIn this section, we are going to see how we can use a \nmetaclass\n to create a class, rather than using the \nclass\n statement as we saw in the classes and objects tutorial. As we saw above, the default \nmetaclass\n is \ntype\n. Thus, we can use the following statement to create a new class:\n\n\nnew_class\n \n=\n \ntype\n(\nmyClass\n,(),{})\n\n\n\n\n\n\nIf you want to make things simpler, you can assign the same class name myClass to the variable name.\n\n\nThe dictionary \n{ }\n here is used to define the attributes of the class. So, having the following statement:\n\n\nmyClass\n \n=\n \ntype\n(\nmyClass\n,(),{\na\n:\nTrue\n})\n\n\n\n\n\n\nIs similar to:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \na\n \n=\n \nTrue\n\n\n\n\n\n\nThe \nmetaclass\n Attribute\n\n\nSay that we created the class \nmyClass\n as follows:\n\n\nclass\n \nmyClass\n(\nobject\n):\n\n \n__metaclass__\n \n=\n \nmyMetaClass\n\n \npass\n\n\n\n\n\n\nIn this case, class creation will occur using myMetaClass instead of type, as follows:\n\n\nmyClass\n \n=\n \nmyMetaClass\n(\nclassName\n,\n \nbases\n,\n \ndictionary\n)\n\n\n\n\n\n\nCreation and Initialization of a Metaclass\n\n\nIf you want to have control on how you create and initialize a class after its creation, you can simply use the metaclass \nnew\n method and \ninit\n constructor, respectively. So, when myMetaClass above is called, this is what will be happening behind the scenes:\n\n\nmyClass\n \n=\n \nmyMetaClass\n.\n__new__\n(\nmyMetaClass\n,\n \nname\n,\n \nbases\n,\n \ndictionary\n)\n\n\nmyMetaClass\n.\n__init__\n(\nmyClass\n,\n \nname\n,\n \nbases\n,\n \ndictionary\n)\n\n\n\n\n\n\n\n\nSource:\n \n\n\n https://code.tutsplus.com/tutorials/quick-tip-what-is-a-metaclass-in-python--cms-26016\n\n\n\n\n\n\nUnderstanding Python metaclasses from Ionelmc.ro\n\n\nA quick overview\n\n\nA high level explanation is necessary before we get down to the details.\n\n\nA class is an object, and just like any other object, it's an instance of something: a metaclass. The default metaclass is type. Unfortunately, due to backwards compatibility, type is a bit confusing: it can also be used as a function that return the class [13] of an object:\n\n\n \nclass\n \nFoobar\n:\n\n\n...\n \npass\n\n\n...\n\n\n \ntype\n(\nFoobar\n)\n\n\nclass\n \ntype\n\n\n \nfoo\n \n=\n \nFoobar\n()\n\n\n \ntype\n(\nfoo\n)\n\n\nclass\n \n__main__\n.\nFoobar\n\n\n\n\n\n\nIf you're familiar with the isinstance builtin then you'll know this:\n\n\n \nisinstance\n(\nfoo\n,\n \nFoobar\n)\n\n\nTrue\n\n\n \nisinstance\n(\nFoobar\n,\n \ntype\n)\n\n\nTrue\n\n\n\n\n\n\nTo put this in picture:\n\n\n \n\n\nBut lets go back to making classes ...\n\n\nSimple metaclass use\n\n\nWe can use type directly to make a class, without any class statement:\n\n\n \nMyClass\n \n=\n \ntype\n(\nMyClass\n,\n \n(),\n \n{})\n\n\n \nMyClass\n\n\nclass\n \n__main__\n.\nMyClass\n\n\n\n\n\n\nThe class statement isn't just syntactic sugar, it does some extra things, like setting an adequate \nqualname\n and \ndoc\n properties or calling \nprepare\n.\n\n\nWe can make a custom metaclass:\n\n\n \nclass\n \nMeta\n(\ntype\n):\n\n\n...\n \npass\n\n\n\n\n\n\nAnd then we can use it :\n\n\n \nclass\n \nComplex\n(\nmetaclass\n=\nMeta\n):\n\n\n...\n \npass\n\n\n \ntype\n(\nComplex\n)\n\n\nclass\n \n__main__\n.\nMeta\n\n\n\n\n\n\nNow we got a rough idea of what we'll be dealing with ...\n\n\nMagic methods\n\n\nOne distinctive feature of Python is magic methods: they allow the programmer to override behavior for various operators and behavior of objects. To override the call operator you'd do this:\n\n\n \nclass\n \nFunky\n:\n\n\n...\n \ndef\n \n__call__\n(\nself\n):\n\n\n...\n \nprint\n(\nLook at me, I work like a function!\n)\n\n\n \nf\n \n=\n \nFunky\n()\n\n\n \nf\n()\n\n\nLook\n \nat\n \nme\n,\n \nI\n \nwork\n \nlike\n \na\n \nfunction\n!\n\n\n\n\n\n\nMetaclasses rely on several magic methods so it's quite useful to know a bit more about them.\n\n\nThe slots\n\n\nWhen you define a magic method in your class the function will end up as a pointer in a struct that describes the class, in addition to the entry in \ndict\n. That struct [7] has a field for each magic method. For some reason these fields are called type slots.\n\n\nNow there's another feature, implemented via the \nslots\n attribute. A class with \nslots\n will create instances that don't have a \ndict\n (they use a little bit less memory). A side-effect of this is that instances cannot have other fields than what was specified in \nslots\n: if you try to set an unexpected field you'll get an exception.\n\n\nFor the scope of this article when slots are mentioned it will mean the type slots, not \nslots\n.\n\n\nObject attribute lookup\n\n\nNow this is something that's easy to get wrong because of the many slight differences to old-style objects in Python 2. \n\n\nAssuming Class is the class and instance is an instance of Class, evaluating instance.foobar roughly equates to this:\n\n\n\n\nCall the type slot for Class.\ngetattribute\n (tp_getattro). The default does this: \n\n\nDoes Class.\ndict\n have a foobar item that is a data descriptor ? \n\n\nIf yes, return the result of Class.\ndict\n['foobar'].\nget\n(instance, Class). \n\n\n\n\n\n\nDoes instance.\ndict\n have a foobar item in it? \n\n\nIf yes, return instance.\ndict\n['foobar']. \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item that is not a data descriptor ? \n\n\nIf yes, return the result of Class.\ndict\n['foobar'].\nget\n(instance, klass). \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item ? \n\n\nIf yes, return the result of Class.\ndict\n['foobar']. \n\n\n\n\n\n\n\n\n\n\nIf the attribute still wasn't found, and there's a Class.\ngetattr\n, call Class.\ngetattr\n('foobar').\n\n\n\n\nStill not clear? Perhaps a diagram normal attribute lookup helps:\n\n\n\n\n\nTo avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.\n\n\n\n\nClass attribute lookup\n\n\nBecause classes needs to be able support the classmethod and staticmethod properties [6] when you evaluate something like Class.foobar the lookup is slightly different than what would happen when you evaluate instance.foobar.\n\n\nAssuming Class is an instance of Metaclass, evaluating Class.foobar roughly equates to this:\n\n\n\n\nCall the type slot for Metaclass.\ngetattribute\n (tp_getattro). The default does this: \n\n\nDoes Metaclass.\ndict\n have a foobar item that is a data descriptor ?\n\n\nIf yes, return the result of Metaclass.\ndict\n['foobar'].\nget\n(Class, Metaclass). \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item that is a descriptor (of any kind)?\n\n\nIf yes, return the result of Class.\ndict\n['foobar'].\nget\n(None, Class). \n\n\n\n\n\n\nDoes Class.\ndict\n have a foobar item in it?\n\n\nIf yes, return Class.\ndict\n['foobar'].\n\n\n\n\n\n\nDoes Metaclass.\ndict\n have a foobar item that is not a data descriptor ?\n\n\nIf yes, return the result of Metaclass.\ndict\n['foobar'].\nget\n(Class, Metaclass).\n\n\n\n\n\n\nDoes Metaclass.\ndict\n have any foobar item?\n\n\nIf yes, return Metaclass.\ndict\n['foobar'].\n\n\n\n\n\n\n\n\n\n\nIf the attribute still wasn't found, and there's a Metaclass.\ngetattr\n, call Metaclass.\ngetattr\n('foobar').\n\n\n\n\nThe whole shebang would look like this in a diagram:\n\n\n\n\n\nTo avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.\n\n\n\n\nMagic method lookup\n\n\nFor magic methods the lookup is done on the class, directly in the big struct with the slots:\n\n\n\n\nDoes the object's class have a slot for that magic method (roughly object-\nob_type-\ntp_\n in C code)? If yes, use it. If it's NULL then the operation is not supported.\n\n\n\n\n\n\nIn C internals parlance:\n - object-\nob_type is the class of the object. \n\n - ob_type-\ntp_\n is the type slot.\n\n\n\n\nThis looks much simpler, however, the type slots are filled with wrappers around your functions, so descriptors work as expected:\n\n\n \nclass\n \nMagic\n:\n\n\n...\n \n@property\n\n\n...\n \ndef\n \n__repr__\n(\nself\n):\n\n\n...\n \ndef\n \ninner\n():\n\n\n...\n \nreturn\n \nIt works!\n\n\n...\n \nreturn\n \ninner\n\n\n...\n\n\n \nrepr\n(\nMagic\n())\n\n\nIt works!\n\n\n\n\n\n\nThats it. Does that mean there are places that don't follow those rules and lookup the slot differently? Sadly yes, read on ...\n\n\nThe \nnew\n method\n\n\nOne of the most common point of confusion with both classes and metaclasses is the \nnew\n method. It has some very special conventions.\n\n\nThe \nnew\n method is the constructor (it returns the new instance) while \ninit\n is just a initializer (the instance is already created when \ninit\n is called).\n\n\nSuppose have a class like this:\n\n\nclass\n \nFoobar\n:\n\n \ndef\n \n__new__\n(\ncls\n):\n\n \nreturn\n \nsuper\n()\n.\n__new__\n(\ncls\n)\n\n\n\n\n\n\nNow if you recall the previous section, you'd expect that __new__ would be looked up on the metaclass, but alas, it wouldn't be so useful that way so it's looked up statically.\n\n\nWhen the Foobar class wants this magic method it will be looked up on the same object (the class), not on a upper level like all the other magic methods. This is very important to understand, because both the class and the metaclass can define this method:\n\n\n\n\nFoobar.__new__ is used to create instances of Foobar\n\n\ntype.__new__ is used to create the Foobar class (an instance of type in the example)\n\n\n\n\nThe \nprepare\n method\n\n\nThis method is called before the class body is executed and it must return a dictionary-like object that's used as the local namespace for all the code from the class body. It was added in Python 3.0, see \nPEP-3115\n.\n\n\nIf your __prepare__ returns an object x then this:\n\n\nclass\n \nClass\n(\nmetaclass\n=\nMeta\n):\n\n \na\n \n=\n \n1\n\n \nb\n \n=\n \n2\n\n \nc\n \n=\n \n3\n\n\n\n\n\n\nWill make the following changes to x:\n\n\nx\n[\na\n]\n \n=\n \n1\n\n\nx\n[\nb\n]\n \n=\n \n2\n\n\nx\n[\nc\n]\n \n=\n \n3\n\n\n\n\n\n\nThis x object needs to look like a dictionary. Note that this x object will end up as an argument to Metaclass.__new\n and if it's not an instance of dict you need to convert it before calling super().__new\n.\n\n\nInterestingly enough this method doesn't have __new__'s special lookup. It appears it doesn't have it's own type slot and it's looked up via the class attribute lookup, if you read back a bit. \n\n\nPutting it all together\n\n\nTo start things off, a diagram of how instances are constructed:\n\n\n\nHow to read this swim lane diagram: \n\n\n\n\nThe horizontal lanes is the place where you define the functions.\n\n\nSolid lines mean a function call.\n\n\nA line from Metaclass.__call\n to Class.__new\n means Metaclass.__call\n will call Class.__new\n.\n\n\n\n\n\n\nDashed lines means something is returned.\n\n\nClass.\nnew\n returns the instance of Class.\n\n\nMetaclass.\ncall\n returns whatever Class.\nnew\n returned (and if it returned an instance of Class it will also call Class.\ninit\n on it). \n\n\n\n\n\n\nThe number in the red circle signifies the call order.\n\n\n\n\nCreating a class is quite similar:\n\n\n\nFew more notes:\n- Metaclass.\nprepare\n just returns the namespace object (a dictionary-like object as explained before).\n- Metaclass.\nnew\n returns the Class object.\n- MetaMetaclass.\ncall\n returns whatever Metaclass.\nnew\n returned (and if it returned an instance of Metaclass it will also call Metaclass.\ninit\n on it). \n\n\nSo you see, metaclasses allow you to customize almost every part of an object life-cycle.\n\n\nMetaclasses are callables\n\n\nIf you look again at the diagrams, you'll notice that making an instance goes through Metaclass.\ncall\n. This means you can use any callable as the metaclass:\n\n\n \nclass\n \nFoo\n(\nmetaclass\n=\nprint\n):\n \n# pointless, but illustrative\n\n\n...\n \npass\n\n\n...\n\n\nFoo\n \n()\n \n{\n__module__\n:\n \n__main__\n,\n \n__qualname__\n:\n \nFoo\n}\n\n\n \nprint\n(\nFoo\n)\n\n\nNone\n\n\n\n\n\n\nIf you use a function as the metaclass then subclasses won't inherit your function metaclass, but the type of whatever that function returned.\n\n\nSubclasses inherit the metaclass\n\n\nOne advantage compared to class decorators is the fact that subclasses inherit the metaclass.\n\n\nThis is a consequence of the fact that Metaclass(...) returns an object which usually has Metaclass as the \nclass\n.\n\n\nRestrictions with multiple metaclasses\n\n\nIn the same tone of classes allowing you to have multiple baseclasses, each one of those baseclasses may have a different metaclass. But with a twist: everything has to be linear - the inheritance tree must have a single leaf.\n\n\nFor example, this is not accepted because there would be two leafs (Meta1 and Meta2):\n\n\n \nclass\n \nMeta1\n(\ntype\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nMeta2\n(\ntype\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase1\n(\nmetaclass\n=\nMeta1\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase2\n(\nmetaclass\n=\nMeta2\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nFoobar\n(\nBase1\n,\n \nBase2\n):\n\n\n...\n \npass\n\n\n...\n\n\nTraceback\n \n(\nmost\n \nrecent\n \ncall\n \nlast\n):\n\n \nFile\n \nstdin\n,\n \nline\n \n1\n,\n \nin\n \nmodule\n\n\nTypeError\n:\n \nmetaclass\n \nconflict\n:\n \nthe\n \nmetaclass\n \nof\n \na\n \nderived\n \nclass\n \nmust\n \nbe\n \na\n \n(\nnon\n-\nstrict\n)\n \nsubclass\n \nof\n \nthe\n \nmetaclasses\n \nof\n \nall\n \nits\n \nbases\n\n\n\n\n\n\nThis will work (and will use the leaf as the metaclass):\n\n\n \nclass\n \nMeta\n(\ntype\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nSubMeta\n(\nMeta\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase1\n(\nmetaclass\n=\nMeta\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nBase2\n(\nmetaclass\n=\nSubMeta\n):\n\n\n...\n \npass\n\n\n...\n\n\n \nclass\n \nFoobar\n(\nBase1\n,\n \nBase2\n):\n\n\n...\n \npass\n\n\n...\n\n\n \ntype\n(\nFoobar\n)\n\n\nclass\n \n__main__\n.\nSubMeta\n\n\n\n\n\n\nThe method signatures\n\n\nThere are still few important details missing, like the method signatures. Lets look at class and metaclass with all the important stuff implemented.\n\n\nNote the extra **kwargs - those are the extra keywords arguments you can pass in the class statement. \n\n\n \nclass\n \nMeta\n(\ntype\n):\n\n\n...\n \n@classmethod\n\n\n...\n \ndef\n \n__prepare__\n(\nmcs\n,\n \nname\n,\n \nbases\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__prepare__(mcs=\n%s\n, name=\n%r\n, bases=\n%s\n, **\n%s\n)\n \n%\n \n(\n\n\n...\n \nmcs\n,\n \nname\n,\n \nbases\n,\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \n{}\n\n\n\n\n\n\nAs mentioned before, __prepare\n can return objects that are not dict instances, so you need to make sure your __new\n handles that.\n\n\n...\n \ndef\n \n__new__\n(\nmcs\n,\n \nname\n,\n \nbases\n,\n \nattrs\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__new__(mcs=\n%s\n, name=\n%r\n, bases=\n%s\n, attrs=[\n%s\n], **\n%s\n)\n \n%\n \n(\n\n\n...\n \nmcs\n,\n \nname\n,\n \nbases\n,\n \n, \n.\njoin\n(\nattrs\n),\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__new__\n(\nmcs\n,\n \nname\n,\n \nbases\n,\n \nattrs\n)\n\n\n\n\n\n\nIt's uncommon to see \ninit\n being implemented in a metaclass because it's not that powerful - the class is already constructed when \ninit\n is called. It roughly equates to having a class decorator with the difference that \ninit\n would get run when making subclasses, while class decorators are not called for subclasses.\n\n\n...\n \ndef\n \n__init__\n(\ncls\n,\n \nname\n,\n \nbases\n,\n \nattrs\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__init__(cls=\n%s\n, name=\n%r\n, bases=\n%s\n, attrs=[\n%s\n], **\n%s\n)\n \n%\n \n(\n\n\n...\n \ncls\n,\n \nname\n,\n \nbases\n,\n \n, \n.\njoin\n(\nattrs\n),\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__init__\n(\nname\n,\n \nbases\n,\n \nattrs\n)\n\n\n\n\n\n\nThe __call__ method will be called when you make instances of Class.\n\n\n...\n \ndef\n \n__call__\n(\ncls\n,\n \n*\nargs\n,\n \n**\nkwargs\n):\n\n\n...\n \nprint\n(\n Meta.__call__(cls=\n%s\n, args=\n%s\n, kwargs=\n%s\n)\n \n%\n \n(\n\n\n...\n \ncls\n,\n \nargs\n,\n \nkwargs\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__call__\n(\n*\nargs\n,\n \n**\nkwargs\n)\n\n\n...\n\n\n\n\n\n\nUsing Meta, note the extra=1: \n\n\n \nclass\n \nClass\n(\nmetaclass\n=\nMeta\n,\n \nextra\n=\n1\n):\n\n\n...\n \ndef\n \n__new__\n(\ncls\n,\n \nmyarg\n):\n\n\n...\n \nprint\n(\n Class.__new__(cls=\n%s\n, myarg=\n%s\n)\n \n%\n \n(\n\n\n...\n \ncls\n,\n \nmyarg\n\n\n...\n \n))\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__new__\n(\ncls\n)\n\n\n...\n\n\n...\n \ndef\n \n__init__\n(\nself\n,\n \nmyarg\n):\n\n\n...\n \nprint\n(\n Class.__init__(self=\n%s\n, myarg=\n%s\n)\n \n%\n \n(\n\n\n...\n \nself\n,\n \nmyarg\n\n\n...\n \n))\n\n\n...\n \nself\n.\nmyarg\n \n=\n \nmyarg\n\n\n...\n \nreturn\n \nsuper\n()\n.\n__init__\n()\n\n\n...\n\n\n...\n \ndef\n \n__str__\n(\nself\n):\n\n\n...\n \nreturn\n \ninstance of Class; myargs=\n%s\n \n%\n \n(\n\n\n...\n \ngetattr\n(\nself\n,\n \nmyarg\n,\n \nMISSING\n),\n\n\n...\n \n)\n\n \nMeta\n.\n__prepare__\n(\nmcs\n=\nclass\n \n__main__\n.\nMeta\n, name=\nClass\n, bases=(),\n\n \n**\n{\nextra\n:\n \n1\n})\n\n \nMeta\n.\n__new__\n(\nmcs\n=\nclass\n \n__main__\n.\nMeta\n, name=\nClass\n, bases=(),\n\n \nattrs\n=\n[\n__qualname__\n,\n \n__new__\n,\n \n__init__\n,\n \n__str__\n,\n \n__module__\n],\n\n \n**\n{\nextra\n:\n \n1\n})\n\n \nMeta\n.\n__init__\n(\ncls\n=\nclass\n \n__main__\n.\nClass\n, name=\nClass\n, bases=(),\n\n \nattrs\n=\n[\n__qualname__\n,\n \n__new__\n,\n \n__init__\n,\n \n__str__\n,\n \n__module__\n],\n\n \n**\n{\nextra\n:\n \n1\n})\n\n\n\n\n\n\nNote that Meta.__call__ is called when we make instance of Class:\n\n\n \nClass\n(\n1\n)\n\n \nMeta\n.\n__call__\n(\ncls\n=\nclass\n \n__main__\n.\nClass\n, args=(1,), kwargs={})\n\n \nClass\n.\n__new__\n(\ncls\n=\nclass\n \n__main__\n.\nClass\n, myarg=1)\n\n \nClass\n.\n__init__\n(\nself\n=\ninstance\n \nof\n \nClass\n;\n \nmyargs\n=\nMISSING\n,\n \nmyarg\n=\n1\n)\n\n\ninstance\n \nof\n \nClass\n;\n \nmyargs\n=\n1\n\n\n\n\n\n\n\n\nSource:\n \n\n\n https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/", "title": "Python Metaclasses" - }, + }, { - "location": "/advanced/Python_Metaclasses/#quick-tip-what-is-a-metaclass-in-python", - "text": "This quick tip gives a brief overview of what we mean by a metaclass in Python and shows some examples of the concept. Before delving into this article, I should point out an important point about classes in Python which makes it easier for us to grasp the concept of metaclasses.", + "location": "/advanced/Python_Metaclasses/#quick-tip-what-is-a-metaclass-in-python", + "text": "This quick tip gives a brief overview of what we mean by a metaclass in Python and shows some examples of the concept. Before delving into this article, I should point out an important point about classes in Python which makes it easier for us to grasp the concept of metaclasses.", "title": "Quick Tip: What Is a Metaclass in Python" - }, + }, { - "location": "/advanced/Python_Metaclasses/#is-a-class-an-object-in-python", - "text": "If you've used a programming language other than Python, the concept you understood about classes is most likely that it is a way used to create new objects. This is also true in Python, but Python even takes it one more step further\u2014classes are also considered objects! So, if you created the following class in Python: class myClass ( object ): \n pass This simply means that an object with the name myClass has been created in memory. Since this object is able to create new objects, it is considered a class. This means we can apply object operations on classes in Python, as classes are objects themselves. We can thus do operations on classes like assigning the class to a variable, as follows: class_object = myClass () print class_object Which returns: __main__ . myClass object at 0x102623610 You can even pass the class myClass as a parameter to a method, as follows: def class_object ( object ): \n print object class_object ( myClass ) Which returns the following output: class __main__ . myClass In addition to other operations you can normally apply on objects.", + "location": "/advanced/Python_Metaclasses/#is-a-class-an-object-in-python", + "text": "If you've used a programming language other than Python, the concept you understood about classes is most likely that it is a way used to create new objects. This is also true in Python, but Python even takes it one more step further\u2014classes are also considered objects! So, if you created the following class in Python: class myClass ( object ): \n pass This simply means that an object with the name myClass has been created in memory. Since this object is able to create new objects, it is considered a class. This means we can apply object operations on classes in Python, as classes are objects themselves. We can thus do operations on classes like assigning the class to a variable, as follows: class_object = myClass () print class_object Which returns: __main__ . myClass object at 0x102623610 You can even pass the class myClass as a parameter to a method, as follows: def class_object ( object ): \n print object class_object ( myClass ) Which returns the following output: class __main__ . myClass In addition to other operations you can normally apply on objects.", "title": "Is a Class an Object in Python?!" - }, + }, { - "location": "/advanced/Python_Metaclasses/#metaclasses", - "text": "Maybe you have come across the type keyword in Python? You most likely used it to check the type of some object, as shown in the following examples: print type ( abder ) print type ( 100 ) print type ( 100.0 ) print type ( int ) In which case you would get the following output: type str type int type float type type Looking at the output, everything seems pretty clear until you come to the type type. To see what this might mean, let's go back to our class we defined at the beginning of this article: class myClass ( object ): \n pass Now, do the following: print type ( myClass ) What would be the output of this statement? It will surprisingly be: type type So, we can conclude that the type of classes in Python is type ! What is the relation between a type and a metaclass ? Well, a type is a metaclass , provided that the default metaclass is type . I know this might be confusing, especially that type can be used to return the class of some object as shown above, but this is due to the backward compatibility in Python. So, if you write: print type ( type ) You will get: type type Meaning that a type is a type ! The term metaclass simply means something used to create classes. In other words, it is the class of a class, meaning that the instance of a class in this case is a class. Thus, type is considered a metaclass since the instance of a type is a class. For instance, when we mentioned the following statement above: class_object = myClass () This simply builds an object/instance of the class myClass . In other words, we used a class to create an object. In the same way, when we did the following: class myClass ( object ): \n pass The metaclass was used to create the class myClass (which is considered a type ). So, like the object being an instance of a class, a class is an instance of a metaclass .", + "location": "/advanced/Python_Metaclasses/#metaclasses", + "text": "Maybe you have come across the type keyword in Python? You most likely used it to check the type of some object, as shown in the following examples: print type ( abder ) print type ( 100 ) print type ( 100.0 ) print type ( int ) In which case you would get the following output: type str type int type float type type Looking at the output, everything seems pretty clear until you come to the type type. To see what this might mean, let's go back to our class we defined at the beginning of this article: class myClass ( object ): \n pass Now, do the following: print type ( myClass ) What would be the output of this statement? It will surprisingly be: type type So, we can conclude that the type of classes in Python is type ! What is the relation between a type and a metaclass ? Well, a type is a metaclass , provided that the default metaclass is type . I know this might be confusing, especially that type can be used to return the class of some object as shown above, but this is due to the backward compatibility in Python. So, if you write: print type ( type ) You will get: type type Meaning that a type is a type ! The term metaclass simply means something used to create classes. In other words, it is the class of a class, meaning that the instance of a class in this case is a class. Thus, type is considered a metaclass since the instance of a type is a class. For instance, when we mentioned the following statement above: class_object = myClass () This simply builds an object/instance of the class myClass . In other words, we used a class to create an object. In the same way, when we did the following: class myClass ( object ): \n pass The metaclass was used to create the class myClass (which is considered a type ). So, like the object being an instance of a class, a class is an instance of a metaclass .", "title": "Metaclasses" - }, + }, { - "location": "/advanced/Python_Metaclasses/#using-metaclass-to-create-a-class", - "text": "In this section, we are going to see how we can use a metaclass to create a class, rather than using the class statement as we saw in the classes and objects tutorial. As we saw above, the default metaclass is type . Thus, we can use the following statement to create a new class: new_class = type ( myClass ,(),{}) If you want to make things simpler, you can assign the same class name myClass to the variable name. The dictionary { } here is used to define the attributes of the class. So, having the following statement: myClass = type ( myClass ,(),{ a : True }) Is similar to: class myClass ( object ): \n a = True", + "location": "/advanced/Python_Metaclasses/#using-metaclass-to-create-a-class", + "text": "In this section, we are going to see how we can use a metaclass to create a class, rather than using the class statement as we saw in the classes and objects tutorial. As we saw above, the default metaclass is type . Thus, we can use the following statement to create a new class: new_class = type ( myClass ,(),{}) If you want to make things simpler, you can assign the same class name myClass to the variable name. The dictionary { } here is used to define the attributes of the class. So, having the following statement: myClass = type ( myClass ,(),{ a : True }) Is similar to: class myClass ( object ): \n a = True", "title": "Using Metaclass to Create a Class" - }, + }, { - "location": "/advanced/Python_Metaclasses/#the-metaclass-attribute", - "text": "Say that we created the class myClass as follows: class myClass ( object ): \n __metaclass__ = myMetaClass \n pass In this case, class creation will occur using myMetaClass instead of type, as follows: myClass = myMetaClass ( className , bases , dictionary )", + "location": "/advanced/Python_Metaclasses/#the-metaclass-attribute", + "text": "Say that we created the class myClass as follows: class myClass ( object ): \n __metaclass__ = myMetaClass \n pass In this case, class creation will occur using myMetaClass instead of type, as follows: myClass = myMetaClass ( className , bases , dictionary )", "title": "The metaclass Attribute" - }, + }, { - "location": "/advanced/Python_Metaclasses/#creation-and-initialization-of-a-metaclass", - "text": "If you want to have control on how you create and initialize a class after its creation, you can simply use the metaclass new method and init constructor, respectively. So, when myMetaClass above is called, this is what will be happening behind the scenes: myClass = myMetaClass . __new__ ( myMetaClass , name , bases , dictionary ) myMetaClass . __init__ ( myClass , name , bases , dictionary ) Source: https://code.tutsplus.com/tutorials/quick-tip-what-is-a-metaclass-in-python--cms-26016", + "location": "/advanced/Python_Metaclasses/#creation-and-initialization-of-a-metaclass", + "text": "If you want to have control on how you create and initialize a class after its creation, you can simply use the metaclass new method and init constructor, respectively. So, when myMetaClass above is called, this is what will be happening behind the scenes: myClass = myMetaClass . __new__ ( myMetaClass , name , bases , dictionary ) myMetaClass . __init__ ( myClass , name , bases , dictionary ) Source: https://code.tutsplus.com/tutorials/quick-tip-what-is-a-metaclass-in-python--cms-26016", "title": "Creation and Initialization of a Metaclass" - }, + }, { - "location": "/advanced/Python_Metaclasses/#understanding-python-metaclasses-from-ionelmcro", - "text": "", + "location": "/advanced/Python_Metaclasses/#understanding-python-metaclasses-from-ionelmcro", + "text": "", "title": "Understanding Python metaclasses from Ionelmc.ro" - }, + }, { - "location": "/advanced/Python_Metaclasses/#a-quick-overview", - "text": "A high level explanation is necessary before we get down to the details. A class is an object, and just like any other object, it's an instance of something: a metaclass. The default metaclass is type. Unfortunately, due to backwards compatibility, type is a bit confusing: it can also be used as a function that return the class [13] of an object: class Foobar : ... pass ... type ( Foobar ) class type foo = Foobar () type ( foo ) class __main__ . Foobar If you're familiar with the isinstance builtin then you'll know this: isinstance ( foo , Foobar ) True isinstance ( Foobar , type ) True To put this in picture: But lets go back to making classes ...", + "location": "/advanced/Python_Metaclasses/#a-quick-overview", + "text": "A high level explanation is necessary before we get down to the details. A class is an object, and just like any other object, it's an instance of something: a metaclass. The default metaclass is type. Unfortunately, due to backwards compatibility, type is a bit confusing: it can also be used as a function that return the class [13] of an object: class Foobar : ... pass ... type ( Foobar ) class type foo = Foobar () type ( foo ) class __main__ . Foobar If you're familiar with the isinstance builtin then you'll know this: isinstance ( foo , Foobar ) True isinstance ( Foobar , type ) True To put this in picture: But lets go back to making classes ...", "title": "A quick overview" - }, + }, { - "location": "/advanced/Python_Metaclasses/#simple-metaclass-use", - "text": "We can use type directly to make a class, without any class statement: MyClass = type ( MyClass , (), {}) MyClass class __main__ . MyClass The class statement isn't just syntactic sugar, it does some extra things, like setting an adequate qualname and doc properties or calling prepare . We can make a custom metaclass: class Meta ( type ): ... pass And then we can use it : class Complex ( metaclass = Meta ): ... pass type ( Complex ) class __main__ . Meta Now we got a rough idea of what we'll be dealing with ...", + "location": "/advanced/Python_Metaclasses/#simple-metaclass-use", + "text": "We can use type directly to make a class, without any class statement: MyClass = type ( MyClass , (), {}) MyClass class __main__ . MyClass The class statement isn't just syntactic sugar, it does some extra things, like setting an adequate qualname and doc properties or calling prepare . We can make a custom metaclass: class Meta ( type ): ... pass And then we can use it : class Complex ( metaclass = Meta ): ... pass type ( Complex ) class __main__ . Meta Now we got a rough idea of what we'll be dealing with ...", "title": "Simple metaclass use" - }, + }, { - "location": "/advanced/Python_Metaclasses/#magic-methods", - "text": "One distinctive feature of Python is magic methods: they allow the programmer to override behavior for various operators and behavior of objects. To override the call operator you'd do this: class Funky : ... def __call__ ( self ): ... print ( Look at me, I work like a function! ) f = Funky () f () Look at me , I work like a function ! Metaclasses rely on several magic methods so it's quite useful to know a bit more about them.", + "location": "/advanced/Python_Metaclasses/#magic-methods", + "text": "One distinctive feature of Python is magic methods: they allow the programmer to override behavior for various operators and behavior of objects. To override the call operator you'd do this: class Funky : ... def __call__ ( self ): ... print ( Look at me, I work like a function! ) f = Funky () f () Look at me , I work like a function ! Metaclasses rely on several magic methods so it's quite useful to know a bit more about them.", "title": "Magic methods" - }, + }, { - "location": "/advanced/Python_Metaclasses/#the-slots", - "text": "When you define a magic method in your class the function will end up as a pointer in a struct that describes the class, in addition to the entry in dict . That struct [7] has a field for each magic method. For some reason these fields are called type slots. Now there's another feature, implemented via the slots attribute. A class with slots will create instances that don't have a dict (they use a little bit less memory). A side-effect of this is that instances cannot have other fields than what was specified in slots : if you try to set an unexpected field you'll get an exception. For the scope of this article when slots are mentioned it will mean the type slots, not slots .", + "location": "/advanced/Python_Metaclasses/#the-slots", + "text": "When you define a magic method in your class the function will end up as a pointer in a struct that describes the class, in addition to the entry in dict . That struct [7] has a field for each magic method. For some reason these fields are called type slots. Now there's another feature, implemented via the slots attribute. A class with slots will create instances that don't have a dict (they use a little bit less memory). A side-effect of this is that instances cannot have other fields than what was specified in slots : if you try to set an unexpected field you'll get an exception. For the scope of this article when slots are mentioned it will mean the type slots, not slots .", "title": "The slots" - }, + }, { - "location": "/advanced/Python_Metaclasses/#object-attribute-lookup", - "text": "Now this is something that's easy to get wrong because of the many slight differences to old-style objects in Python 2. Assuming Class is the class and instance is an instance of Class, evaluating instance.foobar roughly equates to this: Call the type slot for Class. getattribute (tp_getattro). The default does this: Does Class. dict have a foobar item that is a data descriptor ? If yes, return the result of Class. dict ['foobar']. get (instance, Class). Does instance. dict have a foobar item in it? If yes, return instance. dict ['foobar']. Does Class. dict have a foobar item that is not a data descriptor ? If yes, return the result of Class. dict ['foobar']. get (instance, klass). Does Class. dict have a foobar item ? If yes, return the result of Class. dict ['foobar']. If the attribute still wasn't found, and there's a Class. getattr , call Class. getattr ('foobar'). Still not clear? Perhaps a diagram normal attribute lookup helps: To avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.", + "location": "/advanced/Python_Metaclasses/#object-attribute-lookup", + "text": "Now this is something that's easy to get wrong because of the many slight differences to old-style objects in Python 2. Assuming Class is the class and instance is an instance of Class, evaluating instance.foobar roughly equates to this: Call the type slot for Class. getattribute (tp_getattro). The default does this: Does Class. dict have a foobar item that is a data descriptor ? If yes, return the result of Class. dict ['foobar']. get (instance, Class). Does instance. dict have a foobar item in it? If yes, return instance. dict ['foobar']. Does Class. dict have a foobar item that is not a data descriptor ? If yes, return the result of Class. dict ['foobar']. get (instance, klass). Does Class. dict have a foobar item ? If yes, return the result of Class. dict ['foobar']. If the attribute still wasn't found, and there's a Class. getattr , call Class. getattr ('foobar'). Still not clear? Perhaps a diagram normal attribute lookup helps: To avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.", "title": "Object attribute lookup" - }, + }, { - "location": "/advanced/Python_Metaclasses/#class-attribute-lookup", - "text": "Because classes needs to be able support the classmethod and staticmethod properties [6] when you evaluate something like Class.foobar the lookup is slightly different than what would happen when you evaluate instance.foobar. Assuming Class is an instance of Metaclass, evaluating Class.foobar roughly equates to this: Call the type slot for Metaclass. getattribute (tp_getattro). The default does this: Does Metaclass. dict have a foobar item that is a data descriptor ? If yes, return the result of Metaclass. dict ['foobar']. get (Class, Metaclass). Does Class. dict have a foobar item that is a descriptor (of any kind)? If yes, return the result of Class. dict ['foobar']. get (None, Class). Does Class. dict have a foobar item in it? If yes, return Class. dict ['foobar']. Does Metaclass. dict have a foobar item that is not a data descriptor ? If yes, return the result of Metaclass. dict ['foobar']. get (Class, Metaclass). Does Metaclass. dict have any foobar item? If yes, return Metaclass. dict ['foobar']. If the attribute still wasn't found, and there's a Metaclass. getattr , call Metaclass. getattr ('foobar'). The whole shebang would look like this in a diagram: To avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.", + "location": "/advanced/Python_Metaclasses/#class-attribute-lookup", + "text": "Because classes needs to be able support the classmethod and staticmethod properties [6] when you evaluate something like Class.foobar the lookup is slightly different than what would happen when you evaluate instance.foobar. Assuming Class is an instance of Metaclass, evaluating Class.foobar roughly equates to this: Call the type slot for Metaclass. getattribute (tp_getattro). The default does this: Does Metaclass. dict have a foobar item that is a data descriptor ? If yes, return the result of Metaclass. dict ['foobar']. get (Class, Metaclass). Does Class. dict have a foobar item that is a descriptor (of any kind)? If yes, return the result of Class. dict ['foobar']. get (None, Class). Does Class. dict have a foobar item in it? If yes, return Class. dict ['foobar']. Does Metaclass. dict have a foobar item that is not a data descriptor ? If yes, return the result of Metaclass. dict ['foobar']. get (Class, Metaclass). Does Metaclass. dict have any foobar item? If yes, return Metaclass. dict ['foobar']. If the attribute still wasn't found, and there's a Metaclass. getattr , call Metaclass. getattr ('foobar'). The whole shebang would look like this in a diagram: To avoid creating confusions with the \u201c.\u201d operator doing crazy things I've used \u201c:\u201d in this diagram to signify the location.", "title": "Class attribute lookup" - }, + }, { - "location": "/advanced/Python_Metaclasses/#magic-method-lookup", - "text": "For magic methods the lookup is done on the class, directly in the big struct with the slots: Does the object's class have a slot for that magic method (roughly object- ob_type- tp_ in C code)? If yes, use it. If it's NULL then the operation is not supported. In C internals parlance:\n - object- ob_type is the class of the object. \n - ob_type- tp_ is the type slot. This looks much simpler, however, the type slots are filled with wrappers around your functions, so descriptors work as expected: class Magic : ... @property ... def __repr__ ( self ): ... def inner (): ... return It works! ... return inner ... repr ( Magic ()) It works! Thats it. Does that mean there are places that don't follow those rules and lookup the slot differently? Sadly yes, read on ...", + "location": "/advanced/Python_Metaclasses/#magic-method-lookup", + "text": "For magic methods the lookup is done on the class, directly in the big struct with the slots: Does the object's class have a slot for that magic method (roughly object- ob_type- tp_ in C code)? If yes, use it. If it's NULL then the operation is not supported. In C internals parlance:\n - object- ob_type is the class of the object. \n - ob_type- tp_ is the type slot. This looks much simpler, however, the type slots are filled with wrappers around your functions, so descriptors work as expected: class Magic : ... @property ... def __repr__ ( self ): ... def inner (): ... return It works! ... return inner ... repr ( Magic ()) It works! Thats it. Does that mean there are places that don't follow those rules and lookup the slot differently? Sadly yes, read on ...", "title": "Magic method lookup" - }, + }, { - "location": "/advanced/Python_Metaclasses/#the-new-method", - "text": "One of the most common point of confusion with both classes and metaclasses is the new method. It has some very special conventions. The new method is the constructor (it returns the new instance) while init is just a initializer (the instance is already created when init is called). Suppose have a class like this: class Foobar : \n def __new__ ( cls ): \n return super () . __new__ ( cls ) Now if you recall the previous section, you'd expect that __new__ would be looked up on the metaclass, but alas, it wouldn't be so useful that way so it's looked up statically. When the Foobar class wants this magic method it will be looked up on the same object (the class), not on a upper level like all the other magic methods. This is very important to understand, because both the class and the metaclass can define this method: Foobar.__new__ is used to create instances of Foobar type.__new__ is used to create the Foobar class (an instance of type in the example)", + "location": "/advanced/Python_Metaclasses/#the-new-method", + "text": "One of the most common point of confusion with both classes and metaclasses is the new method. It has some very special conventions. The new method is the constructor (it returns the new instance) while init is just a initializer (the instance is already created when init is called). Suppose have a class like this: class Foobar : \n def __new__ ( cls ): \n return super () . __new__ ( cls ) Now if you recall the previous section, you'd expect that __new__ would be looked up on the metaclass, but alas, it wouldn't be so useful that way so it's looked up statically. When the Foobar class wants this magic method it will be looked up on the same object (the class), not on a upper level like all the other magic methods. This is very important to understand, because both the class and the metaclass can define this method: Foobar.__new__ is used to create instances of Foobar type.__new__ is used to create the Foobar class (an instance of type in the example)", "title": "The new method" - }, + }, { - "location": "/advanced/Python_Metaclasses/#the-prepare-method", - "text": "This method is called before the class body is executed and it must return a dictionary-like object that's used as the local namespace for all the code from the class body. It was added in Python 3.0, see PEP-3115 . If your __prepare__ returns an object x then this: class Class ( metaclass = Meta ): \n a = 1 \n b = 2 \n c = 3 Will make the following changes to x: x [ a ] = 1 x [ b ] = 2 x [ c ] = 3 This x object needs to look like a dictionary. Note that this x object will end up as an argument to Metaclass.__new and if it's not an instance of dict you need to convert it before calling super().__new . Interestingly enough this method doesn't have __new__'s special lookup. It appears it doesn't have it's own type slot and it's looked up via the class attribute lookup, if you read back a bit.", + "location": "/advanced/Python_Metaclasses/#the-prepare-method", + "text": "This method is called before the class body is executed and it must return a dictionary-like object that's used as the local namespace for all the code from the class body. It was added in Python 3.0, see PEP-3115 . If your __prepare__ returns an object x then this: class Class ( metaclass = Meta ): \n a = 1 \n b = 2 \n c = 3 Will make the following changes to x: x [ a ] = 1 x [ b ] = 2 x [ c ] = 3 This x object needs to look like a dictionary. Note that this x object will end up as an argument to Metaclass.__new and if it's not an instance of dict you need to convert it before calling super().__new . Interestingly enough this method doesn't have __new__'s special lookup. It appears it doesn't have it's own type slot and it's looked up via the class attribute lookup, if you read back a bit.", "title": "The prepare method" - }, + }, { - "location": "/advanced/Python_Metaclasses/#putting-it-all-together", - "text": "To start things off, a diagram of how instances are constructed: How to read this swim lane diagram: The horizontal lanes is the place where you define the functions. Solid lines mean a function call. A line from Metaclass.__call to Class.__new means Metaclass.__call will call Class.__new . Dashed lines means something is returned. Class. new returns the instance of Class. Metaclass. call returns whatever Class. new returned (and if it returned an instance of Class it will also call Class. init on it). The number in the red circle signifies the call order. Creating a class is quite similar: Few more notes:\n- Metaclass. prepare just returns the namespace object (a dictionary-like object as explained before).\n- Metaclass. new returns the Class object.\n- MetaMetaclass. call returns whatever Metaclass. new returned (and if it returned an instance of Metaclass it will also call Metaclass. init on it). So you see, metaclasses allow you to customize almost every part of an object life-cycle.", + "location": "/advanced/Python_Metaclasses/#putting-it-all-together", + "text": "To start things off, a diagram of how instances are constructed: How to read this swim lane diagram: The horizontal lanes is the place where you define the functions. Solid lines mean a function call. A line from Metaclass.__call to Class.__new means Metaclass.__call will call Class.__new . Dashed lines means something is returned. Class. new returns the instance of Class. Metaclass. call returns whatever Class. new returned (and if it returned an instance of Class it will also call Class. init on it). The number in the red circle signifies the call order. Creating a class is quite similar: Few more notes:\n- Metaclass. prepare just returns the namespace object (a dictionary-like object as explained before).\n- Metaclass. new returns the Class object.\n- MetaMetaclass. call returns whatever Metaclass. new returned (and if it returned an instance of Metaclass it will also call Metaclass. init on it). So you see, metaclasses allow you to customize almost every part of an object life-cycle.", "title": "Putting it all together" - }, + }, { - "location": "/advanced/Python_Metaclasses/#metaclasses-are-callables", - "text": "If you look again at the diagrams, you'll notice that making an instance goes through Metaclass. call . This means you can use any callable as the metaclass: class Foo ( metaclass = print ): # pointless, but illustrative ... pass ... Foo () { __module__ : __main__ , __qualname__ : Foo } print ( Foo ) None If you use a function as the metaclass then subclasses won't inherit your function metaclass, but the type of whatever that function returned.", + "location": "/advanced/Python_Metaclasses/#metaclasses-are-callables", + "text": "If you look again at the diagrams, you'll notice that making an instance goes through Metaclass. call . This means you can use any callable as the metaclass: class Foo ( metaclass = print ): # pointless, but illustrative ... pass ... Foo () { __module__ : __main__ , __qualname__ : Foo } print ( Foo ) None If you use a function as the metaclass then subclasses won't inherit your function metaclass, but the type of whatever that function returned.", "title": "Metaclasses are callables" - }, + }, { - "location": "/advanced/Python_Metaclasses/#subclasses-inherit-the-metaclass", - "text": "One advantage compared to class decorators is the fact that subclasses inherit the metaclass. This is a consequence of the fact that Metaclass(...) returns an object which usually has Metaclass as the class .", + "location": "/advanced/Python_Metaclasses/#subclasses-inherit-the-metaclass", + "text": "One advantage compared to class decorators is the fact that subclasses inherit the metaclass. This is a consequence of the fact that Metaclass(...) returns an object which usually has Metaclass as the class .", "title": "Subclasses inherit the metaclass" - }, + }, { - "location": "/advanced/Python_Metaclasses/#restrictions-with-multiple-metaclasses", - "text": "In the same tone of classes allowing you to have multiple baseclasses, each one of those baseclasses may have a different metaclass. But with a twist: everything has to be linear - the inheritance tree must have a single leaf. For example, this is not accepted because there would be two leafs (Meta1 and Meta2): class Meta1 ( type ): ... pass ... class Meta2 ( type ): ... pass ... class Base1 ( metaclass = Meta1 ): ... pass ... class Base2 ( metaclass = Meta2 ): ... pass ... class Foobar ( Base1 , Base2 ): ... pass ... Traceback ( most recent call last ): \n File stdin , line 1 , in module TypeError : metaclass conflict : the metaclass of a derived class must be a ( non - strict ) subclass of the metaclasses of all its bases This will work (and will use the leaf as the metaclass): class Meta ( type ): ... pass ... class SubMeta ( Meta ): ... pass ... class Base1 ( metaclass = Meta ): ... pass ... class Base2 ( metaclass = SubMeta ): ... pass ... class Foobar ( Base1 , Base2 ): ... pass ... type ( Foobar ) class __main__ . SubMeta", + "location": "/advanced/Python_Metaclasses/#restrictions-with-multiple-metaclasses", + "text": "In the same tone of classes allowing you to have multiple baseclasses, each one of those baseclasses may have a different metaclass. But with a twist: everything has to be linear - the inheritance tree must have a single leaf. For example, this is not accepted because there would be two leafs (Meta1 and Meta2): class Meta1 ( type ): ... pass ... class Meta2 ( type ): ... pass ... class Base1 ( metaclass = Meta1 ): ... pass ... class Base2 ( metaclass = Meta2 ): ... pass ... class Foobar ( Base1 , Base2 ): ... pass ... Traceback ( most recent call last ): \n File stdin , line 1 , in module TypeError : metaclass conflict : the metaclass of a derived class must be a ( non - strict ) subclass of the metaclasses of all its bases This will work (and will use the leaf as the metaclass): class Meta ( type ): ... pass ... class SubMeta ( Meta ): ... pass ... class Base1 ( metaclass = Meta ): ... pass ... class Base2 ( metaclass = SubMeta ): ... pass ... class Foobar ( Base1 , Base2 ): ... pass ... type ( Foobar ) class __main__ . SubMeta", "title": "Restrictions with multiple metaclasses" - }, + }, { - "location": "/advanced/Python_Metaclasses/#the-method-signatures", - "text": "There are still few important details missing, like the method signatures. Lets look at class and metaclass with all the important stuff implemented. Note the extra **kwargs - those are the extra keywords arguments you can pass in the class statement. class Meta ( type ): ... @classmethod ... def __prepare__ ( mcs , name , bases , ** kwargs ): ... print ( Meta.__prepare__(mcs= %s , name= %r , bases= %s , ** %s ) % ( ... mcs , name , bases , kwargs ... )) ... return {} As mentioned before, __prepare can return objects that are not dict instances, so you need to make sure your __new handles that. ... def __new__ ( mcs , name , bases , attrs , ** kwargs ): ... print ( Meta.__new__(mcs= %s , name= %r , bases= %s , attrs=[ %s ], ** %s ) % ( ... mcs , name , bases , , . join ( attrs ), kwargs ... )) ... return super () . __new__ ( mcs , name , bases , attrs ) It's uncommon to see init being implemented in a metaclass because it's not that powerful - the class is already constructed when init is called. It roughly equates to having a class decorator with the difference that init would get run when making subclasses, while class decorators are not called for subclasses. ... def __init__ ( cls , name , bases , attrs , ** kwargs ): ... print ( Meta.__init__(cls= %s , name= %r , bases= %s , attrs=[ %s ], ** %s ) % ( ... cls , name , bases , , . join ( attrs ), kwargs ... )) ... return super () . __init__ ( name , bases , attrs ) The __call__ method will be called when you make instances of Class. ... def __call__ ( cls , * args , ** kwargs ): ... print ( Meta.__call__(cls= %s , args= %s , kwargs= %s ) % ( ... cls , args , kwargs ... )) ... return super () . __call__ ( * args , ** kwargs ) ... Using Meta, note the extra=1: class Class ( metaclass = Meta , extra = 1 ): ... def __new__ ( cls , myarg ): ... print ( Class.__new__(cls= %s , myarg= %s ) % ( ... cls , myarg ... )) ... return super () . __new__ ( cls ) ... ... def __init__ ( self , myarg ): ... print ( Class.__init__(self= %s , myarg= %s ) % ( ... self , myarg ... )) ... self . myarg = myarg ... return super () . __init__ () ... ... def __str__ ( self ): ... return instance of Class; myargs= %s % ( ... getattr ( self , myarg , MISSING ), ... ) \n Meta . __prepare__ ( mcs = class __main__ . Meta , name= Class , bases=(), \n ** { extra : 1 }) \n Meta . __new__ ( mcs = class __main__ . Meta , name= Class , bases=(), \n attrs = [ __qualname__ , __new__ , __init__ , __str__ , __module__ ], \n ** { extra : 1 }) \n Meta . __init__ ( cls = class __main__ . Class , name= Class , bases=(), \n attrs = [ __qualname__ , __new__ , __init__ , __str__ , __module__ ], \n ** { extra : 1 }) Note that Meta.__call__ is called when we make instance of Class: Class ( 1 ) \n Meta . __call__ ( cls = class __main__ . Class , args=(1,), kwargs={}) \n Class . __new__ ( cls = class __main__ . Class , myarg=1) \n Class . __init__ ( self = instance of Class ; myargs = MISSING , myarg = 1 ) instance of Class ; myargs = 1 Source: https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/", + "location": "/advanced/Python_Metaclasses/#the-method-signatures", + "text": "There are still few important details missing, like the method signatures. Lets look at class and metaclass with all the important stuff implemented. Note the extra **kwargs - those are the extra keywords arguments you can pass in the class statement. class Meta ( type ): ... @classmethod ... def __prepare__ ( mcs , name , bases , ** kwargs ): ... print ( Meta.__prepare__(mcs= %s , name= %r , bases= %s , ** %s ) % ( ... mcs , name , bases , kwargs ... )) ... return {} As mentioned before, __prepare can return objects that are not dict instances, so you need to make sure your __new handles that. ... def __new__ ( mcs , name , bases , attrs , ** kwargs ): ... print ( Meta.__new__(mcs= %s , name= %r , bases= %s , attrs=[ %s ], ** %s ) % ( ... mcs , name , bases , , . join ( attrs ), kwargs ... )) ... return super () . __new__ ( mcs , name , bases , attrs ) It's uncommon to see init being implemented in a metaclass because it's not that powerful - the class is already constructed when init is called. It roughly equates to having a class decorator with the difference that init would get run when making subclasses, while class decorators are not called for subclasses. ... def __init__ ( cls , name , bases , attrs , ** kwargs ): ... print ( Meta.__init__(cls= %s , name= %r , bases= %s , attrs=[ %s ], ** %s ) % ( ... cls , name , bases , , . join ( attrs ), kwargs ... )) ... return super () . __init__ ( name , bases , attrs ) The __call__ method will be called when you make instances of Class. ... def __call__ ( cls , * args , ** kwargs ): ... print ( Meta.__call__(cls= %s , args= %s , kwargs= %s ) % ( ... cls , args , kwargs ... )) ... return super () . __call__ ( * args , ** kwargs ) ... Using Meta, note the extra=1: class Class ( metaclass = Meta , extra = 1 ): ... def __new__ ( cls , myarg ): ... print ( Class.__new__(cls= %s , myarg= %s ) % ( ... cls , myarg ... )) ... return super () . __new__ ( cls ) ... ... def __init__ ( self , myarg ): ... print ( Class.__init__(self= %s , myarg= %s ) % ( ... self , myarg ... )) ... self . myarg = myarg ... return super () . __init__ () ... ... def __str__ ( self ): ... return instance of Class; myargs= %s % ( ... getattr ( self , myarg , MISSING ), ... ) \n Meta . __prepare__ ( mcs = class __main__ . Meta , name= Class , bases=(), \n ** { extra : 1 }) \n Meta . __new__ ( mcs = class __main__ . Meta , name= Class , bases=(), \n attrs = [ __qualname__ , __new__ , __init__ , __str__ , __module__ ], \n ** { extra : 1 }) \n Meta . __init__ ( cls = class __main__ . Class , name= Class , bases=(), \n attrs = [ __qualname__ , __new__ , __init__ , __str__ , __module__ ], \n ** { extra : 1 }) Note that Meta.__call__ is called when we make instance of Class: Class ( 1 ) \n Meta . __call__ ( cls = class __main__ . Class , args=(1,), kwargs={}) \n Class . __new__ ( cls = class __main__ . Class , myarg=1) \n Class . __init__ ( self = instance of Class ; myargs = MISSING , myarg = 1 ) instance of Class ; myargs = 1 Source: https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/", "title": "The method signatures" - }, + }, { - "location": "/About/", - "text": "I'll write later", + "location": "/About/", + "text": "I'll write later", "title": "About" - }, + }, { - "location": "/About/#ill-write-later", - "text": "", + "location": "/About/#ill-write-later", + "text": "", "title": "I'll write later" } ] diff --git a/site/sitemap.xml b/site/sitemap.xml index 788725a..02e1eb5 100644 --- a/site/sitemap.xml +++ b/site/sitemap.xml @@ -4,7 +4,7 @@ / - 2017-09-19 + 2017-10-20 daily @@ -13,37 +13,49 @@ /beginner/Python_Programming_Lanuage/ - 2017-09-19 + 2017-10-20 daily /beginner/Python_Installation/ - 2017-09-19 + 2017-10-20 daily /beginner/Start_Coding_With_Python/ - 2017-09-19 + 2017-10-20 daily /beginner/Data_Types_In_Python_3/ - 2017-09-19 + 2017-10-20 daily /beginner/Variables_And_Assignment/ - 2017-09-19 + 2017-10-20 + daily + + + + /beginner/Conditions/ + 2017-10-20 + daily + + + + /beginner/For_Loop/ + 2017-10-20 daily /beginner/Functions/ - 2017-09-19 + 2017-10-20 daily @@ -53,13 +65,13 @@ /advanced/Context_Managers/ - 2017-09-19 + 2017-10-20 daily /advanced/Python_Metaclasses/ - 2017-09-19 + 2017-10-20 daily @@ -68,7 +80,7 @@ /About/ - 2017-09-19 + 2017-10-20 daily From b536a842018cca3a4a138f0b0bc32af6f5ca1638 Mon Sep 17 00:00:00 2001 From: Goga Patarkatsishvili Date: Sat, 28 Oct 2017 17:36:03 +0400 Subject: [PATCH 35/39] Update questions.md --- docs/questions/questions.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/questions/questions.md b/docs/questions/questions.md index 42f81a9..2e45aa5 100644 --- a/docs/questions/questions.md +++ b/docs/questions/questions.md @@ -157,4 +157,8 @@ To show a list of the defined names in a module, for example the math module, an getattr(math,name) returns the object (function, or otherwise) from the math module, named by the value of the string in the variable "name". For example type(getattr(math,'pi')) is 'float' > **Source:** -> :fa-link: https://stackoverflow.com/questions/26818007/python-dir-how-can-i-differentiate-between-functions-method-and-simple-att \ No newline at end of file +> :fa-link: https://stackoverflow.com/questions/26818007/python-dir-how-can-i-differentiate-between-functions-method-and-simple-att + +## Why do we need wrapper function in decorators? +### answers from stackoverflow : +https://stackoverflow.com/questions/45335580/why-do-we-need-wrapper-function-in-decorators From 98ea7b4d963da32beacade33485df8d683449b82 Mon Sep 17 00:00:00 2001 From: Goga Patarkatsishvili Date: Thu, 23 Nov 2017 21:13:36 +0400 Subject: [PATCH 36/39] publish pages about scopes and namespaces --- README.md | 2 + docs/beginner/Scopes_Namespaces_LEGB_rule.md | 371 ++++++ docs/images/scope_resolution_1.png | Bin 0 -> 44577 bytes docs/index.md | 5 +- mkdocs.yml | 3 + site/404.html | 24 + site/About/index.html | 24 + site/advanced/Context_Managers/index.html | 28 +- site/advanced/Python_Metaclasses/index.html | 24 + site/beginner/Conditions/index.html | 24 + .../Data_Types_In_Python_3/index.html | 24 + site/beginner/For_Loop/index.html | 24 + site/beginner/Functions/index.html | 28 +- site/beginner/Python_Installation/index.html | 24 + .../Python_Programming_Lanuage/index.html | 24 + site/beginner/Scopes/index.html | 705 +++++++++++ .../Scopes_Namespaces_LEGB_rule/index.html | 1043 +++++++++++++++++ .../Start_Coding_With_Python/index.html | 24 + .../Variables_And_Assignment/index.html | 24 + site/images/scope_resolution_1.png | Bin 0 -> 44577 bytes site/index.html | 26 + site/mkdocs/search_index.json | 79 +- site/sitemap.xml | 36 +- 23 files changed, 2547 insertions(+), 19 deletions(-) create mode 100644 docs/beginner/Scopes_Namespaces_LEGB_rule.md create mode 100644 docs/images/scope_resolution_1.png create mode 100644 site/beginner/Scopes/index.html create mode 100644 site/beginner/Scopes_Namespaces_LEGB_rule/index.html create mode 100644 site/images/scope_resolution_1.png diff --git a/README.md b/README.md index e0cdf1c..78f404a 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ So, You can start study from here: - [Variables and Assignment](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Variables_And_Assignment) - [Conditions](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Conditions) - [For Loop](https://ent1c3d.github.io/Python-Synopsis/site/beginner/For_Loop) + - [Scope](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Scopes) + - [Scopes, Namespaces and LEGB Rule](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Scopes_Namespaces_LEGB_rule) - ... - [Functions](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Functions) - ... diff --git a/docs/beginner/Scopes_Namespaces_LEGB_rule.md b/docs/beginner/Scopes_Namespaces_LEGB_rule.md new file mode 100644 index 0000000..607f7d2 --- /dev/null +++ b/docs/beginner/Scopes_Namespaces_LEGB_rule.md @@ -0,0 +1,371 @@ +# A Beginner's Guide to Python's Namespaces, Scope Resolution, and the LEGB Rule + + +## Introduction to namespaces and scopes + +## Namespaces + +Roughly speaking, namespaces are just containers for mapping names to objects. As you might have already heard, everything in Python - literals, lists, dictionaries, functions, classes, etc. - is an object. +Such a “name-to-object” mapping allows us to access an object by a name that we’ve assigned to it. E.g., if we make a simple string assignment via a_string = "Hello string", we created a reference to the "Hello string" object, and henceforth we can access via its variable name a_string. + +We can picture a namespace as a Python dictionary structure, where the dictionary keys represent the names and the dictionary values the object itself (and this is also how namespaces are currently implemented in Python), e.g., + +```python +a_namespace = {'name_a':object_1, 'name_b':object_2, ... } +``` + +Now, the tricky part is that we have multiple independent namespaces in Python, and names can be reused for different namespaces (only the objects are unique, for example: + + +```python +a_namespace = {'name_a':object_1, 'name_b':object_2, ...} +b_namespace = {'name_a':object_3, 'name_b':object_4, ...} +``` + +For example, everytime we call a for-loop or define a function, it will create its own namespace. Namespaces also have different levels of hierarchy (the so-called “scope”), which we will discuss in more detail in the next section. + + +## Scope +In the section above, we have learned that namespaces can exist independently from each other and that they are structured in a certain hierarchy, which brings us to the concept of “scope”. The “scope” in Python defines the “hierarchy level” in which we search namespaces for certain “name-to-object” mappings. +For example, let us consider the following code: + +```python +i = 1 + +def foo(): + i = 5 + print(i, 'in foo()') + +print(i, 'global') + +foo() + +''' +output: +1 global +5 in foo() +''' + +``` + +Here, we just defined the variable name i twice, once on the foo function. +- foo_namespace = {'i':object_3, ...} +- global_namespace = {'i':object_1, 'name_b':object_2, ...} + +So, how does Python know which namespace it has to search if we want to print the value of the variable i? This is where Python’s LEGB-rule comes into play, which we will discuss in the next section. + +#### Tip: +If we want to print out the dictionary mapping of the global and local variables, we can use the the functions global() and local() + +```python +#print(globals()) # prints global namespace +#print(locals()) # prints local namespace + +glob = 1 + +def foo(): + loc = 5 + print('loc in foo():', 'loc' in locals()) + +foo() +print('loc in global:', 'loc' in globals()) +print('glob in global:', 'foo' in globals()) + +''' +loc in foo(): True +loc in global: False +glob in global: True +''' +``` + + +### Scope resolution for variable names via the LEGB rule. + +We have seen that multiple namespaces can exist independently from each other and that they can contain the same variable names on different hierachy levels. The “scope” defines on which hierarchy level Python searches for a particular “variable name” for its associated object. Now, the next question is: “In which order does Python search the different levels of namespaces before it finds the name-to-object’ mapping?” +To answer is: It uses the LEGB-rule, which stands for + +`Local -> Enclosed -> Global -> Built-in,` + + +where the arrows should denote the direction of the namespace-hierarchy search order. + +- Local can be inside a function or class method, for example. +- Enclosed can be its enclosing function, e.g., if a function is wrapped inside another function. +- Global refers to the uppermost level of the executing script itself, and +- Built-in are special names that Python reserves for itself. + +So, if a particular name:object mapping cannot be found in the local namespaces, the namespaces of the enclosed scope are being searched next. If the search in the enclosed scope is unsuccessful, too, Python moves on to the global namespace, and eventually, it will search the built-in namespace (side note: if a name cannot found in any of the namespaces, a NameError will is raised). + +Namespaces can also be further nested, for example if we import modules, or if we are defining new classes. In those cases we have to use prefixes to access those nested namespaces. Let me illustrate this concept in the following code block: + +```python +import numpy +import math +import scipy + +print(math.pi, 'from the math module') +print(numpy.pi, 'from the numpy package') +print(scipy.pi, 'from the scipy package') + + +''' +3.141592653589793 from the math module +3.141592653589793 from the numpy package +3.141592653589793 from the scipy package +''' +``` + +(This is also why we have to be careful if we import modules via “from a_module import *”, since it loads the variable names into the global namespace and could potentially overwrite already existing variable names) + + +![a2box.](../images/scope_resolution_1.png) + +## 1. LG - Local and Global scopes +As a warm-up exercise, let us first forget about the enclosed (E) and built-in (B) scopes in the LEGB rule and only take a look at LG - the local and global scopes. +What does the following code print? + + +```python +a_var = 'global variable' + +def a_func(): + print(a_var, '[ a_var inside a_func() ]') + +a_func() +print(a_var, '[ a_var outside a_func() ]') + +''' +answer: +global value [ a_var inside a_func() ] +global value [ a_var outside a_func() ] +''' +``` +Here is why: + +We call a_func() first, which is supposed to print the value of a_var. According to the LEGB rule, the function will first look in its own local scope (L) if a_var is defined there. Since a_func() does not define its own a_var, it will look one-level above in the global scope (G) in which a_var has been defined previously. + +Example 1.2 +Now, let us define the variable a_var in the global and the local scope. +Can you guess what the following code will produce? + +```python +a_var = 'global value' + +def a_func(): + a_var = 'local value' + print(a_var, '[ a_var inside a_func() ]') + +a_func() +print(a_var, '[ a_var outside a_func() ]') +''' +answer: +local value [ a_var inside a_func() ] +global value [ a_var outside a_func() ] +''' +``` + +Here is why: + +When we call a_func(), it will first look in its local scope (L) for a_var, since a_var is defined in the local scope of a_func, its assigned value local variable is printed. Note that this doesn’t affect the global variable, which is in a different scope. + + +However, it is also possible to modify the global by, e.g., re-assigning a new value to it if we use the global keyword as the following example will illustrate: + + +```python +a_var = 'global value' + +def a_func(): + global a_var + a_var = 'local value' + print(a_var, '[ a_var inside a_func() ]') + +print(a_var, '[ a_var outside a_func() ]') +a_func() +print(a_var, '[ a_var outside a_func() ]') +''' +output: +global value [ a_var outside a_func() ] +local value [ a_var inside a_func() ] +local value [ a_var outside a_func() ] +''' +``` +But we have to be careful about the order: it is easy to raise an UnboundLocalError if we don’t explicitly tell Python that we want to use the global scope and try to modify a variable’s value (remember, the right side of an assignment operation is executed first): + + +```python +a_var = 1 + +def a_func(): + a_var = a_var + 1 + print(a_var, '[ a_var inside a_func() ]') + +print(a_var, '[ a_var outside a_func() ]') +a_func() + +''' +output: +--------------------------------------------------------------------------- +UnboundLocalError Traceback (most recent call last) +''' +``` + + +## 2. LEG - Local, Enclosed, and Global scope + +Now, let us introduce the concept of the enclosed (E) scope. Following the order “Local -> Enclosed -> Global”, can you guess what the following code will print? + +Example 2.1 + +```python +a_var = 'global value' + +def outer(): + a_var = 'enclosed value' + + def inner(): + a_var = 'local value' + print(a_var) + + inner() + +outer() +''' +output: +local value +''' +``` + +Here is why: + +Let us quickly recapitulate what we just did: We called outer(), which defined the variable a_var locally (next to an existing a_var in the global scope). Next, the outer() function called inner(), which in turn defined a variable with of name a_var as well. The print() function inside inner() searched in the local scope first (L->E) before it went up in the scope hierarchy, and therefore it printed the value that was assigned in the local scope. + +Similar to the concept of the global keyword, which we have seen in the section above, we can use the keyword nonlocal inside the inner function to explicitly access a variable from the outer (enclosed) scope in order to modify its value. +Note that the nonlocal keyword was added in Python 3.x and is not implemented in Python 2.x (yet). + + +```python +a_var = 'global value' + +def outer(): + a_var = 'local value' + print('outer before:', a_var) + def inner(): + nonlocal a_var + a_var = 'inner value' + print('in inner():', a_var) + inner() + print("outer after:", a_var) +outer() +''' +output: +outer before: local value +in inner(): inner value +outer after: inner value +''' +``` + + +## 3. LEGB - Local, Enclosed, Global, Built-in + +To wrap up the LEGB rule, let us come to the built-in scope. Here, we will define our “own” length-function, which happens to bear the same name as the in-built len() function. What outcome do you excpect if we’d execute the following code? + +```python +a_var = 'global variable' + +def len(in_var): + print('called my len() function') + l = 0 + for i in in_var: + l += 1 + return l + +def a_func(in_var): + len_in_var = len(in_var) + print('Input variable is of length', len_in_var) + +a_func('Hello, World!') +''' +output: +called my len() function +Input variable is of length 13 +''' +``` + +Here is why: + +Since the exact same names can be used to map names to different objects - as long as the names are in different name spaces - there is no problem of reusing the name len to define our own length function (this is just for demonstration pruposes, it is NOT recommended). As we go up in Python’s L -> E -> G -> B hierarchy, the function a_func() finds len() already in the global scope (G) first before it attempts to search the built-in (B) namespace. + + +### Self-assessment exercise + +Now, after we went through a couple of exercises, let us quickly check where we are. So, one more time: What would the following code print out? + +```python +a = 'global' + +def outer(): + + def len(in_var): + print('called my len() function: ', end="") + l = 0 + for i in in_var: + l += 1 + return l + + a = 'local' + + def inner(): + global len + nonlocal a + a += ' variable' + inner() + print('a is', a) + print(len(a)) + + +outer() + +print(len(a)) +print('a is', a) + + +''' +output: +a is local variable +called my len() function: 14 +6 +a is global +''' +``` + + + +## Conclusion + +I hope this short tutorial was helpful to understand the basic concept of Python’s scope resolution order using the LEGB rule. I want to encourage you (as a little self-assessment exercise) to look at the code snippets again tomorrow and check if you can correctly predict all their outcomes. + +A rule of thumb + +In practice, it is usually a bad idea to modify global variables inside the function scope, since it often be the cause of confusion and weird errors that are hard to debug. +If you want to modify a global variable via a function, it is recommended to pass it as an argument and reassign the return-value. +For example: + + +```python +a_var = 2 + +def a_func(some_var): + return 2**3 + +a_var = a_func(a_var) +print(a_var) + +''' +output: +8 +''' +``` + +> **Source:** +> :fa-link: http://sebastianraschka.com/Articles/2014_python_scope_and_namespaces.html diff --git a/docs/images/scope_resolution_1.png b/docs/images/scope_resolution_1.png new file mode 100644 index 0000000000000000000000000000000000000000..6bf48b0f7d730f96409da902141ccb23cc319ace GIT binary patch literal 44577 zcmZU5by!qg_x8ZR48qVM%?Q%nNDfj`f;7_Iol4DsbSoewDM+WJ#L!3ysDOad-AD-n z-we<5zQ6anKK_9@bN1e6uXV3`uYK=zh}L|ngpW&&3jhG{m7mCK0RWgC0071$4kqeK zxP(~_>O-`HoSdezoE%is)6Lew*#-b$Bd<)BQU%HqMJ&Wlu-&74XpftWt-!Uv8mFN4 z@iRC*N+Al@(XS;tIw^6*^T8!>*ZCun3)v}eln6zdWqvpmr)vRTP zK0{wcOu2LQei$$veBe(Ydu@&*r-(&jS=^}f2Q#{?!)=!$h9&lyjc{5?+G%Sk6{D*D zH^b!c)khfvM>!sZAM1R1UroHN(rd?Jd;?ps&>wyW@H>YcmX@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bkIGBcN$vs5q#WFEpBwug(q6j=VUt0UC8Q_Ig!^(lEFr1>$B28 z%5&&Z+N|8^&d<@_yy!bp9sh{ERGc^*72%&jjwV3~q!sdunYcq@1f_Oh=8KSuiK}Jo zl;wi|5~Cr!-mkDqpF%v1jQ%|t^_|AW>O!3dL;gg$xU)qa4{^2%k7^h#(r4BEDNDIX zgG`W_1Rdeho+Pqu=q5xd-F4Oh(k9+GK|0hP#+j;hq9)f&H#2BL)a8*yE3!rluGrVI zmT+3njZM`BGT?rjmXNE>h2n5VEZ&4L)3L%2#|RML+BHBDIcVZ)Of32h3L`#+a3zv~H7<{l z?I5}q**LmPMPM9&Qk1{q$ek`7o$Mh_M%k~?sONuboML!V3bh3sJT2wrv-v5(-A4Z# z19y|9ztVZP%n61vxR~3hB6TGHO5jMD$X}(6q8pM`GXK=9sYGuU##mkwZK`wy*w4S& zuv8IVp8fJ6bByU@>r~y;y3AG(5yDwGY|N4AeW!Un8V-t-NddY!g9~6Y0ZN|$Mw5-h zzP&7l>#C_?hf>I#039C>9F!F`+))*!gV+D|bJU z&KVb|kk9{5f%E@0wx{Z*FAC{ZGBFOY)McR|zk zRho)uIhWQWEaFG7h|v&~C@DA%P=@EIT;ZN|+fxH%jbuqF+H6yq`D)JGztT1E{U+h$ zU?MaBs^~y05nuNMQUs%D{f7D9OJW9Y-6_2b-XZ==gc1^<&y<-5@`Ay4{qK@FRU&k9 z#!3$*UQhf~iW7)jX>Wb&|GfykBny)MH$N!D|GiNu5=7enKaH%O!(a`V1g=t_5eWFx M*D=;^(8R|4AKrzIApigX literal 0 HcmV?d00001 diff --git a/docs/index.md b/docs/index.md index 57a65ef..4ae7ad5 100644 --- a/docs/index.md +++ b/docs/index.md @@ -21,6 +21,8 @@ Of course, it needs plenty of time to organize best resources based on the topic - [For Loop](https://ent1c3d.github.io/Python-Synopsis/site/beginner/For_Loop) - ... - [Functions](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Functions) + - [Scope](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Scopes) + - [Scopes, Namespaces and LEGB Rule](https://ent1c3d.github.io/Python-Synopsis/site/beginner/Scopes_Namespaces_LEGB_rule) - ... - Intermediate - ... @@ -28,4 +30,5 @@ Of course, it needs plenty of time to organize best resources based on the topic - ... - [Context Managers](https://ent1c3d.github.io/Python-Synopsis/site/advanced/Context_Managers) - [Python Metaclasses](https://ent1c3d.github.io/Python-Synopsis/site/advanced/Python_Metaclasses) - - ... \ No newline at end of file + - ... + diff --git a/mkdocs.yml b/mkdocs.yml index d0d41ea..e26e4ef 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -21,6 +21,9 @@ pages: - Conditions : beginner/Conditions.md - For Loop : beginner/For_Loop.md - Functions : beginner/Functions.md + - Scope : beginner/Scopes.md + - Scopes, Namespaces and LEGB Rule : beginner/Scopes_Namespaces_LEGB_rule.md + - Advanced: - Context Managers : advanced/Context_Managers.md - Python Metaclasses : advanced/Python_Metaclasses.md diff --git a/site/404.html b/site/404.html index a50ea1c..821c3bf 100644 --- a/site/404.html +++ b/site/404.html @@ -307,6 +307,30 @@ + + + + + + + + + + + + + +
        • + + Scopes, Namespaces and LEGB Rule + +
        • + +
        • + + Scope + +
      35. diff --git a/site/About/index.html b/site/About/index.html index e74698e..7a13723 100644 --- a/site/About/index.html +++ b/site/About/index.html @@ -309,6 +309,30 @@ + + + + + +
      36. + + Scope + +
      37. + + + + + + + +
      38. + + Scopes, Namespaces and LEGB Rule + +
      39. + + diff --git a/site/advanced/Context_Managers/index.html b/site/advanced/Context_Managers/index.html index 15b9e1a..0969104 100644 --- a/site/advanced/Context_Managers/index.html +++ b/site/advanced/Context_Managers/index.html @@ -313,6 +313,30 @@ + + + + + +
      40. + + Scope + +
      41. + + + + + + + +
      42. + + Scopes, Namespaces and LEGB Rule + +
      43. + + @@ -662,7 +686,7 @@

        Python diff --git a/site/advanced/Python_Metaclasses/index.html b/site/advanced/Python_Metaclasses/index.html index fc09fbd..396281a 100644 --- a/site/advanced/Python_Metaclasses/index.html +++ b/site/advanced/Python_Metaclasses/index.html @@ -313,6 +313,30 @@ + + + + + +
      44. + + Scope + +
      45. + + + + + + + +
      46. + + Scopes, Namespaces and LEGB Rule + +
      47. + + diff --git a/site/beginner/Conditions/index.html b/site/beginner/Conditions/index.html index e4eec97..45bb3f5 100644 --- a/site/beginner/Conditions/index.html +++ b/site/beginner/Conditions/index.html @@ -449,6 +449,30 @@ + + + + + +
      48. + + Scope + +
      49. + + + + + + + +
      50. + + Scopes, Namespaces and LEGB Rule + +
      51. + + diff --git a/site/beginner/Data_Types_In_Python_3/index.html b/site/beginner/Data_Types_In_Python_3/index.html index f34ab1b..45ecec4 100644 --- a/site/beginner/Data_Types_In_Python_3/index.html +++ b/site/beginner/Data_Types_In_Python_3/index.html @@ -495,6 +495,30 @@ + + + + + +
      52. + + Scope + +
      53. + + + + + + + +
      54. + + Scopes, Namespaces and LEGB Rule + +
      55. + + diff --git a/site/beginner/For_Loop/index.html b/site/beginner/For_Loop/index.html index a8917b2..07d5a06 100644 --- a/site/beginner/For_Loop/index.html +++ b/site/beginner/For_Loop/index.html @@ -388,6 +388,30 @@ + + + + + +
      56. + + Scope + +
      57. + + + + + + + +
      58. + + Scopes, Namespaces and LEGB Rule + +
      59. + + diff --git a/site/beginner/Functions/index.html b/site/beginner/Functions/index.html index 8eaf941..d486d6a 100644 --- a/site/beginner/Functions/index.html +++ b/site/beginner/Functions/index.html @@ -573,6 +573,30 @@ + + + + + +
      60. + + Scope + +
      61. + + + + + + + +
      62. + + Scopes, Namespaces and LEGB Rule + +
      63. + + @@ -2083,13 +2107,13 @@

        Things to Remember

        -
      64. + Scope + +
      65. + + + + + + + +
      66. + + Scopes, Namespaces and LEGB Rule + +
      67. + + diff --git a/site/beginner/Python_Programming_Lanuage/index.html b/site/beginner/Python_Programming_Lanuage/index.html index 30d419c..ebc978d 100644 --- a/site/beginner/Python_Programming_Lanuage/index.html +++ b/site/beginner/Python_Programming_Lanuage/index.html @@ -439,6 +439,30 @@ + + + + + +
      68. + + Scope + +
      69. + + + + + + + +
      70. + + Scopes, Namespaces and LEGB Rule + +
      71. + + diff --git a/site/beginner/Scopes/index.html b/site/beginner/Scopes/index.html new file mode 100644 index 0000000..4fbf521 --- /dev/null +++ b/site/beginner/Scopes/index.html @@ -0,0 +1,705 @@ + + + + + + + + + + + + + + + + + + + + + + + Scope - Python Synopsis + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + +
        + +
        + + +
        +
        + + +
        +
        +
        + +
        +
        +
        + + +
        +
        +
        + + +
        +
        +
        + + +
        +
        + + + +

        Scope

        + +

        Scopes - Python Scope Basics

        +

        Now that you’re ready to start writing your own functions, we need to get more formal +about what names mean in Python. When you use a name in a program, Python creates, +changes, or looks up the name in what is known as a namespace—a place where names +live. When we talk about the search for a name’s value in relation to code, the term +scope refers to a namespace: that is, the location of a name’s assignment in your code +determines the scope of the name’s visibility to your code.
        +Just about everything related to names, including scope classification, happens at assignment +time in Python. As we’ve seen, names in Python spring into existence when +they are first assigned values, and they must be assigned before they are used. Because +names are not declared ahead of time, Python uses the location of the assignment of a +name to associate it with (i.e., bind it to) a particular namespace. In other words, the +place where you assign a name in your source code determines the namespace it will +live in, and hence its scope of visibility.
        +Besides packaging code, functions add an extra namespace layer to your programs— +by default, all names assigned inside a function are associated with that function’s +namespace, and no other. This means that:

        +
          +
        • Names defined inside a def can only be seen by the code within that def. You cannot +even refer to such names from outside the function.
        • +
        • Names defined inside a def do not clash with variables outside the def, even if the +same names are used elsewhere. A name X assigned outside a given def (i.e., in a +different def or at the top level of a module file) is a completely different variable +from a name X assigned inside that def.
        • +
        +

        In all cases, the scope of a variable (where it can be used) is always determined by where +it is assigned in your source code and has nothing to do with which functions call which. +In fact, as we’ll learn in this chapter, variables may be assigned in three different places, +corresponding to three different scopes:
        +- If a variable is assigned inside a def, it is local to that function.
        +- If a variable is assigned in an enclosing def, it is nonlocal to nested functions.
        +- If a variable is assigned outside all defs, it is global to the entire file.
        +We call this lexical scoping because variable scopes are determined entirely by the locations +of the variables in the source code of your program files, not by function calls.
        +For example, in the following module file, the X = 99 assignment creates a global variable +named X (visible everywhere in this file), but the X = 88 assignment creates a +local variable X (visible only within the def statement):

        +
        X = 99
        +def func():
        +    X = 88
        +
        + + +

        Even though both variables are named X, their scopes make them different. The net +effect is that function scopes help to avoid name clashes in your programs and help to +make functions more self-contained program units.

        +

        Scope Rules

        +

        Before we started writing functions, all the code we wrote was at the top level of a +module (i.e., not nested in a def), so the names we used either lived in the module itself +or were built-ins predefined by Python (e.g., open). Functions provide nested namespaces +(scopes) that localize the names they use, such that names inside a function +won’t clash with those outside it (in a module or another function). Again, functions +define a local scope, and modules define a global scope. The two scopes are related as +follows:
        +- The enclosing module is a global scope. Each module is a global scope—that +is, a namespace in which variables created (assigned) at the top level of the module +file live. Global variables become attributes of a module object to the outside world +but can be used as simple variables within a module file. +- The global scope spans a single file only. Don’t be fooled by the word “global” +here—names at the top level of a file are only global to code within that single file. +There is really no notion of a single, all-encompassing global file-based scope in Python. Instead, names are partitioned into modules, and you must always import +a module explicitly if you want to be able to use the names its file defines. When +you hear “global” in Python, think “module.”
        +- Each call to a function creates a new local scope. Every time you call a function, +you create a new local scope—that is, a namespace in which the names created +inside that function will usually live. You can think of each def statement (and +lambda expression) as defining a new local scope, but because Python allows functions +to call themselves to loop (an advanced technique known as recursion), the +local scope in fact technically corresponds to a function call—in other words, each +call creates a new local namespace. Recursion is useful when processing structures +whose shapes can’t be predicted ahead of time.
        +- Assigned names are local unless declared global or nonlocal. By default, all +the names assigned inside a function definition are put in the local scope (the +namespace associated with the function call). If you need to assign a name that +lives at the top level of the module enclosing the function, you can do so by declaring +it in a global statement inside the function. If you need to assign a name +that lives in an enclosing def, as of Python 3.0 you can do so by declaring it in a +nonlocal statement.
        +- All other names are enclosing function locals, globals, or built-ins. Names +not assigned a value in the function definition are assumed to be enclosing scope +locals (in an enclosing def), globals (in the enclosing module’s namespace), or builtins +(in the predefined builtin module Python provides).

        +

        There are a few subtleties to note here. First, keep in mind that code typed at the +interactive command prompt follows these same rules. You may not know it yet, but +code run interactively is really entered into a built-in module called main; this +module works just like a module file, but results are echoed as you go. Because of this, +interactively created names live in a module, too, and thus follow the normal scope +rules: they are global to the interactive session. You’ll learn more about modules in the +next part of this book.

        +

        Also note that any type of assignment within a function classifies a name as local. This +includes = statements, module names in import, function names in def, function argument +names, and so on. If you assign a name in any way within a def, it will become a +local to that function.

        +

        Conversely, in-place changes to objects do not classify names as locals; only actual name +assignments do. For instance, if the name L is assigned to a list at the top level of a +module, a statement L = X within a function will classify L as a local, but L.append(X) +will not. In the latter case, we are changing the list object that L references, not L itself— +L is found in the global scope as usual, and Python happily modifies it without requiring +a global (or nonlocal) declaration. As usual, it helps to keep the distinction between +names and objects clear: changing an object is not an assignment to a name.

        +
        +

        Source:
        + Learning Python, Fourth Edition by Mark Lutz - 2009

        +
        +

        good resource : http://sebastianraschka.com/Articles/2014_python_scope_and_namespaces.html

        + + + + + + + +
        +
        +
        +
        + + + + +
        + + + + + + + + + + + + \ No newline at end of file diff --git a/site/beginner/Scopes_Namespaces_LEGB_rule/index.html b/site/beginner/Scopes_Namespaces_LEGB_rule/index.html new file mode 100644 index 0000000..aeab779 --- /dev/null +++ b/site/beginner/Scopes_Namespaces_LEGB_rule/index.html @@ -0,0 +1,1043 @@ + + + + + + + + + + + + + + + + + + + + + + + Scopes, Namespaces and LEGB Rule - Python Synopsis + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + +
        + +
        + + +
        +
        + + +
        +
        +
        + +
        +
        +
        + + + + + +
        +
        + + + +

        A Beginner's Guide to Python's Namespaces, Scope Resolution, and the LEGB Rule

        +

        Introduction to namespaces and scopes

        +

        Namespaces

        +

        Roughly speaking, namespaces are just containers for mapping names to objects. As you might have already heard, everything in Python - literals, lists, dictionaries, functions, classes, etc. - is an object. +Such a “name-to-object” mapping allows us to access an object by a name that we’ve assigned to it. E.g., if we make a simple string assignment via a_string = "Hello string", we created a reference to the "Hello string" object, and henceforth we can access via its variable name a_string.

        +

        We can picture a namespace as a Python dictionary structure, where the dictionary keys represent the names and the dictionary values the object itself (and this is also how namespaces are currently implemented in Python), e.g.,

        +
        a_namespace = {'name_a':object_1, 'name_b':object_2, ... }
        +
        + + +

        Now, the tricky part is that we have multiple independent namespaces in Python, and names can be reused for different namespaces (only the objects are unique, for example:

        +
        a_namespace = {'name_a':object_1, 'name_b':object_2, ...}
        +b_namespace = {'name_a':object_3, 'name_b':object_4, ...}
        +
        + + +

        For example, everytime we call a for-loop or define a function, it will create its own namespace. Namespaces also have different levels of hierarchy (the so-called “scope”), which we will discuss in more detail in the next section.

        +

        Scope

        +

        In the section above, we have learned that namespaces can exist independently from each other and that they are structured in a certain hierarchy, which brings us to the concept of “scope”. The “scope” in Python defines the “hierarchy level” in which we search namespaces for certain “name-to-object” mappings. +For example, let us consider the following code:

        +
        i = 1
        +
        +def foo():
        +    i = 5
        +    print(i, 'in foo()')
        +
        +print(i, 'global')
        +
        +foo()
        +
        +'''
        +output:
        +1 global
        +5 in foo()
        +'''
        +
        + + +

        Here, we just defined the variable name i twice, once on the foo function. +- foo_namespace = {'i':object_3, ...} +- global_namespace = {'i':object_1, 'name_b':object_2, ...}

        +

        So, how does Python know which namespace it has to search if we want to print the value of the variable i? This is where Python’s LEGB-rule comes into play, which we will discuss in the next section.

        +

        Tip:

        +

        If we want to print out the dictionary mapping of the global and local variables, we can use the the functions global() and local()

        +
        #print(globals()) # prints global namespace
        +#print(locals()) # prints local namespace
        +
        +glob = 1
        +
        +def foo():
        +    loc = 5
        +    print('loc in foo():', 'loc' in locals())
        +
        +foo()
        +print('loc in global:', 'loc' in globals())    
        +print('glob in global:', 'foo' in globals())
        +
        +'''
        +loc in foo(): True
        +loc in global: False
        +glob in global: True
        +'''
        +
        + + +

        Scope resolution for variable names via the LEGB rule.

        +

        We have seen that multiple namespaces can exist independently from each other and that they can contain the same variable names on different hierachy levels. The “scope” defines on which hierarchy level Python searches for a particular “variable name” for its associated object. Now, the next question is: “In which order does Python search the different levels of namespaces before it finds the name-to-object’ mapping?” +To answer is: It uses the LEGB-rule, which stands for

        +

        Local -> Enclosed -> Global -> Built-in,

        +

        where the arrows should denote the direction of the namespace-hierarchy search order.

        +
          +
        • Local can be inside a function or class method, for example.
        • +
        • Enclosed can be its enclosing function, e.g., if a function is wrapped inside another function.
        • +
        • Global refers to the uppermost level of the executing script itself, and
        • +
        • Built-in are special names that Python reserves for itself.
        • +
        +

        So, if a particular name:object mapping cannot be found in the local namespaces, the namespaces of the enclosed scope are being searched next. If the search in the enclosed scope is unsuccessful, too, Python moves on to the global namespace, and eventually, it will search the built-in namespace (side note: if a name cannot found in any of the namespaces, a NameError will is raised).

        +

        Namespaces can also be further nested, for example if we import modules, or if we are defining new classes. In those cases we have to use prefixes to access those nested namespaces. Let me illustrate this concept in the following code block:

        +
        import numpy
        +import math
        +import scipy
        +
        +print(math.pi, 'from the math module')
        +print(numpy.pi, 'from the numpy package')
        +print(scipy.pi, 'from the scipy package')
        +
        +
        +'''
        +3.141592653589793 from the math module
        +3.141592653589793 from the numpy package
        +3.141592653589793 from the scipy package
        +'''
        +
        + + +

        (This is also why we have to be careful if we import modules via “from a_module import *”, since it loads the variable names into the global namespace and could potentially overwrite already existing variable names)

        +

        a2box.

        +

        1. LG - Local and Global scopes

        +

        As a warm-up exercise, let us first forget about the enclosed (E) and built-in (B) scopes in the LEGB rule and only take a look at LG - the local and global scopes. +What does the following code print?

        +
        a_var = 'global variable'
        +
        +def a_func():
        +    print(a_var, '[ a_var inside a_func() ]')
        +
        +a_func()
        +print(a_var, '[ a_var outside a_func() ]')
        +
        +'''
        +answer:
        +global value [ a_var inside a_func() ]  
        +global value [ a_var outside a_func() ]
        +'''
        +
        + + +

        Here is why:

        +

        We call a_func() first, which is supposed to print the value of a_var. According to the LEGB rule, the function will first look in its own local scope (L) if a_var is defined there. Since a_func() does not define its own a_var, it will look one-level above in the global scope (G) in which a_var has been defined previously.

        +

        Example 1.2 +Now, let us define the variable a_var in the global and the local scope. +Can you guess what the following code will produce?

        +
        a_var = 'global value'
        +
        +def a_func():
        +    a_var = 'local value'
        +    print(a_var, '[ a_var inside a_func() ]')
        +
        +a_func()
        +print(a_var, '[ a_var outside a_func() ]')
        +'''
        +answer:
        +local value [ a_var inside a_func() ]
        +global value [ a_var outside a_func() ]
        +'''
        +
        + + +

        Here is why:

        +

        When we call a_func(), it will first look in its local scope (L) for a_var, since a_var is defined in the local scope of a_func, its assigned value local variable is printed. Note that this doesn’t affect the global variable, which is in a different scope.

        +

        However, it is also possible to modify the global by, e.g., re-assigning a new value to it if we use the global keyword as the following example will illustrate:

        +
        a_var = 'global value'
        +
        +def a_func():
        +    global a_var
        +    a_var = 'local value'
        +    print(a_var, '[ a_var inside a_func() ]')
        +
        +print(a_var, '[ a_var outside a_func() ]')
        +a_func()
        +print(a_var, '[ a_var outside a_func() ]')
        +'''
        +output:
        +global value [ a_var outside a_func() ]
        +local value [ a_var inside a_func() ]
        +local value [ a_var outside a_func() ]
        +'''
        +
        + + +

        But we have to be careful about the order: it is easy to raise an UnboundLocalError if we don’t explicitly tell Python that we want to use the global scope and try to modify a variable’s value (remember, the right side of an assignment operation is executed first):

        +
        a_var = 1
        +
        +def a_func():
        +    a_var = a_var + 1
        +    print(a_var, '[ a_var inside a_func() ]')
        +
        +print(a_var, '[ a_var outside a_func() ]')
        +a_func()
        +
        +'''
        +output:
        +---------------------------------------------------------------------------
        +UnboundLocalError                         Traceback (most recent call last)
        +'''
        +
        + + +

        2. LEG - Local, Enclosed, and Global scope

        +

        Now, let us introduce the concept of the enclosed (E) scope. Following the order “Local -> Enclosed -> Global”, can you guess what the following code will print?

        +

        Example 2.1

        +
        a_var = 'global value'
        +
        +def outer():
        +    a_var = 'enclosed value'
        +
        +    def inner():
        +        a_var = 'local value'
        +        print(a_var)
        +
        +    inner()
        +
        +outer()
        +'''
        +output:
        +local value
        +'''
        +
        + + +

        Here is why:

        +

        Let us quickly recapitulate what we just did: We called outer(), which defined the variable a_var locally (next to an existing a_var in the global scope). Next, the outer() function called inner(), which in turn defined a variable with of name a_var as well. The print() function inside inner() searched in the local scope first (L->E) before it went up in the scope hierarchy, and therefore it printed the value that was assigned in the local scope.

        +

        Similar to the concept of the global keyword, which we have seen in the section above, we can use the keyword nonlocal inside the inner function to explicitly access a variable from the outer (enclosed) scope in order to modify its value. +Note that the nonlocal keyword was added in Python 3.x and is not implemented in Python 2.x (yet).

        +
        a_var = 'global value'
        +
        +def outer():
        +       a_var = 'local value'
        +       print('outer before:', a_var)
        +       def inner():
        +           nonlocal a_var
        +           a_var = 'inner value'
        +           print('in inner():', a_var)
        +       inner()
        +       print("outer after:", a_var)
        +outer()
        +'''
        +output:
        +outer before: local value
        +in inner(): inner value
        +outer after: inner value
        +'''
        +
        + + +

        3. LEGB - Local, Enclosed, Global, Built-in

        +

        To wrap up the LEGB rule, let us come to the built-in scope. Here, we will define our “own” length-function, which happens to bear the same name as the in-built len() function. What outcome do you excpect if we’d execute the following code?

        +
        a_var = 'global variable'
        +
        +def len(in_var):
        +    print('called my len() function')
        +    l = 0
        +    for i in in_var:
        +        l += 1
        +    return l
        +
        +def a_func(in_var):
        +    len_in_var = len(in_var)
        +    print('Input variable is of length', len_in_var)
        +
        +a_func('Hello, World!')
        +'''
        +output:
        +called my len() function
        +Input variable is of length 13
        +'''
        +
        + + +

        Here is why:

        +

        Since the exact same names can be used to map names to different objects - as long as the names are in different name spaces - there is no problem of reusing the name len to define our own length function (this is just for demonstration pruposes, it is NOT recommended). As we go up in Python’s L -> E -> G -> B hierarchy, the function a_func() finds len() already in the global scope (G) first before it attempts to search the built-in (B) namespace.

        +

        Self-assessment exercise

        +

        Now, after we went through a couple of exercises, let us quickly check where we are. So, one more time: What would the following code print out?

        +
        a = 'global'
        +
        +def outer():
        +
        +    def len(in_var):
        +        print('called my len() function: ', end="")
        +        l = 0
        +        for i in in_var:
        +            l += 1
        +        return l
        +
        +    a = 'local'
        +
        +    def inner():
        +        global len
        +        nonlocal a
        +        a += ' variable'
        +    inner()
        +    print('a is', a)
        +    print(len(a))
        +
        +
        +outer()
        +
        +print(len(a))
        +print('a is', a)
        +
        +
        +'''
        +output:
        +a is local variable
        +called my len() function: 14
        +6
        +a is global
        +'''
        +
        + + +

        Conclusion

        +

        I hope this short tutorial was helpful to understand the basic concept of Python’s scope resolution order using the LEGB rule. I want to encourage you (as a little self-assessment exercise) to look at the code snippets again tomorrow and check if you can correctly predict all their outcomes.

        +

        A rule of thumb

        +

        In practice, it is usually a bad idea to modify global variables inside the function scope, since it often be the cause of confusion and weird errors that are hard to debug. +If you want to modify a global variable via a function, it is recommended to pass it as an argument and reassign the return-value. +For example:

        +
        a_var = 2
        +
        +def a_func(some_var):
        +    return 2**3
        +
        +a_var = a_func(a_var)
        +print(a_var)
        +
        +'''
        +output:
        +8
        +'''
        +
        + + +
        +

        Source:
        + http://sebastianraschka.com/Articles/2014_python_scope_and_namespaces.html

        +
        + + + + + + + +
        +
        +
        +
        + + + + +
        + + + + + + + + + + + + \ No newline at end of file diff --git a/site/beginner/Start_Coding_With_Python/index.html b/site/beginner/Start_Coding_With_Python/index.html index 507074b..4ef88d2 100644 --- a/site/beginner/Start_Coding_With_Python/index.html +++ b/site/beginner/Start_Coding_With_Python/index.html @@ -469,6 +469,30 @@ + + + + + +
      72. + + Scope + +
      73. + + + + + + + +
      74. + + Scopes, Namespaces and LEGB Rule + +
      75. + + diff --git a/site/beginner/Variables_And_Assignment/index.html b/site/beginner/Variables_And_Assignment/index.html index b98edbc..68bcac6 100644 --- a/site/beginner/Variables_And_Assignment/index.html +++ b/site/beginner/Variables_And_Assignment/index.html @@ -412,6 +412,30 @@ + + + + + +
      76. + + Scope + +
      77. + + + + + + + +
      78. + + Scopes, Namespaces and LEGB Rule + +
      79. + + diff --git a/site/images/scope_resolution_1.png b/site/images/scope_resolution_1.png new file mode 100644 index 0000000000000000000000000000000000000000..6bf48b0f7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H%jbuqF+H6yq`D)JGztT1E{U+h$ zU?MaBs^~y05nuNMQUs%D{f7D9OJW9Y-6_2b-XZ==gc1^<&y<-5@`Ay4{qK@FRU&k9 z#!3$*UQhf~iW7)jX>Wb&|GfykBny)MH$N!D|GiNu5=7enKaH%O!(a`V1g=t_5eWFx M*D=;^(8R|4AKrzIApigX literal 0 HcmV?d00001 diff --git a/site/index.html b/site/index.html index f83fb8b..8464549 100644 --- a/site/index.html +++ b/site/index.html @@ -345,6 +345,30 @@ + + + + + + + + + + + + + +
      80. + + Scopes, Namespaces and LEGB Rule + +
      81. + + @@ -469,6 +493,8 @@

        Python Study Guide

      82. For Loop
      83. ...
      84. Functions
      85. +
      86. Scope
      87. +
      88. Scopes, Namespaces and LEGB Rule
      89. ...
      90. diff --git a/site/mkdocs/search_index.json b/site/mkdocs/search_index.json index ddba050..ceedd3b 100644 --- a/site/mkdocs/search_index.json +++ b/site/mkdocs/search_index.json @@ -2,7 +2,7 @@ "docs": [ { "location": "/", - "text": "Welcome to Python Synopsis!\n\n\nPython Study Guide\n\n\nIn this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate \nbooks, articles, answers from Stackoverflow, online courses, videos from py conferences\n and etc. \n\n\nSo, after all I decided to share \ntop resources\n for everyone about each topic, that you need to know about python, if you want to be senior python \nSoftware Engineer\n. \n\n\nOf course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than \n30-40\n chapters.\n\n\n\n\nBeginner\n\n\nThe Python Programming Language, Implementation and Adventages\n\n\nPython Installation\n\n\nStart Coding With Python\n\n\nData Types In Python 3\n\n\nVariables and Assignment\n\n\nConditions\n\n\nFor Loop\n\n\n...\n\n\nFunctions\n\n\n...\n\n\n\n\n\n\nIntermediate\n\n\n... \n\n\n\n\n\n\nAdvanced\n\n\n...\n\n\nContext Managers\n\n\nPython Metaclasses\n\n\n...", + "text": "Welcome to Python Synopsis!\n\n\nPython Study Guide\n\n\nIn this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate \nbooks, articles, answers from Stackoverflow, online courses, videos from py conferences\n and etc. \n\n\nSo, after all I decided to share \ntop resources\n for everyone about each topic, that you need to know about python, if you want to be senior python \nSoftware Engineer\n. \n\n\nOf course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than \n30-40\n chapters.\n\n\n\n\nBeginner\n\n\nThe Python Programming Language, Implementation and Adventages\n\n\nPython Installation\n\n\nStart Coding With Python\n\n\nData Types In Python 3\n\n\nVariables and Assignment\n\n\nConditions\n\n\nFor Loop\n\n\n...\n\n\nFunctions\n\n\nScope\n\n\nScopes, Namespaces and LEGB Rule\n\n\n...\n\n\n\n\n\n\nIntermediate\n\n\n... \n\n\n\n\n\n\nAdvanced\n\n\n...\n\n\nContext Managers\n\n\nPython Metaclasses\n\n\n...", "title": "Home" }, { @@ -12,7 +12,7 @@ }, { "location": "/#python-study-guide", - "text": "In this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate books, articles, answers from Stackoverflow, online courses, videos from py conferences and etc. So, after all I decided to share top resources for everyone about each topic, that you need to know about python, if you want to be senior python Software Engineer . Of course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than 30-40 chapters. Beginner The Python Programming Language, Implementation and Adventages Python Installation Start Coding With Python Data Types In Python 3 Variables and Assignment Conditions For Loop ... Functions ... Intermediate ... Advanced ... Context Managers Python Metaclasses ...", + "text": "In this repository I want to share resources, that helped me understand python programing language deeply. \nIt was not easy to find appropriate books, articles, answers from Stackoverflow, online courses, videos from py conferences and etc. So, after all I decided to share top resources for everyone about each topic, that you need to know about python, if you want to be senior python Software Engineer . Of course, it needs plenty of time to organize best resources based on the topics and it's hard for me to do it every day, but I want to do min 1 chapter each week and now I think, that there will be more than 30-40 chapters. Beginner The Python Programming Language, Implementation and Adventages Python Installation Start Coding With Python Data Types In Python 3 Variables and Assignment Conditions For Loop ... Functions Scope Scopes, Namespaces and LEGB Rule ... Intermediate ... Advanced ... Context Managers Python Metaclasses ...", "title": "Python Study Guide" }, { @@ -595,6 +595,81 @@ "text": "Functions that return None to indicate special meaning are error prone because\nNone and other values (e.g., zero, the empty string) all evaluate to False in\nconditional expressions. Raise exceptions to indicate special situations instead of returning None. Expect the\ncalling code to handle exceptions properly when they\u2019re documented. Source: Effective Python by Brett Slatkin", "title": "Things to Remember" }, + { + "location": "/beginner/Scopes/", + "text": "Scopes - Python Scope Basics\n\n\nNow that you\u2019re ready to start writing your own functions, we need to get more formal\nabout what names mean in Python. When you use a name in a program, Python creates,\nchanges, or looks up the name in what is known as a namespace\u2014a place where names\nlive. When we talk about the search for a name\u2019s value in relation to code, the term\nscope refers to a namespace: that is, the location of a name\u2019s assignment in your code\ndetermines the scope of the name\u2019s visibility to your code.\n\nJust about everything related to names, including scope classification, happens at assignment\ntime in Python. As we\u2019ve seen, names in Python spring into existence when\nthey are first assigned values, and they must be assigned before they are used. Because\nnames are not declared ahead of time, Python uses the location of the assignment of a\nname to associate it with (i.e., bind it to) a particular namespace. In other words, the\nplace where you assign a name in your source code determines the namespace it will\nlive in, and hence its scope of visibility.\n\nBesides packaging code, functions add an extra namespace layer to your programs\u2014\nby default, all names assigned inside a function are associated with that function\u2019s\nnamespace, and no other. This means that: \n\n\n\n\nNames defined inside a def can only be seen by the code within that def. You cannot\neven refer to such names from outside the function. \n\n\nNames defined inside a def do not clash with variables outside the def, even if the\nsame names are used elsewhere. A name X assigned outside a given def (i.e., in a\ndifferent def or at the top level of a module file) is a completely different variable\nfrom a name X assigned inside that def. \n\n\n\n\nIn all cases, the scope of a variable (where it can be used) is always determined by where\nit is assigned in your source code and has nothing to do with which functions call which.\nIn fact, as we\u2019ll learn in this chapter, variables may be assigned in three different places,\ncorresponding to three different scopes:\n\n- If a variable is assigned inside a def, it is local to that function.\n\n- If a variable is assigned in an enclosing def, it is nonlocal to nested functions.\n\n- If a variable is assigned outside all defs, it is global to the entire file.\n\nWe call this lexical scoping because variable scopes are determined entirely by the locations\nof the variables in the source code of your program files, not by function calls.\n\nFor example, in the following module file, the X = 99 assignment creates a global variable\nnamed X (visible everywhere in this file), but the X = 88 assignment creates a\nlocal variable X (visible only within the def statement): \n\n\nX\n \n=\n \n99\n\n\ndef\n \nfunc\n():\n\n \nX\n \n=\n \n88\n\n\n\n\n\n\nEven though both variables are named X, their scopes make them different. The net\neffect is that function scopes help to avoid name clashes in your programs and help to\nmake functions more self-contained program units. \n\n\nScope Rules\n\n\nBefore we started writing functions, all the code we wrote was at the top level of a\nmodule (i.e., not nested in a def), so the names we used either lived in the module itself\nor were built-ins predefined by Python (e.g., open). Functions provide nested namespaces\n(scopes) that localize the names they use, such that names inside a function\nwon\u2019t clash with those outside it (in a module or another function). Again, functions\ndefine a local scope, and modules define a global scope. The two scopes are related as\nfollows:\n\n- \nThe enclosing module is a global scope.\n Each module is a global scope\u2014that\nis, a namespace in which variables created (assigned) at the top level of the module\nfile live. Global variables become attributes of a module object to the outside world\nbut can be used as simple variables within a module file.\n- \nThe global scope spans a single file only.\n Don\u2019t be fooled by the word \u201cglobal\u201d\nhere\u2014names at the top level of a file are only global to code within that single file.\nThere is really no notion of a single, all-encompassing global file-based scope in Python. Instead, names are partitioned into modules, and you must always import\na module explicitly if you want to be able to use the names its file defines. When\nyou hear \u201cglobal\u201d in Python, think \u201cmodule.\u201d\n\n- \nEach call to a function creates a new local scope.\n Every time you call a function,\nyou create a new local scope\u2014that is, a namespace in which the names created\ninside that function will usually live. You can think of each def statement (and\nlambda expression) as defining a new local scope, but because Python allows functions\nto call themselves to loop (an advanced technique known as recursion), the\nlocal scope in fact technically corresponds to a function call\u2014in other words, each\ncall creates a new local namespace. Recursion is useful when processing structures\nwhose shapes can\u2019t be predicted ahead of time.\n\n- \nAssigned names are local unless declared global or nonlocal.\n By default, all\nthe names assigned inside a function definition are put in the local scope (the\nnamespace associated with the function call). If you need to assign a name that\nlives at the top level of the module enclosing the function, you can do so by declaring\nit in a global statement inside the function. If you need to assign a name\nthat lives in an enclosing def, as of Python 3.0 you can do so by declaring it in a\nnonlocal statement.\n\n- \nAll other names are enclosing function locals, globals, or built-ins.\n Names\nnot assigned a value in the function definition are assumed to be enclosing scope\nlocals (in an enclosing def), globals (in the enclosing module\u2019s namespace), or builtins\n(in the predefined \nbuiltin\n module Python provides).\n\n\nThere are a few subtleties to note here. First, keep in mind that code typed at the\ninteractive command prompt follows these same rules. You may not know it yet, but\ncode run interactively is really entered into a built-in module called \nmain\n; this\nmodule works just like a module file, but results are echoed as you go. Because of this,\ninteractively created names live in a module, too, and thus follow the normal scope\nrules: they are global to the interactive session. You\u2019ll learn more about modules in the\nnext part of this book.\n\n\nAlso note that any type of assignment within a function classifies a name as local. This\nincludes = statements, module names in import, function names in def, function argument\nnames, and so on. If you assign a name in any way within a def, it will become a\nlocal to that function.\n\n\nConversely, in-place changes to objects do not classify names as locals; only actual name\nassignments do. For instance, if the name L is assigned to a list at the top level of a\nmodule, a statement L = X within a function will classify L as a local, but L.append(X)\nwill not. In the latter case, we are changing the list object that L references, not L itself\u2014\nL is found in the global scope as usual, and Python happily modifies it without requiring\na global (or nonlocal) declaration. As usual, it helps to keep the distinction between\nnames and objects clear: changing an object is not an assignment to a name.\n\n\n\n\nSource:\n \n\n\n \nLearning Python, Fourth Edition\n by Mark Lutz - 2009\n\n\n\n\ngood resource : http://sebastianraschka.com/Articles/2014_python_scope_and_namespaces.html", + "title": "Scope" + }, + { + "location": "/beginner/Scopes/#scopes-python-scope-basics", + "text": "Now that you\u2019re ready to start writing your own functions, we need to get more formal\nabout what names mean in Python. When you use a name in a program, Python creates,\nchanges, or looks up the name in what is known as a namespace\u2014a place where names\nlive. When we talk about the search for a name\u2019s value in relation to code, the term\nscope refers to a namespace: that is, the location of a name\u2019s assignment in your code\ndetermines the scope of the name\u2019s visibility to your code. \nJust about everything related to names, including scope classification, happens at assignment\ntime in Python. As we\u2019ve seen, names in Python spring into existence when\nthey are first assigned values, and they must be assigned before they are used. Because\nnames are not declared ahead of time, Python uses the location of the assignment of a\nname to associate it with (i.e., bind it to) a particular namespace. In other words, the\nplace where you assign a name in your source code determines the namespace it will\nlive in, and hence its scope of visibility. \nBesides packaging code, functions add an extra namespace layer to your programs\u2014\nby default, all names assigned inside a function are associated with that function\u2019s\nnamespace, and no other. This means that: Names defined inside a def can only be seen by the code within that def. You cannot\neven refer to such names from outside the function. Names defined inside a def do not clash with variables outside the def, even if the\nsame names are used elsewhere. A name X assigned outside a given def (i.e., in a\ndifferent def or at the top level of a module file) is a completely different variable\nfrom a name X assigned inside that def. In all cases, the scope of a variable (where it can be used) is always determined by where\nit is assigned in your source code and has nothing to do with which functions call which.\nIn fact, as we\u2019ll learn in this chapter, variables may be assigned in three different places,\ncorresponding to three different scopes: \n- If a variable is assigned inside a def, it is local to that function. \n- If a variable is assigned in an enclosing def, it is nonlocal to nested functions. \n- If a variable is assigned outside all defs, it is global to the entire file. \nWe call this lexical scoping because variable scopes are determined entirely by the locations\nof the variables in the source code of your program files, not by function calls. \nFor example, in the following module file, the X = 99 assignment creates a global variable\nnamed X (visible everywhere in this file), but the X = 88 assignment creates a\nlocal variable X (visible only within the def statement): X = 99 def func (): \n X = 88 Even though both variables are named X, their scopes make them different. The net\neffect is that function scopes help to avoid name clashes in your programs and help to\nmake functions more self-contained program units.", + "title": "Scopes - Python Scope Basics" + }, + { + "location": "/beginner/Scopes/#scope-rules", + "text": "Before we started writing functions, all the code we wrote was at the top level of a\nmodule (i.e., not nested in a def), so the names we used either lived in the module itself\nor were built-ins predefined by Python (e.g., open). Functions provide nested namespaces\n(scopes) that localize the names they use, such that names inside a function\nwon\u2019t clash with those outside it (in a module or another function). Again, functions\ndefine a local scope, and modules define a global scope. The two scopes are related as\nfollows: \n- The enclosing module is a global scope. Each module is a global scope\u2014that\nis, a namespace in which variables created (assigned) at the top level of the module\nfile live. Global variables become attributes of a module object to the outside world\nbut can be used as simple variables within a module file.\n- The global scope spans a single file only. Don\u2019t be fooled by the word \u201cglobal\u201d\nhere\u2014names at the top level of a file are only global to code within that single file.\nThere is really no notion of a single, all-encompassing global file-based scope in Python. Instead, names are partitioned into modules, and you must always import\na module explicitly if you want to be able to use the names its file defines. When\nyou hear \u201cglobal\u201d in Python, think \u201cmodule.\u201d \n- Each call to a function creates a new local scope. Every time you call a function,\nyou create a new local scope\u2014that is, a namespace in which the names created\ninside that function will usually live. You can think of each def statement (and\nlambda expression) as defining a new local scope, but because Python allows functions\nto call themselves to loop (an advanced technique known as recursion), the\nlocal scope in fact technically corresponds to a function call\u2014in other words, each\ncall creates a new local namespace. Recursion is useful when processing structures\nwhose shapes can\u2019t be predicted ahead of time. \n- Assigned names are local unless declared global or nonlocal. By default, all\nthe names assigned inside a function definition are put in the local scope (the\nnamespace associated with the function call). If you need to assign a name that\nlives at the top level of the module enclosing the function, you can do so by declaring\nit in a global statement inside the function. If you need to assign a name\nthat lives in an enclosing def, as of Python 3.0 you can do so by declaring it in a\nnonlocal statement. \n- All other names are enclosing function locals, globals, or built-ins. Names\nnot assigned a value in the function definition are assumed to be enclosing scope\nlocals (in an enclosing def), globals (in the enclosing module\u2019s namespace), or builtins\n(in the predefined builtin module Python provides). There are a few subtleties to note here. First, keep in mind that code typed at the\ninteractive command prompt follows these same rules. You may not know it yet, but\ncode run interactively is really entered into a built-in module called main ; this\nmodule works just like a module file, but results are echoed as you go. Because of this,\ninteractively created names live in a module, too, and thus follow the normal scope\nrules: they are global to the interactive session. You\u2019ll learn more about modules in the\nnext part of this book. Also note that any type of assignment within a function classifies a name as local. This\nincludes = statements, module names in import, function names in def, function argument\nnames, and so on. If you assign a name in any way within a def, it will become a\nlocal to that function. Conversely, in-place changes to objects do not classify names as locals; only actual name\nassignments do. For instance, if the name L is assigned to a list at the top level of a\nmodule, a statement L = X within a function will classify L as a local, but L.append(X)\nwill not. In the latter case, we are changing the list object that L references, not L itself\u2014\nL is found in the global scope as usual, and Python happily modifies it without requiring\na global (or nonlocal) declaration. As usual, it helps to keep the distinction between\nnames and objects clear: changing an object is not an assignment to a name. Source: Learning Python, Fourth Edition by Mark Lutz - 2009 good resource : http://sebastianraschka.com/Articles/2014_python_scope_and_namespaces.html", + "title": "Scope Rules" + }, + { + "location": "/beginner/Scopes_Namespaces_LEGB_rule/", + "text": "A Beginner's Guide to Python's Namespaces, Scope Resolution, and the LEGB Rule\n\n\nIntroduction to namespaces and scopes\n\n\nNamespaces\n\n\nRoughly speaking, namespaces are just containers for mapping names to objects. As you might have already heard, everything in Python - literals, lists, dictionaries, functions, classes, etc. - is an object.\nSuch a \u201cname-to-object\u201d mapping allows us to access an object by a name that we\u2019ve assigned to it. E.g., if we make a simple string assignment via a_string = \"Hello string\", we created a reference to the \"Hello string\" object, and henceforth we can access via its variable name a_string.\n\n\nWe can picture a namespace as a Python dictionary structure, where the dictionary keys represent the names and the dictionary values the object itself (and this is also how namespaces are currently implemented in Python), e.g.,\n\n\na_namespace\n \n=\n \n{\nname_a\n:\nobject_1\n,\n \nname_b\n:\nobject_2\n,\n \n...\n \n}\n\n\n\n\n\n\nNow, the tricky part is that we have multiple independent namespaces in Python, and names can be reused for different namespaces (only the objects are unique, for example:\n\n\na_namespace\n \n=\n \n{\nname_a\n:\nobject_1\n,\n \nname_b\n:\nobject_2\n,\n \n...\n}\n\n\nb_namespace\n \n=\n \n{\nname_a\n:\nobject_3\n,\n \nname_b\n:\nobject_4\n,\n \n...\n}\n\n\n\n\n\n\nFor example, everytime we call a for-loop or define a function, it will create its own namespace. Namespaces also have different levels of hierarchy (the so-called \u201cscope\u201d), which we will discuss in more detail in the next section.\n\n\nScope\n\n\nIn the section above, we have learned that namespaces can exist independently from each other and that they are structured in a certain hierarchy, which brings us to the concept of \u201cscope\u201d. The \u201cscope\u201d in Python defines the \u201chierarchy level\u201d in which we search namespaces for certain \u201cname-to-object\u201d mappings.\nFor example, let us consider the following code: \n\n\ni\n \n=\n \n1\n\n\n\ndef\n \nfoo\n():\n\n \ni\n \n=\n \n5\n\n \nprint\n(\ni\n,\n \nin foo()\n)\n\n\n\nprint\n(\ni\n,\n \nglobal\n)\n\n\n\nfoo\n()\n\n\n\n\n\noutput:\n\n\n1 global\n\n\n5 in foo()\n\n\n\n\n\n\n\n\nHere, we just defined the variable name i twice, once on the foo function.\n- foo_namespace = {'i':object_3, ...}\n- global_namespace = {'i':object_1, 'name_b':object_2, ...}\n\n\nSo, how does Python know which namespace it has to search if we want to print the value of the variable i? This is where Python\u2019s LEGB-rule comes into play, which we will discuss in the next section.\n\n\nTip:\n\n\nIf we want to print out the dictionary mapping of the global and local variables, we can use the the functions global() and local()\n\n\n#print(globals()) # prints global namespace\n\n\n#print(locals()) # prints local namespace\n\n\n\nglob\n \n=\n \n1\n\n\n\ndef\n \nfoo\n():\n\n \nloc\n \n=\n \n5\n\n \nprint\n(\nloc in foo():\n,\n \nloc\n \nin\n \nlocals\n())\n\n\n\nfoo\n()\n\n\nprint\n(\nloc in global:\n,\n \nloc\n \nin\n \nglobals\n())\n \n\nprint\n(\nglob in global:\n,\n \nfoo\n \nin\n \nglobals\n())\n\n\n\n\n\nloc in foo(): True\n\n\nloc in global: False\n\n\nglob in global: True\n\n\n\n\n\n\n\n\nScope resolution for variable names via the LEGB rule.\n\n\nWe have seen that multiple namespaces can exist independently from each other and that they can contain the same variable names on different hierachy levels. The \u201cscope\u201d defines on which hierarchy level Python searches for a particular \u201cvariable name\u201d for its associated object. Now, the next question is: \u201cIn which order does Python search the different levels of namespaces before it finds the name-to-object\u2019 mapping?\u201d\nTo answer is: It uses the LEGB-rule, which stands for\n\n\nLocal -\n Enclosed -\n Global -\n Built-in,\n\n\nwhere the arrows should denote the direction of the namespace-hierarchy search order.\n\n\n\n\nLocal can be inside a function or class method, for example.\n\n\nEnclosed can be its enclosing function, e.g., if a function is wrapped inside another function.\n\n\nGlobal refers to the uppermost level of the executing script itself, and\n\n\nBuilt-in are special names that Python reserves for itself.\n\n\n\n\nSo, if a particular name:object mapping cannot be found in the local namespaces, the namespaces of the enclosed scope are being searched next. If the search in the enclosed scope is unsuccessful, too, Python moves on to the global namespace, and eventually, it will search the built-in namespace (side note: if a name cannot found in any of the namespaces, a NameError will is raised).\n\n\nNamespaces can also be further nested, for example if we import modules, or if we are defining new classes. In those cases we have to use prefixes to access those nested namespaces. Let me illustrate this concept in the following code block:\n\n\nimport\n \nnumpy\n\n\nimport\n \nmath\n\n\nimport\n \nscipy\n\n\n\nprint\n(\nmath\n.\npi\n,\n \nfrom the math module\n)\n\n\nprint\n(\nnumpy\n.\npi\n,\n \nfrom the numpy package\n)\n\n\nprint\n(\nscipy\n.\npi\n,\n \nfrom the scipy package\n)\n\n\n\n\n\n\n3.141592653589793 from the math module\n\n\n3.141592653589793 from the numpy package\n\n\n3.141592653589793 from the scipy package\n\n\n\n\n\n\n\n\n(This is also why we have to be careful if we import modules via \u201cfrom a_module import *\u201d, since it loads the variable names into the global namespace and could potentially overwrite already existing variable names)\n\n\n\n\n1. LG - Local and Global scopes\n\n\nAs a warm-up exercise, let us first forget about the enclosed (E) and built-in (B) scopes in the LEGB rule and only take a look at LG - the local and global scopes.\nWhat does the following code print?\n\n\na_var\n \n=\n \nglobal variable\n\n\n\ndef\n \na_func\n():\n\n \nprint\n(\na_var\n,\n \n[ a_var inside a_func() ]\n)\n\n\n\na_func\n()\n\n\nprint\n(\na_var\n,\n \n[ a_var outside a_func() ]\n)\n\n\n\n\n\nanswer:\n\n\nglobal value [ a_var inside a_func() ] \n\n\nglobal value [ a_var outside a_func() ]\n\n\n\n\n\n\n\n\nHere is why:\n\n\nWe call a_func() first, which is supposed to print the value of a_var. According to the LEGB rule, the function will first look in its own local scope (L) if a_var is defined there. Since a_func() does not define its own a_var, it will look one-level above in the global scope (G) in which a_var has been defined previously. \n\n\nExample 1.2\nNow, let us define the variable a_var in the global and the local scope.\nCan you guess what the following code will produce?\n\n\na_var\n \n=\n \nglobal value\n\n\n\ndef\n \na_func\n():\n\n \na_var\n \n=\n \nlocal value\n\n \nprint\n(\na_var\n,\n \n[ a_var inside a_func() ]\n)\n\n\n\na_func\n()\n\n\nprint\n(\na_var\n,\n \n[ a_var outside a_func() ]\n)\n\n\n\n\nanswer:\n\n\nlocal value [ a_var inside a_func() ]\n\n\nglobal value [ a_var outside a_func() ]\n\n\n\n\n\n\n\n\nHere is why:\n\n\nWhen we call a_func(), it will first look in its local scope (L) for a_var, since a_var is defined in the local scope of a_func, its assigned value local variable is printed. Note that this doesn\u2019t affect the global variable, which is in a different scope.\n\n\nHowever, it is also possible to modify the global by, e.g., re-assigning a new value to it if we use the global keyword as the following example will illustrate:\n\n\na_var\n \n=\n \nglobal value\n\n\n\ndef\n \na_func\n():\n\n \nglobal\n \na_var\n\n \na_var\n \n=\n \nlocal value\n\n \nprint\n(\na_var\n,\n \n[ a_var inside a_func() ]\n)\n\n\n\nprint\n(\na_var\n,\n \n[ a_var outside a_func() ]\n)\n\n\na_func\n()\n\n\nprint\n(\na_var\n,\n \n[ a_var outside a_func() ]\n)\n\n\n\n\noutput:\n\n\nglobal value [ a_var outside a_func() ]\n\n\nlocal value [ a_var inside a_func() ]\n\n\nlocal value [ a_var outside a_func() ]\n\n\n\n\n\n\n\n\nBut we have to be careful about the order: it is easy to raise an UnboundLocalError if we don\u2019t explicitly tell Python that we want to use the global scope and try to modify a variable\u2019s value (remember, the right side of an assignment operation is executed first):\n\n\na_var\n \n=\n \n1\n\n\n\ndef\n \na_func\n():\n\n \na_var\n \n=\n \na_var\n \n+\n \n1\n\n \nprint\n(\na_var\n,\n \n[ a_var inside a_func() ]\n)\n\n\n\nprint\n(\na_var\n,\n \n[ a_var outside a_func() ]\n)\n\n\na_func\n()\n\n\n\n\n\noutput:\n\n\n---------------------------------------------------------------------------\n\n\nUnboundLocalError Traceback (most recent call last)\n\n\n\n\n\n\n\n\n2. LEG - Local, Enclosed, and Global scope\n\n\nNow, let us introduce the concept of the enclosed (E) scope. Following the order \u201cLocal -\n Enclosed -\n Global\u201d, can you guess what the following code will print?\n\n\nExample 2.1\n\n\na_var\n \n=\n \nglobal value\n\n\n\ndef\n \nouter\n():\n\n \na_var\n \n=\n \nenclosed value\n\n\n \ndef\n \ninner\n():\n\n \na_var\n \n=\n \nlocal value\n\n \nprint\n(\na_var\n)\n\n\n \ninner\n()\n\n\n\nouter\n()\n\n\n\n\noutput:\n\n\nlocal value\n\n\n\n\n\n\n\n\nHere is why:\n\n\nLet us quickly recapitulate what we just did: We called outer(), which defined the variable a_var locally (next to an existing a_var in the global scope). Next, the outer() function called inner(), which in turn defined a variable with of name a_var as well. The print() function inside inner() searched in the local scope first (L-\nE) before it went up in the scope hierarchy, and therefore it printed the value that was assigned in the local scope.\n\n\nSimilar to the concept of the global keyword, which we have seen in the section above, we can use the keyword nonlocal inside the inner function to explicitly access a variable from the outer (enclosed) scope in order to modify its value.\nNote that the nonlocal keyword was added in Python 3.x and is not implemented in Python 2.x (yet).\n\n\na_var\n \n=\n \nglobal value\n\n\n\ndef\n \nouter\n():\n\n \na_var\n \n=\n \nlocal value\n\n \nprint\n(\nouter before:\n,\n \na_var\n)\n\n \ndef\n \ninner\n():\n\n \nnonlocal\n \na_var\n\n \na_var\n \n=\n \ninner value\n\n \nprint\n(\nin inner():\n,\n \na_var\n)\n\n \ninner\n()\n\n \nprint\n(\nouter after:\n,\n \na_var\n)\n\n\nouter\n()\n\n\n\n\noutput:\n\n\nouter before: local value\n\n\nin inner(): inner value\n\n\nouter after: inner value\n\n\n\n\n\n\n\n\n3. LEGB - Local, Enclosed, Global, Built-in\n\n\nTo wrap up the LEGB rule, let us come to the built-in scope. Here, we will define our \u201cown\u201d length-function, which happens to bear the same name as the in-built len() function. What outcome do you excpect if we\u2019d execute the following code?\n\n\na_var\n \n=\n \nglobal variable\n\n\n\ndef\n \nlen\n(\nin_var\n):\n\n \nprint\n(\ncalled my len() function\n)\n\n \nl\n \n=\n \n0\n\n \nfor\n \ni\n \nin\n \nin_var\n:\n\n \nl\n \n+=\n \n1\n\n \nreturn\n \nl\n\n\n\ndef\n \na_func\n(\nin_var\n):\n\n \nlen_in_var\n \n=\n \nlen\n(\nin_var\n)\n\n \nprint\n(\nInput variable is of length\n,\n \nlen_in_var\n)\n\n\n\na_func\n(\nHello, World!\n)\n\n\n\n\noutput:\n\n\ncalled my len() function\n\n\nInput variable is of length 13\n\n\n\n\n\n\n\n\nHere is why:\n\n\nSince the exact same names can be used to map names to different objects - as long as the names are in different name spaces - there is no problem of reusing the name len to define our own length function (this is just for demonstration pruposes, it is NOT recommended). As we go up in Python\u2019s L -\n E -\n G -\n B hierarchy, the function a_func() finds len() already in the global scope (G) first before it attempts to search the built-in (B) namespace.\n\n\nSelf-assessment exercise\n\n\nNow, after we went through a couple of exercises, let us quickly check where we are. So, one more time: What would the following code print out?\n\n\na\n \n=\n \nglobal\n\n\n\ndef\n \nouter\n():\n\n\n \ndef\n \nlen\n(\nin_var\n):\n\n \nprint\n(\ncalled my len() function: \n,\n \nend\n=\n)\n\n \nl\n \n=\n \n0\n\n \nfor\n \ni\n \nin\n \nin_var\n:\n\n \nl\n \n+=\n \n1\n\n \nreturn\n \nl\n\n\n \na\n \n=\n \nlocal\n\n\n \ndef\n \ninner\n():\n\n \nglobal\n \nlen\n\n \nnonlocal\n \na\n\n \na\n \n+=\n \n variable\n\n \ninner\n()\n\n \nprint\n(\na is\n,\n \na\n)\n\n \nprint\n(\nlen\n(\na\n))\n\n\n\n\nouter\n()\n\n\n\nprint\n(\nlen\n(\na\n))\n\n\nprint\n(\na is\n,\n \na\n)\n\n\n\n\n\n\noutput:\n\n\na is local variable\n\n\ncalled my len() function: 14\n\n\n6\n\n\na is global\n\n\n\n\n\n\n\n\nConclusion\n\n\nI hope this short tutorial was helpful to understand the basic concept of Python\u2019s scope resolution order using the LEGB rule. I want to encourage you (as a little self-assessment exercise) to look at the code snippets again tomorrow and check if you can correctly predict all their outcomes.\n\n\nA rule of thumb\n\n\nIn practice, it is usually a bad idea to modify global variables inside the function scope, since it often be the cause of confusion and weird errors that are hard to debug.\nIf you want to modify a global variable via a function, it is recommended to pass it as an argument and reassign the return-value.\nFor example:\n\n\na_var\n \n=\n \n2\n\n\n\ndef\n \na_func\n(\nsome_var\n):\n\n \nreturn\n \n2\n**\n3\n\n\n\na_var\n \n=\n \na_func\n(\na_var\n)\n\n\nprint\n(\na_var\n)\n\n\n\n\n\noutput:\n\n\n8\n\n\n\n\n\n\n\n\n\n\nSource:\n \n\n\n http://sebastianraschka.com/Articles/2014_python_scope_and_namespaces.html", + "title": "Scopes, Namespaces and LEGB Rule" + }, + { + "location": "/beginner/Scopes_Namespaces_LEGB_rule/#a-beginners-guide-to-pythons-namespaces-scope-resolution-and-the-legb-rule", + "text": "", + "title": "A Beginner's Guide to Python's Namespaces, Scope Resolution, and the LEGB Rule" + }, + { + "location": "/beginner/Scopes_Namespaces_LEGB_rule/#introduction-to-namespaces-and-scopes", + "text": "", + "title": "Introduction to namespaces and scopes" + }, + { + "location": "/beginner/Scopes_Namespaces_LEGB_rule/#namespaces", + "text": "Roughly speaking, namespaces are just containers for mapping names to objects. As you might have already heard, everything in Python - literals, lists, dictionaries, functions, classes, etc. - is an object.\nSuch a \u201cname-to-object\u201d mapping allows us to access an object by a name that we\u2019ve assigned to it. E.g., if we make a simple string assignment via a_string = \"Hello string\", we created a reference to the \"Hello string\" object, and henceforth we can access via its variable name a_string. We can picture a namespace as a Python dictionary structure, where the dictionary keys represent the names and the dictionary values the object itself (and this is also how namespaces are currently implemented in Python), e.g., a_namespace = { name_a : object_1 , name_b : object_2 , ... } Now, the tricky part is that we have multiple independent namespaces in Python, and names can be reused for different namespaces (only the objects are unique, for example: a_namespace = { name_a : object_1 , name_b : object_2 , ... } b_namespace = { name_a : object_3 , name_b : object_4 , ... } For example, everytime we call a for-loop or define a function, it will create its own namespace. Namespaces also have different levels of hierarchy (the so-called \u201cscope\u201d), which we will discuss in more detail in the next section.", + "title": "Namespaces" + }, + { + "location": "/beginner/Scopes_Namespaces_LEGB_rule/#scope", + "text": "In the section above, we have learned that namespaces can exist independently from each other and that they are structured in a certain hierarchy, which brings us to the concept of \u201cscope\u201d. The \u201cscope\u201d in Python defines the \u201chierarchy level\u201d in which we search namespaces for certain \u201cname-to-object\u201d mappings.\nFor example, let us consider the following code: i = 1 def foo (): \n i = 5 \n print ( i , in foo() ) print ( i , global ) foo () output: 1 global 5 in foo() Here, we just defined the variable name i twice, once on the foo function.\n- foo_namespace = {'i':object_3, ...}\n- global_namespace = {'i':object_1, 'name_b':object_2, ...} So, how does Python know which namespace it has to search if we want to print the value of the variable i? This is where Python\u2019s LEGB-rule comes into play, which we will discuss in the next section.", + "title": "Scope" + }, + { + "location": "/beginner/Scopes_Namespaces_LEGB_rule/#tip", + "text": "If we want to print out the dictionary mapping of the global and local variables, we can use the the functions global() and local() #print(globals()) # prints global namespace #print(locals()) # prints local namespace glob = 1 def foo (): \n loc = 5 \n print ( loc in foo(): , loc in locals ()) foo () print ( loc in global: , loc in globals ()) print ( glob in global: , foo in globals ()) loc in foo(): True loc in global: False glob in global: True", + "title": "Tip:" + }, + { + "location": "/beginner/Scopes_Namespaces_LEGB_rule/#scope-resolution-for-variable-names-via-the-legb-rule", + "text": "We have seen that multiple namespaces can exist independently from each other and that they can contain the same variable names on different hierachy levels. The \u201cscope\u201d defines on which hierarchy level Python searches for a particular \u201cvariable name\u201d for its associated object. Now, the next question is: \u201cIn which order does Python search the different levels of namespaces before it finds the name-to-object\u2019 mapping?\u201d\nTo answer is: It uses the LEGB-rule, which stands for Local - Enclosed - Global - Built-in, where the arrows should denote the direction of the namespace-hierarchy search order. Local can be inside a function or class method, for example. Enclosed can be its enclosing function, e.g., if a function is wrapped inside another function. Global refers to the uppermost level of the executing script itself, and Built-in are special names that Python reserves for itself. So, if a particular name:object mapping cannot be found in the local namespaces, the namespaces of the enclosed scope are being searched next. If the search in the enclosed scope is unsuccessful, too, Python moves on to the global namespace, and eventually, it will search the built-in namespace (side note: if a name cannot found in any of the namespaces, a NameError will is raised). Namespaces can also be further nested, for example if we import modules, or if we are defining new classes. In those cases we have to use prefixes to access those nested namespaces. Let me illustrate this concept in the following code block: import numpy import math import scipy print ( math . pi , from the math module ) print ( numpy . pi , from the numpy package ) print ( scipy . pi , from the scipy package ) 3.141592653589793 from the math module 3.141592653589793 from the numpy package 3.141592653589793 from the scipy package (This is also why we have to be careful if we import modules via \u201cfrom a_module import *\u201d, since it loads the variable names into the global namespace and could potentially overwrite already existing variable names)", + "title": "Scope resolution for variable names via the LEGB rule." + }, + { + "location": "/beginner/Scopes_Namespaces_LEGB_rule/#1-lg-local-and-global-scopes", + "text": "As a warm-up exercise, let us first forget about the enclosed (E) and built-in (B) scopes in the LEGB rule and only take a look at LG - the local and global scopes.\nWhat does the following code print? a_var = global variable def a_func (): \n print ( a_var , [ a_var inside a_func() ] ) a_func () print ( a_var , [ a_var outside a_func() ] ) answer: global value [ a_var inside a_func() ] global value [ a_var outside a_func() ] Here is why: We call a_func() first, which is supposed to print the value of a_var. According to the LEGB rule, the function will first look in its own local scope (L) if a_var is defined there. Since a_func() does not define its own a_var, it will look one-level above in the global scope (G) in which a_var has been defined previously. Example 1.2\nNow, let us define the variable a_var in the global and the local scope.\nCan you guess what the following code will produce? a_var = global value def a_func (): \n a_var = local value \n print ( a_var , [ a_var inside a_func() ] ) a_func () print ( a_var , [ a_var outside a_func() ] ) answer: local value [ a_var inside a_func() ] global value [ a_var outside a_func() ] Here is why: When we call a_func(), it will first look in its local scope (L) for a_var, since a_var is defined in the local scope of a_func, its assigned value local variable is printed. Note that this doesn\u2019t affect the global variable, which is in a different scope. However, it is also possible to modify the global by, e.g., re-assigning a new value to it if we use the global keyword as the following example will illustrate: a_var = global value def a_func (): \n global a_var \n a_var = local value \n print ( a_var , [ a_var inside a_func() ] ) print ( a_var , [ a_var outside a_func() ] ) a_func () print ( a_var , [ a_var outside a_func() ] ) output: global value [ a_var outside a_func() ] local value [ a_var inside a_func() ] local value [ a_var outside a_func() ] But we have to be careful about the order: it is easy to raise an UnboundLocalError if we don\u2019t explicitly tell Python that we want to use the global scope and try to modify a variable\u2019s value (remember, the right side of an assignment operation is executed first): a_var = 1 def a_func (): \n a_var = a_var + 1 \n print ( a_var , [ a_var inside a_func() ] ) print ( a_var , [ a_var outside a_func() ] ) a_func () output: --------------------------------------------------------------------------- UnboundLocalError Traceback (most recent call last)", + "title": "1. LG - Local and Global scopes" + }, + { + "location": "/beginner/Scopes_Namespaces_LEGB_rule/#2-leg-local-enclosed-and-global-scope", + "text": "Now, let us introduce the concept of the enclosed (E) scope. Following the order \u201cLocal - Enclosed - Global\u201d, can you guess what the following code will print? Example 2.1 a_var = global value def outer (): \n a_var = enclosed value \n\n def inner (): \n a_var = local value \n print ( a_var ) \n\n inner () outer () output: local value Here is why: Let us quickly recapitulate what we just did: We called outer(), which defined the variable a_var locally (next to an existing a_var in the global scope). Next, the outer() function called inner(), which in turn defined a variable with of name a_var as well. The print() function inside inner() searched in the local scope first (L- E) before it went up in the scope hierarchy, and therefore it printed the value that was assigned in the local scope. Similar to the concept of the global keyword, which we have seen in the section above, we can use the keyword nonlocal inside the inner function to explicitly access a variable from the outer (enclosed) scope in order to modify its value.\nNote that the nonlocal keyword was added in Python 3.x and is not implemented in Python 2.x (yet). a_var = global value def outer (): \n a_var = local value \n print ( outer before: , a_var ) \n def inner (): \n nonlocal a_var \n a_var = inner value \n print ( in inner(): , a_var ) \n inner () \n print ( outer after: , a_var ) outer () output: outer before: local value in inner(): inner value outer after: inner value", + "title": "2. LEG - Local, Enclosed, and Global scope" + }, + { + "location": "/beginner/Scopes_Namespaces_LEGB_rule/#3-legb-local-enclosed-global-built-in", + "text": "To wrap up the LEGB rule, let us come to the built-in scope. Here, we will define our \u201cown\u201d length-function, which happens to bear the same name as the in-built len() function. What outcome do you excpect if we\u2019d execute the following code? a_var = global variable def len ( in_var ): \n print ( called my len() function ) \n l = 0 \n for i in in_var : \n l += 1 \n return l def a_func ( in_var ): \n len_in_var = len ( in_var ) \n print ( Input variable is of length , len_in_var ) a_func ( Hello, World! ) output: called my len() function Input variable is of length 13 Here is why: Since the exact same names can be used to map names to different objects - as long as the names are in different name spaces - there is no problem of reusing the name len to define our own length function (this is just for demonstration pruposes, it is NOT recommended). As we go up in Python\u2019s L - E - G - B hierarchy, the function a_func() finds len() already in the global scope (G) first before it attempts to search the built-in (B) namespace.", + "title": "3. LEGB - Local, Enclosed, Global, Built-in" + }, + { + "location": "/beginner/Scopes_Namespaces_LEGB_rule/#self-assessment-exercise", + "text": "Now, after we went through a couple of exercises, let us quickly check where we are. So, one more time: What would the following code print out? a = global def outer (): \n\n def len ( in_var ): \n print ( called my len() function: , end = ) \n l = 0 \n for i in in_var : \n l += 1 \n return l \n\n a = local \n\n def inner (): \n global len \n nonlocal a \n a += variable \n inner () \n print ( a is , a ) \n print ( len ( a )) outer () print ( len ( a )) print ( a is , a ) output: a is local variable called my len() function: 14 6 a is global", + "title": "Self-assessment exercise" + }, + { + "location": "/beginner/Scopes_Namespaces_LEGB_rule/#conclusion", + "text": "I hope this short tutorial was helpful to understand the basic concept of Python\u2019s scope resolution order using the LEGB rule. I want to encourage you (as a little self-assessment exercise) to look at the code snippets again tomorrow and check if you can correctly predict all their outcomes. A rule of thumb In practice, it is usually a bad idea to modify global variables inside the function scope, since it often be the cause of confusion and weird errors that are hard to debug.\nIf you want to modify a global variable via a function, it is recommended to pass it as an argument and reassign the return-value.\nFor example: a_var = 2 def a_func ( some_var ): \n return 2 ** 3 a_var = a_func ( a_var ) print ( a_var ) output: 8 Source: http://sebastianraschka.com/Articles/2014_python_scope_and_namespaces.html", + "title": "Conclusion" + }, { "location": "/advanced/Context_Managers/", "text": "How Exactly Do Context Managers Work?\n\n\nContext managers (PEP 343) are pretty important in Python. You probably use one every time you open a file:\n\n\nwith\n \nopen\n(\ncake.txt\n)\n \nas\n \nc\n:\n\n \ngobble_gobble\n(\nc\n)\n\n\n\n\n\n\nBut how well do you understand what\u2019s going on behind the scenes?\n\n\nCONTEXT MANAGER CLASSES\n\n\nIt\u2019s actually quite simple. A context manager is a class that implements an \n__enter__\n and an \n__exit__\n method.\n\n\nLet\u2019s imagine you want to you print a line of text to the console surrounded with asterisks. Here\u2019s a context manager to do it:\n\n\nclass\n \nasterisks\n():\n\n \ndef\n \n__enter__\n(\nself\n):\n\n \nprint\n(\n*\n \n*\n \n32\n)\n\n\n \ndef\n \n__exit__\n(\nself\n,\n \nexc_type\n,\n \nexc_val\n,\n \nexc_tb\n):\n\n \nprint\n(\n*\n \n*\n \n32\n)\n\n\n\n\n\n\nThe \n__exit__\n method takes three arguments apart from \nself\n. Those arguments contain information about any errors that occurred inside the \nwith\n block.\n\n\nYou can use \nasterisks\n in the same way as any of the built-in context managers:\n\n\n \nwith\n \nasterisks\n():\n\n\n \nprint\n(\nContext Managers Rock!\n)\n\n\n********************************\n\n\nContext\n \nManagers\n \nRock\n!\n\n\n********************************\n\n\n\n\n\n\nACCESSING THE CONTEXT INSIDE THE WITH BLOCK\n\n\nIf you need to get something back and use it inside the with block \u2013 such as a file descriptor \u2013 you simply return it from \n__enter__\n:\n\n\nclass\n \nmyopen\n():\n\n \ndef\n \n__init__\n(\nself\n,\n \nfilename\n,\n \nfilemode\n):\n\n \nself\n.\nfilename\n \n=\n \nfilename\n\n \nself\n.\nfilemode\n \n=\n \nfilemode\n\n\n \ndef\n \n__enter__\n(\nself\n):\n\n \nself\n.\nfile\n \n=\n \nopen\n(\nself\n.\nfilename\n,\n \nself\n.\nfilemode\n)\n\n \nreturn\n \nself\n.\nfile\n\n\n \ndef\n \n__exit__\n(\nself\n,\n \nexc_type\n,\n \nexc_val\n,\n \nexc_tb\n):\n\n \nself\n.\nfile\n.\nclose\n()\n\n\n\n\n\n\nmyopen\n works identically to the built-in \nopen\n:\n\n\nwith\n \nmyopen\n(\nbeer.txt\n)\n \nas\n \nb\n:\n\n \nguzzle_guzzle\n(\nb\n)\n\n\n\n\n\n\nTHE CONTEXTMANAGER DECORATOR\n\n\nThankfully, you don\u2019t have to implement a class every time. The \ncontextlib\n package has a \ncontextmanager\n decorator that you can apply to generators to automatically transform them into context managers:\n\n\nfrom\n \ncontextlib\n \nimport\n \ncontextmanager\n\n\n\n@contextmanager\n\n\ndef\n \nspoiler\n():\n\n \nprint\n(\nspoiler\n)\n\n \nyield\n\n \nprint\n(\n/spoiler\n)\n\n\n\n\n\n\nThe code before \nyield\n corresponds to \n__enter__\n and the code after \nyield\n corresponds to \n__exit__\n. A context manager generator should have exactly one \nyield\n in it.\n\n\nIt works the same as the class version:\n\n\n \nwith\n \nspoiler\n():\n\n\n \nprint\n(\nJon Snow is Luke\ns father.\n)\n\n\nspoiler\n\n\nJon\n \nSnow\n \nis\n \nLuke\ns father.\n\n\n/\nspoiler\n\n\n\n\n\n\nROLL YOUR OWN CONTEXTMANAGER DECORATOR\n\n\nThe implementation in \ncontextlib\n is complicated, but it\u2019s not hard to write something that works similarly with the exception of a few edge cases:\n\n\ndef\n \ncontextmanager\n(\ngen\n):\n\n \nclass\n \nCMWrapper\n(\nobject\n):\n\n \ndef\n \n__init__\n(\nself\n,\n \nwrapped\n):\n\n \nself\n.\ngenerator\n \n=\n \nwrapped\n\n\n \ndef\n \n__enter__\n(\nself\n):\n\n \nreturn\n \nnext\n(\nself\n.\ngenerator\n)\n\n\n \ndef\n \n__exit__\n(\nself\n,\n \nex_type\n,\n \nvalue\n,\n \ntraceback\n):\n\n \ntry\n:\n\n \nnext\n(\nself\n.\ngenerator\n)\n\n \nexcept\n \nStopIteration\n:\n\n \npass\n\n\n \ndef\n \ninner\n(\n*\nargs\n,\n \n**\nkwargs\n):\n\n \nreturn\n \nCMWrapper\n(\ngen\n(\n*\nargs\n,\n \n**\nkwargs\n))\n\n\n \nreturn\n \ninner\n\n\n\n\n\n\nIt\u2019s not as robust as the real implementation, but it should be understandable. Here are the key points:\n- The inner function instantiates a copy of the nested CMWrapper class with a handle on the generator passed into the decorator.\n\n- \n__enter__\n calls next() on the generator and returns the yielded value so it can be used in the with block.\n\n- \n__exit__\n calls next() again and catches the StopIteration exception that the generator throws when it finishes. \n\n\nThat\u2019s it for now. If you want to learn more about context managers, I recommend you take a look at the code for \ncontextlib\n.\n\n\n\n\nSource:\n \n\n\n https://www.smallsurething.com/how-exactly-do-context-managers-work/\n\n\n\n\nPython Context Managers and the \"with\" Statement (\nenter\n \n \nexit\n) \nVIDEO", diff --git a/site/sitemap.xml b/site/sitemap.xml index 02e1eb5..f0cc2f8 100644 --- a/site/sitemap.xml +++ b/site/sitemap.xml @@ -4,7 +4,7 @@ / - 2017-10-20 + 2017-11-23 daily @@ -13,49 +13,61 @@ /beginner/Python_Programming_Lanuage/ - 2017-10-20 + 2017-11-23 daily /beginner/Python_Installation/ - 2017-10-20 + 2017-11-23 daily /beginner/Start_Coding_With_Python/ - 2017-10-20 + 2017-11-23 daily /beginner/Data_Types_In_Python_3/ - 2017-10-20 + 2017-11-23 daily /beginner/Variables_And_Assignment/ - 2017-10-20 + 2017-11-23 daily /beginner/Conditions/ - 2017-10-20 + 2017-11-23 daily /beginner/For_Loop/ - 2017-10-20 + 2017-11-23 daily /beginner/Functions/ - 2017-10-20 + 2017-11-23 + daily + + + + /beginner/Scopes/ + 2017-11-23 + daily + + + + /beginner/Scopes_Namespaces_LEGB_rule/ + 2017-11-23 daily @@ -65,13 +77,13 @@ /advanced/Context_Managers/ - 2017-10-20 + 2017-11-23 daily /advanced/Python_Metaclasses/ - 2017-10-20 + 2017-11-23 daily @@ -80,7 +92,7 @@ /About/ - 2017-10-20 + 2017-11-23 daily From 0acb8cd34dc52c1e7cfaa23840521bf819fe691c Mon Sep 17 00:00:00 2001 From: Goga Patarkatsishvili Date: Sun, 29 Apr 2018 12:55:27 +0400 Subject: [PATCH 37/39] no message --- docs/advanced/Python_Magic_Methods.md | 3 + docs/index.md | 1 + mkdocs.yml | 1 + site/404.html | 103 ++- site/About/index.html | 107 ++- site/advanced/Context_Managers/index.html | 107 ++- site/advanced/Python_Magic_Methods/index.html | 570 ++++++++++++ site/advanced/Python_Metaclasses/index.html | 111 ++- site/assets/images/favicon.ico | Bin 1150 -> 0 bytes site/assets/images/favicon.png | Bin 0 -> 521 bytes ...-670608a71a.svg => bitbucket.4ebea66e.svg} | 0 ...hub-1da075986e.svg => github.a4034fb1.svg} | 0 ...lab-5ad3f9f9e5.svg => gitlab.d80e5efc.svg} | 0 .../javascripts/application-6940329b9f.js | 1 - .../javascripts/application.ce2ab4bf.js | 1 + site/assets/javascripts/lunr/lunr.da.js | 2 +- site/assets/javascripts/lunr/lunr.de.js | 2 +- site/assets/javascripts/lunr/lunr.du.js | 2 +- site/assets/javascripts/lunr/lunr.es.js | 2 +- site/assets/javascripts/lunr/lunr.fi.js | 2 +- site/assets/javascripts/lunr/lunr.fr.js | 2 +- site/assets/javascripts/lunr/lunr.hu.js | 2 +- site/assets/javascripts/lunr/lunr.it.js | 2 +- site/assets/javascripts/lunr/lunr.jp.js | 2 +- site/assets/javascripts/lunr/lunr.no.js | 2 +- site/assets/javascripts/lunr/lunr.pt.js | 2 +- site/assets/javascripts/lunr/lunr.ro.js | 2 +- site/assets/javascripts/lunr/lunr.ru.js | 2 +- site/assets/javascripts/lunr/lunr.sv.js | 2 +- site/assets/javascripts/lunr/lunr.tr.js | 2 +- .../javascripts/modernizr-1df76c4e58.js | 1 - site/assets/javascripts/modernizr.1aa3b519.js | 1 + .../application-02c2a4388f.palette.css | 1 - .../stylesheets/application-bfecc7305d.css | 1 - .../application-palette.792431c1.css | 2 + .../stylesheets/application.2a88008a.css | 2 + site/beginner/Conditions/index.html | 107 ++- .../Data_Types_In_Python_3/index.html | 107 ++- site/beginner/For_Loop/index.html | 107 ++- site/beginner/Functions/index.html | 114 ++- site/beginner/Python_Installation/index.html | 107 ++- .../Python_Programming_Lanuage/index.html | 107 ++- site/beginner/Scopes/index.html | 107 ++- .../Scopes_Namespaces_LEGB_rule/index.html | 107 ++- .../Start_Coding_With_Python/index.html | 107 ++- .../Variables_And_Assignment/index.html | 107 ++- site/index.html | 104 ++- site/mkdocs/js/lunr.min.js | 7 - site/mkdocs/js/mustache.min.js | 1 - site/mkdocs/js/require.js | 36 - .../js/search-results-template.mustache | 4 - site/mkdocs/js/search.js | 88 -- site/mkdocs/js/text.js | 390 -------- site/mkdocs/search_index.json | 829 ----------------- site/search/search_index.json | 839 ++++++++++++++++++ site/sitemap.xml | 34 +- 56 files changed, 2481 insertions(+), 1971 deletions(-) create mode 100644 docs/advanced/Python_Magic_Methods.md create mode 100644 site/advanced/Python_Magic_Methods/index.html delete mode 100644 site/assets/images/favicon.ico create mode 100644 site/assets/images/favicon.png rename site/assets/images/icons/{bitbucket-670608a71a.svg => bitbucket.4ebea66e.svg} (100%) rename site/assets/images/icons/{github-1da075986e.svg => github.a4034fb1.svg} (100%) rename site/assets/images/icons/{gitlab-5ad3f9f9e5.svg => gitlab.d80e5efc.svg} (100%) delete mode 100644 site/assets/javascripts/application-6940329b9f.js create mode 100644 site/assets/javascripts/application.ce2ab4bf.js delete mode 100644 site/assets/javascripts/modernizr-1df76c4e58.js create mode 100644 site/assets/javascripts/modernizr.1aa3b519.js delete mode 100644 site/assets/stylesheets/application-02c2a4388f.palette.css delete mode 100644 site/assets/stylesheets/application-bfecc7305d.css create mode 100644 site/assets/stylesheets/application-palette.792431c1.css create mode 100644 site/assets/stylesheets/application.2a88008a.css delete mode 100644 site/mkdocs/js/lunr.min.js delete mode 100644 site/mkdocs/js/mustache.min.js delete mode 100644 site/mkdocs/js/require.js delete mode 100644 site/mkdocs/js/search-results-template.mustache delete mode 100644 site/mkdocs/js/search.js delete mode 100644 site/mkdocs/js/text.js delete mode 100644 site/mkdocs/search_index.json create mode 100644 site/search/search_index.json diff --git a/docs/advanced/Python_Magic_Methods.md b/docs/advanced/Python_Magic_Methods.md new file mode 100644 index 0000000..e286d6b --- /dev/null +++ b/docs/advanced/Python_Magic_Methods.md @@ -0,0 +1,3 @@ +# All about Python magic methods: + +> :fa-link: https://rszalski.github.io/magicmethods/ diff --git a/docs/index.md b/docs/index.md index 4ae7ad5..4f99de9 100644 --- a/docs/index.md +++ b/docs/index.md @@ -30,5 +30,6 @@ Of course, it needs plenty of time to organize best resources based on the topic - ... - [Context Managers](https://ent1c3d.github.io/Python-Synopsis/site/advanced/Context_Managers) - [Python Metaclasses](https://ent1c3d.github.io/Python-Synopsis/site/advanced/Python_Metaclasses) + - [Python Magic Methods](https://ent1c3d.github.io/Python-Synopsis/site/advanced/Python_Magic_Methods) - ... diff --git a/mkdocs.yml b/mkdocs.yml index e26e4ef..3f1bc66 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -27,6 +27,7 @@ pages: - Advanced: - Context Managers : advanced/Context_Managers.md - Python Metaclasses : advanced/Python_Metaclasses.md + - Python Magic Methods : advanced/Python_Magic_Methods.md - About: About.md # Documentation and theme diff --git a/site/404.html b/site/404.html index 821c3bf..b0c54d5 100644 --- a/site/404.html +++ b/site/404.html @@ -1,4 +1,7 @@ + + + @@ -14,9 +17,22 @@ - + + + + + + + - + + + + + + + + @@ -24,19 +40,14 @@ - + + - - - - + - - - @@ -47,9 +58,7 @@ - - - + @@ -67,38 +76,48 @@
        - +
        - Python Synopsis + + Python Synopsis + + + + + - +
        - + +
      91. + + Scope + +
      92. + + Functions + +
      93. + + Functions + +