Tech C**P
Some useful string methods, variables:   string.ascii_letters: in case you want to use alpha characters a-zA-Z. The output is:  abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ  string.ascii_lowercase:  abcdefghijklmnopqrstuvwxyz  string.ascii_uppercase:…
Generate a sample string (bonus coupon) from 
 
This function returns a random string from
GET THE IDEA!
#python #string #ascii_uppercase #digits #random #random_choice #range
  string functions and removing misguiding characters from the final list:def generate_coupon(coupon_code_length=10):
alphanum = list(string.ascii_uppercase + string.digits)
alphanum.remove('L')
alphanum.remove('I')
alphanum.remove('1')
alphanum.remove('0')
alphanum.remove('O')
return ''.join(random.choice(alphanum) for i in range(coupon_code_length))
This function returns a random string from
ascii_uppercase and string.digits. This is one usages out of very many usages of        string module public variables. :)GET THE IDEA!
#python #string #ascii_uppercase #digits #random #random_choice #range
