collection类:处理Python列表和字典

List类

关键字说明
convert_to_list转换为python的list类型
append_to_list将元素加入列表
insert_into_list将元素插入列表指定位置
combine_lists将列表按顺序合并
set_list_value设置列表指定位置的值
remove_values_from_list去除列表中指定Values
remove_from_list去除列表中指定位置的值
remove_duplicates对列表去重
get_from_list获取列表中指定位置的值
get_slice_from_list获取列表中指定位置范围内的值
count_values_in_list获取元素在列表中出现的次数
get_index_from_list获取元素在列表中第一次出现的位置
copy_list复制列表
reverse_list翻转列表
sort_list列表排序
list_should_contain_value判断列表应该包含某元素
list_should_not_contain_value
list_should_not_contain_duplicates判断列表不应存在重复值
lists_should_be_equal判断列表是否相等
list_should_contain_sub_list判断列表是否包含子列表
log_list打印列表信息

Dictionary类

关键字说明
convert_to_dictionary转换为python的字典类型
set_to_dictionary将键值对加入字典
remove_from_dictionary从字典中去除指定key
pop_from_dictionary从字典中去除指定key并返回对应的Value
keep_in_dictionary只保留key,去除其他所有
copy_dictionary复制字典
get_dictionary_keys获取字典的key列表
get_dictionary_values获取字典的value列表
get_dictionary_items获取字典的键值对列表
get_from_dictionary获取字典中key对应的value
dictionary_should_contain_key判断字典应该包含key
dictionary_should_not_contain_key
dictionary_should_contain_item判断字典应该包含键值对
dictionary_should_contain_value判断字典应该包含value
dictionary_should_not_contain_value
dictionaries_should_be_equal判断字典是否相等
dictionary_should_contain_sub_dictionary判断字典是否包含子字典
log_dictionary打印字典的大小和内容
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值