lundi 13 février 2017

Forming a tuple/list from a text file in Python

Vote count: 0

I have file of format:

C1  A1
C2  A2
C3  A3  
C1  A4
C4  A5

Each line is separted by a tab. Can I get this file in array/list/tuple directly so that the columns of each line can be accessible through index? Like [(c1,a1),(c2,a2)..] Any python functions allows us to do this?

asked 16 secs ago

Let's block ads! (Why?)



Forming a tuple/list from a text file in Python

Aucun commentaire:

Enregistrer un commentaire