今天学习python的时候发现,学习软件开发大多数的教程都是从hello开始的,我的都是从机选双色球开始的C/C++,JAVA,JS,PYTHON都是这样的
昨晚中五亿那人我好羡慕!!!
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:")