The 'p': print('******') part means to print the stars now, and use the result fromprint as the value for the 'p' key. The result is None, because print displays text as a side effect and returns None. Inside the loop, A['p'] does nothing useful; simply looking up a value in a dict can’t cause the function to run. All of that part already happened; lookup is just lookup.
If you just store print in the dictionary, then you can retrieve it and call it later:
A = {'a': {x*y for x in range(7) for y in range(7)}, 'p': print }
while True:
A['p']('******')
But with this technique, you have to say what to call it with, when you call it. Because the way that you say what the arguments are, is the actual call.
If you want to “store” the argument so that it’s decided ahead of time, really what you are trying to do is make a new function, that doesn’t want any arguments, and just always prints the '******' string when it is called. There are a few techniques for this:
I can’t understand how you want to “involve” this key - why it should be useful to help solve the problem. I also don’t understand exactly what you want to be printed. But I think you should first check the result from {x*y for x in range(7) for y in range(7)}. I know what it does, but I think you might be surprised. I can’t really tell what you want it to do.