Python 簡介

出自KMU Wiki

在2008年12月3日 (三) 14:47由Cch (對話 | 貢獻)所做的修訂版本
跳轉到: 導航, 搜索

本條目所指的 Python 是 Python 程式語言

目錄

概覽

Python 官方網站對 Python 的介紹

A Byte of Python 對 Python 的簡介(中譯版)

Marr 對 Python 的簡介

根據 2008 年 11 月 TIOBE Programming Community Index,Python 的普及率在全世界排名第 6

免費電子書

Python 官方文件

A Byte of Python

A Byte of Python 中譯版

下載

官方網站下載

校內下載

參考資料

Python 官方網站

Swaroop C.H.'s Python Notes

練習

檢查一個數是否為質數

#!/usr/local/bin/python # This program tests wether an integer is a prime import sys import string print 'This program tests wether an integer is a prime' while 1 : sys.stdout.write('Please input an integer: ') s = raw_input() n = string.atol(s) ub = n / 2 + 1 is_prime = 1 f = 2 while f < ub : if n % f == 0: is_prime = 0 print n, ' has a factor ', f break else : f = f + 1 if is_prime == 1 : print n, ' is a prime' else : print n, ' is not a prime' <nowiki>