Question on Manipulating List and on Python

David dwblas at gmail.com
Thu Sep 29 18:34:00 CEST 2011


> word1=line_word[0]
> if word1==001:


You are comparing a string and an integer assuming you are reading a
text file.

integers
word1=int(line_word[0])
if word1=1:

strings
word1=line_word[0]
if word1=="001:"




More information about the Python-list mailing list