字母數字轉換 ord(c), chr(21)
# 遍歷所有字母
for c in [chr(x) for x in range(ord('a'), ord('z')+1)]: print不換行 print(a, end="") 列表部分 交換列表中的元素: nums[l], nums[r] = nums[r], nums[l] # 元素交換
【基于Python】MIT OCW 計算機科學與編程導論(MIT Course Number 6.0001)Introduction to Computer Science and Programming in Python, MIT OPENCOURSEWARE之前選了MIT的C語言導論,這次同樣在MIT的EECS的OCW上選,選擇這門課,MIT計算機科學與編程導論
實例 import time, threading /# 新線程執行的代碼: def loop(): print('thread %s is running...' % threading.current_thread().name) n = 0 while n < 5: n = n + 1 print('thread %s >>> %s' % (threading.current_thread().nam