473,378 Members | 1,388 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Combine two lists

Is this possible to zip or combine two different sized list?
Expand|Select|Wrap|Line Numbers
  1. >>list1 = [1, 2, 3]
  2. >>list2 = [4, 5, 6, 7, 8]
  3. >>zip(list1, list2)
  4. [(1, 4), (2, 5), (3, 6)]
  5.  
Oct 20 '11 #1
1 2619
bvdet
2,851 Expert Mod 2GB
What do you expect the output to be?
Oct 21 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

24
by: Lasse Vågsæther Karlsen | last post by:
I need to merge several sources of values into one stream of values. All of the sources are sorted already and I need to retrieve the values from them all in sorted order. In other words: s1 = ...
7
by: deanfamily | last post by:
Here's the problem: I have two linked lists of integers (list1 and list2) that are already in sequential order, and I need to combine them into one list in sequential order (newList). Any...
1
by: Girish Sahani | last post by:
hello ppl, Consider a list like . Here 'a','b','c' are objects and 1,3,4,2 are their instance ids and they are unique e.g. a.1 and b.1 cannot exist together. From this list i want to generate...
1
by: martin.zarate | last post by:
I'm working on a simple command-line app. The app takes an XML file that provides the operations to perform. However, the problem I'm running in to is that the file must contain a seperate array...
10
by: Anton Vredegoor | last post by:
Python's sorting algorithm takes advantage of preexisting order in a sequence: #sort_test.py import random import time def test(): n = 1000 k = 2**28
5
by: Scott | last post by:
I'm sorry if most of my question's seem "petty", but as I've said before, I need to know the petty just because I need to know. This question is more along the lines of just having you guys...
5
by: TokiDoki | last post by:
Hi! I have a Python problem which is my last problem to solve to finish up a Django application. This is amazingly simple but I have been stuck now for a couple of days. It is embarrisingly...
6
by: weg22 | last post by:
Hi all, I have two lists of textboxes: 'Create list of all textboxes on error log data tab el_textboxes = New List(Of Windows.Forms.TextBox)(New Windows.Forms.TextBox() {addr_x100, addr_x101,...
1
by: colin | last post by:
Hi, I have 3 object of interest wich are objects in 3d space, surface,wire,point. they are all interconnected, and they all contain lists of objects they are connected to, eg each surface will...
3
by: Kubie | last post by:
I'm having problems finding the syntax/comands that do the this correctly. I'm must not be doing the join right or something.. List one AAC1234 CDA2w31 12ZZC12 12TRE1 23234 243
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.