自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Python编程快速上手 7.18.2 strip()的正则表达式

import re def fn(strtemp,char=r'\s'): regex = r'^%s*|%s*$'%(char,char) strregex = re.compile(regex) s = strregex.sub('',strtemp) return s print(fn(' sss ')) print(fn('aasssaa','a'))  

2018-07-19 16:56:47 1154

原创 Python编程快速上手 7.18.1 强口令检测

import re while True: pw = input('请输入口令:') if pw == 'q': break elif re.match(r'^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,}$',pw): print('强口令') else: print('若口令')  

2018-07-19 14:17:11 643 1

原创 python编程快速上手 -- 6.7 实践项目(表格打印)

tableData = [['apples', 'oranges', 'cherries', 'banana'], ['Alice', 'Bob', 'Carol', 'David'], ['dogs', 'cats', 'moose', 'goose']] def printTable(tableData): maxlist = [] for i in tableDa...

2018-07-16 17:40:24 1049 1

原创 python编程快速上手 -- 5.6.2 列表到字典的函数,针对好玩游戏物品清单

def displayInventory(stuff): num = 0 print('Inventory:') for i,v in stuff.items(): print(str(v)+' '+i) num += v print('Total number of items:%d'%num) def addToInventory(inventory,dragonLoot):...

2018-07-13 17:52:52 656 1

空空如也

空空如也

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

TA关注的人

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