Dapatkan daftar dengan nomor acak python
from num_tool import random_num_list
print(random_num_list(0, 5, length=20))
Impossible Ibex
from num_tool import random_num_list
print(random_num_list(0, 5, length=20))
import random
def main():
global random_int
random_int = random.randint(5, 13)
print random_int
makelist(random_int)
random_list.sort
string = ' ' . join([str(x) for x in random_list])
print string
def makelist(list_length):
global random_list
random_list = []
for x in range (list_length):
random_list.append(random.randint(0, 100))
main()
import random
def main():
random_int = random.randint(6, 12)
print (random_int)
makelist()
def makelist():
num_list = []
for count in range(1, 101)
num_list.append(random_int)
main()
import random
def main():
random_int = random.randint(6, 13)
print(random_int)
rand_list = make_list(random_int)
num_string = ""
for i in sorted(rand_list):
num_string += str(i) + " "
return num_string
def make_list(list_length):
num_list = []
for count in range(list_length):
num_list.append(random.randint(1, 101))
return num_list
print main()