How can I use indices in math using python

0 votes
I want to print 2^3=8 in python

how can I do that?
Dec 11, 2018 in Python by charlie_brown
• 7,710 points
38 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Operator ^ is a bitwise operator, which does "bitwise exclusive or".
More: http://wiki.python.org/moin/BitwiseOperators

The power operator is **, like 8**3 which equals to 512.
Ref: http://docs.python.org/reference/expressions.html#the-power-operator

answered Dec 11, 2018 by ariaholic
• 7,320 points

Related Questions In Python

+2 votes
3 answers

How can I play an audio file in the background using Python?

down voteacceptedFor windows: you could use  winsound.SND_ASYNC to play them ...READ MORE

answered Apr 3, 2018 in Python by charlie_brown
• 7,710 points
939 views
0 votes
1 answer

How can I use grep in Python?

First of all, you are not iterating ...READ MORE

answered Dec 12, 2018 in Python by charlie_brown
• 7,710 points
782 views
0 votes
1 answer
0 votes
1 answer

How can I have only positive decimal numbers in Django using Python?

Hi, are you aware of something called ...READ MORE

answered Jan 30 in Python by Nymeria
• 3,500 points
120 views
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
19 views
+4 votes
6 answers
0 votes
1 answer

How can I define a multidimensional array in python using ctype?

Here's one quick-and-dirty method: >>> A = ((ctypes.c_float ...READ MORE

answered Oct 9, 2018 in Python by ariaholic
• 7,320 points
111 views
0 votes
1 answer

How can I rename multiple files in a certain directory using Python?

Use os.rename(src, dst) to rename or move a file ...READ MORE

answered Nov 23, 2018 in Python by ariaholic
• 7,320 points
57 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.