Fundamentals
-4
Fundamentals
Strings
Data Types
Algorithms
Logic
Arithmetic
Mathematics
Algorithms
Logic
Numbers
Fundamentals
Strings
Data Types
Algorithms
Logic
Fundamentals
numberprint=lambda x:int(''.join(map(str,__import__("itertools").chain((m:=range(1, x + 1)),m[-2::-1]))))
def numberprint(x):return int(''.join(map(lambda x: str(x), list(range(1, x + 1)) + list(range(x - 1, 0, -1)))))# harder to read but 1 line ¯\_(ツ)_/¯- numberprint=lambda x:int(''.join(map(str,__import__("itertools").chain((m:=range(1, x + 1)),m[-2::-1]))))
Fundamentals
def numberprint(x): l1 = list(map(str, range(1, x + 1))) l1.extend(l1[-2::-1]) return int(''.join(l1))
- def numberprint(x):
l1 = [str(i) for i in range(1, x + 1)]l2 = [str(i) for i in range(x - 1, 0, -1)]l1 += l2return int("".join(l1))- l1 = list(map(str, range(1, x + 1)))
- l1.extend(l1[-2::-1])
- return int(''.join(l1))
reverse_compliment= lambda dna:(''.join(list(reversed(dna)))).translate(str.maketrans("ACGT", "TGCA"))
t = str.maketrans("ACGTacgt", "TGCATGCA")reverse_compliment = lambda dna: "".join(chr(t[ord(x)]) for x in reversed(dna))- reverse_compliment= lambda dna:(''.join(list(reversed(dna)))).translate(str.maketrans("ACGT", "TGCA"))