I get NameError: name 'array' is not defined in python error when I want to create array, for example:
a = array([1,8,3])
What am I doing wrong? How to use arrays?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you need a container to hold a bunch of things, then lists might be your best bet:
Type
from a Python interpreter to see the methods that lists support, such as append, pop, reverse, and sort.
Lists also support list comprehensions and Python’s iterable interface: