This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by segelnd
about 9 years

what does symbol ^ mean

in the example of eight = 2 ** 3 I don’t really understand the explanation of this expression: 3(2^3)

I tried to goolge what does ^ mean in both math and coding, but no correct results returned

as I dont really have a coding friend to ask

please help me

PS: the practice is very easy, just copy the question description, but I so badly want to know the meaning of ^

Answer 54d030eb9113cb4537001885

1 vote

Permalink

2^3 actually means 2 ** 3 in the current course. In some languages, but not in Python, ^ is an exponentiation operator.

In Python, ^ is an exclusive or (XOR) operator. Accordingly, 2^3 evaluates to 1, and not 8. You’ll learn about the exclusive or operation in Introduction to Bitwise Operators.

For the current course, use ** for exponentiation. 2 ** 3 evaluates to 8.

points
Submitted by Glenn Richard
about 9 years

1 comments

segelnd about 9 years

thank you! the link is helpful too