Q0
Q1
Q2
Q3
Q4
Q5
Q6
Q7
Q8
Q9
QA
QB
QC
QD
QE
QF
QG
QH
QI
QJ
QK
QL
QM
QN
QO
QP
Find the least common multiple of an array of numbers
#!/usr/bin/python3
import sys
from math import gcd
def lcm_list(nums):
from functools import reduce
def lcm(a, b):
return a * b // gcd(a, b)
return reduce(lcm, nums)
nums = list(map(int, sys.argv[1:]))
print(lcm_list(nums))
QR
Print a range of unicode characters
#!/usr/bin/python3
import sys
a = int(sys.argv[1],16)
b = int(sys.argv[2],16)
for i in range(a,b + 1):
print(" ".join([str(hex(i))," ",chr(i)]))
QS
Make the first field of standard input uppercase:
python3 -c "import sys;[print(l.split()[0].upper(),*l.split()[1:]) for l in sys.stdin]"
QT
šš°šÆš·š¦š³šµ š±šš¢šŖšÆ šµš¦š¹šµ šµš° š¶šÆšŖš¤š°š„š¦ šŖšµš¢ššŖš¤
#!/usr/bin/python3
import sys
str = ' '.join(sys.argv[1:])
def bold(input_text):
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
bold_chars = "ššššššššššššššššššššššššš š”š¢š£š¤š„š¦š§šØš©šŖš«š¬šš®šÆš°š±š²š³š“šµš¶š·šøš¹šŗš»"
output = ""
for character in input_text:
if character in chars:
output += bold_chars[chars.index(character)]
else:
output += character
return output
print (bold(str))
QU
QV
QW
QX
QY
QZ














