https://blog.csdn.net/xiemanr/article/details/72763234timeit只输出被测试代码的总运行时间,单位为秒,没有详细的统计。2.profile>>> import profile>>> def fun(): for i in range(100000): a = i * i >>> profile.run('fun()') 5 function calls in 0.031 seconds ...【阅读全文】
1、python的程序格式框架:python在语法上采用缩进表达程序的格式框架,这说的是什么意思呢?咱们先来看下面的代码,下面是2个for循环,我们主要看它的结构,每个for循环的首行没有任何缩进,第二行开始有4格缩进(可以按4个空格键,也可以按1个tab键)。for a in range(1, 5): print(a)for b in ran...【阅读全文】