I have the following code:
import numpy as np
import math as mat
list_of_numbers = {int(mat.sqrt(x)) for x in range(7)}
print(list_of_numbers)
I was expecting the output to be the square root of each number from zero to 6.
i.e., [0, 1, 1, 1, 2, 2, 2]
Why is it that Python only prints
[0, 1, 2]
I have checked the documentation on print https://www.python-course.eu/python3_print.php
It seems that there is no reference about print not printing duplicate values. Can anyone help?