|
|
@ -2,10 +2,10 @@ import numpy |
|
|
|
import datetime |
|
|
|
import datetime |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def new_num(max_num, random_num): |
|
|
|
def new_num(min_num, max_num, random_num): |
|
|
|
num = {} |
|
|
|
num = {} |
|
|
|
|
|
|
|
|
|
|
|
d = [i for i in range(1, max_num + 1)] |
|
|
|
d = [i for i in range(min_num, max_num + 1)] |
|
|
|
|
|
|
|
|
|
|
|
n = 100000 |
|
|
|
n = 100000 |
|
|
|
while n > 0: |
|
|
|
while n > 0: |
|
|
@ -15,7 +15,7 @@ def new_num(max_num, random_num): |
|
|
|
if r in num.keys(): |
|
|
|
if r in num.keys(): |
|
|
|
num[r] += 1 |
|
|
|
num[r] += 1 |
|
|
|
else: |
|
|
|
else: |
|
|
|
num[r] = 0 |
|
|
|
num[r] = 1 |
|
|
|
n -= 1 |
|
|
|
n -= 1 |
|
|
|
|
|
|
|
|
|
|
|
sorted_result = sorted(num.items(), key=lambda x: x[0]) |
|
|
|
sorted_result = sorted(num.items(), key=lambda x: x[0]) |
|
|
@ -52,4 +52,4 @@ if __name__ == "__main__": |
|
|
|
# print_time() |
|
|
|
# print_time() |
|
|
|
# print_num('red', get_num(new_num(33, 6), new_num(33, 6), 6)) |
|
|
|
# print_num('red', get_num(new_num(33, 6), new_num(33, 6), 6)) |
|
|
|
# print_num('blue', get_num(new_num(16, 1), new_num(16, 1), 1)) |
|
|
|
# print_num('blue', get_num(new_num(16, 1), new_num(16, 1), 1)) |
|
|
|
print(new_num(33, 6)[0:6]) |
|
|
|
print(new_num(1, 11, 3)) |
|
|
|