python使用append合并两个数组的方法

yipeiwu_com6年前Python基础

本文实例讲述了python使用append合并两个数组的方法。分享给大家供大家参考。具体如下:

lista = [1,2,3]
listb = [4,5,6]
mergedlist =[]
for elem in lista:
  mergedlist.append(elem)
for elem in listb:
  mergedlist.append(elem)

希望本文所述对大家的Python程序设计有所帮助。

相关文章

opencv3/C++实现视频背景去除建模(BSM)

opencv3/C++实现视频背景去除建模(BSM)

视频背景建模主要使用到: 高斯混合模型(Mixture Of Gauss,MOG) createBackgroundSubtractorMOG2(int history=500, d...

在Python中操作时间之strptime()方法的使用

 strptime()方法分析表示根据格式的时间字符串。返回值是一个struct_time所返回gmtime()或localtime()。 格式参数使用相同的指令使用strft...

Python处理json字符串转化为字典的简单实现

今天一个朋友给个需求: 来来 {'isOK': 1, 'isRunning': None, 'isError': None} 怎么转换成字典 好,一看就是json转化很简单,开始:...

Python3中正则模块re.compile、re.match及re.search函数用法详解

本文实例讲述了Python3中正则模块re.compile、re.match及re.search函数用法。分享给大家供大家参考,具体如下: re模块 re.compile、re.matc...

python实现巡检系统(solaris)示例

使用python + shell 编写,是一个简易solaris系统巡检程序 复制代码 代码如下:#!/usr/bin/python -u#-*- coding:utf-8 -*-''...