# Using bitwise AND (&) and OR (|) operators⏎
a = 5 & 3⏎
b = 5 | 3⏎
print(f"Bitwise AND: {a}, Bitwise OR: {b}")⏎
# Checking multiple conditions with logical AND (&) and OR (|)⏎
condition = (x > 10) & (y < 20) | (z == 15)⏎
if condition:⏎
print("Condition met!")⏎
# Strings with single (' ') and double (" ") quotes⏎
single_quote_str = 'This is a string with single quotes.'⏎
double_quote_str = "This is a string with double quotes."⏎
print(single_quote_str + " " + double_quote_str)⏎
# Escaping quotes within strings⏎
escaped_quote_str = "He said, \"Hello!\""⏎
print('Using escaped quotes: ', escaped_quote_str)⏎
# Logical NOT (!)⏎
not_true = not True⏎
print(f"Not True equals: {not_true}")⏎
# Equality (==) and assignment (=)⏎
x = 10⏎
if x == 10:⏎
print("x is equal to 10")⏎
# Using parentheses () for grouping⏎
result = (2 + 3) * (5 - 1)⏎
print(f"Result of grouped operation: {result}")⏎
# Using curly braces {} for dictionaries and string formatting⏎
my_dict = {"name": "Alice", "age": 30}⏎
print(f"My name is {my_dict['name']} and I am {my_dict['age']} years old.")⏎
# Using square brackets [] for lists and indexing⏎
my_list = [1, 2, 3, 4, 5]⏎
print(f"The first element is {my_list[0]} and the last element is {my_list[-1]}")⏎
# Conditional expressions with a question mark (?)⏎
# In Python, use a conditional expression instead⏎
result = "Even" if x % 2 == 0 else "Odd"⏎
print(f"The number {x} is {result}.")⏎
# Using plus (+) for addition and concatenation⏎
sum_result = 3 + 7⏎
concat_result = "Hello, " + "world!"⏎
print(f"Sum: {sum_result}, Concatenation: {concat_result}")⏎
# Using asterisk (*) for multiplication and repetition⏎
mul_result = 5 * 3⏎
repeat_result = "Repeat " * 3⏎
print(f"Multiplication: {mul_result}, Repetition: {repeat_result}")⏎