自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Python编程快速上手——让繁琐工作自动化第十二章实践题

##12.13.1import openpyxl, sysfrom openpyxl.utils import get_column_letterfrom openpyxl.styles import Fontshuzhi = sys.argv[1]wb = openpyxl.Workbook()sheet = wb.get_active_sheet()geshi = Font...

2019-01-20 13:03:59 695

原创 Python编程快速上手——让繁琐工作自动化第十章实践题

##10.8import randomguess = ''while guess not in ('heads', 'tails'): print('Guess the coin toss! Enter heads or tails:') guess = input()toss = random.randint(0, 1)#变量toss的值是0或1,而变量guess的值是...

2019-01-12 15:34:52 456

原创 Python编程快速上手——让繁琐工作自动化第九章实践题

##9.8.1import os, shutildef beifen(): if not os.path.isdir(beifen_mulu): os.makedirs(beifen_mulu) for foldername, subfolders, filenames in os.walk(chazhao_mulu): for filenam...

2019-01-11 23:05:33 610

原创 Python编程快速上手——让繁琐工作自动化第八章实践题

##8.9.1import shelve, pyperclip, sysmcbShelf = shelve.open('mcb')if len(sys.argv) == 3: if sys.argv[1].lower() == 'save': mcbShelf[sys.argv[2]] = pyperclip.paste() elif sys.argv[1]....

2019-01-02 21:09:49 574

原创 Python编程快速上手——让繁琐工作自动化第七章实践题

##7.18.1import redef yanzheng(zifu): if len(zifu) < 8: print('密码长度不足8位') elif re.compile(r'[A-Z]').search(mima) == None: print('密码中须包含大写字母') elif re.compile(r'[a-z]')...

2018-12-31 22:24:29 613 1

原创 Python编程快速上手——让繁琐工作自动化第六章实践题

##6.7tableData = [['apples', 'oranges', 'cherries', 'banana'], ['Alice', 'Bob', 'Carol', 'David'], ['dogs', 'cats', 'moose', 'goose']]def printTable(data): zifuchang =...

2018-12-31 10:57:08 567

原创 Python编程快速上手——让繁琐工作自动化第五章实践题

##5.6.1参照书中提示答案##5.6.2def hanshu1(canshu1, canshu2): for a in canshu2: ziliao[a] = (canshu1.get(a, 0) + 1) return ziliaodef hanshu2(canshu): print("Inventory: ") zongliang...

2018-12-27 20:19:55 477 1

原创 Python编程快速上手——让繁琐工作自动化第四章实践题

##4.10.1def hanshu1(list2): str1 = list2[0] + ', ' + 'and ' + list2[1] print(str1)def hanshu2(list2): str1 = list2[0] str2 = ', ' + 'and ' + list2[-1] for a in range(1,(len(list...

2018-12-26 20:25:00 444 1

原创 Python编程快速上手——让繁琐工作自动化第三章实践题

3.11.1def collatz(number): if number % 2 == 0: print(number // 2) return(number // 2) else: print(number * 3 + 1) return(number * 3 + 1)print("Enter number: ...

2018-12-24 22:21:14 260

空空如也

空空如也

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

TA关注的人

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