Skip to content

Instantly share code, notes, and snippets.

@ErickMwazonga
Created February 5, 2018 11:28
Show Gist options
  • Save ErickMwazonga/a5b863c8fd7081c3175c40669ebde0ce to your computer and use it in GitHub Desktop.
Save ErickMwazonga/a5b863c8fd7081c3175c40669ebde0ce to your computer and use it in GitHub Desktop.
import random
def _generate_cart_id():
cart_id = ''
characters = 'ABCDEFGHIJKLMNOPQRQSTUVWXYZabcdefghiklmnopqrstuvwxyz1234567890!@#$%^&*()'
cart_id_length = 50
for y in range(cart_id_length):
cart_id += characters[random.randint(0, len(characters)-1)]
return cart_id
print(_generate_cart_id())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment