└── python /python: -------------------------------------------------------------------------------- 1 | # DataType Output: str 2 | x = "Hello World" 3 | 4 | # DataType Output: int 5 | x = 50 6 | 7 | # DataType Output: float 8 | x = 60.5 9 | 10 | # DataType Output: complex 11 | x = 3j 12 | 13 | # DataType Output: list 14 | x = ["geeks", "for", "geeks"] 15 | 16 | # DataType Output: tuple 17 | x = ("geeks", "for", "geeks") 18 | 19 | # DataType Output: range 20 | x = range(10) 21 | 22 | # DataType Output: dict 23 | x = {"name": "Suraj", "age": 24} 24 | 25 | # DataType Output: set 26 | x = {"geeks", "for", "geeks"} 27 | 28 | # DataType Output: frozenset 29 | x = frozenset({"geeks", "for", "geeks"}) 30 | 31 | # DataType Output: bool 32 | x = True 33 | 34 | # DataType Output: bytes 35 | x = b"Geeks" 36 | 37 | # DataType Output: bytearray 38 | x = bytearray(4) 39 | 40 | # DataType Output: memoryview 41 | x = memoryview(bytes(6)) 42 | 43 | # DataType Output: NoneType 44 | x = None 45 | # Examples of Arithmetic Operator 46 | a = 9 47 | b = 4 48 | 49 | # Addition of numbers 50 | add = a + b 51 | 52 | # Subtraction of numbers 53 | sub = a - b 54 | 55 | # Multiplication of number 56 | mul = a * b 57 | 58 | # Modulo of both number 59 | mod = a % b 60 | 61 | # Power 62 | p = a ** b 63 | 64 | # print results 65 | print(add) 66 | print(sub) 67 | print(mul) 68 | print(mod) 69 | print(p) 70 | # Examples of Bitwise operators 71 | a = 10 72 | b = 4 73 | 74 | # Print bitwise AND operation 75 | print(a & b) 76 | 77 | # Print bitwise OR operation 78 | print(a | b) 79 | 80 | # Print bitwise NOT operation 81 | print(~a) 82 | 83 | # print bitwise XOR operation 84 | print(a ^ b) 85 | 86 | # print bitwise right shift operation 87 | print(a >> 2) 88 | 89 | # print bitwise left shift operation 90 | print(a << 2) 91 | --------------------------------------------------------------------------------