Algorithms, functions, classes, regular expressions, iterators, generators, OOP, exceptions, NumPy, pandas, scikit-learn
https://telega.in/c/python_tasks
Questions — @dina_ladnyuk
Post #2421
1.34K
- 🤔 5
- 👍 1
PY @python_tasks
Showing posts older than #2422 · Back to latest
x, y = ord("A"), ord("А")
assert(x << 4 == y)
print(chr(y + 1))from copy import deepcopy
d = {"a": [1], "b": 2}
d2 = deepcopy(d)
d2["a"] += [2]
d2["b"] += 3
print(sum(d["a"]) + d["b"])
d = {"a": [1], "b": 2}
d2 = d.copy()
d2["a"] = d2["a"] + [2]
d2["b"] += 3
print(sum(d["a"]) + d["b"])d = {"a": [1], "b": 2}
d2 = d.copy()
d2["a"] += [2]
d2["b"] += 3
print(sum(d["a"]) + d["b"])ord(chr("A"))bytes(b"hello")[::-4]*2
d1 = {'x': 2}
d2 = {}
d1.setdefault("x", 1)
d2.setdefault("x", 2)
print(d1 == d2)bytes(b"aB") + bytes(b"Cd").upper()
chr(ord(8) - ord(6))