Arrays

suggest change

Introduction

A list can hold mixed values, including ints, strings, or other lists. The typecodes below belong to the array module, which stores values of one C type.

Parameters

Parameter Details
b Signed integer, 1 byte
B Unsigned integer, 1 byte
c Not a Python 3 typecode. array('c') raises ValueError
u Unicode character, 2 bytes. Deprecated, and scheduled for removal in Python 3.16
h Signed integer, 2 bytes
H Unsigned integer, 2 bytes
i Signed C int. Minimum 2 bytes; 4 bytes in this Windows build
I Unsigned C int. Minimum 2 bytes; 4 bytes in this Windows build
w Unicode character, 4 bytes
l Signed C long. Minimum 4 bytes; 4 bytes in this Windows build
L Unsigned C long. Minimum 4 bytes; 4 bytes in this Windows build
q Signed integer, 8 bytes
Q Unsigned integer, 8 bytes
f Floating point, 4 bytes
d Floating point, 8 bytes

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents