#!/usr/bin/env python #-*- coding:utf-8 -*- import random code = [] for i in range(0,6): if i == random.randint(0,6): code.append(str(i)) else: M = (random.randint(65,90)) code.append(str(chr(M))) print(''.join(code))