This Python code uses a set comprehension to create a set named powers_of_2 that contains the powers of 2 for x ranging from 1 to 10. Here's how the code works:
powers_of_2 = {2**x for x in range(1, 11)} print(powers_of_2)
{32, 64, 2, 128, 4, 256, 512, 1024, 8, 16}
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions