[关闭]
@LiuYongJie 2016-09-25T14:07:34.000000Z 字数 828 阅读 290

Exercise_3

Liu Yongjie 2014301020094

Abstract

1.Moving your English name horizontally on the screen.
2.Let figures spin.

Background

Using python preliminarily.
Learning how to use matplotlib.

The Main Body

L 1: Design a programe to make my Eglish name moved on the screen.

Code:

import os
import time
i=os.system('cls')
a0 = " # "
a1 = " # "
a2 = " # "
a3 = " # "
a4 = " # ## # # "
a5 = " # # # # # "
a6 = "# # # # # # "
a7 = "# # # # # # "
a8 = " # # ## # # "
a9 = " # # "
a10 = " # # "
a11 = " ### "
b = 0
while b < 20:
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)
time.sleep(1)
i=os.system('cls')
b += 1

L 2: Let figures spin

Code:

Result:

Conclusion

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.

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注