python:dierbach:chapter_2_data_and_expressions
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
python:dierbach:chapter_2_data_and_expressions [2016/07/28 21:06] – mithat | python:dierbach:chapter_2_data_and_expressions [2016/07/29 00:11] – mithat | ||
---|---|---|---|
Line 1: | Line 1: | ||
~~SLIDESHOW~~ | ~~SLIDESHOW~~ | ||
~~NOTOC~~ | ~~NOTOC~~ | ||
+ | |||
+ | |||
+ | ====== Data and Expressions ====== | ||
+ | Mithat Konar\\ | ||
+ | based on Dierbach' | ||
===== Contents ===== | ===== Contents ===== | ||
Line 12: | Line 17: | ||
===== Literals ===== | ===== Literals ===== | ||
- | {{http://thecatapi.com/api/images/get? | + | {{http://mkonar.org/assets/img/cat-silhouette-01-trans-64px.png}} |
===== What is a literal? ===== | ===== What is a literal? ===== | ||
* **literal**: | * **literal**: | ||
- | * **numeric literal**: contains only the digits | + | * **numeric literal**: contains only the digits |
* integer versus floating point value | * integer versus floating point value | ||
* '' | * '' | ||
Line 25: | Line 30: | ||
* Floating point values have limited range and precision. | * Floating point values have limited range and precision. | ||
- | * IEEE 754: ±10< | + | * IEEE 754: ±10< |
- | * **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 32: | Line 37: | ||
inf | inf | ||
</ | </ | ||
- | * **arithmetic underflow**: | + | * **arithmetic underflow**: |
<code python> | <code python> | ||
Line 131: | Line 136: | ||
' | ' | ||
</ | </ | ||
- | * 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 | + | * **explicit joining** (backslash) can be used in some situations where implicit joining |
<code python> | <code python> | ||
Line 141: | Line 146: | ||
num_minutes * 60 | num_minutes * 60 | ||
</ | </ | ||
- | * Also doesn’t work to break up strings. | + | * Also doesn’t work to break up strings. |
===== Silly encoding example ===== | ===== Silly encoding example ===== | ||
Line 157: | Line 162: | ||
===== Variables and Identifiers ===== | ===== Variables and Identifiers ===== | ||
- | {{http://thecatapi.com/api/images/get? | + | {{http://mkonar.org/assets/img/cat-silhouette-01-64px-trans.png}} |
===== 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