« first day (889 days earlier)      last day (2467 days later) » 

5:37 AM
hey guys I answered a question here. If it's not appropriate please delete/downvote it. If it's helpful please upvote it.
0
A: python - Is there a way to store a function in a list or dictionary so that when the index (or key) is called it fires off the stored function?

amilapsnYou can do something like this also: Let foo1(), foo2(), foo3(), ... be functions Define foo like this: foo = lambda n: eval("foo"+str(n)) Now you can iterate through them. for i in range(n): foo(i)() n is the number of foo functions defined. This way come in handy if you don't want t...

if you need more clarifications please comment.
 
 
1 hour later…
6:48 AM
@AnttiHaapala Delete-voted
 
thanks :D
 
6:59 AM
@amilapsn it's not appropriate to solicit upvotes for your posts, and your answer is bad and harmful.
 
@amilapsn downvoted. That's abuse of eval
also it doesn't answer the q
 
7:17 AM
6 messages moved from Python
 
8:00 AM
@AnttiHaapala wow what an answer :P
 
@AnttiHaapala *downvotes (not from me though).
 
5 messages moved from Python
 

« first day (889 days earlier)      last day (2467 days later) »