(b) Convert given python code in while loop 2
for a in range(1, 12) :
m=2** a-1
print( m, end=” “)
print()
Answers
Answered by
2
Answer:
hello,
Explanation:
#program with for loop:
for a in range(1, 12) :
m=2** a-1
print( m, end=” “)
______________________________________________
#program with while loop:
i=1 # here we have assigned the starting value as 1
while i<12: # here we are checking the condition till i is less than 12
m=2**(i-1)
print(m,end=" ") #here we are printing
i=i+1 # here to continue the loop we are adding 1 to the value of i
______________________________________________________
hope it helps you
please mark brainliest
@ItzSnowySecret07
_______________________________________________________
Similar questions