I don't know what is your main goal. But i did quick change to your code and this should do what you want.
import random
elements = []
while len(elements) < 100:
selection = random.randint(1, 100)
print(selection)
if selection not in elements:
elements.append(selection)
print(elements)
Here's snippet of the output,
22
[22]
14
[22, 14]
...
76
[22, 14, 4, 45, 39, 51, 36, 30, 94, 41, 73, 32, 89, 100, 64, 18, 6, 16, 46, 52, 98, 71, 58, 62, 33, 17, 29, 56, 9, 25, 83, 53, 28, 72, 37, 86, 31, 61, 15, 26, 99, 70, 84, 66, 93, 79, 48, 34, 78, 90, 97, 49, 75, 54, 55, 13, 85, 20, 7, 96, 81, 68, 57, 60, 74, 11, 91, 69, 1, 40, 65, 21, 12, 63, 87, 5, 92, 77, 24, 44, 67, 3, 8, 35, 50, 42, 38, 23, 10, 76, 95, 2, 59, 27, 47, 82, 88, 19, 43]
80
[22, 14, 4, 45, 39, 51, 36, 30, 94, 41, 73, 32, 89, 100, 64, 18, 6, 16, 46, 52, 98, 71, 58, 62, 33, 17, 29, 56, 9, 25, 83, 53, 28, 72, 37, 86, 31, 61, 15, 26, 99, 70, 84, 66, 93, 79, 48, 34, 78, 90, 97, 49, 75, 54, 55, 13, 85, 20, 7, 96, 81, 68, 57, 60, 74, 11, 91, 69, 1, 40, 65, 21, 12, 63, 87, 5, 92, 77, 24, 44, 67, 3, 8, 35, 50, 42, 38, 23, 10, 76, 95, 2, 59, 27, 47, 82, 88, 19, 43, 80]