Thursday, May 14, 2020

Empty list of a given size in Python

l = [0]*n

creates a list of size n, with each element as 0

source: https://stackoverflow.com/questions/5205575/how-do-i-get-an-empty-array-of-any-size-in-python

No comments:

Post a Comment

Is the number of all INTO functions from the set {1, 2, 3, ..... n} to itself equal to all number of MANY to ONE fuctions?

Yes,  t he number of all into functions from the set {1, 2, 3, .... n} to itself is exactly equal to the number of many-to-one functions ...