Category:Python: Difference between revisions

update
No edit summary
(update)
 
(37 intermediate revisions by 14 users not shown)
Line 1:
{{language
[[Category:Solutions by Programming Language]]
|exec=interpreted
From the official [http://www.python.org Python] web-site "Python is a dynamic object-oriented programming language that can be used for many kinds of software development."
|site=https://www.python.org
|strength=strong
|safety=safe
|express=implicit
|checking=dynamic
|parampass=object reference
|gc=yes
|LCT=yes
|bnf=https://docs.python.org/3/reference/grammar.html}}{{language programming paradigm|Dynamic}}{{language programming paradigm|Object-oriented}}{{codepad}}From the official [https://www.python.org Python] website: "Python is a programming language that lets you work more quickly and integrate your systems more effectively. You can learn to use Python and see almost immediate gains in productivity and lower maintenance costs."
 
PythonIt is very readable and easy to create clean bug-free programs in Python due to the motto: "Errors should never pass silently." Python is an [[wp:Interpreter (computing)|interpreter]]. Python source files (.py files) are typically compiled to an intermediate [[bytecode]] language (.pyc files) and executed by a Python Virtual Machine.
Python source files (.py files) are typically compiled to an intermediate bytecode language (.pyc files) and executed by a Python Virtual Machine.
 
===Notes===
Note: becauseBecause Python useuses whitespace for structure, do not format long code exampleexamples with leading whitespace, butinstead use <code><nowiki><pre></pre></nowiki></code> tags, or, preferably, <code><nowiki><syntaxhighlight lang="python"></syntaxhighlight></nowiki></code> tags. This will make it easier to copy tested code into the wiki, and copying code out of the wiki. Example:
<pre>
print<syntaxhighlight lang="python">print('this line must not have leading indentation!')
if True:
</pre>
print('example: ', foo(3), len(bar))</syntaxhighlight>
 
Some Python examples may deviate from idiomatic Python because they may be written to work in Python 3.X as well as Python 2.X environments. This includes doing things like:
* Using brackets in print statements/functions of one expression.
* Using zip and not izip; keys(), values(), items() and not their iter- forms.
* Checking for raw_input and setting raw_input to input if not found.
* Conditionally importing reduce if it is not found.
This style is not a requirement for Python code on RC, but it may be in use and should not necessarily be 'corrected' if found in examples.
 
The command line is often used in Python for short pieces of code, and so, again; examples showing such use are not incorrect and may be left.
 
==See Also==
* [http[wp://en.wikipedia.org/wiki/python_(programming_language) |Wikipedia: Python]]
 
* [http://www.python.org The Python official site]
==Todo==
[[Tasks_not_implemented_in_Python]]
559

edits