<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Control flows
<code>if</code>
<code>for</code>
<code>while</code>
if statements
Step1:  the body of the if is indented
indentation is python 's way to grouping statement (code block). C using brackets for grouping.
each line within a code block must be indented by the same about.
you should use only tab to indent or spaces to indent
There can be zero or more elif parts, and the else part is optional
Step2:  for statements
the for statement in python differs with the other languages.
No loop over an arithmetic progression of numbers. e.g
Step3:  if you need to iterate over a sequence of numbers, using built-in function <code>range()</code> function
Step4:  Iterate over the indices of a sequence, you can combine <code>range()</code> and <code>len()</code> as follows
Step5:  break and continue statements
Borrowed from C
In case you don't know... In the loop when encounter
Step6:  In the loop when encounter
continue
Step7:  while statements
Like <code>while</code> in C
Step8:  exercise
Calculate dot product of two vector <code>[1, 5, 8, 9, 10]</code> and <code>[9, 2, 5, 7, 3]</code>
<ASSISTANT_TASK:>
Python Code:
x = -5
if x < 0:
    x = 0
    print 'Negative changed to zero'
elif x == 0:
    print 'Zero'
elif x == 1:
    print 'Single'
else:
    print 'More'
    
print x
Explanation: Control flows
<code>if</code>
<code>for</code>
<code>while</code>
if statements
End of explanation
x = -5
if x < 0:
    print "X is negative"
x = 5
if x == 0: print 'X is zero'
Explanation: the body of the if is indented
indentation is python 's way to grouping statement (code block). C using brackets for grouping.
each line within a code block must be indented by the same about.
you should use only tab to indent or spaces to indent
There can be zero or more elif parts, and the else part is optional
End of explanation
for pet in ['cat', 'dog', 'pig']:
    print 'I own a', pet
Explanation: for statements
the for statement in python differs with the other languages.
No loop over an arithmetic progression of numbers. e.g: cannot write <pre>for(int i = 0; i < 10; i++)</pre>
only loop over the items of any sequence
End of explanation
print range(10)
print range(5, 10)
print range(0, 10, 3)
Explanation: if you need to iterate over a sequence of numbers, using built-in function <code>range()</code> function
End of explanation
a = ['Mary', 'had', 'a', 'little', 'lamb']
range(len(a))
for i in range(len(a)):
    print i, a[i]
Explanation: Iterate over the indices of a sequence, you can combine <code>range()</code> and <code>len()</code> as follows:
End of explanation
for n in [1, 2, 3, 4, 5]:
    if n % 2 == 0:
        print 'Found an even number', n
        break
Explanation: break and continue statements
Borrowed from C
In case you don't know... In the loop when encounter:
break: the loop is immediately terminated and the program control resumes at the next statement following the loop.
End of explanation
for n in [1, 2, 3, 4, 5]:
    if n % 2 == 1:
        continue
    print 'Even number:', n
Explanation: In the loop when encounter
continue: instead of forcing termination like break. The continue however, forces the next iteration of the loop to take place, skipping any code in between.
End of explanation
i = 0
while i < 5:
    print i,
    i = i + 1
Explanation: while statements
Like <code>while</code> in C
End of explanation
x = [1, 5, 8, 9, 10]
y = [9, 2, 5, 7, 3]
result = 0
for i in range(len(x)):
    result = result + x[i] * y[i]
print result
Explanation: exercise
Calculate dot product of two vector <code>[1, 5, 8, 9, 10]</code> and <code>[9, 2, 5, 7, 3]</code>
End of explanation
<END_TASK>