📅  最后修改于: 2022-03-11 14:45:38.910000             🧑  作者: Mango
Try the following:
import random
import string
def random_char(y):
return ''.join(random.choice(string.ascii_letters) for x in range(y))
print (random_char(7)+"@gmail.com")
you can use string.ascii_lowercase if you only want lower case letters