Report Bug

QusWrite a list comprehension to produce the list: [1, 2, 4, 8, 16……212]. Qusलिस्ट तैयार करने के लिए एक लिस्ट लिखें: [1, 2, 4, 8, 16……212].


A. [(2**x) for x in range(0, 13)]
B. [(x**2) for x in range(1, 13)]
C. [(2**x) for x in range(1, 13)]
D. [(x**2) for x in range(0, 13)]


Solution
A. [(2**x) for x in range(0, 13)]



Explanation
The required list comprehension will print the numbers from 1 to 12, each raised to 2. The required answer is thus, [(2**x) for x in range(0, 13)].
CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad