Issue
In Python, I am using uuid4() method to create a unique char set. But I can not find a way to limit that to 10 or 8 characters. Is there any way?
uuid4()
ffc69c1b-9d87-4c19-8dac-c09ca857e3fc
Thanks.
Solution
Try :
x = uuid4()
str(x)[:8]
Output :
"ffc69c1b"
Is there a way to substring a string in Python?
Answered By - littleDev
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.