import uuid id = uuid.uuid1() print(id)
38fd8eae-6a0a-11eb-bc49-0242ac130002
import uuid id = uuid.UUID('edfbee76-6a08-11eb-9ab1-0242ac130002') print(id)
edfbee76-6a08-11eb-9ab1-0242ac130002
import uuid id = uuid.uuid4() print(id)
77d9196d-c2eb-4a15-a088-50611b513f23This example generates a random UUID. It returns a string representing the UUID. The package library for UUID is inbuilt in Python, so no external package installations are required.