- 博客(6)
- 收藏
- 关注
原创 python 表格打印
python 表格打印tabledata = [['apples','oranges','cherries','banana'], ['alice','bob','carol','david'], ['dogs','cats','moose','goose']]def themaxlens(table): maxs = 0 ...
2019-04-25 18:26:48 1665
原创 针对好玩游戏物品清单
针对好玩游戏物品清单game_item = {'rope':1,'torch':6,'glod coin':42,'dagger':1,'arrow':12}def displayInventory(Inventory): print('Inventory:') item = 0 for k,v in Inventory.items(): print(s...
2019-04-22 18:25:22 707 1
原创 字符串中最长子串
字符串中最长子串numb="abc defgh ijkl mnopqrs tuv w xyz"print(numb.split())numbs=numb.split()print(max(numbs,key=lambda item:len(str(item))))print(len(max(numbs,key=lambda item:len(str(item)))))...
2019-04-15 23:33:29 196
原创 逗号代码
逗号代码spams=['apple','bananas','tofu','cats']sppp=[1,2,2,3,4,5,3,3,32,2,1,2,2,2,2]def fruit(spam): spam=[str(i) for i in spam] spam[-1]='and'+' '+spam[-1]+'.' print(' ,'.join(spam))frui...
2019-04-15 17:23:37 929
原创 Collatz序列
Collatz序列def collatz(number): if number % 2==0: return number // 2 if number % 2==1: return 3*number+1print('please enter some number')try: mumber = int(input()) i =...
2019-04-15 17:21:38 171
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人