Bitwise operators include the standard bitwise booleans, AND, OR, and XOR, plus operators for shifting bits left and right.
- [Instructor] These are Python's Bitwise Operators.…There's And, Or, Xor, Shift left, and Shift right.…These operators operate on bits.…They are not the logical operators…used for the conditional constructs.…These are bitwise operators that operate on numbers,…and they operate on the individual bits in the numbers.…We'll take a look now at how that works.…Here in Komodo,…I've opened a working copy of bitwise.py…from chapter five of the exercise files.…
And I'm just going to go ahead and run this…so you can see what it is that's going on…before we talk about the individual operators.…If you come down here,…I have two variables: x and y.…And these variables are initialized…using hexadecimal literal numbers.…And so the first one is 0a…and the second one is 02…and then I'll operate on them using an operator,…in this case it's the And operator.…And then I printed out twice,…once in hexadecimal and once in binary.…
And you'll notice that I'm using f-string,…and I'm using these format controls,…these format specifiers,…
Author
Released
1/18/2018- Python anatomy
- Types and values
- Conditionals and operators
- Building loops
- Defining functions
- Python data structures: lists, tuples, sets, and more
- Creating classes
- Handling exceptions
- Working with strings
- File input/output (I/O)
- Creating modules
- Integrating a database with Python db-api
Skill Level Intermediate
Duration
Views
Related Courses
-
Learning Python Generators
with Josh McQuiston44m 23s Intermediate -
Python: Programming Efficiently (2017)
with Michele Vallisneri2h 15m Intermediate
-
Introduction
-
Welcome55s
-
Exercise files1m 23s
-
About Python 32m 53s
-
-
1. Installation
-
2. Language Overview
-
Hello world1m 57s
-
Python anatomy4m 36s
-
Expressions and statements2m 38s
-
Whitespace and comments3m 26s
-
Using print()3m 56s
-
Blocks and scope4m 2s
-
Conditionals3m 49s
-
Loops3m 7s
-
Functions4m 50s
-
Objects3m 26s
-
3. Types and Values
-
Overview of types and values1m 52s
-
The string type7m 25s
-
Numeric types5m 56s
-
The bool type3m 20s
-
Sequence types5m 46s
-
type() and id()5m 50s
-
-
4. Conditionals
-
Conditional syntax2m 26s
-
Conditional assignment1m 50s
-
-
5. Operators
-
Arithmetic operators2m 32s
-
Bitwise operators5m 21s
-
Comparison operators2m 17s
-
Boolean operators3m 21s
-
Operator precedence1m 17s
-
-
6. Loops
-
Python loops53s
-
The while loop1m 57s
-
The for loop1m 20s
-
Additional controls6m 33s
-
-
7. Functions
-
Defining a function5m 6s
-
Function arguments8m 36s
-
Argument lists2m 16s
-
Keyword arguments1m 45s
-
Return values1m 25s
-
Generators3m 57s
-
Decorators5m 6s
-
-
8. Structured Data
-
Basic data structures1m 10s
-
Lists and tuples5m 1s
-
Dictionaries5m 37s
-
Sets2m 31s
-
List comprehension4m 31s
-
Mixed structures3m 18s
-
-
9. Classes
-
Creating a class2m 35s
-
Constructing an object5m 3s
-
Class methods4m 1s
-
Object data4m 56s
-
Inheritance4m 26s
-
Iterator objects2m 57s
-
-
10. Exceptions
-
Handling exceptions5m 40s
-
Reporting errors2m 9s
-
-
11. String Objects
-
Overview of string objects2m 59s
-
Common string methods4m 15s
-
Formatting strings6m 16s
-
Splitting and joining2m 37s
-
-
12. File I/O
-
Opening files2m 48s
-
Text vs. binary mode1m 45s
-
Text files3m 55s
-
Binary files3m 36s
-
-
13. Built-in Functions
-
Numeric functions3m 11s
-
String functions5m 10s
-
Container functions4m 41s
-
Object and class functions1m 51s
-
-
14. Modules
-
Using standard modules5m 59s
-
Creating a module5m 38s
-
-
15. Databases
-
Python database API4m 28s
-
A database interface10m 44s
-
Example: Short URL database10m 53s
-
-
Conclusion
-
Wrap up43s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Bitwise operators