今天學習python的時候發現,學習軟件開發大多數的教程都是從hello開始的,個人都是從機選雙色球開始的C/C++,JAVA,JS,PYTHON都是這樣的python
昨晚中五億那人我好羨慕!!!dom
import random
def creatRandum(rangeSize, arrSize): arr = [0 for x in range(0,arrSize)] rangeArr = [x + 1 for x in range(rangeSize)] for i in range(len(arr)) : arr[i] = rangeArr[random.randint(0, len(rangeArr) - 1)] rangeArr.remove(arr[i]) arr.sort() return arr
def creatDouble(): redball = creatRandum(33, 6) blueball = random.randint(1,16) print ("redball:") for a in redball : print (a," ",end='') print ("") print ("blueball:") print (blueball,end='')
def creatDaLeTou(): beforeArea = creatRandum(35, 5) afterArea = creatRandum(12, 2) print("beforArea:") for i in beforeArea : print(i," ",end='') print("") print("afterArea:") for i in afterArea : print(i," ",end='') type = input("Enter your type:") while type != "exit" : if type == "ssq" : creatDouble() elif type == "dlt" : creatDaLeTou() else : print("No this type") print("") type = input("Enter your type:")