Last answered:

22 Nov 2022

Posted on:

16 Nov 2022

0

question question quesion question question quesion

range1= range(10)
for n in range1
    print(2**n,end=" ")

why this doesnt work?

3 answers ( 0 marked as helpful)
Posted on:

16 Nov 2022

0

Print's functionality is to display specified data, not operate on data. Feel free to correct me if I'm wrong.

Posted on:

17 Nov 2022

0

you have not put indented block for loops place and also parenthesis

Instructor
Posted on:

22 Nov 2022

0

Hi Shiva!
Thanks for reaching out.

You missed the colon (:) after the for loop. Please, use the following code:
range1=range(10)
for n in range1:
    print(2**n,end=" ")

Hope this helps.
Best,
Tsvetelin

Submit an answer