Python基础 – 基本绘制与基本程序设计

基本绘制

>>> import turtle
>>> turtle.showturtle()
>>> turtle.write("Welcome TomYuan")
>>> turtle.forward(100);
>>> turtle.right(90)
>>> turtle.forward(100);
>>> turtle.color("red");
>>> turtle.right(90)
>>> turtle.forward(100);
>>> turtle.goto(200, 200);
>>> turtle.penup();
>>> turtle.goto(100, 100);
>>> turtle.pendown();
>>> turtle.circle(50);

 >>> 4 / 2.5
1.6
>>> 4 // 2.5
1.0
>>> 4 * 2.5
10.0
>>> 4 ** 2.5
32.0
>>> 4 % 7
4
>>> int(10.5)
10
>>> round(10.5)
11.0
>>> 

欢迎留言

avatar
  Subscribe  
Notify of