python:features
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
python:features [2016/07/13 22:10] – [Selection] mithat | python:features [2017/12/06 01:54] (current) – [if, if/else] mithat | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Some Python features ====== | ====== Some Python features ====== | ||
- | ===== Header, suite/ | + | ===== Types ===== |
+ | ==== Boolean ==== | ||
+ | <code python> | ||
+ | True | ||
+ | False | ||
+ | </ | ||
+ | ===== Header, suite/ | ||
<code python> | <code python> | ||
if foo == bar: # header | if foo == bar: # header | ||
Line 19: | Line 24: | ||
</ | </ | ||
- | < | + | < |
if condition: | if condition: | ||
suite | suite | ||
Line 51: | Line 56: | ||
print(' | print(' | ||
</ | </ | ||
+ | |||
+ | ===== Iteration/ | ||
+ | <code python> | ||
+ | while condition: | ||
+ | suite: | ||
+ | </ | ||
+ | |||
+ | **definite loop**: counter controlled repetition, "a program loop in which the number of times the loop will iterate can be determined before the loop is executed." | ||
+ | |||
+ | **indefinite loop**: sentinel controlled repetition, "a program loop in which the number of times the loop will iterate is not known before the loop is executed." | ||
+ | |||
+ | **flag/ |
python/features.txt · Last modified: 2017/12/06 01:54 by mithat