scriptdiddy
scriptdiddy

Reputation: 1265

Two Dimensional List Python with loop

I have two lists:

ask[]
timeStamp[]

I need to add the information in these lists into a two dimensional array.

Here is my code:

for item in actTime:
    rawData.append(ask[x],timeStamp[x])
    x = x + 1

Upvotes: 0

Views: 746

Answers (1)

Matt Fenwick
Matt Fenwick

Reputation: 49085

Use zip:

>>> pairs = zip(ask, timeStamp)

This will return a list of (tuple) pairs.

Upvotes: 4

Related Questions