摘要: 1.基本语法[]创建 a=[10,20,'luis',frank'] a=[] 创建一个空的列表对象 2.list()创建 使用list()可以将任何可迭代的数据转化称列表。 a=list() 创建一个空的列表对象 a=list(range(10)) a [0,1,2,3,4,5,6,7,8,9] 阅读全文
posted @ 2019-12-25 20:40 青年小白学编程 阅读(646) 评论(0) 推荐(0)
摘要: 1.将to be or not to be字符串倒序输出 a='to be or not to be' b=a[:: 1] print(b) 2.将sxtsxtsxtsxtsxt字符串所有的S输出 a='sxtsxtsxtsxtsxt' b=a[::3] print(b) 阅读全文
posted @ 2019-12-24 20:44 青年小白学编程 阅读(193) 评论(0) 推荐(0)
摘要: import turtle import math 定义多个点的坐标 x1,y1=100,100 x2,y2=100, 100 x3,y3= 100, 100 x4,y4= 100,100 绘制折线 turtle.penup() turtle.goto(x1,y1) turtle.pendown() 阅读全文
posted @ 2019-12-23 19:19 青年小白学编程 阅读(444) 评论(0) 推荐(0)
摘要: import turtle turtle.showturtle() 显示箭头,并绘制第一个300 300的矩形 turtle.goto(300,0) turtle.goto(300,300) turtle.goto(0,300) turtle.goto(0,0) turtle.penup() 绘制第 阅读全文
posted @ 2019-12-22 19:43 青年小白学编程 阅读(1003) 评论(0) 推荐(0)
摘要: import turtle turtle.width(10) turtle.color("bolue") turtle.circle(50) turtle.color("black") turtle.penup() turtle.goto(120,0) turtle.pendown() turtle 阅读全文
posted @ 2019-12-22 19:19 青年小白学编程 阅读(376) 评论(0) 推荐(0)
摘要: imrort turtle 导入turtle模块 turtle.showturtle() 显示箭头 turtle.write("Frank") 写字符串 turtle.forward(300) 前进300像素 turtle.color("red") 画笔颜色给为红色 turtle.left(90) 阅读全文
posted @ 2019-12-22 19:10 青年小白学编程 阅读(210) 评论(0) 推荐(0)
点击右上角即可分享
微信分享提示