Home | Mirror | Search

第 28 章 資料結構

目錄

1. List
2. Set

1. List

隨機抽取list成員

import random

# random choice from a list
for i in range(5):
    print random.choice([1, 2, 3, 5, 9])
		
comments powered by Disqus