Archive:Think Python/Variables, expressions and statements: Difference between revisions

wikademia>Whiteknight
m Partial (mostly) conversion from HTML to Wikitext
wikademia>Wikademia
 
(4 intermediate revisions by 2 users not shown)
Line 8: Line 8:




 
{{?}}


A '''value''' is one of the basic things a program works with,
A '''value''' is one of the basic things a program works with,
Line 253: Line 253:
<PRE CLASS="verbatim">&gt;&gt;&gt; minute/60.0
<PRE CLASS="verbatim">&gt;&gt;&gt; minute/60.0
0.98333333333333328
0.98333333333333328
</PRE>=== 2.6&#XA0;&#XA0;Expressions ===
</PRE>
=== 2.6&#XA0;&#XA0;Expressions ===


An '''expression''' is a combination of values, variables, and operators.
An '''expression''' is a combination of values, variables, and operators.
Line 284: Line 285:
expression into a print statement and then run it again.
expression into a print statement and then run it again.
''''
''''
</DIV>=== 2.7&#XA0;&#XA0;Order of operations ===
</DIV>
=== 2.7&#XA0;&#XA0;Order of operations ===




Line 472: Line 474:
programmers (or anyone reading the source code) and has no effect on the
programmers (or anyone reading the source code) and has no effect on the
execution of the program.
execution of the program.
</DD></DL>=== 2.12&#XA0;&#XA0;Exercises ===
</DD></DL>
=== 2.12&#XA0;&#XA0;Exercises ===


<DIV CLASS="theorem">'''Exercise&#XA0;3'''&#XA0;&#XA0;''
<DIV CLASS="theorem">'''Exercise&#XA0;3'''&#XA0;&#XA0;''
Line 515: Line 518:
<TT>//</TT> performs integer division.
<TT>//</TT> performs integer division.
</DD></DL>
</DD></DL>
<HR>
<IMG SRC="previous_motif.gif" ALT="Previous">
<IMG SRC="contents_motif.gif" ALT="Up">
<IMG SRC="next_motif.gif" ALT="Next">