variable = []
Now variable refers to an empty list*.
Of course this is an assignment, not a declaration. There's no way to say in Python "this variable should never refer to anything other than a list", since Python is dynamically typed.
*The default built-in Python type is called a list, not an array. It is an ordered container of arbitrary length that can hold a heterogenous collection of objects (their types do not matter and can be freely mixed). This should not be confused with the array module, which offers a type closer to the C array type; the contents must be homogenous (all of the same type), but the length is still dynamic.
variable = []
Now variable refers to an empty list*.
Of course this is an assignment, not a declaration. There's no way to say in Python "this variable should never refer to anything other than a list", since Python is dynamically typed.
*The default built-in Python type is called a list, not an array. It is an ordered container of arbitrary length that can hold a heterogenous collection of objects (their types do not matter and can be freely mixed). This should not be confused with the array module, which offers a type closer to the C array type; the contents must be homogenous (all of the same type), but the length is still dynamic.
This is surprisingly complex topic in Python.
Practical answer
Arrays are represented by class list (see reference and do not mix them with generators).
Check out usage examples:
# empty array
arr = []
# init with values (can contain mixed types)
arr = [1, "eels"]
# get item by index (can be negative to access end of array)
arr = [1, 2, 3, 4, 5, 6]
arr[0] # 1
arr[-1] # 6
# get length
length = len(arr)
# supports append and insert
arr.append(8)
arr.insert(6, 7)
Theoretical answer
Under the hood Python's list is a wrapper for a real array which contains references to items. Also, underlying array is created with some extra space.
Consequences of this are:
- random access is really cheap (
arr[6653]is same toarr[0]) appendoperation is 'for free' while some extra spaceinsertoperation is expensive
Check this awesome table of operations complexity.
Also, please see this picture, where I've tried to show most important differences between array, array of references and linked list:

How is an array different from a list in Python?
How do I initialize an array in Python with a size?
When should I use arrays instead of lists in Python?
As noted in the comments, initializing a list (not an array, that's not the type in Python, though there is an array module for more specialized use) to a bunch of zeroes is just:
a = [0] * 10000
If you want an equivalent to memset for this purpose, say, you want to zero the first 1000 elements of an existing list, you'd use slice assignment:
a[:1000] = [0] * 1000
You can initialize a list of a given size in several ways.
Python has list comprehensions, which create lists from other lists inline. So, if you make a list with 10000 elements (range(10000)) you can easily make from this a list with 10000 zeroes:
[0 for _ in range(10000)]
This is pretty close to your original solution.
Probably a more efficient approach is to multiply a list with a single zero by 10000:
[0]*10000
Both will yield a list with 10000 zeroes.
Based on your last line (that you don't know how many elements are there in the array), you want to create an empty array and then use the append() function to add values into it.
The modified version of the code which you have provided in the question:
ip_pb = []
ip_pb.append("0111111100000000000000011110001")
print(ip_pb)
In Python, we usually call it list instead of the traditional array.
list in Python is always a dynamically lengthened, that means it doesn't have a fixed size as opposed to what called array.
for fixed size array, I believe Python itself has a standard library which you can use it with import array but unfortunately it has limited data types.
array
For the sake of simplicity, maybe you can just try this method:
def array(fill, n):
return [fill] * n
a = array("", 10)
a[0] = "10010101"
a[9] = "10230123"
a[10] # IndexError