0
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-02-01

参考

Python実践入門

方法1 uuid

標準モジュール

import uuid

for i in range(10):
    print(str(uuid.uuid4().hex))
ad37a981e8774484823d3446c1d7cf3a
69b36e62cebd49afa138241c1c9d6282
8329326e86f4417c817bfe372769a96f
2fb71832bb7242c6a7ba7d78c5405cf4
e4bcea0b3f4e45e1a093923145f2488c
8ee8734a6abd4e50a21c923c83f3c1eb
3980c4574fc044dcb18e0802abaf11e1
a3f655f41a6a4c7dafa9d722676a0a3c
a97c6c33963f4795907b71b3d4f04b2b
040e31e4ac804de7b8fd81cf8308a3c4

方法2 names

サードパーティー製モジュール

pip install names
import names

for i in range(10):
    print(names.get_full_name())
Amanda Settle
Kevin Bejar
Luella Inman
Sara Runyon
Levi Rezentes
Cesar Smith
Constance Coates
Patricia Schrag
Jessica Cauthen
William Conkle
0
0
0

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
0
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?