|
INTERVIEW QUESTIONS
WEB
PYTHON
DETAILS
Question: How do you make an array in Python?
Answer: Use a list: ["this", 1, "is", "an", "array"]
Lists are equivalent to C or Pascal arrays in their time complexity; the primary difference is that a Python list can contain objects of many different types.
The array module also provides methods for creating arrays of fixed types with compact representations, but they are slower to index than lists. Also note that the Numeric extensions and others define array-like structures with various characteristics as well.
|
|
|
Category |
Python Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 8658 users |
Added on |
4/28/2014 |
Views |
65809 |
Rate it! |
|
|
Question:
How do you make an array in Python?
Answer:
Use a list: ["this", 1, "is", "an", "array"]
Lists are equivalent to C or Pascal arrays in their time complexity; the primary difference is that a Python list can contain objects of many different types.
The array module also provides methods for creating arrays of fixed types with compact representations, but they are slower to index than lists. Also note that the Numeric extensions and others define array-like structures with various characteristics as well. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
How do you remove duplicates from a list?
|
View Answer
|
|
How can I find the methods or attributes of an object?
|
View Answer
|
|
How do I copy an object in Python?
|
View Answer
|
|
How do you make a higher order function in Python?
|
View Answer
|
|
How can I pass optional or keyword parameters from one function to another?
|
View Answer
|
|
How do I share global variables across modules?
|
View Answer
|
|
What are the rules for local and global variables in Python?
|
View Answer
|
|
How do you set a global variable in a function?
|
View Answer
|
|
Is there a tool to help find bugs or perform static analysis?
|
View Answer
|
|
Why can't I use an assignment in an expression?
|
View Answer
|
|
What is Python?
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All Python Interview Questions & Answers - Exam Mode /
Learning Mode
|