I want to have an array with random binary values, its length is p, but I get the error:
AttributeError: 'NoneType' object has no attribute 'type'
this is my code
import random
def length(p):
binary = []
for i in range(p):
temp = random.randint(0, 1)
binary.append(temp )
print(binary)
fn=length(5)
fn.type
Aucun commentaire:
Enregistrer un commentaire