Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Array
#2
list is an array, it can hold combination of mixed values, which makes is very flexable.
x = [1, 2, 3, 4, 'Harry']
to use array, you must import array (and define type), it is 'C' array
example:
from array import array
x = array('l', [1, 2, 3, 4, 5])
array is a function, allows more operations, at the cost of being less easy to use see: https://docs.python.org/3/library/array.html
Reply


Messages In This Thread
Array - by Prasanna - Sep-25-2018, 05:42 AM
RE: Array - by Larz60+ - Sep-25-2018, 10:27 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020