Archive:Think Python/The way of the program: Difference between revisions
wikademia>Whiteknight m Partial (mostly) conversion from HTML to Wikitext |
wikademia>Whiteknight No edit summary |
||
| Line 308: | Line 308: | ||
are less redundant and more concise.</DD><DT CLASS="dt-description">'''literalness:'''</DT><DD CLASS="dd-description"> Natural languages are full of idiom and metaphor. | are less redundant and more concise.</DD><DT CLASS="dt-description">'''literalness:'''</DT><DD CLASS="dd-description"> Natural languages are full of idiom and metaphor. | ||
If I say, “The penny dropped,” there is probably no penny and | If I say, “The penny dropped,” there is probably no penny and | ||
nothing dropping< | nothing dropping<ref>This idiom means that someone realized something | ||
after a period of confusion.</ref>. Formal languages | |||
mean exactly what they say.</DD></DL> | mean exactly what they say.</DD></DL> | ||
People who grow up speaking a natural language—everyone—often have a | People who grow up speaking a natural language—everyone—often have a | ||
| Line 345: | Line 346: | ||
<PRE CLASS="verbatim">print 'Hello, World!' | <PRE CLASS="verbatim">print 'Hello, World!' | ||
</PRE> | </PRE> | ||
This is an example of a '''print statement'''< | This is an example of a '''print statement'''<ref>In Python 3.0, | ||
<TT>print</TT> is a function, not a statement, so the syntax is <TT>print(’Hello, World!’)</TT>. We will get to functions soon!</ref>, which | |||
doesn’t actually print anything on paper. It displays a value on the | doesn’t actually print anything on paper. It displays a value on the | ||
screen. In this case, the result is the words | screen. In this case, the result is the words | ||
| Line 386: | Line 388: | ||
There is evidence that people naturally respond to computers as if | There is evidence that people naturally respond to computers as if | ||
they were people< | they were people<ref>See Reeves and Nass, <I>The Media | ||
Equation: How People Treat Computers, Television, and New Media | |||
Like Real People and Places</I>.</ref>. When they work well, we think | |||
of them as teammates, and when they are obstinate or rude, we | of them as teammates, and when they are obstinate or rude, we | ||
respond to them the same way we respond to rude, | respond to them the same way we respond to rude, | ||
| Line 501: | Line 505: | ||
(Hint: there are 1.61 kilometers in a mile).'' | (Hint: there are 1.61 kilometers in a mile).'' | ||
==References == | |||
<references/> | |||
</ | |||