# Integer
a = 10
print("Value of a:", a)
print("Type of a:", type(a))
# Float
b = 5.75
print("\nValue of b:", b)
print("Type of b:", type(b))
# Complex
c = 2 + 3j
print("\nValue of c:", c)
print("Type of c:", type(c))
OUTPUT
Value of a: 10
Type of a: <class 'int'>
Value of b: 5.75
Type of b: <class 'float'>
Value of c: (2+3j)
Type of c: <class 'complex'>
# List
numbers = [10, 20, 30, 40]
print("List:", numbers)
print("First element in list:", numbers[0]) # Indexing
# Tuple
values = (1, 2, 3, 4)
print("\nTuple:", values)
print("Second element in tuple:", values[1])
# String
text = "Python"
print("\nString:", text)
print("First character in string:", text[0])
# Slicing
print("\nSlicing list (1 to 3):", numbers[1:3])
print("Slicing string (0 to 4):", text[0:4])
Output
List: [10, 20, 30, 40]
First element in list: 10
Tuple: (1, 2, 3, 4)
Second element in tuple: 2
String: Python
First character in string: P
Slicing list (1 to 3): [20, 30]
Slicing string (0 to 4): Pyth