def make_serial_code(n: int = 16) -> str:
# I と O は 0,1と混同するので外す
randlst = [random.choice("ABCDEFGHJKLMNPQRSTUVWXYZ0123456789") for _ in range(n)]
return "".join(randlst)
print(make_serial_code())
# 4E0G4XZLMFFSEB44
More than 1 year has passed since last update.
Python: シリアルコード的なランダム文字列を発行する
Last updated at Posted at 2022-03-11
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme