[PYTHON] Limited standard output problem

https://qiita.com/sh1ma/items/86f03c08b324e7a88495

--String / numeric literals are not possible --chr / ord function not possible

I had a similar problem I asked with CodeIQ, but it was supposed to use the chr function. , Another twist was quite difficult (even getattr cannot be left if chr cannot be used). I barely got things done with bytearray.decode.

Sh1ma.py


#!/usr/bin/env python
szero = len(str(len([])))
sone = szero + szero
stwo = sone + sone
sthree = stwo + stwo
sfour = sthree + sthree
sfive = sfour + sfour
ssix = sfive + sfive
print(bytearray([
	ssix+sfour+sone+szero,
	ssix+sfive+sthree,
	sfive+sfour+szero,
	ssix+sfive+sthree+stwo+szero,
	ssix+sfive+szero,
]).decode())

Recommended Posts

Limited standard output problem
Theme: Standard output [Difficulty ★★★★★]
Standard input / output summary
Test standard output with Pytest
Decorator to silence standard output
Write standard output to a file
Make standard output non-blocking in Python
Notes on standard input / output of Go
UnicodeEncodeError struggle with standard output of python3