I want to generate a string of size N.
It should be made up of numbers and uppercase English letters such as:
I have gone though almost all of the answers but none of them looks easier. I would suggest you to try the passgen library which is generally used to create random passwords.
You can generate random strings of your choice of length, punctuation, digits, letters and case.
Here's the code for your case:
from passgen import passgen
string_length = int(input())
random_string = passgen(length=string_length, punctuation=False, digits=True, letters=True, case='upper')