User Tools

Site Tools


python:dierbach:chapter_2_data_and_expressions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
python:dierbach:chapter_2_data_and_expressions [2016/07/28 21:03] mithatpython:dierbach:chapter_2_data_and_expressions [2016/07/29 00:12] mithat
Line 1: Line 1:
 ~~SLIDESHOW~~ ~~SLIDESHOW~~
 ~~NOTOC~~ ~~NOTOC~~
 +
 +
 +====== Data and Expressions ======
 +Mithat Konar\\ 
 +based on Dierbach's //[[http://www.wiley.com/WileyCDA/WileyTitle/productCd-EHEP002046.html|Introduction to Computer Science using Python]]//.
  
 ===== Contents ===== ===== Contents =====
Line 12: Line 17:
 ===== Literals ===== ===== Literals =====
  
-<HTML> +{{http://mkonar.org/assets/img/cat-silhouette-01-trans-64px.png}} 
-<iframe width="560" height="315" src="https://www.youtube.com/embed/pxf_EVTJtPg" frameborder="0" allowfullscreen> +
-</iframe> +
-</HTML>+
 ===== What is a literal? ===== ===== What is a literal? =====
  
   * **literal**: a sequence of one or more characters that stands for itself.   * **literal**: a sequence of one or more characters that stands for itself.
-  * **numeric literal**: contains only the digits 0–9, a sign character (1 or 2) and a optional decimal point.+  * **numeric literal**: contains only the digits 0–9, a sign character (1 or 2) and a optional decimal point.
     * integer versus floating point value     * integer versus floating point value
     * ''%%e%%'' for scientific notation     * ''%%e%%'' for scientific notation
Line 27: Line 30:
  
   * Floating point values have limited range and precision.   * Floating point values have limited range and precision.
-  * IEEE 754: Â±10<sup>-308</sup> to Â±10<sup>308</sup> with 16 to 17 digits of precision. +  * IEEE 754: ±10<sup>-308</sup> to ±10<sup>308</sup> with 16 to 17 digits of precision. 
-  * **arithmetic overflow**: results when operation causes number to be â€œtoo big”.+  * **arithmetic overflow**: results when operation causes number to be too big”.
  
 <code python> <code python>
Line 34: Line 37:
 inf inf
 </code> </code>
-  * **arithmetic underflow**: results when operation causes number to be â€œtoo small”.+  * **arithmetic underflow**: results when operation causes number to be too small”.
  
 <code python> <code python>
Line 133: Line 136:
       'Number of Credits:', total_credits, 'GPA:', current_gpa)       'Number of Credits:', total_credits, 'GPA:', current_gpa)
 </code> </code>
-  * Doesn’t work to break up a string.+  * Doesn’t work to break up a string.
  
 ===== Explicit Line Joining ===== ===== Explicit Line Joining =====
  
-  * **explicit joining** (backslash) can be used in some situations where implicit joining won’t.+  * **explicit joining** (backslash) can be used in some situations where implicit joining won’t.
  
 <code python> <code python>
Line 143: Line 146:
               num_minutes * 60                num_minutes * 60 
 </code> </code>
-  * Also doesn’t work to break up strings.+  * Also doesn’t work to break up strings.
  
 ===== Silly encoding example ===== ===== Silly encoding example =====
Line 159: Line 162:
 ===== Variables and Identifiers ===== ===== Variables and Identifiers =====
  
-<HTML> +{{http://mkonar.org/assets/img/cat-silhouette-01-trans-64px.png}} 
-<iframe width="560" height="315" src="https://www.youtube.com/embed/pxf_EVTJtPg" frameborder="0" allowfullscreen> +
-</iframe> +
-</HTML>+
 ===== What is a variable? ===== ===== What is a variable? =====
  
python/dierbach/chapter_2_data_and_expressions.txt · Last modified: 2016/07/29 03:03 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki