How I can define array of integer numbers in Python code
Say if this code is ok. or no
pos = [int]
len = 99
for i in range (0,99):
pos[i]=7
import array
pos = array.array('l', 7 * [99])
The array module of Python's standard library is the only way to make an array that comes with Python (the third-party module numpy offers other ways, but needs do be downloaded and installed separately) -- what your Q is doing, as well as every answer so far, is building a list, not an array.
In particular, there is no constraint that the pos list built in your Q and the several As contains just integers -- while, with the snippet I give, you do get that constraint (32-bit signed integers in this case, to be precise), which rigidly limits you but also saves a bunch of memory (an array of integers should take about one fifth the amount of memory that a list filled with integers will take, unless there's a lot of perennial duplication in the lists' items).
BTW, if you say array when you mean list (just in case list is what you meant), you're sure to cause a lot of confusion -- saying what you mean, and meaning what you say, helps a lot in clear communication, unsurprisingly!-)
0 <= Probability("OP means array.array, not list" | code_in_the_question) < epsilonOne way is:
pos = [7 for _ in xrange(0,99)]
in Python 2 or:
pos = [7 for _ in range(0,99)]
in Python 3. These are list comprehensions, and are easy to extend for more complex work.
Also:
pos = [int]
doesn't make much sense. You're creating a list with the only element being the type int.
xrange(0, 99)==xrange(99): the first element is zero, by default!
[int]defines a list of one element, which is theinttype (as a first-class object itself).