@computationalphysics-2014301020090
2016-09-25T19:04:53.000000Z
字数 2192
阅读 318
● Review the contents of the two courses on the main page of the cours master the grammar rules of Python and Matplotlib, and prepare for the next course.
● Moving your English name horizontally on the screen.
● Use the character to spell out what you want to draw on the 80*80 dot matrix, and let it spin, hoping to open the hole in the brain!
● Using python preliminarily.
● Learning how to use matplotlib.
● Master the basic knowledge of computer program.
L1:
import osimport timei=os.system('cls')a0 = " # # # # "a1 = " # # # # # "a2 = "# # # # # "a3 = " # # # # "a4 = " # # #### ### #### ### # ## #### ### "a5 = " # # # # # # # # # # # # # # # # "a6 = "# # # # ####### # # # # # # # # # # # "a7 = " # # # # # # # # # # # # # # # # "a8 = " # # # ### # # ### # # ## # # ### "a9 = " # # "a10 = " # # # # "a11 = " # # # # "a12 = " ## ## "b = 0while b < 8:print (' '*b+a0)print (' '*b+a1)print (' '*b+a2)print (' '*b+a3)print (' '*b+a4)print (' '*b+a5)print (' '*b+a6)print (' '*b+a7)print (' '*b+a8)print (' '*b+a9)print (' '*b+a10)print (' '*b+a11)print (' '*b+a12)time.sleep(0.7)i=os.system('cls')b += 1
L2:
import timeimport osa=("###########\n")b=("###\n")c=("##################\n")d=(" ### ###\n")e=3*a+2*b+3*a+6*bf=3*c+4*dg=6*b+3*a+2*b+3*ah=4*d+3*cli=[e,f,g,h]i=0while i<20:print(li[i%4])time.sleep(1)i=i+1os.system('cls')
该图形像字母F,又像一个旋转的扳手。
result:https://github.com/computationalphysics-N2014301020090/computational_physics_N2014301020090/blob/master/%E6%97%8B%E8%BD%AC%E5%9B%BE%E5%BD%A2.gif
another
import timeimport osa=(" ############\n")b=(" ### ###\n")c=(" #### \n")d=("##################\n")e=(" ## \n")f=("##### ## ######\n")k=(" ######### ##\n")g=3*a+6*b+2*c+2*d+2*c+2*a+4*bh=3*e+3*f+4*k+3*f+3*ei=4*b+2*a+2*c+2*d+2*c+6*b+3*aj=3*e+3*f+4*k+3*f+3*eli=[g,h,i,j]i=0while i<20:print(li[i%4])time.sleep(1)i=i+1os.system('cls')
这是一个变形机器人@---@
result:https://github.com/computationalphysics-N2014301020090/computational_physics_N2014301020090/blob/master/%E6%97%8B%E8%BD%AC%E5%9B%BE%E5%BD%A22.gif
● This exercise is much more difficult than last one,but also much more interesting.
● After this exercise,I can use python a little more adroitly,and I've learnt more grammar about python.
● Matplotlib is really useful in physics studing.
● Still unable to use Python and Matplotlib Skillfully.
Thanks to Yang Zongmeng's code Guide