Update code
This commit is contained in:
parent
232c3187e5
commit
e2c68f256c
8 changed files with 1 additions and 74 deletions
|
@ -1,13 +0,0 @@
|
|||
READ_PERMISSION = 4
|
||||
WRITE_PERMISSION = 2
|
||||
EXECUTE_PERMISSION = 1
|
||||
|
||||
userPermissions = 6
|
||||
|
||||
if (userPermissions & READ_PERMISSION) == READ_PERMISSION:
|
||||
print("Can Read")
|
||||
else:
|
||||
print("Cannot Read")
|
||||
|
||||
print(userPermissions & READ_PERMISSION)
|
||||
print(bin(userPermissions & READ_PERMISSION))
|
|
@ -1,9 +0,0 @@
|
|||
number = 5
|
||||
|
||||
print(number)
|
||||
print(bin(number))
|
||||
|
||||
number = number << 2
|
||||
|
||||
print(number)
|
||||
print(bin(number))
|
|
@ -1,9 +0,0 @@
|
|||
number = 5
|
||||
|
||||
print(number)
|
||||
print(bin(number))
|
||||
|
||||
number = ~number
|
||||
|
||||
print(number)
|
||||
print(bin(number))
|
|
@ -1,8 +0,0 @@
|
|||
READ_PERMISSION = 4
|
||||
WRITE_PERMISSION = 2
|
||||
EXECUTE_PERMISSION = 1
|
||||
|
||||
userPermissions = READ_PERMISSION | WRITE_PERMISSION
|
||||
|
||||
print(userPermissions)
|
||||
print(bin(userPermissions))
|
|
@ -1,10 +0,0 @@
|
|||
READ_PERMISSION = 4
|
||||
WRITE_PERMISSION = 2
|
||||
EXECUTE_PERMISSION = 1
|
||||
|
||||
userPermissions = READ_PERMISSION | WRITE_PERMISSION
|
||||
|
||||
userPermissions |= EXECUTE_PERMISSION
|
||||
|
||||
print(userPermissions)
|
||||
print(bin(userPermissions))
|
|
@ -1,14 +0,0 @@
|
|||
number = 5
|
||||
|
||||
print(number)
|
||||
print(bin(number))
|
||||
|
||||
number = number << 2
|
||||
|
||||
print(number)
|
||||
print(bin(number))
|
||||
|
||||
number = number >> 2
|
||||
|
||||
print(number)
|
||||
print(bin(number))
|
|
@ -1,10 +0,0 @@
|
|||
READ_PERMISSION = 4
|
||||
WRITE_PERMISSION = 2
|
||||
EXECUTE_PERMISSION = 1
|
||||
|
||||
userPermissions = READ_PERMISSION | WRITE_PERMISSION
|
||||
|
||||
userPermissions ^= WRITE_PERMISSION
|
||||
|
||||
print(userPermissions)
|
||||
print(bin(userPermissions))
|
|
@ -12,5 +12,5 @@ I will add new code as soon as I am done editing the videos. So, you might find
|
|||
| 2022-12-09 | [Big O Notation](https://youtu.be/aIG48ldbpRI) | [code](/alexhyett/big-o-notation) |
|
||||
| 2022-11-25 | [Stack vs Heap](https://youtu.be/5OJRqkYbK-4) | [code](/alexhyett/stack-vs-heap) |
|
||||
| 2022-11-11 | [Automate Your Life With Python](https://youtu.be/1dgnl7oCVTY) | [code](/alexhyett/automate-python-example) |
|
||||
| 2022-10-21 | [Bitwise Operators and WHY we use them](https://youtu.be/igIjGxF2J-w) | [code](2022-10-21-Bitwise-Operators-and-WHY-we-use-them) |
|
||||
| 2022-10-21 | [Bitwise Operators and WHY we use them](https://youtu.be/igIjGxF2J-w) | [code](/alexhyett/bitwise-operators-example) |
|
||||
| 2022-10-10 | [6 Coding Concepts You MUST Know For Beginners](https://youtu.be/pKFcVs2HibA) | [code](2022-10-10-6-Coding-Concepts-You-MUST-Know-For-Beginners) |
|
||||
|
|
Loading…
Reference in a new issue