FAQ: Learn Python: Syntax - Exponents

This community-built FAQ covers the “Exponents” exercise from the lesson “Learn Python: Syntax”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Join the Discussion. Help a fellow learner on their journey.

Agree with a comment or answer? Like () to up-vote the contribution!

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

1 Like

Q). Since each person is requesting 6 quilts, we’ll need `6 * 6 * 6 * 6` squares. Can you think of a way to express that as an exponent?

One quilt is 6x6=36
so 6 quilts for 6 people would be 36*6= 216
why is there an extra times 6 for the answer 1296?

4 Likes

6 quilts for 6 people is 36 quilts
if each quilt is 36 squares, then the total is 36 * 36 squares

4 Likes

One quilt is 36 squares
6 people want a quilt
All 6 people want 6 quilts

36 * 6 * 6 = answer to the question

3 Likes

i am not good at maths please tell me how come 2 ** 10 will be 1024 i am so confused

1 Like

So what would the computer do if you input “6**6” vs. “6 ** 6”?
Basically, what is the difference of inputting the spaces vs. omitting them?

Thank you!

1 Like

So I would like to know when it is asking “Your 6x6 quilts have taken off so well, 6 people have each requested 6 quilts. Print out how many tiles you would need to make 6 quilts apiece for 6 people.”

why is the answer: print (6 ** 4) and not (6 ** 6)? i am a little confused because isn’t there 6 people asking for quilts so shouldn’t the answer be greater than 1296?

1 Like

Six people want six quilts each. That’s `6 * 6`; or, 36 quilts.

Each quilt has six by six patches. That’s `6 * 6` patches; or, 36 patches per quilt.

36 quilts times 36 patches per quilt gives `36 * 36` patches in total.

``````> 36 * 36
= 6 * 6 * 6 * 6
= 6 ** 4``````
8 Likes

I don’t think there’s a difference at all.

But it’s better to use spaces as if you are writing in a paper to make everything look neat and organized.

Exactly.

To make code readable and mistakes easy to spot, always use whitespace around operators, like the second example. There is no mistaking what operation is taking place, here.

I understand all code except for when it comes to the math

1 Like

This answer gave me a clear understanding of the question. Thanks

so the answer is 1296? I am confuse too.

So exponents might be new to you?

``````6 ** 4
6 * 6 * 6 * 6
1296
``````

Repeated multiplication by the same factor is exponentiation. Count the sixes, and that’s the exponent.

If 6 people want 6 each has 36" so, my logic was 36 ** 2 I got the same result, but I just want to confirm if my logic was right. Trying to remember basic math concepts, I dont use very often.

Thanks.

2 Likes

Yes, you have it right.

``````6 * 6 * 6 *6

(6 * 6) * (6 * 6)

36 * 36
``````

Put another way,

``````6 * 6 * 6 * 6

6 ** 4  =>  6 ** 2 * 6 ** 2  =>  36 ** 2``````
1 Like

@coro121 this makes much more sense to me now thanks!

Yes! Finally I understand lol

1 Like

I had same mind set and now makes sence thanks