PGoCareerGoCareer prep tools
Home
LoginSign up
  • Java
  • Python
  • AI
  • React
  • Angular
  • PHP
  • Node.js
  • SQL
  • DSA
  • HTML
  • CSS
  • JS
  • Spring
  • ML
  • MongoDB

Python · Theory

Arrays

← All stacks

Theory

93/268

Arrays

array.array is a typed compact list (like 'i' for ints). Most freshers should use list. array is for memory when you have many numbers of one type.

Interview — list is general; array.array is typed. NumPy array is the data-science version — different library.

Arrays — output — 20 3. array('i') is typed ints. Daily work still uses list.

Exam tip

When list vs array.array vs NumPy.

Example

# Arrays
from array import array
a = array("i", [10, 20, 30])
print(a[1], len(a))

Arrays — output: 20 3. array('i') is typed ints. Daily work still uses list.

Short notes

  • DefArray.array = typed
  • RuleDaily work = list
  • RememberNumPy = data science

Questions

1

Explain Arrays as if you are teaching a junior — definition, then one tiny script.

2

What does the example print, and why?

3

What mistake do freshers make with Arrays?

Previous← IDEsNextCLI arguments →
P

GoCareerGo

Utilities · Preparation Hub · Resume · CV · Tools — one workspace.

Workspace

DashboardProfilePreparation HubResume builderCV builderCareer planning

PDF Tools

Merge PDFSplit PDFCompress PDFImage to PDFAll toolsJobs

Image & QR

Compress ImageResize ImageQR ScannerQR GeneratorBlogIT interview prep

Company

FAQFeedbackContactPrivacyTermsSitemap

© 2026 GoCareerGo. Keep moving forward.