乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      python實現(xiàn)雙色球機選功能

       子歌-特斯拉 2016-05-31

      python實現(xiàn)雙色球機選功能

      import randomblue = [x for x in range (1,17)]red = [y for y in range (1,34)]print 'The blue ball is :', random.choice(blue)for n in range(1,7):    print 'The %d red ball is :' %n, red.pop(random.randint(0, (len(red)-1)))

      >>> ================================ RESTART ================================>>> The blue ball is : 3The 1 red ball is : 17The 2 red ball is : 22The 3 red ball is : 26The 4 red ball is : 30The 5 red ball is : 27The 6 red ball is : 25>>> ================================ RESTART ================================>>> The blue ball is : 9The 1 red ball is : 32The 2 red ball is : 23The 3 red ball is : 15The 4 red ball is : 8The 5 red ball is : 17The 6 red ball is : 9>>> ================================ RESTART ================================>>> The blue ball is : 6The 1 red ball is : 15The 2 red ball is : 16The 3 red ball is : 11The 4 red ball is : 23The 5 red ball is : 10The 6 red ball is : 27>>>

      生成過程:red list 依次減少已經(jīng)取到的紅球號數(shù),避免重復抽取到同一個號碼;

      import randomblue = [x for x in range (1,17)]red = [y for y in range (1,34)]print 'The blue ball is :', random.choice(blue),'\n'for n in range(1,7): print 'The %d red ball are :' %n,red.pop(random.randint(0, (len(red)-1))), '\n' print 'Now the red ball be left are:',red, '\n'

      >>> The blue ball is : 2 The 1 red ball is : 26 Now the red ball be left are: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33] The 2 red ball is : 25 Now the red ball be left are: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 27, 28, 29, 30, 31, 32, 33] The 3 red ball is : 14 Now the red ball be left are: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 27, 28, 29, 30, 31, 32, 33] The 4 red ball is : 29 Now the red ball be left are: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 27, 28, 30, 31, 32, 33] The 5 red ball is : 8 Now the red ball be left are: [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 27, 28, 30, 31, 32, 33] The 6 red ball is : 31 Now the red ball be left are: [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 27, 28, 30, 32, 33] >>>


        本站是提供個人知識管理的網(wǎng)絡存儲空間,所有內容均由用戶發(fā)布,不代表本站觀點。請注意甄別內容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權內容,請點擊一鍵舉報。
        轉藏 分享 獻花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多