Python (Programming Language) - Wikipedia
Python (Programming Language) - Wikipedia
(programming
language)
Paradigm Multi-paradigm:
object-oriented,[1]
procedural
(imperative),
functional, structured,
reflective
OS Windows, macOS,
Linux/UNIX,
Android[7][8] and
more[9]
Major implementations
Dialects
Influenced by
Influenced
History
The designer of Python, Guido van Rossum, at OSCON 2006
Indentation
Expressions
Methods
Typing
The standard type hierarchy in Python 3
True
bool immutable Boolean value
False
bytearray(b'Some
ASCII')
bytearray(b"Some
bytearray mutable Sequence of bytes
ASCII")
bytearray([119,
105, 107, 105])
b'Some ASCII'
b"Some ASCII"
bytes immutable Sequence of bytes
bytes([119, 105,
107, 105])
An ellipsis placeholder
...
types.EllipsisType immutable to be used as an index
Ellipsis
in NumPy arrays
Unordered set,
contains no
frozenset([4.0,
frozenset immutable duplicates; can
'string', True])
contain mixed types, if
hashable
Integer of unlimited
int immutable 42
magnitude[108]
[4.0, 'string',
List, can contain
list mutable True]
mixed types
[]
An object representing
the absence of a
types.NoneType immutable None
value, often called null
in other languages
An immutable
sequence of numbers
range(-1, 10)
commonly used for
range immutable range(10, -5,
looping a specific
-2)
number of times in
for loops[109]
Unordered set,
contains no {4.0, 'string',
set mutable duplicates; can True}
contain mixed types, if set()
hashable
str immutable A character string: 'Wikipedia'
sequence of Unicode "Wikipedia"
codepoints
"""Spanning
multiple
lines"""
Spanning
multiple
lines
(4.0, 'string',
True)
Can contain mixed
tuple immutable ('single
types
element',)
()
Arithmetic operations
Programming examples
Hello world program:
print('Hello, world!')
Libraries
Python's large standard library[121]
provides tools suited to many tasks and is
commonly cited as one of its greatest
strengths. For Internet-facing applications,
many standard formats and protocols
such as MIME and HTTP are supported. It
includes modules for creating graphical
user interfaces, connecting to relational
databases, generating pseudorandom
numbers, arithmetic with arbitrary-
precision decimals,[122] manipulating
regular expressions, and unit testing.
Automation
Data analytics
Databases
Documentation
Graphical user interfaces
Image processing
Machine learning
Mobile apps
Multimedia
Computer networking
Scientific computing
System administration
Test frameworks
Text processing
Web frameworks
Web scraping
Development environments
Most Python implementations (including
CPython) include a read–eval–print loop
(REPL), permitting them to function as a
command line interpreter for which users
enter statements sequentially and receive
results immediately.
Python also comes with an Integrated
development environment (IDE) called
IDLE, which is more beginner-oriented.
Implementations
Reference implementation
Other implementations
Unsupported implementations
Specialized:
MyHDL is a Python-based hardware
description language (HDL), that
converts MyHDL code to Verilog or
VHDL code.
Performance
Naming
Python's name is derived from the British
comedy group Monty Python, whom
Python creator Guido van Rossum enjoyed
while developing the language. Monty
Python references appear frequently in
Python code and culture;[178] for example,
the metasyntactic variables often used in
Python literature are spam and eggs
instead of the traditional foo and
bar.[178][179] The official Python
documentation also contains various
references to Monty Python
routines.[180][181]
Popularity
Since 2003, Python has consistently
ranked in the top ten most popular
programming languages in the TIOBE
Programming Community Index where as
of December 2022 it was the most popular
language (ahead of C, C++, and Java).[40] It
was selected Programming Language of
the Year (for "the highest rise in ratings in
a year") in 2007, 2010, 2018, and 2020 (the
only language to have done so four times
as of 2020[182]).
An empirical study found that scripting
languages, such as Python, are more
productive than conventional languages,
such as C and Java, for programming
problems involving string manipulation
and search in a dictionary, and determined
that memory consumption was often
"better than Java and not much worse
than C or C++".[183]
Uses
Python Powered
Languages influenced by
Python
Python's design and philosophy have
influenced many other programming
languages:
See also
Computer
programming
portal
Free and
open-source
software
portal
Sources
Further reading
Downey, Allen B. (May 2012). Think
Python: How to Think Like a Computer
Scientist (version 1.6.6 ed.). ISBN 978-0-
521-72596-5.
Hamilton, Naomi (5 August 2008). "The
A-Z of Programming Languages:
Python" (https://web.archive.org/web/2
0081229095320/http://www.computerw
orld.com.au/index.php/id%3B6666577
1) . Computerworld. Archived from the
original (http://www.computerworld.co
m.au/index.php/id;66665771) on 29
December 2008. Retrieved 31 March
2010.
Lutz, Mark (2013). Learning Python
(5th ed.). O'Reilly Media. ISBN 978-0-
596-15806-4.
Summerfield, Mark (2009). Programming
in Python 3 (2nd ed.). Addison-Wesley
Professional. ISBN 978-0-321-68056-3.
Ramalho, Luciano (May 2022). Fluent
Python (https://www.thoughtworks.com/i
nsights/books/fluent-python-2nd-editio
n) (2nd ed.). O'Reilly Media. ISBN 978-1-
4920-5632-4.
External links
Python
at Wikipedia's sister projects
Media from
Commons
Quotations
from
Wikiquote
Textbooks
from
Wikibooks
Resources
from
Wikiversity
Data from
Wikidata