1>>> import numpy as np
2>>> a = np.array([0, 1, 2, 3])
3>>> a
4array([0, 1, 2, 3])
5
1x = 3
2print(type(x)) # Prints "<class 'int'>"
3print(x) # Prints "3"
4print(x + 1) # Addition; prints "4"
5print(x - 1) # Subtraction; prints "2"
6print(x * 2) # Multiplication; prints "6"
7print(x ** 2) # Exponentiation; prints "9"
8x += 1
9print(x) # Prints "4"
10x *= 2
11print(x) # Prints "8"
12y = 2.5
13print(type(y)) # Prints "<class 'float'>"
14print(y, y + 1, y * 2, y ** 2) # Prints "2.5 3.5 5.0 6.25"
15
1t = True
2f = False
3print(type(t)) # Prints "<class 'bool'>"
4print(t and f) # Logical AND; prints "False"
5print(t or f) # Logical OR; prints "True"
6print(not t) # Logical NOT; prints "False"
7print(t != f) # Logical XOR; prints "True"
8