1# Python3 code to demonstrate
2# generating random strings
3# using random.choices()
4import string
5import random
6
7# initializing size of string
8N = 7
9
10# using random.choices()
11# generating random strings
12res = ''.join(random.choices(string.ascii_uppercase +
13 string.digits, k = N))
14
15# print result
16print("The generated random string : " + str(res))