+ 4
How can built a english dictionary in python
29 Antworten
+ 9
Dictionary = {
'apple': 'An edible fruit ',
'ant': 'A bug that bites'
'another': 'One more'
}
You can fill in the rest of the words. Good luck
+ 3
Thnx rik for your response
+ 3
Thanks for your answer
+ 3
Make dictionary of words and define meanings of that word as value of word and take user input to enter word.
+ 3
If user input is in dictionary then print the values of that word
+ 3
Thanks mirza
+ 3
Example:
Take a dictionary name, some variable like
Animals={ 'herbivores': 'cow', 'carnivores':'lion', 'omivores':'crow' }
First words like herbivores, carnivores, omnivores are called "keys". Second words like cow,lion,crow are called "values".
Each key has value.
Similarly you can write nested dictionaries.
+ 2
Yes am mean that like as english dictionary of words with their their definitions
+ 2
Ok sir can give some modules sir
+ 2
WhyFry thanks, I corrected it, definetly important to mention
+ 2
Tnx 😅
+ 1
What is it you want exactly ? You mean a list of words and their definitions ?
+ 1
bharathkanna well you technically can just write them down one by one... by it would be useless.
I would say you use some modules and frameworks, but you're still a beginner, better stick to the basics
+ 1
bharathkanna no problem
+ 1
WhyFry you mean beautifulsoup ? Also, I don't think a beginner (who also has no experience in web scraping) would be able to do so.
But indeed it is the correct way to do it, other than the module I shared
+ 1
Use a database. Just DO NOT write it all out😂
+ 1
You can add dictionary using following Syntex i.e.,
Dictionaryname={element:value,
element:value,
element:value,
element:value,
}
You can use Single quote ('element') if the element or value is string.
You can execute dictionary by using following Syntex i.e.,
Dictionaryname [element]
0
Do you want to make a program or an app?