Editing 353: Python
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 18: | Line 18: | ||
Whitespace is a string of invisible text characters, like spaces or tabs. In programming, blocks of code controlled by a statement are usually indented under that statement. Most languages require you to use braces (<code>{…}</code>) or special keywords (<code>BEGIN…END</code>) to delimit these blocks; in Python, the indentation itself is the delimiter. Many Python programmers find that this makes code more readable, but many other programmers find it too "magical" and don't trust it. | Whitespace is a string of invisible text characters, like spaces or tabs. In programming, blocks of code controlled by a statement are usually indented under that statement. Most languages require you to use braces (<code>{…}</code>) or special keywords (<code>BEGIN…END</code>) to delimit these blocks; in Python, the indentation itself is the delimiter. Many Python programmers find that this makes code more readable, but many other programmers find it too "magical" and don't trust it. | ||
− | Classes, functions, and constants in Python are packed into modules. To use a module, you write "<code>import ''module''</code>" at the top of your source file | + | Classes, functions, and constants in Python are packed into modules. To use a module, you write "<code>import ''module''</code>" at the top of your source file. Python comes with a very powerful standard library of modules to do everything from parsing XML to comparing two sets of files for differences, and new modules can be easily installed from the PyPI repository, which has more than 79,000 more to choose from (as of April 2016). [[Cueball]] can fly because he imported the <code>antigravity</code> module. Python still works for Cueball in [[482: Height]]. |
In the final panel, Cueball admits that his ability to fly may actually be because he has "sampled everything in the medicine cabinet," though he's sure it is the Python anyway. An implication of this is that ingesting everything in the medicine cabinet has given him the feeling of freedom and ease that "flying" represents - or that he is hallucinating himself flying and having a conversation with the other character about it. Here, the metaphor of "feeling like you're flying" while using Python is transformed back from being literal (Cueball is actually flying) to being metaphorical (Randall feels like he is flying because Python is so easy to use... or because he had too many strange drugs). | In the final panel, Cueball admits that his ability to fly may actually be because he has "sampled everything in the medicine cabinet," though he's sure it is the Python anyway. An implication of this is that ingesting everything in the medicine cabinet has given him the feeling of freedom and ease that "flying" represents - or that he is hallucinating himself flying and having a conversation with the other character about it. Here, the metaphor of "feeling like you're flying" while using Python is transformed back from being literal (Cueball is actually flying) to being metaphorical (Randall feels like he is flying because Python is so easy to use... or because he had too many strange drugs). | ||
Line 24: | Line 24: | ||
{{w|Perl}}, mentioned in the title text, is another programming language with the same target audience as Python, as both are {{w|High-level programming language|high-level}}, {{w|General-purpose programming language|general-purpose}}, {{w|Interpreter (computing)|interpreted}}, {{w|dynamic programming language}}s. | {{w|Perl}}, mentioned in the title text, is another programming language with the same target audience as Python, as both are {{w|High-level programming language|high-level}}, {{w|General-purpose programming language|general-purpose}}, {{w|Interpreter (computing)|interpreted}}, {{w|dynamic programming language}}s. | ||
However they strongly oppose each other in their language design: | However they strongly oppose each other in their language design: | ||
− | * Perl’s philosophy for its syntax is "{{w|There's more than one way to do it}}, | + | * Perl’s philosophy for its syntax is "{{w|There's more than one way to do it}}", so each coder can choose their own coding style to do exactly the same thing. |
− | * Python’s {{w|Zen of Python|philosophy}} for its syntax is "There should be one — and preferably only one — obvious way to do it, | + | * Python’s {{w|Zen of Python|philosophy}} for its syntax is "There should be one — and preferably only one — obvious way to do it", so the written code is more consistent. |
− | Since he has discovered Python, [[Randall]] doesn't like Perl anymore, probably because its syntax is less consistent | + | Since he has discovered Python, [[Randall]] doesn't like Perl anymore, probably because its syntax is less consistent. |
==Transcript== | ==Transcript== | ||
Line 47: | Line 47: | ||
[[Category:Comics featuring Cueball]] | [[Category:Comics featuring Cueball]] | ||
[[Category:Programming]] | [[Category:Programming]] | ||
− |