pythonでファイルを読み取って、文字列を操作する
pythonコード:
f = open('c:\\names_startnews24.txt’);
lang =0;
result ="";
for line in f:
name = line.strip();
name_ = name[::-1];
leng = len(name);
if(name ==name_ and leng>=lang):
lang = leng;
result = name;
# print name;
print “result “,result;
f.close();