03. Logic and Bit Operations

🚀 Aspiring DevOps & Cloud Engineer | Passionate about Automation, CI/CD, Containers, and Cloud Infrastructure ☁️ I work with Docker, Kubernetes, Jenkins, Terraform, AWS (IAM & S3), Linux, Shell Scripting, and Git to build efficient, scalable, and secure systems. Currently contributing to DevOps-driven projects at Assurex e-Consultant while continuously expanding my skills through hands-on cloud and automation projects. Sharing my learning journey, projects, and tutorials on DevOps, AWS, and cloud technologies to help others grow in their tech careers. 💡 Let’s learn, build, and innovate together!
Operators
and - or keyword


>>> age1 = 24
>>> age2 = 16
>>> if(age1 >= 18 and age2 >= 18):
print("You both are adults")
elif(age1 >= 18 or age2 >= 18):
print("One of you is an adult")
else:
print("You both are children")
not keyword

>>> is_hungry = False
>>> if(not is_hungry)
print("You are not hundry")
Bitwise operator



>>> print(15 & 22)
6

>>> print(15 | 22)
31

>>> print(15 ^ 22)
25

>>> print(~22)
-23

Bit shifting


>>> print(22 >> 1)
11

>>> print(22 >> 2)
5

>>> print(22 << 1)
44

Operators
Logical operators
andnotandorreturns boolean values based on the passed valuesBitwise operators
&|^and~allows us to manipulate single bits of data, and return 0 or 1 based on the value of the bits that are usedBit shifting can be done with the
<<and>>operators



