2018年4月10日
摘要: 字符串格式化msg='i am %s my hobby is %s' % ('lhf','alex')print(msg)msg='i am %s my hobby is %s' % ('lhf',1)msg='i am %s my hobby is %s' % ('lhf',[1,2])print 阅读全文
posted @ 2018-04-10 21:23 雪糕不凉 阅读(83) 评论(0) 推荐(0)
  2018年4月9日
摘要: !/usr/bin/env python -*- coding:utf-8 -*- v = "李杰" for item in v: print(item) str name = "alex" list 类,列表 li = [1, 12, 9, "age", ["石振文", ["19", 10], " 阅读全文
posted @ 2018-04-09 17:57 雪糕不凉 阅读(120) 评论(0) 推荐(0)
  2018年4月7日
摘要: 7个基本魔法 # join # '_'.join("asdfasdf") # split # find # strip # upper # lower # replace4个灰魔法 # test = "郑建文妹子有种冲我来" # 一、for循环 # for 变量名 in 字符串: # 变量名 # b 阅读全文
posted @ 2018-04-07 10:48 雪糕不凉 阅读(97) 评论(0) 推荐(0)
  2018年4月6日
摘要: 数字intPython3里面,不管数字不管多长,都属于int,Python2里面属于long(长整型)int()将字符串转换成数字num="0011"v=int(num,base=2) ##base代表转换成进制print(v)bit_length()当前数字的二进制,至少用多少位表示 字符串 in 阅读全文
posted @ 2018-04-06 17:15 雪糕不凉 阅读(100) 评论(0) 推荐(0)
摘要: 条件语句 缩进用4个空格 a. n1 = input('>>>') if "alex" == "alex": n2 = input('>>>') if n2 == "确认": print('alex SB') else: print('alex DB') else: print('error') 注 阅读全文
posted @ 2018-04-06 00:41 雪糕不凉 阅读(109) 评论(0) 推荐(0)
  2018年4月5日
摘要: 下载Python解释器,建议安装到C盘根目录,一步一步安装 打开计算机-属性-高级设置-环境变量-新建-复制进去Python解释器的安装目录(C:\Python36) 阅读全文
posted @ 2018-04-05 18:21 雪糕不凉 阅读(80) 评论(0) 推荐(0)