等效于C ++ STL矢量/列表容器的Python [英] Python equivalent for C++ STL vector/list containers

查看:95
本文介绍了等效于C ++ STL矢量/列表容器的Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Python 中是否有类似内容,我将用于像一个向量和一个列表?

Is there something similar in Python that I would use for a container that's like a vector and a list?

任何链接也将有所帮助.

Any links would be helpful too.

推荐答案

您可以使用内置列表-基础实现类似于C ++向量.尽管有些事情有所不同-例如,您可以将不同类型的对象放在一个相同的列表中.

You can use the inbuilt list - underlying implementation is similar to C++ vector. Although some things differ - for example, you can put objects of different type in one and the same list.

http://effbot.org/zone/python-list.htm

这篇关于等效于C ++ STL矢量/列表容器的Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆