Python
閱讀設定
![]() | |
Guido van Rossum | |
Python軟件 | |
1991 | |
穩定 | |
軟件授權 | Python軟件 |
.py、.pyi、.pyc、.pyd、.pyo(3.5 | |
www![]() | |
Major implementations | |
CPython、PyPy、IronPython、Jython、Stackless Python、MicroPython、CircuitPython、RustPython[7] | |
Dialects | |
Cython、RPython、Starlark[8] | |
ABC[9]、Ada[10]、ALGOL 68[11]、APL[12]、C[13]、C++[14]、CLU[15]、Dylan[16]、Haskell[17]、Icon[18]、Java[19]、Lisp[20]、Modula-3[14]、Perl、Standard ML[12] | |
Boo、Cobra、CoffeeScript[21]、D、F#、Falcon、Genie[22]、Go、Groovy、JavaScript[23][24]、Julia[25]、Nim、Ring[26]、Ruby[27]、Swift[28] | |
Python(
語法
[縮 進
[Python 呢種
關 鍵 字
[Python
and
as
assert
async
await
break
class
continue
def
del
elif
else
except
False
finally
for
from
global
if
import
in
is
lambda
None
nonlocal
not
or
pass
raise
return
True
try
while
with
yield
數 據 結構
[array[::]
zip(,)
控 制 流 程
[Python
if... else
if...elif...else
for
while
try
I/O
[print(...)
input("")
with open("...", " ") as ...
子 程 序
[def func1(*args):
運算 子
[+
相 加 -
相 減 *
相乘 /
除 %
取 餘 數
例 子 碼
[print("Hello, world!")
input
,output
:
n = int(input('Type a number, and its factorial will be printed: '))
if n < 0:
raise ValueError('You must enter a positive integer')
fact = 1
i = 2
while i <= n:
fact *= i
i += 1
print(fact)
睇埋
[攷
[- ↑ Guttag, John V. (12 August 2016). Introduction to Computation and Programming Using Python: With Application to Understanding Data. MIT Press. ISBN 978-0-262-52962-4.
- ↑ "Python Insider: Python 3.12.4 released";
出版 日 期 : 2024年 6月 6號 ;檢索 日 期 : 2024年 6月 7號 . - ↑ "Why is Python a dynamic language and also a strongly typed language - Python Wiki". wiki.python.org. 喺2021-01-27搵到.
- ↑ "PEP 483 -- The Theory of Type Hints". Python.org.
原 先 內容歸 檔喺2020-06-14. 喺2020-04-22搵到. - ↑ File extension .pyo was removed in Python 3.5. See PEP 0488 互聯
網 檔案館 嘅歸 檔,歸 檔日期 2020年 6月 1號 ,. - ↑ Holth, Moore (2014-03-30). "PEP 0441 -- Improving Python ZIP Application Support".
原 先 內容歸 檔喺2018-12-26. 喺2015-11-12搵到. - ↑ "RustPython".
- ↑ "Starlark Language". 喺25 May 2019搵到.
- ↑
引用 錯誤 無效 嘅<ref>
標 籤 ;無 文字 提供 畀叫做faq-created
嘅參照 - ↑ "Ada 83 Reference Manual (raise statement)".
- ↑ Kuchling, Andrew M. (22 December 2006). "Interview with Guido van Rossum (July 1998)". amk.ca.
原著 喺1 May 2007歸 檔. 喺12 March 2012搵到. - ↑ 12.0 12.1 "itertools — Functions creating iterators for efficient looping — Python 3.7.1 documentation". docs.python.org.
- ↑ van Rossum, Guido (1993). 1&type=pdf "An Introduction to Python for UNIX/C Programmers". Proceedings of the NLUUG Najaarsconferentie (Dutch UNIX Users Group).
even though the design of C is far from ideal, its influence on Python is considerable.
{{cite journal}}
: Check|url=
value (help) - ↑ 14.0 14.1 "Classes". The Python Tutorial. Python Software Foundation. 喺20 February 2012搵到.
It is a mixture of the class mechanisms found in C++ and Modula-3
- ↑ Lundh, Fredrik. "Call By Object". effbot.org.
原著 喺2019年 11月23號 歸 檔. 喺21 November 2017搵到.replace "CLU" with "Python", "record" with "instance", and "procedure" with "function or method", and you get a pretty accurate description of Python's object model.
- ↑ Simionato, Michele. ses/2.3/mro/ "The Python 2.3 Method Resolution Order". Python Software Foundation.
The C3 method itself has nothing to do with Python, since it was invented by people working on Dylan and it is described in a paper intended for lispers
{{cite web}}
: Check|url=
value (help)CS1 maint: url-status (link) - ↑ Kuchling, A. M. "Functional Programming HOWTO". Python v2.7.2 documentation. Python Software Foundation. 喺9 February 2012搵到.
- ↑ Schemenauer, Neil; Peters, Tim; Hetland, Magnus Lie (18 May 2001). "PEP 255 – Simple Generators". Python Enhancement Proposals. Python Software Foundation. 喺9 February 2012搵到.
- ↑ Smith, Kevin D.; Jewett, Jim J.; Montanaro, Skip; Baxter, Anthony (2 September 2004). 18/ "PEP 318 – Decorators for Functions and Methods". Python Enhancement Proposals. Python Software Foundation. 喺24 February 2012搵到.
{{cite web}}
: Check|url=
value (help) - ↑ "More Control Flow Tools". Python 3 documentation. Python Software Foundation. 喺24 July 2015搵到.
- ↑ "CoffeeScript". coffeescript.org.
- ↑ "The Genie Programming Language Tutorial". 喺28 February 2020搵到.
- ↑ "Perl and Python influences in JavaScript". www.2ality.com. 24 February 2013. 喺15 May 2015搵到.
- ↑ Rauschmayer, Axel. "Chapter 3: The Nature of JavaScript; Influences". O'Reilly, Speaking JavaScript.
原著 喺2018年 12月26號 歸 檔. 喺15 May 2015搵到. - ↑
引用 錯誤 無效 嘅<ref>
標 籤 ;無 文字 提供 畀叫做Julia
嘅參照 - ↑ Ring Team (4 December 2017). "Ring and other languages". ring-lang.net. ring-lang.
原著 喺2018年 12月25號 歸 檔. 喺2022年 4月 5號 搵到. - ↑ Bini, Ola (2007). Practical JRuby on Rails Web 2.0 Projects: bringing Ruby on Rails to the Java platform. Berkeley: APress. p. 3. ISBN 978-1-59059-881-8.
- ↑ Lattner, Chris (3 June 2014). "Chris Lattner's Homepage". Chris Lattner. 喺3 June 2014搵到.
The Swift la nguage is the product of tireless effort from a team of language experts, documentation gurus, compiler optimization ninjas, and an incredibly important internal dogfooding group who provided feedback to help refine and battle-test ideas. Of course, it also greatly benefited from the experiences hard-won by many other languages in the field, drawing ideas from Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and far too many others to list.
- ↑ "History and License — Python 3.11.2 documentation" (
英文 ). Python Software Foundation. 喺2023年 2月 20號 搵到. - ↑ "The History of Python: A Brief Timeline of Python". Blogger. 2009-01-20. 喺2016-03-20搵到.
- ↑ "About Python". Python Software Foundation. Retrieved 24 April 2012., second section "Fans of Python use the phrase "batteries included" to describe the standard library, which covers everything from asynchronous processing to zip files."
- ↑ Kuhlman, Dave. "A Python Book: Beginning Python, Advanced Python, and Python Exercises". Section 1.1.
- ↑
世 澤 (2023年 3月 19號 ). 《瑞 士 政府 嘗試迫 UBS同 Credit Suisse合併 投資 銀行 部分 爛 到 無 朋友 邊 個 會 接 手 大 行 黃金 時代 已 經 過去 古 怪 事情 將 會 陸續 有 嚟》. 《黃 世 澤 幾 分 鐘 評 論 》.時間 22:37. 喺2023年 3月 19號 搵到.
參考
[- Downey, Allen B. (May 2012). Think Python: How to Think Like a Computer Scientist (Version 1.6.6 ed.). ISBN 978-0-521-72596-5.
免 費 Python網 上 廣東 話 教學 (由 香港 浸 會 大學 提供 )