Computer Science, asked by Elsa1221, 4 months ago

Write a python program to generate the following series:-
1,2,4,8,16...n

If you give right answer, I will mark as brainliest or else I will report the answer


AryaPratap18: while true :
AryaPratap18: a = a*2
AryaPratap18: if a <= 1000 :
AryaPratap18: pa s s
AryaPratap18: else
AryaPratap18: break
AryaPratap18: print ("Program Ends")
AryaPratap18: done, i hope it helped
AryaPratap18: also add another line after a = a*2
AryaPratap18: print (a)

Answers

Answered by Anonymous
4

Answer:

a=int(input()) while a<=10000: print (a) a=a*2

Answered by sperd620
0

Answer:

def generateSequence(n):

   i = 1

   items = []

   for _ in range(n):

       items.append(i)

       i *= 2

   return items

print(generateSequence(6))

Similar questions