相关疑难解决方法(0)

如何在Python中创建整数数组?

它不应该那么难.我的意思是在C,

int a[10]; 
Run Code Online (Sandbox Code Playgroud)

是你所需要的全部.如何为随机大小创建全零的数组.我知道NumPy中的零()函数,但必须有一个简单的内置方法,而不是另一个模块.

python arrays

29
推荐指数
4
解决办法
23万
查看次数

使用类型定义列表

我来自Java,我想做一些像这样的数据传输对象(DTO):

class ErrorDefinition():
    code = ''
    message = ''
    exception = ''

class ResponseDTO():
    sucess = True
    errors = list() # How do I say it that it is directly of the ErrorDefinition() type, to not import it every time that I'm going to append an error definition?
Run Code Online (Sandbox Code Playgroud)

或者有更好的方法吗?

python

6
推荐指数
2
解决办法
3万
查看次数

标签 统计

python ×2

arrays ×1