Category:Python: Difference between revisions

update
(Undo revision 212666 by Sidhus (talk)Misplaced edit removed.)
(update)
 
(4 intermediate revisions by 2 users not shown)
Line 1:
{{language
|exec=interpreted
|site=httphttps://www.python.org
|strength=strong
|safety=safe
Line 9:
|gc=yes
|LCT=yes
|bnf=httphttps://docs.python.org/py3k3/reference/grammar.html}}{{language programming paradigm|Dynamic}}{{language programming paradigm|Object-oriented}}{{codepad}}From the official [httphttps://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."
 
It is 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.
 
===Notes===
Because Python uses whitespace for structure, do not format long code examples with leading whitespace, instead use <code><nowiki><pre></pre></nowiki></code> tags, or, preferably, <code><nowiki><syntaxhighlight lang ="python"></langsyntaxhighlight></nowiki></code> tags. This will make it easier to copy code into and out of the wiki. Example:
:<syntaxhighlight lang ="python">print ('this line must not have leading indentation!')
if True:
print ('example: ', foo(3), len(bar))</langsyntaxhighlight>
 
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:
Line 30:
==See Also==
* [[wp:python_(programming_language)|Wikipedia: Python]]
 
==Todo==
[[Tasks_not_implemented_in_Python]]
559

edits