<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Agenda
<ul>
<li><h3>Control flows</h3></li>
<li><h3>Functions</h3></li>
<li><h3>Data structures</h3></li>
<li><h3>Modules</h3></li>
</ul>
Python at a glance
A sample code from C
<pre>
    for (int i = 0; i <= 6; i++) {
        if (i % 2 == 0) {
            printf("Even number
Step1:  What do we see?
No semicolon
No parenthese () or brackets {}
Wait... How do we express code block like in C?
Using indentation
No static typing
Basic of Python
Number
Expression syntax and the operators
Step2:  <code>**</code> operator can be used to calculate powers
Step3:  String
Enclosed in single quotes <code>'...'</code> or double quotes <code>"..."</code>.
<code>\</code> can be used to escape characters
Step4:  Print a string using <code>print</code> statement.
If you don’t want characters prefaced by <code>\</code> to be interpreted as special characters, you can use raw strings by adding an r before the first quote
Step5:  String literals can span multiple lines using triple-quotes
Step7:  Concatenate string using <code>+</code>
Repeat a string using <code>*</code>
Step8:  Access a character in string using index, first index is 0
Indices may also be negative numbers, to start counting from the right
Step9:  Slicing is also supported.
Step10:  Python strings cannot be changed - they are immutable
Step11:  But if you need a different string, you can create a new one
Step12:  <code>len()</code> function can be used to calculate length of string
Step13:  List
You can think it as array.
Can be defined as list of comma-separated values between square brackets
Might contain items of different types.
Step14:  Like strings (and all other built-in sequence types), list can be indexed and sliced
Step15:  However, unlike strings, list are mutable type. It is possible to change their content
Step16:  Concatenate lists using <code>+</code> operator
Add new items at the end of the list by using <code>append()</code> method
Calculate length of list using <code>len()</code> function
Step17:  Assignment to slices is also possible
It can change the size of the list
Step18:  Unpacking
Unpack a sequence to the variables
Step19:  Number of variables and length of sequence must match
<ASSISTANT_TASK:>
Python Code:
for number in [0, 1, 2, 3, 4, 5, 6]:
    if number % 2 == 0:
        print "Even number:", number
Explanation: Agenda
<ul>
<li><h3>Control flows</h3></li>
<li><h3>Functions</h3></li>
<li><h3>Data structures</h3></li>
<li><h3>Modules</h3></li>
</ul>
Python at a glance
A sample code from C
<pre>
    for (int i = 0; i <= 6; i++) {
        if (i % 2 == 0) {
            printf("Even number: %d\n", i);
        }
    }
</pre>
A sample code from Python
End of explanation
(50 - 5.0 * 6) / 4
Explanation: What do we see?
No semicolon
No parenthese () or brackets {}
Wait... How do we express code block like in C?
Using indentation
No static typing
Basic of Python
Number
Expression syntax and the operators: <code>+, -, *, %, /</code> work just like in most other languages.
End of explanation
5 ** 2
Explanation: <code>**</code> operator can be used to calculate powers
End of explanation
"I can eat glass it doesn't hurt me"
'I can eat glass it doesn\'t hurt me'
Explanation: String
Enclosed in single quotes <code>'...'</code> or double quotes <code>"..."</code>.
<code>\</code> can be used to escape characters
End of explanation
print 'I can eat glass.\nIt doesn\'t hurt me'
print '---------------'
print r'I can eat glass.\n It doesn\'t hurt me'
Explanation: Print a string using <code>print</code> statement.
If you don’t want characters prefaced by <code>\</code> to be interpreted as special characters, you can use raw strings by adding an r before the first quote
End of explanation
print '''I can eat glass
It doesn't hurt me'''
Explanation: String literals can span multiple lines using triple-quotes: <code>...</code> or <code>'''...'''</code>
End of explanation
print 'AA' + 'BB'
print 'AA' * 3
Explanation: Concatenate string using <code>+</code>
Repeat a string using <code>*</code>
End of explanation
word = 'python'
print word[0]
print word[-1]
print word[-2]
Explanation: Access a character in string using index, first index is 0
Indices may also be negative numbers, to start counting from the right
End of explanation
#  Get characters from position 1 to position 4 (4 characters)
print word[1:5] # exclude 5
# Get characters from position 1 to the end
print word[1:]
# Get all characters except the final character
print word[:-1]
# Get 3 last characters
print word[-3:]
Explanation: Slicing is also supported.
End of explanation
# get error when trying to change 
word[0] = 'J'
Explanation: Python strings cannot be changed - they are immutable
End of explanation
print 'J' + word[1:]
Explanation: But if you need a different string, you can create a new one
End of explanation
print len(word)
Explanation: <code>len()</code> function can be used to calculate length of string
End of explanation
squares = [1, 4, 9, 16, 25]
print squares
Explanation: List
You can think it as array.
Can be defined as list of comma-separated values between square brackets
Might contain items of different types.
End of explanation
print squares[0] # Indexing returns the item
print squares[-1] 
print squares[-3:] # Slicing returns a new list
Explanation: Like strings (and all other built-in sequence types), list can be indexed and sliced:
End of explanation
cubes = [1, 8, 27, 65, 125] # something's wrong here
print cubes
cubes[3] = 64
print cubes
Explanation: However, unlike strings, list are mutable type. It is possible to change their content
End of explanation
print squares + [36, 49]
squares.append(36)
print squares
print len(squares)
Explanation: Concatenate lists using <code>+</code> operator
Add new items at the end of the list by using <code>append()</code> method
Calculate length of list using <code>len()</code> function
End of explanation
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g']
print letters
letters[2:5] = ['C', 'D', 'E']
print letters
letters[2:5] = ['-']
print letters
Explanation: Assignment to slices is also possible
It can change the size of the list
End of explanation
a, b, c = [1, 2, 3]
print a, b, c
Explanation: Unpacking
Unpack a sequence to the variables
End of explanation
a, b, c = [1, 2]
a, b = 1, 2
a, b = b, a
print a, b
Explanation: Number of variables and length of sequence must match
End of explanation
<END_TASK>