import random
numbers = []
numbers.append(random.randint(0,25))
def is_elem(r):
for i in range(0,len(numbers)):
if r == numbers[i]: return 1
return 2
def randomnumber():
wexit = 1
while wexit == 1:
r = random.randint(0,25)
if is_elem(r) == 2:
numbers.append(r)
if (len(numbers) == 10):
wexit = 0
randomnumber()
for i in range(0,len(numbers)):
numbers.append(numbers[i])
output =""
for i in range(0,len(numbers)):
output += str(numbers[i]) + " "
print(output)
for i in range(0,len(numbers)):
index1 = random.randint(0,len(numbers)-1)
n = numbers[i]
numbers[i] = numbers[index1]
numbers[index1] = n
output =""
for i in range(0,len(numbers)):
output += str(numbers[i]) + " "
print(output)
while 1:
pass
|