This Python code uses a set comprehension to create a set named num_squares that contains tuples with pairs of numbers and their squares. Here's how the code works:
num_squares = {(x, x**2) for x in range(1, 6)} print(num_squares)
{(2, 4), (4, 16), (1, 1), (3, 9), (5, 25)}
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions