This Python code uses a set comprehension to create a new set named num_cubes. It contains pairs of numbers where the first number (x) is in the range from 1 to 5, and the second number is the cube of x. Here's how the code works:
num_cubes = {(x, x**3) for x in range(1, 6)} print(num_cubes)
{(3, 27), (4, 64), (1, 1), (5, 125), (2, 8)}
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions