自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(16)
  • 收藏
  • 关注

原创 趣学python第7章函数

趣学python第7章函数函数的组成部分三个,函数名,参数,函数体def testfunc(name): print('hello, %s' %name)testfunc('wang')打印出hello,wang =================== RESTART: C:\Python27\lianxi\2018123.py ===================

2018-01-27 19:19:52 171

原创 趣学Python第6章whlie

趣学Python第6章whliefor循环用于指定长度的循环,whlie用于事先不知道什么时候停止的情况step = 0while step < 100000: print(step) step = 2**step=================== RESTART: C:\Python27\lianxi\2018123.py ===================01

2018-01-25 21:37:17 320

原创 趣学python第6章1循环for

趣学python第6章循环for# -*- coding: utf-8 -*-"""2018-1-23@author: linda"""for x in range(0,5): print('hello,world!')=================== RESTART: C:\Python27\lianxi\2018123.py ===================hello

2018-01-23 18:22:39 653

原创 趣学PYTHON第5章2 none,字符串与数字间的不同

趣学PYTHON第5章2 none,字符串与数字间的不同1.没有值myval = Noneprint(None)myv = 0print(myv)=================== RESTART: C:\Python27\lianxi\2018123.py ===================None0没有变量的值和给0值是不一样的。myval = None

2018-01-23 16:48:12 253

原创 趣学PYTHON第5章if else

趣学PYTHON第5章if elseif语句的结构和c中不同,# -*- coding: utf-8 -*-"""2018-1-23@author: linda"""age = 23if age >20: print('you are old!') print('what can you do ?') print('you can do it now,or too late!')

2018-01-23 16:12:10 156

原创 趣学Python第4章用海龟画图

趣学Python第4章用海龟画图使用模块turtleimport turtlepython中有一个叫turtle的模块,可以用来学习计算机是如何在屏幕上画图的。让python引入turtle模块,需要用到上面的语句创建画布avery = turtle.Pen()调用turtle的pen函数。出现问题了,没有装turtle实在是没有办法了,不会装turtl

2018-01-23 15:48:18 1446

原创 趣学python34字典dict,映射map

趣学python34字典dict,映射mapfavorite={'min':'football','ling':'pingpang','zhang':'paiqiu','zhao':'basketball'}print favorite===================== RESTART: C:/Python27/lianxi/31.py ===================

2018-01-22 13:33:25 552

原创 趣学python第3章元组

趣学python第3章元组元组是一个使用()的列表,列表用的是[ ].元组和列表的不同还在于元组一旦创建就不能改动了。fibs =(3,3,8,5,3,1,5)print (fibs)print (fibs[2])===================== RESTART: C:/Python27/lianxi/31.py =====================(3,

2018-01-22 13:05:04 146

原创 趣学PYTHON第三章32列表

趣学PYTHON第三章32列表list1 =[ 'why','was' ,6,'afraid' ,'of',7,'because',7,8,6]list =[ 1.2,2.1,5.0,9]list2=[list,list1]print listprint list1print list2列表List的使用,list1是一个字符串列表,list是数值,list2是两者的组合。lis

2018-01-22 11:56:37 134

原创 趣学python第3章字符串2把值插入到某位置

趣学python第3章字符串2把值插入到某位置1.用%s把值嵌入到字符串里mysorce = 100message = 'i scored %s point.'print(message % mysorce)===================== RESTART: C:/Python27/lianxi/31.py =====================i score

2018-01-21 21:21:44 576

原创 趣学PYTHON第3章 字符串

字符串的使用,可以是英文单引号,双引号,都可以输出1.但是当字符串超过了一行,就要使用三个单引号了。否则会报错。fred = "why do you like it very much?"print(fred)fred1 = 'why do you like it very much?1'print(fred1)fred2 = '''why do you like it very m

2018-01-21 21:07:21 186

原创 趣学PYTHON第二章计算与变量

趣学PYTHON第二章计算与变量fred = 100print (fred)john = fredprint(john)number_of_coins = 200print(number_of_coins)found_coins = 20magic_coins = 10stolen_coins = 3number_of_coins = found_coins + magic

2018-01-21 20:38:47 155

原创 趣学PYTHON 第一章python不是大蟒蛇

趣学PYTHON 第一章python不是大蟒蛇把我自己的学习记录在这里,留下一片回忆。Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] on win32Type "copyright", "credits" or "license()" for more infor

2018-01-21 20:24:56 800

原创 趣学PYTHON第2部分弹球实例

趣学PYTHON第2部分弹球实例#!/usr/bin/env python#coding:utf-8 from Tkinter import *import randomimport timeclass Ball: def __init__(self,canvas,paddle,color): self.canvas =canvas self.paddle = pad

2018-01-21 20:03:56 544

原创 趣学python第12章练习3

趣学python第12章练习3,移动照片。#!/usr/bin/env python#coding:utf-8import timefrom Tkinter import *tk = Tk()canvas=Canvas(tk,width=500,height=500)canvas.pack()#my_image=canvas.create_polygon(10,10,10,60,50

2018-01-15 15:51:01 187

原创 python,tkinter

趣学python第12章的第二个练习题,移动三角形。先横向向右移动,然后向下, 再向左,最后回到起始位置。#!/usr/bin/env python#coding:utf-8import randomimport timefrom Tkinter import *tk = Tk()canvas=Canvas(tk,width=500,height=500)canvas.pack(

2018-01-15 15:24:35 196

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除