-1
import numpy as np
import random
with open(r'C:\Python27\Lib\site-packages\visual\examples\hsp.txt') as f:
random.choice(set(f),10)
def repeat(f,N):
for _ in itertools.repeat(None,N): f()
錯誤:
TypeError: choice() takes exactly 2 arguments (3 given)
這也給了我一個無效的語法如果我換成n,其中50
很好的提示上的xrange –
慣於採取credit..I瞭解到它,而它回答。所有的感謝stackoverflow :) – therealprashant