-
Notifications
You must be signed in to change notification settings - Fork 0
/
programming-language-python.html
248 lines (186 loc) · 23 KB
/
programming-language-python.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>PrograMix</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<style>
body {
padding-top: 70px;
/* Required padding for .navbar-fixed-top. Remove if using .navbar-static-top. Change if height of navigation changes. */
font-size: 15px;
font-style: verdana;
}
li{
color: #33AAFF;
}
</style>
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html"><img src="images/logo-trans-134px.png" style="margin-top: -10px"></a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse " id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<!-- languages nav and dropdown-->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="false" aria-expanded="false">Programming Languages<span class="caret"></span></a>
<!-- languages dropdown menu -->
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<ul>
<li><a class="dropdown-item" href="programming-language-java.html">Java</a></li>
<li><a class="dropdown-item" href="programming-language-python.html">Python</a></li>
<li><a class="dropdown-item" href="programming-language-haskell.html">Haskell</a></li>
<li><a class="dropdown-item" href="programming-language-php.html">PHP</a></li>
<li><a class="dropdown-item" href="programming-language-c++.html">C++</a></li>
<li><a class="dropdown-item" href="programming-language-c_sharp.html">C#</a></li>
<li><a class="dropdown-item" href="programming-language-ios.html">IOS - Objective-C</a></li>
<li><a class="dropdown-item" href="programming-language-SQL.html">SQL</a></li>
<li><a class="dropdown-item" href="programming-language-Perl.html">Perl</a></li>
<li><a class="dropdown-item" href="programming-language-JavaScript.html">JavaScript</a></li>
</ul>
</div>
</li><!--end of languages dropdown-->
<!--tutorials in nav and dropdown-->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="false" aria-expanded="false">Tutorials<span class="caret"></span></a>
<!-- Tutorials dropdown menu -->
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<ul>
<li><a class="dropdown-item" href="tutorials-java.html">Java</a></li>
<li><a class="dropdown-item" href="tutorials-python.html">Python</a></li>
<li><a class="dropdown-item" href="tutorials-haskell.html">Haskell</a></li>
<li><a class="dropdown-item" href="tutorials-php.html">PHP</a></li>
<li><a class="dropdown-item" href="tutorials-c++.html">C++</a></li>
<li><a class="dropdown-item" href="tutorials-c_shar.html">C#</a></li>
<li><a class="dropdown-item" href="tutorials-ios.html">IOS - Objective-C</a></li>
<li><a class="dropdown-item" href="tutorials-sql.html">SQL</a></li>
<li><a class="dropdown-item" href="tutorials-perl.html">Perl</a></li>
<li><a class="dropdown-item" href="tutorials-js.html">JavaScript</a></li>
</ul>
</div>
</li><!-- end of tutorials -->
<!--programming software in navbar with dropdown-->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="false" aria-expanded="false">Programming Softwares<span class="caret"></span></a>
<!-- languages dropdown menu -->
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<ul>
<li><a class="dropdown-item" href="prosoft-nb.html">NetBeans</a></li>
<li><a class="dropdown-item" href="prosoft-jc.html">JCreator</a></li>
<li><a class="dropdown-item" href="prosoft-st.html">Sublime Text</a></li>
<li><a class="dropdown-item" href="prosoft-eclipse.html">Eclipse</a></li>
<li><a class="dropdown-item" href="prosoft-xcode.html">Xcode</a></li>
</ul>
</div>
</li><!-- end of programming softwares -->
<!-- search bar icon w/ dropdown searchbox-->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="false" aria-expanded="false"><img src="images/search-icon.png"></a>
<!-- languages dropdown menu -->
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<form method="get" action="/search" id="search">
<input name="q" type="text" size="40" placeholder="Search..." />
</form>
</div>
</li><!-- end of search bar-->
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<!-- Page Content w/ container-->
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<div class="well">
<h1>PYTHON</h1>
</div>
<p class="lead"><b>What is Python Programming Language?</b></p>
<p class="lead" style="text-indent: 40px">Python is a widely used high-level programming language for general-purpose programming, created by Guido van Rossum and first released in 1991. An interpreted language, Python has a design philosophy which emphasizes code readability (notably using whitespace indentation to delimit code blocks rather than curly brackets or keywords), and a syntax which allows programmers to express concepts in fewer lines of code than might be used in languages such as C++ or Java. The language provides constructs intended to enable writing clear programs on both a small and large scale.</p>
<p class="lead" style="text-indent: 40px">Python features a dynamic type system and automatic memory management and supports multiple programming paradigms, including object-oriented, imperative, functional programming, and procedural styles. It has a large and comprehensive standard library.</p>
<p class="lead" style="text-indent: 40px">Python interpreters are available for many operating systems, allowing Python code to run on a wide variety of systems. CPython, the reference implementation of Python, is open source softwareand has a community-based development model, as do nearly all of its variant implementations. CPython is managed by the non-profit Python Software Foundation.</p>
<p class="lead"><b>History</b></p>
<p class="lead" style="text-indent: 40px">Python was conceived in the late 1980s, and its implementation began in December 1989 by Guido van Rossum at Centrum Wiskunde & Informatica (CWI) in the Netherlands as a successor to the ABC language (itself inspired by SETL) capable of exception handling and interfacing with the operating system Amoeba.Van Rossum is Python's principal author, and his continuing central role in deciding the direction of Python is reflected in the title given to him by the Python community, benevolent dictator for life (BDFL).</p>
<p class="lead" style="text-indent: 40px">Python was conceived in the late 1980s, and its implementation began in December 1989 by Guido van Rossum at Centrum Wiskunde & Informatica (CWI) in the Netherlands as a successor to the ABC language (itself inspired by SETL) capable of exception handling and interfacing with the operating system Amoeba. Van Rossum is Python's principal author, and his continuing central role in deciding the direction of Python is reflected in the title given to him by the Python community, benevolent dictator for life (BDFL).</p>
<p class="lead"><b>About the origin of Python, Van Rossum wrote in 1996:</b></p>
<p class="lead" style="text-indent: 40px">“ Over six years ago, in December 1989, I was looking for a "hobby" programming project that would keep me occupied during the week around Christmas. My office ... would be closed, but I had a home computer, and not much else on my hands. I decided to write an interpreter for the new scripting language I had been thinking about lately: a descendant of ABC that would appeal to Unix/C hackers. I chose Python as a working title for the project, being in a slightly irreverent mood (and a big fan of Monty Python's Flying Circus). ”
Python 2.0 was released on 16 October 2000 and had many major new features, including a cycle-detecting garbage collector and support for Unicode. With this release the development process was changed and became more transparent and community-backed.</p>
<p class="lead" style="text-indent: 40px">Python 3.0 (which early in its development was commonly referred to as Python 3000 or py3k), a major, backwards-incompatible release, was released on 3 December 2008 after a long period of testing. Many of its major features have been backported to the backwards-compatible Python 2.6.x and 2.7.x version series.</p>
<p class="lead" style="text-indent: 40px">The End Of Life date (EOL, sunset date) for Python 2.7 was initially set at 2015, then postponed to 2020 out of concern that a large body of existing code cannot easily be forward-ported to Python 3. In January 2017, Google announced work on a Python 2.7 to Go transcompiler, which The Register speculated was in response to Python 2.7's planned end-of-life but Google cited performance under concurrent workloads as their only motivation</p>
<p class="lead"><b>Features and philosophy</b></p>
<p class="lead" style="text-indent: 40px">Python is a multi-paradigm programming language: object-oriented programming and structured programming are fully supported, and many language features support functional programming and aspect-oriented programming (including by metaprogramming and metaobjects (magic methods)). Many other paradigms are supported via extensions, including design by contract and logic programming.</p>
<p class="lead" style="text-indent: 40px">Python uses dynamic typing and a mix of reference counting and a cycle-detecting garbage collector for memory management. An important feature of Python is dynamic name resolution (late binding), which binds method and variable names during program execution.</p>
<p class="lead" style="text-indent: 40px">The design of Python offers some support for functional programming in the Lisp tradition. The language has map(), reduce() and filter() functions; list comprehensions, dictionaries, and sets; and generator expressions. The standard library has two modules (itertools and functools) that implement functional tools borrowed from Haskell and Standard ML.</p>
<p class="lead" style="text-indent: 40px">Python is a multi-paradigm programming language: object-oriented programming and structured programming are fully supported, and many language features support functional programming and aspect-oriented programming (including by metaprogramming and metaobjects (magic methods)). Many other paradigms are supported via extensions, including design by contract and logic programming.</p>
<p class="lead" style="text-indent: 40px">Python uses dynamic typing and a mix of reference counting and a cycle-detecting garbage collector for memory management. An important feature of Python is dynamic name resolution (late binding), which binds method and variable names during program execution.</p>
<p class="lead" style="text-indent: 40px">The design of Python offers some support for functional programming in the Lisp tradition. The language has map(), reduce() and filter() functions; list comprehensions, dictionaries, and sets; and generator expressions. The standard library has two modules (itertools and functools) that implement functional tools borrowed from Haskell and Standard ML.</p>
<p class="lead" style="text-indent: 40px">The core philosophy of the language is summarized by the document The Zen of Python (PEP 20), which includes aphorisms such as:</p>
<div class="well">
<ul>
<li>Beautiful is better than ugly</li>
<li>Explicit is better than implicit</li>
<li>Simple is better than complex</li>
<li>Complex is better than complicated</li>
<li>Readability counts</li>
</ul>
</div>
<p class="lead" style="text-indent: 40px">Rather than requiring all desired functionality to be built into the language's core, Python was designed to be highly extensible. Python can also be embedded in existing applications that need a programmable interface. This design of a small core language with a large standard library and an easily extensible interpreter was intended by Van Rossum from the start because of his frustrations with ABC, which espoused the opposite mindset.</p>
<p class="lead" style="text-indent: 40px">While offering choice in coding methodology, the Python philosophy rejects exuberant syntax, such as in Perl, in favor of a sparser, less-cluttered grammar. As Alex Martelli put it: "To describe something as clever is not considered a compliment in the Python culture." Python's philosophy rejects the Perl "there is more than one way to do it" approach to language design in favor of "there should be one—and preferably only one—obvious way to do it".</p>
<p class="lead" style="text-indent: 40px">Python's developers strive to avoid premature optimization, and moreover, reject patches to non-critical parts of CPython that would offer a marginal increase in speed at the cost of clarity. When speed is important, a Python programmer can move time-critical functions to extension modules written in languages such as C, or try using PyPy, a just-in-time compiler. Cython is also available, which translates a Python script into C and makes direct C-level API calls into the Python interpreter.</p>
<p class="lead" style="text-indent: 40px">An important goal of Python's developers is making it fun to use. This is reflected in the origin of the name, which comes from Monty Python, and in an occasionally playful approach to tutorials and reference materials, such as using examples that refer to spam and eggs instead of the standard foo and bar.</p>
<p class="lead" style="text-indent: 40px">While offering choice in coding methodology, the Python philosophy rejects exuberant syntax, such as in Perl, in favor of a sparser, less-cluttered grammar. As Alex Martelli put it: "To describe something as clever is not considered a compliment in the Python culture."Python's philosophy rejects the Perl "there is more than one way to do it" approach to language design in favor of "there should be one—and preferably only one—obvious way to do it".</p>
<p class="lead" style="text-indent: 40px">Python's developers strive to avoid premature optimization, and moreover, reject patches to non-critical parts of CPython that would offer a marginal increase in speed at the cost of clarity. When speed is important, a Python programmer can move time-critical functions to extension modules written in languages such as C, or try using PyPy, a just-in-time compiler. Cython is also available, which translates a Python script into C and makes direct C-level API calls into the Python interpreter.</p>
<p class="lead" style="text-indent: 40px">An important goal of Python's developers is making it fun to use. This is reflected in the origin of the name, which comes from Monty Python, and in an occasionally playful approach to tutorials and reference materials, such as using examples that refer to spam and eggs instead of the standard foo and bar.</p>
<p class="lead" style="text-indent: 40px">A common neologism in the Python community is pythonic, which can have a wide range of meanings related to program style. To say that code is pythonic is to say that it uses Python idioms well, that it is natural or shows fluency in the language, that it conforms with Python's minimalist philosophy and emphasis on readability. In contrast, code that is difficult to understand or reads like a rough transcription from another programming language is called unpythonic.</p>
<p class="lead" style="text-indent: 40px">Users and admirers of Python, especially those considered knowledgeable or experienced, are often referred to as Pythonists, Pythonistas, and Pythoneers.</p>
<p class="lead"><b>Syntax and semantics</b></p>
<p class="lead" style="text-indent: 40px">Python is intended to be a highly readable language. It is designed to have an uncluttered visual layout, often using English keywords where other languages use punctuation. Python doesn't have semicolons and curly brackets "{}", in contrast to many other programming languages. Further, Python has fewer syntactic exceptions and special cases than C or Pascal.</p>
<p class="lead"><b>Indentation</b></p>
<p class="lead" style="text-indent: 40px">Python uses whitespace indentation to delimit blocks – rather than curly braces or keywords. An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block. This feature is also sometimes termed the off-side rule.</p>
<p class="lead"><b>Statements and control flow</b></p>
<p>Python's statements include (among others):</p>
<div class="well">
<ul>
<li>The assignment statement (token '=', the equals sign). This operates differently than in traditional imperative programming languages, and this fundamental mechanism (including the nature of Python's version of variables) illuminates many other features of the language. Assignment in C, e.g., x = 2, translates to "typed variable name x receives a copy of numeric value 2". The (right-hand) value is copied into an allocated storage location for which the (left-hand) variable name is the symbolic address. The memory allocated to the variable is large enough (potentially quite large) for the declared type. In the simplest case of Python assignment, using the same example, x = 2, translates to "(generic) name x receives a reference to a separate, dynamically allocated object of numeric (int) type of value 2." This is termed binding the name to the object. Since the name's storage location doesn't contain the indicated value, it is improper to call it a variable. Names may be subsequently rebound at any time to objects of greatly varying types, including strings, procedures, complex objects with data and methods, etc. Successive assignments of a common value to multiple names, e.g., x = 2; y = 2; z = 2 result in allocating storage to (at most) three names and one numeric object, to which all three names are bound. Since a name is a generic reference holder it is unreasonable to associate a fixed data type with it. However at a given time a name will be bound to some object, which will have a type; thus there is dynamic typing.</li>
<li>The if statement, which conditionally executes a block of code, along with else and elif (a contraction of else-if).</li>
<li>The for statement, which iterates over an iterable object, capturing each element to a local variable for use by the attached block.</li>
<li>The while statement, which executes a block of code as long as its condition is true.</li>
</ul>
</div>
<p class="lead" style="text-indent: 40px">Python is a widely used high-level programming language used for general-purpose programming, as it is simple and readable. It is a versatile embedded scripting language, a solid foundation of many web frameworks, a preferred choice for automating tasks (including in 3D software applications), programming desktop tools, and performing data science and computation activities. Several libraries have been created for Python related to mathematics, physics and natural processing due to its use in the educational field. Python’s flexibility makes it possible to build applications for various operating systems, including Android. Tech giants like Google and Yahoo along with NASA, PBS, and Reddit use Python for their websites.</p>
<p class="lead" style="text-indent: 40px">Microsoft launched the beta version 2.0 of its Cognitive Toolkit open source deep-learning framework in October 2016, which includes support for Python.</p>
</div>
<br>
<br>
<br>
<br>
</div>
</div>
<!-- /.row -->
</div>
<!-- end of content & container -->
<!-- jQuery Version 1.11.1 -->
<script src="js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>