自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 测试python程序运行时间

import timeimport decimal# text decimal_sumprint("decimal:")start =time.time()sum = decimal.Decimal('0')for x in range(100): sum += decimal.Decimal(x)end = time.time()# print('Running t...

2018-04-30 09:51:55 10364 1

原创 python中list,dict,set的总结

list基本特性 有序可变,元素可以是任何已知的数据结构初始化 a = [] a = [1,3,54] a = [1, '34', (2,4)] 增删改查a.append()a.extend()a.pop()a.pop(index)a[0] = 'need'a.clear()x in a遍历for x in l...

2018-04-24 20:33:04 5026

原创 python遍历字典以及list转化字典,求字典元素最大值

我们先来看这样一个故事:程序员加班回家,已经是深夜了,加上路途遥远,只好坐车回去,他现在想到的交通工具如下。costs = ['bike', 'car', 'bus', 'light railway']程序员想了想:for cost in costs: print(cost)各种交通工具的价格已经贴在墙上了:costs = [['bike', 2], ['c...

2018-04-18 21:13:12 1798

转载 jupyter notebook 关于不同版本py共存的问题

The idea here is to install multiple ipython kernels. Here are instructions for anaconda. If you are not using anaconda, I recently added instructions using pure virtualenvs.conda create -n py27 pyt...

2018-04-18 07:26:03 836

原创 python 中zip() 不同版本之间的差异, *表达式

1. zip()之前练习的时候写过这样的代码:items = ["bananas", "mattress", "dog kennels", "machine", "cheeses"]weights = [15, 34, 42, 120, 5]totals = zip(items, weights)for total in totals: print(total, end=' ...

2018-04-17 07:45:43 638

原创 python列表 sort和sorted的区别

对于一个指定的列表,如果想要对它进行排序,python内置了sort和sorted方法,那么这两者又有什么区别呢?准确的说,sorted是个函数,sort是方法。 下边看下python的官方文档。sort():a = [1,4,5,6,7,123,4,5]print(a)a.sort()print(a) sorted():b = [1,4,5,6,7,123,4,5]...

2018-04-16 12:58:43 4300 1

MacOS wmware 安装包

MacOS wmware 安装包

2024-03-24

pandoc MACOS安装包

pandoc MACOS安装包

2024-03-24

空空如也

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

TA关注的人

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