編寫一個Python程序?
importrandomcount=0#1正面0反面記錄1的次數(shù)foriinrange(10000000):n=random.randint(0,1)ifn==1:count+=1print(u'正面{0}次,反面{1}次'.format(count,1000000-count))
編寫一個Python程序?
importrandomcount=0#1正面0反面記錄1的次數(shù)foriinrange(10000000):n=random.randint(0,1)ifn==1:count+=1print(u'正面{0}次,反面{1}次'.format(count,1000000-count))