Course Content

Python Exercise 1 - Apni Dictionary

So, guys this is our first tutorial in which I am going to give you a task as an exercise. I have designed a lot of exercises for you in the upcoming tutorials, by the help of which you can get an idea about your skills or learning, as each one of them covers the concepts we learned in the Tutorials before that.

So, in order for you to test yourself, you may take them as a challenge and upon their completion you can move forward. In case you are having any difficulty solving an exercise, you can always revisit the previously taken tutorials. So, in this way exercises will help you to evaluate yourself and will also provide a revision up to some level.

Problem Statement:

So, in this tutorial i.e. Python exercise 1 tutorial, what we have to do is to create a dictionary, similar to the real-world dictionary. There is no limit to the definition you provide to any word as this exercise is just for your practice.

The details and functionalities that are essential and must be present are:

  • User will give a word as an input. Suppose that the word is present in your dictionary along with its definition or meaning.
  • The program will print the meaning or definition of that word.

For example:

The user inputs the word : “programming”

The output will be:

 "the process of writing computer programs"

Your main focus should be towards writing a neat and efficient code, using only the knowledge from our previously done tutorials.

I would encourage all of you to participate in solving this task. At least give it a try so you may have an idea about your progress, because the starting tutorials make the real basis for the upcoming one’s and if the basis aren’t strong, we can not achieve our desired goal of becoming a better python language programmer.


SachinJ 1 year, 5 months ago
Tharoor= { "snollygoster": "", 
word=input("Select a word from the above dictionary ")
print("Kindly go to the link, it will give you much more information than just meaning and synonyms of",word,"\n",   "Here is the link: ", Tharoor.get(word))
pawan 1 year, 3 months ago
d2 = {"Cause-and-effect diagram":"",
      "Check sheet":"",
      "Control chart":"",
      "Pareto chart":"",
      "Scatter diagram":"",
print("Enter the QC Tool Name:")

white_devil 1 year, 1 month ago
dict1 = {"Harry": "Programmer", "Priyanshu": "Py Learner", "Larry": "Js Learner", "Carry": "Android Developer"}
print("Copy One Of The Name And Paste It")
print("1) Harry", "2) Priyanshu", "3) Larry", "4) Carry")
a = input()
Manav_Seng 1 year ago
Python Excercise 1 apni dictionary
Name:Manav Sengupta
Solution(Copy and paste  everything below):

#This is the Question given by CodeWithHarry Channel #Python Excercise 1 #ApniDictionary
#The following is the solution
Word=['Tensor','Diffusion','Quantum','Calculus','Lemma']# Words
Meanings=['A Rank n Tensor in m dimensions is a mathematical object which has n indices and m^n components which follow certain mathematical transformation rules','Diffusion is defined as the movement of substances from a region of higher concentration to a region of lower concentration down an concentration gradient','The smallest amount of a quantised quantity like charge is called its quantum','Calculus is the Branch of Mathematics which deals with the nature of change and allows to perform various mathematical operations on it','A Lemma is a proven statement used to prove other statements'] # Respective Meanings
ApniDictionary={Word[0]:Meanings[0],Word[1]:Meanings[1],Word[2]:Meanings[2],Word[3]:Meanings[3],Word[4]:Meanings[4]} #Creation of Dictionary
input_word=input("Enter Your Word") #User Input
temp=input_word.capitalize() #Presentation Purposes
#Input should be in lower case
print("\n"+ temp+" : "+ApniDictionary[temp]+"\n") #Final Output
print(147*"*"+"\n*"+145*" "+"*\n*"+9*" "+"Thanks for checking out my code, and a ton of thanks to CodewithHarry Channel for all the Quality Content for Free"+22*" "+"*\n*"+145*" "+"*\n"+147*"*") # Gratitude
#Run the Code with the Run Terminal or Console enlarged more than default as the output take some space

#The excercise could be done in lesser code but to balance preentation and code size which are tradeoffs, I think this solution is in the sweet spot.
#Feel free(anyone) to give reviews and suggestions to the above exercise, Constructive critisizim is appreciated , but critisize ideas not people.
zadrain 11 months, 2 weeks ago
x={"life":"a different journey for every humenbeing ",
   "death":"the action or fact of dying or being killed; the end of the life of a person ",
   "marriage":"the legally or formally recognized union of two people as partners in a personal relationship (historically and in some jurisdictions specifically a union between a man and a woman",
   "education":"the process of receiving or giving systematic instruction, especially at a school or university."}
print(x[input("type here in lower case")])
arnavc06 9 months, 2 weeks ago
nazishali 10 months, 3 weeks ago
# create a dictionary and take input from the user and return the meaning of the word from the dictionary
print("for making a dictionary input 5 string")
a1 = input()
m1 = input("Enter meaning of the word:")
a2 = input()
m2 = input("Enter meaning of the word:")
a3 = input()
m3 = input("Enter meaning of the word:")
a4 = input()
m4 = input("Enter meaning of the word:")
a5 = input()
m5 = input("Enter meaning of the word:")
dict4 = {a1:m1,a2:m2,a3:m3,a4:m4,a5:m5}
a7 = input(print("search from dictionary:"))
if a7 in dict4:
saswata 10 months ago
import wikipedia
dict = {'virus':'',
word = list(dict.items())

word = input('Enter thr word: ')
for i,j in dict.items():
    if (word==i):
        print(wikipedia.summary(j, sentences=2))
iammsami 9 months ago
Harry bhai 
#creating a dictionary with words and meanings
d1 ={"Mutable":"Which Changes","Immutable" : "Which doesn't Change","Luminous":"Object with Light","Sonorous" : "Sound Producing Utencils"}
print("Enter the word to which you want meaning")
#ye print(d1[input()]) ke badle kch oor use nae krsakte kya
Vivek-Mishra 8 months, 2 weeks ago
Full Notes and Source Code ::::::::::} |::::::::::::| Thanks, Harry Bhai for Awesome Tutorials


No downloadable resources for this video. If you think you need anything, please post it in the QnA!

Course Announcements

Any Course related announcements will be posted here