Python mange with liste

Baladjy KICHENASSAMY baladjy at gmail.com
Sat Dec 28 18:11:03 EST 2013


Hello guys,
i need some help with is program

I have a txt file "test.txt" where there is Name;Sexe;Answer(Y or N)
example of txt file:
--------------------------------------
*nam1;F*;Y
nam2;M;N
nam3;F;Y
nam4;M;N
halo;M;Y
rock;M;N
nam1;F;N
_________________________________

so my program will ask the name, sexe, and answer and it will tell me if
the name exist or not

example i will enter
nam1;F;O

The program must tell me that *nam1 *with sexe *F* existe. (it must take in
count the answer)

------------------------------------------------
name = raw_input('name: ')
sexe = raw_input('sexe: ')
r1 = raw_input('r1 Y or N: ')
infos = name+";"+sexe+";"+r1

f=open("test.txt","r")
conten = f.read()
print conten
f.close()

 #f=open("test.txt","a")
#f.write(infos)
#f.write('\n')
 #f.close()
------------------------------------------------

thank you =)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20131229/06d9f0c5/attachment.html>


More information about the Python-list mailing list