0% found this document useful (0 votes)
20 views3 pages

Py

Uploaded by

preeeti250
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views3 pages

Py

Uploaded by

preeeti250
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

[[ 6 8 10 11]

[ 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

N, M = map(int, input().split(' '))

a = [[Link]((input().split(' ')), dtype='int') for i in range(N)]


b = [[Link]((input().split(' ')), dtype='int') for j in range(N)]

N = [[Link]((input().split()),dtype='int') for i in range(n)]

N = [[Link](input().split(),dtype='int') for i in range(1)]

print(' '.join(map(str,Y)))

print(*result)
[Link]->cartesian product
[Link]
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] = [Link](i, 0) + 1

from collections import deque


d=deque()
for _ in range(int(input())):
x=list(input().split())
if len(x)>1:
eval(d.x[0](x[1]))
else:
eval(d.x[0])
print(d)
---------
counter = {c : [Link](c) for c in s}

counter = sorted([Link](), key=lambda x: (-x[1], x[0]))[:3]->doubt(clarified


# default is ascending order so negate the counts)

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 = [Link]() if d[0] >= d[-1] else [Link]()
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"

pat = [(s*(2*i + 1)).center(m, h) for i in range(n//2)]


wel = [[Link](m,h)]

x = "\n".join(pat+wel+pat[::-1])
print(x)

and
N, M = map(int, input().split())

if N%2 != 0 and 5 < N < 101 and 15 < M < 303:


for i in range(1, N, 2):
print((".|."*i).center(M, "-"))

print("WELCOME".center(M, "-"))

for j in range(N-2, -1, -2):


print((".|." *j).center(M, "-"))
string-validators:
print(any([Link]() for c in s))``
print(any([Link]() for c in s))
print(any([Link]() for c in s))
print(any([Link]() for c in s))
print(any([Link]() for c in s))

print(any([[Link]() for x in s]))


print(any([[Link]() for x in s]))
print(any([[Link]() for x in s]))
print(any([[Link]() for x in s]))
print(any([[Link]() for x in s]))
def split_and_join(line):
return "-".join([Link](" "))

l=list(string)
l[position]=character
print(''.join(l))
#return ''.join(l)

#learn more abt fromkeys()


used in merge_the_tools:
def merge_the_tools(string, k):
S=[]
l=[]
[Link]([Link](string,k))
for i in l:
print("".join([Link](i)))
foo = "mppmt"
result = "".join([Link](foo))

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}")

You might also like