When I execute the code, it print" function aa in 0x0000... "and all.
I want it to print aa,a,b,c,d,. Is it possible?
Sorry for the stupid question, thanks a lot.
def main():
lunch = {
0: aa,
1: a,
2: b,
3: c,
4: d,
}
for i in range(len(lunch)):
print(lunch[i])
def aa():
print("aa")
def a():
pass
def b():
pass
def c():
pass
def d():
pass
if __name__ == "__main__":
main()
__name__attribute. Lambdas are a notable exception.lunch = { 0: aa, ... }or did you meanlunch = { 0: "aa", ... }? The later makes the for-loop print what you want , and the following functions aren't usefull anymore.