Hi Python,
I am trying to make a french to English dictionary. First of all, I made a 
dictionary with keys and values. Then I asked the user to enter a letter. If 
the letter correspond to the Keys, my print function should display the Key and 
value. But my code below, could not . Thank you!

List ={"le":"Determinant: The. Pronoun: Him, Her, It, Them .. Example: vive la 
politique, vive l'amour:long live politics, long live love","de": "Preposition: 
Of, From, Some, Any.. Example: Il ne rêve que d'argent et de plaisirs: he only 
dreams of money and pleasure","un":" Adjective,Noum, Pronoun: One..Article: 
A,An... Example: Je me suis cassé un ongle: I broke one of my fingernails","à": 
"Preposition: To,At,In. Example: Ils restent à l'école le plus longtemps 
possible:they remain at school as long as possible","être": "Verb: To be..Noum: 
Being..Example:Tout le monde veut être beau:everybody wants to be 
beautiful","et": "Conjunction: And.. Example: Et les larmes se remirent à 
couler:and the tears started flowing again","en": "Adverb:Thereof. Preposition: 
In, Into, Of, At..Example: Je suis retournée en Espagne en septembre:I returned 
to Spain in September","avoir": "Verb: To have. Noun: Asset, Credit..Example: 
On était six donc tu peux pas avoir une conversation:there were six of us so 
you can't have a conversation","que": "Conjunction: That,Than. 
Pronoun:Which,Who,Whom..Example: C'est un soldat,mais que fait? Il est ici?: 
it's a soldier. But what's he doing here?","pour": "Preposition: For, In order 
to....Example: Elle jouait pour gagner:she played to win","dans": "Preposition: 
In, Into, From..Example: Je reviendrai dans dix minutes:I will return in 10 
minutes","ce": "Proposition,Adjective: This, that..Example: Je ne déteste pas 
cet homme: I do not detest this man","il": "Pronoun:He, It....Example: Allez 
voir s'il est blessé: go see if he is injured","qui": "Pronoun: Who, 
Whom....Example: Je ne sais pas à qui m'adresser: I don't know who to talk 
to","ne": "Adverb: Not...Example: Nous ne faisons pas du très bon travail:we 
are not doing very good work","sur":"Preposition:On,Upon, Over,...Example: 
T'avais une chance sur un million:you had one chance in a million",  }

keys = List.keys()print(keys)
a = str(input(""))
if 'a' in keys:    print(a + ":"+ List['a'])else:    print("impossible")
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to