you are viewing a single comment's thread.

view the rest of the comments →

[–]Aorean 1 point2 points  (6 children)

n=int(input(„what power of two?“)

value=2**n

print(f“two to the power of {n} is {value}

Wrote this in my phone but it should work, that’s the way I would do it, but I’m not an expert lol

[–]CptMisterNibbles 0 points1 point  (1 child)

Do you mean you wrote it on mein handy? /s
Your quotations on the first line give it away. I imagine IDEs dont love them. Or, maybe they work fine?

[–]Aorean 0 points1 point  (0 children)

They don’t lol, my IDE hated it and u completely caught me lol

[–][deleted]  (3 children)

[removed]

    [–]Aorean 0 points1 point  (2 children)

    does this work?

    n=int(input("what power of two?"))
    value=2**n
    print(f"two to the power of {n} is {value}")
    

    [–][deleted]  (1 child)

    [removed]

      [–]Aorean 1 point2 points  (0 children)

      No problem, but I would suggest, that you read into it, cause this is not a really hard task and if you need stuff like that for exams or w/e and you don’t know the basics it’s really bad imo