^
is the binary XOR operator. In short, it converts input into binary numbers and performs a bitwise XOR operation.
>>> 2^3 # 10 XOR 11
1 # 01
The expression lone num ^= number
is equivalent to
lone_num = lone_num ^ number
I’d be happy to answer any additional questions you might have.
More Related Contents:
- How to append() two dimensional array/list in python 3 with for-in loop?
- Using numpy to build an array of all combinations of two arrays
- Find the row indexes of several values in a numpy array
- What are the differences between numpy arrays and matrices? Which one should I use?
- How to read a text file into a list or an array with Python
- How to split a string of space separated numbers into integers?
- Working with big data in python and numpy, not enough ram, how to save partial results on disc?
- Shuffle an array with python, randomize array item order with python
- Find nearest indices for one array against all values in another array – Python / NumPy
- Get the position of the largest value in a multi-dimensional NumPy array
- Convert a 1D array to a 2D array in numpy
- How to extend an array in-place in Numpy?
- How to translate “bytes” objects into literal strings in pandas Dataframe, Python3.x?
- “In” operator for numpy arrays?
- How to replace values at specific indexes of a python list?
- np arrays being immutable – “assignment destination is read-only”
- Can numpy bincount work with 2D arrays?
- How to convert hexadecimal string to bytes in Python?
- Sort invariant for numpy.argsort with multiple dimensions
- Numpy isnan() fails on an array of floats (from pandas dataframe apply)
- How can I interleave or create unique permutations of two strings (without recursion)
- Concatenate range arrays given start, stop numbers in a vectorized way – NumPy
- How to pass a 2d array from Python to C?
- Numpy – Replace a number with NaN
- Python: how to store a numpy multidimensional array in PyTables?
- Python list([]) and []
- Python: Elegant and efficient ways to mask a list
- Efficient dot products of large memory-mapped arrays
- Optimal method to find the max of sublist items within list
- SWIG/python array inside structure