Skip to Content
Python 技術手冊 第三版
book

Python 技術手冊 第三版

by lex Martelli, Anna Martelli Ravenscroft, Steve Holden
January 2018
Intermediate to advanced
856 pages
17h 17m
Chinese
GoTop Information, Inc.
Content preview from Python 技術手冊 第三版
244
|
7 章 核心內建功能和標準程式庫模組
zip zip(seq,*seqs)
v2 中,回傳元組所成的一個串列( a list of tuples),其中第
n
個元
組含有來自各個引數序列的第
n
個元素。
zip
至少必須以一個引數呼叫,
而所有的引數都必須是可迭代的(iterable)。如果那些 iterables 的長
度不同,
zip
會回傳長度與最短的 iterable 相同的一個串列,忽略其他
可迭代物件尾端的項目。也請參閱本表中的
map
,以及表 7-5 中的
izip_
longest
。在 v3 中,
zip
會回傳一個迭代器(iterator),而非一個串列,因
此它等同於一個產生器運算式(generator expression),而非一個串列概
括式(list comprehension)。
sys 模組
sys
模組的屬性所繫結的資料與函式,提供了 Python 直譯器(interpreter
的或會直接影響到直譯器的狀態資訊。表 7-3 涵蓋了
sys
最常被使用的
屬性,以字母順序列出。我們沒有涵蓋的大多數屬性都是特別要給除錯
器(debuggers)、效能側寫器(profilers)與整合開發環境(integrated
development environments)使用的,更多資訊請參閱線上文件(
https://
docs.python.org/3/library/sys.html
)。平台特定的資訊最好是使用
platform
模組來取用,涵蓋於線上文件(
https://docs.python.or ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

利用 Python 进行数据分析(原书第2版)

利用 Python 进行数据分析(原书第2版)

Wes McKinney

Publisher Resources

ISBN: 9789864766819