Dec-18-2018, 09:12 AM
Hello everyone,
I would like to create a list of 12 numbers which each term is equal to the previous triple using a while loop.
Here is my code:
I would like to create a list of 12 numbers which each term is equal to the previous triple using a while loop.
Here is my code:
i, n=int(input("Enter a number:"), 1 while n<=12: print(i, end=",") i*=3 n+=1
Error:File "learning.py", line 2
while n<=1:
^
SyntaxError: invalid syntax
I don't understand why it doesn't work, what should I do differently ?