2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Python: シリアルコード的なランダム文字列を発行する

Last updated at Posted at 2022-03-11
    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
2
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?