Python mange with liste

Bala Ji baladjy at gmail.com
Sun Dec 29 05:18:01 EST 2013


Oh sorry it's a Y (in french it's O) sorry for the mistake


Le dimanche 29 décembre 2013 00:30:23 UTC+1, Bala Ji a écrit :
> 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 =)




More information about the Python-list mailing list