MS python学习(3)

Array是Python的array模块提供的一种数据类型,它与list相似但存储同种类型的元素,如字符、整数或浮点数。Array使用typecode来定义元素类型,如c、i、f等,这使得它在处理大量数据时更紧凑且效率更高。与list相比,Array在内存管理和速度上有优势,尤其在需要存储特定类型数据时。
摘要由CSDN通过智能技术生成

继续学习

Array VS list

array
From array module to import array function, the above result would be:
result
区别如下
differences

Array 用法

https://docs.python.org/3/library/array.html#module-array

This module defines an object type which can compactly represent an array of basic values: characters, integers, floating point numbers. Arrays are sequence types and behave very much like lists, except that the type of objects stored in them is constrained. The type is specified at object creation time by using a type code, which is a single character. The following type codes are defined:
types of array
格式就是array('<type>', <objects>) 用于储存同一种类型的元素,方便归类管理。

tips: VSC 中Ctrl+D 可以快速替换选中代码中的相同字段。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值