<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Some very basic python
Showing some very basic python, variables, arrays, math and plotting
Step1:  The right way to print is using the official print() function in python
and this way you can also print out multiple lines in the out[]
Step2:  Now you can see that each call to print() will cause output on a new line,and also note they are not in the Out[] list
overwriting the same variable , now as a string
Step3:  Python versions
Python2 and Python3 are still being used today. So safeguard printing between python2 and python3 you will need a special import for old python2
Step4:  Now we can print(pi) in python2.  The old style would be print pi
Step5:  Control stuctures
Most programming languages have a way to control the flow of the program. The common ones are
if/then/else
for-loop
while-loop
While you are looking at this code, note that white-space (indentation) controls the extent of the code, and unlike other language, there is no special symbol or end type statement. This is probably the single most confusing thing about those new to the python language.
Step6:  Python Data Structures
A list is one of four major data structures (lists, dictionaries, sets, tuples) that python uses. It is the most simple one, and has direct parallels to those in other languages such as Fortran, C/C++, Java etc.
Python Lists
Python uses special symbols to make up these collection, briefly they are
Step7:  Math and Numeric Arrays
<ASSISTANT_TASK:>
Python Code:
#  setting a variable
a = 1.23
#  although just writing the variable will show it's value, but this is not the recommended
#  way, because per cell only the last one will be printed and stored in the out[]
#  list that the notebook maintains
a
a+1
Explanation: Some very basic python
Showing some very basic python, variables, arrays, math and plotting:
Variables and printing them
End of explanation
print(a)
print(type(a))
Explanation: The right way to print is using the official print() function in python
and this way you can also print out multiple lines in the out[]
End of explanation
a="1.23"
print(a,type(a))
# checking the value of the variable
a
Explanation: Now you can see that each call to print() will cause output on a new line,and also note they are not in the Out[] list
overwriting the same variable , now as a string
End of explanation
from __future__ import print_function
Explanation: Python versions
Python2 and Python3 are still being used today. So safeguard printing between python2 and python3 you will need a special import for old python2:
End of explanation
pi = 3.1415
print("pi=",pi)
print("pi=%15.10f" % pi)
# for reference, here is the old style of printing in python2 
# print "pi=",pi
Explanation: Now we can print(pi) in python2.  The old style would be print pi
End of explanation
n = 1
if n > 0:
    print("yes, n>0")
else:
    print("not")     
    
for i in [2,4,n,6]:
    print("i=",i)
print("oulala, after this for loop, i=",i)
n = 10
while n>0:
    #  n = n - 2
    print("whiling",n)
    n = n - 2
print("last n",n)
        
Explanation: Control stuctures
Most programming languages have a way to control the flow of the program. The common ones are
if/then/else
for-loop
while-loop
While you are looking at this code, note that white-space (indentation) controls the extent of the code, and unlike other language, there is no special symbol or end type statement. This is probably the single most confusing thing about those new to the python language.
End of explanation
a1 = [1,2,3,4]
a2 = range(1,5)
print(a1)
print(a2)
a2 = ['a',1,'cccc']
print(a1)
print(a2)
a3 = range(12,20,2)
print(a3)
a1=range(3)
a2=range(1,4)
print(a1,a2)
a1+a2
Explanation: Python Data Structures
A list is one of four major data structures (lists, dictionaries, sets, tuples) that python uses. It is the most simple one, and has direct parallels to those in other languages such as Fortran, C/C++, Java etc.
Python Lists
Python uses special symbols to make up these collection, briefly they are:
* list:  [1,2,3]
* dictionary:     { "a":1  , "b":2   , "c": 3}
* set:  {1,2,3,"abc"}
* tuple:  (1,2,3)
End of explanation
import math
import numpy as np
math.pi
np.pi
# %matplotlib inline
import matplotlib.pyplot as plt
a=np.arange(0,1,0.01)
b = a*a
c = np.sqrt(a)
plt.plot(a,b,'-bo',label='b')
plt.plot(a,c,'-ro',label='c')
plt.legend()
plt.plot(a,a+1)
plt.show()
Explanation: Math and Numeric Arrays
End of explanation
<END_TASK>