There are no hints except that Python has various operands (exoperiment with them to get a hold onto math operations within the programming.) "^" is bitwise operand XOR.
Python works on another angle from other maths machines (calculators), well it is a computer app.  powefull and mighty, with its own rules
Doing normal math we would assume that in d=c^a+5676 operand "^" represents "to the power of"; so our solution for "d" would be d=145^123
+5676 which is 7.05122e+265.
THIS IS, HOWEVER NOT TRUE. WE HAVE NOT USED THE REQUIRED PYTHON OPERATOR.
In Python math module (remember include math) we may use several operators. Here they are:
Arithmetic Operators
Comparison (i.e., Relational) Operators
Assignment Operators
Logical Operators
Bitwise Operators
Membership Operators
Identity Operators
READ ON THIS MATHEMATICAL CONCEPT (Or You may want to prepare for (while waiting) for our new book: Python; Learn from another angle! The book will make sense of most of the confusing aspects of object programming, especially 'the latest' aspect introduced in Python (most versions on your comps. are 2.7.6.0., the latest version being 3.4.1. You will be able to buy the book soon, as well as other products/solutions we offer to all countries of the globe
Specifically here, in documentation, you find this under (character specific):
help>BITWISE
Binary bitwise operations
*************************
Each of the three bitwise operations has a different priority level:
and_expr ::= shift_expr  and_expr "&" shift_expr
xor_expr ::= and_expr  xor_expr "^" and_expr
or_expr ::= xor_expr  or_expr "" xor_expr
The ``^`` operator yields the bitwise XOR (exclusive OR) of its
arguments, which must be plain or long integers. The arguments are
converted to a common type.
The ```` operator yields the bitwise (inclusive) OR of its arguments,
which must be plain or long integers. The arguments are converted to
a common type.
One thing to note, is that Python, when doing bitwise operators (mathematical operations) uses the binary number system
remember, 0S AND 1S. SO OUR NUMBER d=145^123+5676, would work like this :
using a decimal to binary converter HERE.
145 = 10001001
123 = 1111011
Since, the ``^`` operator yields the bitwise XOR (exclusive OR) of its
arguments, which must be plain or long integers. The arguments are
converted to a common type.
Now again remember the operands:
The Operators:
x << y
Returns x with the bits shifted to the left by y places (and new bits on the righthandside are zeros). This is the same as
multiplying x by 2**y.
x >> y
Returns x with the bits shifted to the right by y places. This is the same as //'ing x by 2**y.
x & y
Does a "bitwise and". Each bit of the output is 1 if the corresponding bit of x AND of y is 1, otherwise it's 0.
x  y
Does a "bitwise or". Each bit of the output is 0 if the corresponding bit of x AND of y is 0, otherwise it's 1.
~ x
Returns the complement of x  the number you get by switching each 1 for a 0 and each 0 for a 1. This is the same as x  1.
x ^ y
Does a "bitwise exclusive or". Each bit of the output is the same as the corresponding bit in x if that bit in y is 0, and it's the
complement of the bit in x if that bit in y is 1.
Just remember about that infinite series of 1 bits in a negative number, and these should all make sense.
Maybe many of you are wandering why the result od d=145^123+5676 is not 234+5676 = 5910.
No, the result is 5686. This is because in Binary/decimal bitwise operations the mathematical expression'+' takes precedance over mathematical expression '^' (XOR). We have learned here one of Python's own math rules and there are a few more listed above, here they are again brought below:
Arithmetic Operators
Comparison (i.e., Relational) Operators
Assignment Operators
Logical Operators
Bitwise Operators
Membership Operators
Identity Operators
It would pay out to learn these so that you get into Python's math module and see what it can be used for in object oriented programming. If you have a plan, an atypical math rule can yield results if you learn how to use them. It will all be explained in our OS Computer Solutions Design and Development, part of Onlineshopper Computer Technology, Webdesign, Programming, Circuit Design, LOGOTYP, Animation design (cartoon advertising) book:
PYTHON: Learn from another angle.
This book will cover all of Python possible operations (known to man up to today) in an easy to read, learn and understand writing style, applicable form expert level to begginer level the same, as it represents a Python "UNIVERSITY COURSE" (it will have questions and exercises to solve at end of each chapter).
What you've read here is about all the maths we need to cover and our writers in Onlineshopper will be instructed to make it
understandable, shmple and easy to remember and apply and use in conjunction with other Pythion modules. To get a list of all modules at prompt:
for example:
~$
type the following:
~$ help()
the prompt will change to:
help>
then type:
help> modules
and a list of all modules will show on the screen (including the math module, discussed here, look for it)
Python is complex. We wanted here, in this tutorial just to show you some parts.
When you buy the book (the shop will open soon so you can use you CC, cheque, money order or direct debit (into our bank account) to get
hold of it. Write to us now at info@onlineshopper.bplaced.net to tell us how many copies you want, to reserve a copy for you or a friend, because the
first publication will only be 5000 for the whole world. This will go in a few days, then you have to wait for another publication (how
many will depend on financial calculations.)
Anyway, we hope we have interested you in Python with this tutorial and made you eager to wait for the book to reach your post box. Thanks,
B.S., Onlineshopper, Director
