seekworser's Library

This documentation is automatically generated by online-judge-tools/verification-helper


Project maintained by seekworser Hosted on GitHub Pages — Theme by mattgraham

:warning: competitive/python/chr2int.py

Code

def chr2int(s):
    return ord(s) - 97

def int2chr(i):
    return chr(i + 97)

def uchr2int(s):
    return ord(s) - 65

def uint2chr(i):
    return chr(i + 65)

print(chr2int("a"))
print(chr2int("z"))
print(uchr2int("A"))
print(uchr2int("Z"))
print(int2chr(0))
print(int2chr(25))
print(uint2chr(0))
print(uint2chr(25))
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.11.3/x64/lib/python3.11/site-packages/onlinejudge_verify/documentation/build.py", line 71, in _render_source_code_stat
    bundled_code = language.bundle(stat.path, basedir=basedir, options={'include_paths': [basedir]}).decode()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.3/x64/lib/python3.11/site-packages/onlinejudge_verify/languages/python.py", line 96, in bundle
    raise NotImplementedError
NotImplementedError
Back to top page