New course! Every coder should learn Generative AI!
Try a free lesson+ 5
If I edit your code a bit then it can be done by using a list:
https://code.sololearn.com/ca218a258a14
Here is an example using list comprehension:
https://code.sololearn.com/c4a4A15a10A1
+ 2
n=int(input())
l=[n*(2**(i-1)) for i in range(1,13)]
print(l)
#this is an old problem with the prize for the chess creator
+ 1
you would need to create a list and append, or use list comprehension, or use list() with an iterable.