会员
周边
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
青年小白学编程
博客园
首页
新随笔
联系
管理
订阅
2019年12月25日
列表的创建
摘要: 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)
2019年12月24日
字符串
摘要: 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)
2019年12月23日
定义多点坐标,给出折线,并计算起始点和重点距离
摘要: 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)
2019年12月22日
使用海龟绘图,输出4个300*300的矩形
摘要: 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)
公告
点击右上角即可分享