py
py
[ 6 8 10 11]]
[[-4 -4 -4 -3]
[-4 -4 -4 -3]]
[[ 5 12 21 28]
[ 5 12 21 28]]
[[0 0 0 0]
[0 0 0 0]]
[[1 2 3 4]
[1 2 3 4]]
[[ 1 64 2187 16384]
[ 1 64 2187 16384]]
2 4
1 2 3 4
1 2 3 4
5 6 7 7
5 6 7 7
print(' '.join(map(str,Y)))
print(*result)
itertools.product->cartesian product
iterdools.permutations
from collections import Counter
from collections import defaultdict->if no key then it will not give error
OrderDict
Nice code:
rsplit(maxsplit=1)
d[n] = d[n] + int(c) if n in d else int(c)
[print(''.join(tup_pair)) for tup_pair in sorted(list(permutations(string,
length)))]
doubts:
exec(f"d.{l[0]}({l[1]})")->what is f????
getattr()->?
ex:input_command = getattr(my_deque, split_input[0])->see gallery on 09.05.2024
s = input()
letters = {}
for i in s:
letters[i] = letters.get(i, 0) + 1
for i in counter:
print(" ".join(map(str, i)))
SOLVE:
Collections->Piling Up
Yes
No
Yes
for _ in range(int(input())):
n = int(input())
d = deque(map(int, input().split()))
flag = 'Yes'
while len(d) > 1:
a = d.popleft() if d[0] >= d[-1] else d.pop()
if a < max(d[0], d[-1]):
flag = 'No'
break
print(flag)
text wrap:(its import textwrap)->learn more abt it
designer door mat->see this code(i have not seen yet)
n,m = list(map(int, input().split()))
s = ".|."
h = "-"
w = "WELCOME"
x = "\n".join(pat+wel+pat[::-1])
print(x)
and
N, M = map(int, input().split())
print("WELCOME".center(M, "-"))
l=list(string)
l[position]=character
print(''.join(l))
#return ''.join(l)
TFuck
for i in range(1, number+1):
width = len(f"{number:b}")
print(f"{i:>{width}d} {i:>{width}o} {i:>{width}X} {i:>{width}b}")