Add some stuff from yesterday
This commit is contained in:
25
22/decode.py
Executable file
25
22/decode.py
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
|
||||
rawInput = sys.stdin.readlines()
|
||||
splitInput = [l.strip() for l in rawInput]
|
||||
|
||||
for c in splitInput:
|
||||
try:
|
||||
int(c)
|
||||
is_int = True
|
||||
except ValueError:
|
||||
is_int = False
|
||||
assert is_int, "Input must be in decimal form, and separated by newlines"
|
||||
|
||||
rawOutput = []
|
||||
for c in splitInput:
|
||||
c2 = chr(int(c))
|
||||
rawOutput.append(c2)
|
||||
|
||||
output = ""
|
||||
for c in rawOutput:
|
||||
output += c
|
||||
|
||||
print(output)
|
Reference in New Issue
Block a user