Files
python/concepts/bitwise-operators/introduction.md
colinleach 7e5a83d333 The bitwise-operators concept (#3564)
* bitwise-operators concept

* small fizes to about.md

* Proposed Edits and Links

First draft of edits and links for Bitwise operations.

* Typos and Review Changes

---------

Co-authored-by: BethanyG <BethanyG@users.noreply.github.com>
2023-12-27 15:02:33 -08:00

1.5 KiB

Introduction

Down at the hardware level, transistors can only be on or off: two states that we traditionally represent with 1 and 0. These are the binary digits, abbreviated as bits. Awareness of bits and binary is particularly important for systems programmers working in low-level languages.

However, for most of the history of computing the programming priority has been to find increasingly sophisticated ways to abstract away this binary reality.

In Python (and many other high-level programming languages), we work with int, float, string and other defined types, up to and including audio and video formats. We let the Python internals take care of (eventually) translating everything to bits.

Nevertheless, using bitwise-operators and bitwise operations can sometimes have significant advantages in speed and memory efficiency, even in a high-level language like Python.