![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
Null_Kt
helooworld
展开
-
python---001
决定了.去享受坚持一件事的乐趣.就这样决定了.从今天开始坚持一下python.坚持一天一篇吧.基础入门.原创 2016-10-09 20:31:53 · 387 阅读 · 0 评论 -
python-002 数组列表问题
python基础、列表、数组原创 2016-10-10 23:45:03 · 555 阅读 · 0 评论 -
python list和tuple区别
#只创建一个tuple 需要加,消除歧义a_tuple=(2,)#在tuple中创建listmixed_tuple=(1,2,['a','b'])print("mixed_tuple"+str(mixed_tuple))#如果在tuple中嵌套list tuple中的list是可以被更改的 mixed_tuple[2][0]='c'print(mixed_tuple)#tuple是原创 2016-12-05 17:11:56 · 9049 阅读 · 0 评论 -
python基础类型-常用函数
#-*-coding:utf-8-*- 这里设置是为了注释可以为中文import sysfrom lib2to3.fixer_util import Numberimport stringa =3;b=4;c=5.64;d=8.0;e=complex(c,d);f=complex(float(a),float(b))print("a is tpye",type(a))prin原创 2016-12-05 13:19:30 · 337 阅读 · 0 评论 -
python Dictionary特点
# -*- coding:utf-8-*-#创建一个词典 键值对 key valuephone_book={'tom':123,'jery':345,'tim':789}mixed_dict={'tom':'boy',11:22}#如何调用字典的值print("tom is phone"+str(phone_book['tom']))#如果修改字典的值phone_book['tom'原创 2016-12-10 09:18:39 · 644 阅读 · 0 评论 -
python 函数基础
#-*- coding:utf-8 -*-'''Created on 2016年12月16日@author: Administrator''''''定义函数 '''def sey_hi(): print("hi~");sey_hi()#调用函数"""传参数函数"""def sey_a_b(a,b): return a+bprint(sey_a_b(2, 4))def原创 2016-12-16 21:20:37 · 475 阅读 · 0 评论 -
python:File "<string>", line 1, in <module>
错误记录: python input 输入报错!!age =input('you think you input number ?')print ageyou think you input number ?jackChengTraceback (most recent call last): return eval(raw_input(prompt)) File "<string>原创 2017-04-29 20:04:00 · 46444 阅读 · 4 评论 -
python日常
# -*-coding:utf-8-*-""" 如果注释里面需要中文 需要加上上面的代码"""age = input('you think you input number ?')age10 = int(age) + 10print 'you age is ' + str(age10) """ 这里需要注意 输出的时候 需要将age10转换为str """ages = 3 * '5原创 2017-04-29 20:35:07 · 482 阅读 · 0 评论 -
python:for while
# -*-coding:utf-8-*-'''Created on 2017年4月29日@author: Administrator'''# if food = raw_input('you name is ')if food == 'jack': age = 'kt' print ageelif food == 'hack': age = 'kts'原创 2017-04-29 20:51:41 · 380 阅读 · 0 评论