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 8: | Line 8: | ||
==Explanation== | ==Explanation== | ||
− | {{w|Python (programming language)|Python}} is a programming language designed specifically to make it easy to write clear, readable programs | + | {{w|Python (programming language)|Python}} is a high-level programming language designed specifically to be make it easy to write clear, readable programs. |
− | |||
− | |||
{{w|Dynamic typing}} and {{w|significant whitespace}} are two controversial features of Python, which make some people—like Cueball's friend—hesitant to use the language. | {{w|Dynamic typing}} and {{w|significant whitespace}} are two controversial features of Python, which make some people—like Cueball's friend—hesitant to use the language. | ||
Line 16: | Line 14: | ||
Dynamic typing means that variables do not have types (like "list of short integers" or "a bunch of letters"); any value of any type can be placed in any variable. Dynamic typing allows for more flexible languages, but it means that certain kinds of errors (like trying to subtract a letter from a number) can't be caught until a program is run, and some people think this is too dangerous for the tradeoff to be acceptable. | Dynamic typing means that variables do not have types (like "list of short integers" or "a bunch of letters"); any value of any type can be placed in any variable. Dynamic typing allows for more flexible languages, but it means that certain kinds of errors (like trying to subtract a letter from a number) can't be caught until a program is run, and some people think this is too dangerous for the tradeoff to be acceptable. | ||
− | + | Whitespaces are 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 | + | 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 65,000 more to choose from. [[Cueball]] can fly because he imported the <code>antigravity</code> module. Python still works for Cueball in [[482: Height]]. |
− | + | {{w|Perl}}, mentioned in the title text, is another high-level programming language, but [[Randall]] doesn't like it any more because its syntax is less friendly. | |
− | |||
− | {{w|Perl}}, mentioned in the title text, is another | ||
− | |||
− | |||
− | |||
− | |||
==Transcript== | ==Transcript== | ||
− | :[A | + | :[A Friend is talking to Cueball, who is floating in the sky.] |
:Friend: You're flying! How? | :Friend: You're flying! How? | ||
:Cueball: Python! | :Cueball: Python! | ||
:Cueball: I learned it last night! Everything is so simple! | :Cueball: I learned it last night! Everything is so simple! | ||
− | :Cueball: Hello world is just print "Hello, World!" | + | :Cueball: Hello world is just 'print "Hello, World!"' |
:Friend: I dunno... Dynamic typing? ''Whitespace?'' | :Friend: I dunno... Dynamic typing? ''Whitespace?'' | ||
:Cueball: Come join us! Programming is fun again! It's a whole new world up here! | :Cueball: Come join us! Programming is fun again! It's a whole new world up here! | ||
Line 44: | Line 36: | ||
==Trivia== | ==Trivia== | ||
*In response to this comic, the Python developers implemented the module <code>antigravity</code> in version 2.7+. When you <code>import</code> it, the default web browser will open this comic. Also, in version 3+, the module contains a [[426: Geohashing|geohashing]] function. | *In response to this comic, the Python developers implemented the module <code>antigravity</code> in version 2.7+. When you <code>import</code> it, the default web browser will open this comic. Also, in version 3+, the module contains a [[426: Geohashing|geohashing]] function. | ||
+ | *As Perl could also be the name of a girl the title text of leaving Perl has double meaning. Also, ''being'' with the other program was wonderful. He has not only been unfaithful he is actually leaving! | ||
+ | |||
{{comic discussion}} | {{comic discussion}} | ||
[[Category:Comics featuring Cueball]] | [[Category:Comics featuring Cueball]] | ||
[[Category:Programming]] | [[Category:Programming]] | ||
− |