![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python官方笔记
Ejikuangren
来自弯弯的新深圳人,
我爱深圳、更爱编程,
你好,我是个程序猿。
展开
-
The Python Tutorial - Data Structures
5.Data Structures关于列表更多的内容>>> a = [66.25, 333, 333, 1, 1234.5] >>> print(a.count(333), a.count(66.25), a.count('x')) 2 1 0 >>> a.insert(2, -1) >>> a.append(333) >>> a [66.25, 333, -1, 333, 1, 1234.5, 3原创 2016-07-21 09:24:56 · 348 阅读 · 0 评论 -
The Python Tutorial - Modules
The Python Tutorial6.Modules# /Desktop/fibo (在桌面创建fibo.py) # Fibonacci numbers moduledef fib(n): # write Fibonacci series up to n a, b = 0, 1 while b < n: print(b, end=' ') a原创 2016-07-21 09:49:14 · 281 阅读 · 0 评论 -
The Python Tutorial - Input and Output
7. Input and Output函数 str() 用于将值转化为适于人阅读的形式,而 repr() 转化为供解释器读取的形式(如果没有等价的语法,则会发生 SyntaxError 异常) 某对象没有适于人阅读的解释形式的话, str() 会返回与 repr() 等同的值。 >>> s = 'Hello, world.' >>> str(s) 'Hello, world.' >>> repr(s原创 2016-07-21 20:18:45 · 488 阅读 · 0 评论