Why this difference?
n00m
n00m at narod.ru
Thu Feb 24 07:19:40 EST 2011
file my.txt:
===============================
0 beb
1 qwe
2 asd
3 hyu
4 zed
5 asd
6 oth
=============================
py script:
===============================
import sys
sys.stdin = open('88.txt', 'r')
t = sys.stdin.readlines()
t = map(lambda rec: rec.split(), t)
print t
print t[2][1] == t[5][1]
print t[2][1] is t[5][1]
print '=================================='
a = 'asd'
b = 'asd'
print a is b
output:
=======================================
[['0', 'beb'], ['1', 'qwe'], ['2', 'asd'], ['3', 'hyu'], ['4', 'zed'],
['5', 'as
d'], ['6', 'oth']]
True
False
==================================
True
More information about the Python-list
mailing list