def check1(x):
return x is None or len(x) == 0:
def check2(x):
return len(x) == 0 or x is None
check1(None)
check2(None)
x = 6
y = 3
print(x / y)
l = [9, 3, 2, 6, 4, 1, 5, 8, 7]
sorted(l, reverse=True)
str
int
str
int
s
s += "more text"
s = "Hello world"
s[0] = 'h'
s
"hello world"
def f(l):
f.append(1)
def g(l):
l += [1]
f
g
def is_BST(tree: Node)
Given the following class definition for a
Node
Node
A binary search tree
# tree.py
from typing import Optional
class Node:
def __init__(self, val: int, l: Optional[Node], r: Optional[Node]):
self.val = val
self.left = l
self.right = r
def get_value(self):
return self.val
def get_left(self):
return self.left
def get_right(self):
return self.right
def find_level_max_num(tree)
def cartesian_product(L)
def permutations(L)