猫史档案馆


【Python作品分享】【去太空,趣编程】【作品秀】

用户:焯级保底人焯级保底人查看:0 回复:0 评论:0 创建时间:2021-05-08T23:28:20


【作品展示】

center_image

 

【作品介绍】

去太空!

趣编程!

 

【作品源代码】

import turtle
import Numbers


#Get start with Python
global the_Solar_system, Hydrogen
the_Solar_system, Hydrogen = (turtle.Pen()), turtle.Screen()

def Move_to(x, y):

    the_Solar_system.penup()
    the_Solar_system.goto(x, y)
    the_Solar_system.pendown()

#Get start with Python
Dict = {'Mercury': ['lightyellow', 5], 'Venus': ['yellow', 10], 'Earth (52)': ['blue', 25], 'Mars': ['red', 20], 'Jupiter': ['green2', 60], 'Saturn': ['white', 47.5], 'Uranus (92)': ['skyblue', 42.5], 'Neptune (93)': ['steelblue', 35]}
the_Solar_system.shape("turtle")
the_Solar_system.speed(Numbers.Infinity)
turtle.bgcolor('midnight blue')
Length = Hydrogen.window_width()
X_coordinate = (0 - Length / 2)
Move_to(X_coordinate, 0)
X_coordinate += (400 / 3)
the_Solar_system.pencolor('gold')
the_Solar_system.dot(200)
for A in Dict:
    Move_to(X_coordinate, 0)
    the_Solar_system.pencolor(Dict[A][0])
    the_Solar_system.dot(Dict[A][1])
    X_coordinate += (400 / 6)
# Done.
the_Solar_system.hideturtle()
turtle.done()

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页