Algorithms, functions, classes, regular expressions, iterators, generators, OOP, exceptions, NumPy, pandas, scikit-learn
https://telega.in/c/python_tasks
Questions — @dina_ladnyuk
Post #2120
1.77K
PY @python_tasks
Showing posts older than #2121 · Back to latest
def f(*, name):
print(len(name), end=" ")
try:
f(name="vasya")
f("sergey")
except:
f(name="oleg")
sum(divmod(16,5), 5)
def f(x, y):
return x ** y
print(f.__call__(3, 2) + f(2, 3))
"{0:b}{1:#o}".format(3, 8)d = {"id": 1, "person": {"name": "Vasya", "age": 18}}
d1 = d.copy()
d1["person"]["age"] += 1
d2 = d
d2["person"]["age"] += 1
print(d["person"]["age"])d = {}
print(d.get("a", 0) + d.setdefault("a", 10) + d.get("a", 0))2 ** -2 + -2 ** 2
a = True
b= False
c = {True, False}
not b and b not in c or not a not in c
2 ^ 1 << 1 | 1 & 1 << 1