[关闭]
@flyboy1995 2016-09-26T05:05:51.000000Z 字数 1165 阅读 50

第三次作业

作业L1 在屏幕上让你的英文名字水平移动起来


  1. import time
  2. import os
  3. for i in range(0,40):
  4. print(i*" "+" ######## ######## ######## ######## # # ")
  5. print(i*" "+" # # # # # # # # ")
  6. print(i*" "+" # # # # # # # # ")
  7. print(i*" "+" # ######## ######## ######## # ")
  8. print(i*" "+" # # # # # # # # ")
  9. print(i*" "+" # # # # # # # # ")
  10. print(i*" "+" #### ######## # # # # # ")
  11. time.sleep(0.1)
  12. i = os.system('cls')

运行结果(点击查看)


作业L2 在80*80点阵上用字符拼出你想画的东西,并让它旋转起来,希望脑洞大开!(比如字符、火柴人、火箭等等)

  1. import time
  2. import os
  3. os.system('cls')
  4. print("This is a rocket")
  5. time.sleep(1)
  6. os.system('cls')
  7. a01=" # "
  8. a02=" # # "
  9. a03=" # # "
  10. a04=" # # "
  11. a05=" # # # # # # # # "
  12. a06=" # # "
  13. a07=" # # "
  14. a08=" # # "
  15. a09=" # # "
  16. a10=" # # "
  17. a11=" # # # # # # # # "
  18. a12=" # # # # # # "
  19. a13=" # # # # # # "
  20. a=[a01,a02,a03,a04,a05,a06,a07,a08,a09,a10,a11,a12,a13]
  21. b01=" "
  22. b02="# "
  23. b03=" # "
  24. b04=" # "
  25. b05="# # ################### "
  26. b06=" # # "
  27. b07="# # # # # "
  28. b08=" # # "
  29. b09="# # # # # "
  30. b10=" # # "
  31. b11="# # # # # "
  32. b12=" # # "
  33. b13="# # #################### "
  34. b14=" # "
  35. b15=" # "
  36. b16="# "
  37. b17=" "
  38. b=[b01,b02,b03,b04,b05,b06,b07,b08,b09,b10,b11,b12,b13,b14,b15,b16,b17]
  39. for i in a:
  40. print(i)
  41. time.sleep(0.5)
  42. i=os.system('cls')
  43. for i in b:
  44. print(i)
  45. time.sleep(0.5)
  46. i=os.system('cls')
  47. a.reverse()
  48. for i in a:
  49. print(i)
  50. time.sleep(0.5)
  51. i=os.system('cls')
  52. for i in b:
  53. i=i[::-1]
  54. print(i)
  55. time.sleep(0.5)
  56. i=os.system('cls')

运行结果(点击查看)

感谢张博奇同学提供的思路,之前他的程序有点小问题,图像不能转到270度,讨论之后,我们分别用了不同的方法实现了让图片旋转270度

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