1.
Demonstration of Operators
a = 10
b=5
# Arithmetic Operators
print("Addition:", a + b)
print("Subtraction:", a - b)
print("Multiplication:", a * b)
print("Division:", a / b)
print("Modulus:", a % b)
print("Exponent:", a ** b)
# Relational Operators
print("a > b:", a > b)
print("a < b:", a < b)
print("a == b:", a == b)
print("a != b:", a != b)
# Logical Operators
print("Logical AND:", a > 5 and b < 10)
print("Logical OR:", a < 5 or b < 10)
print("Logical NOT:", not(a > b))
# Assignment Operators
x=5
x += 3
print("Assignment (+=):", x)
[Link] Data Types in Python
#Integer
a = 10
print("Integer:", a, type(a))
#Float
b = 10.5
print("Float:", b, type(b))
#String
c = "Hello Python"
print("String:", c, type(c))
#Boolean
d = True
print("Boolean:", d, type(d))
#List
e = [1, 2, 3, 4]
print("List:", e, type(e))
#Tuple
f = (10, 20, 30)
print("Tuple:", f, type(f))
#Dictionary
g = {"name": "John", "age": 21}
print("Dictionary:", g, type(g))
#Set
h = {1, 2, 3, 4}
print("Set:", h, type(h))